require('./sourcemap-register.js');module.exports = /******/ (() => { // webpackBootstrap /******/ var __webpack_modules__ = ({ /***/ 94822: /***/ (function(__unused_webpack_module, exports, __webpack_require__) { "use strict"; var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { if (k2 === undefined) k2 = k; Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); }) : (function(o, m, k, k2) { if (k2 === undefined) k2 = k; o[k2] = m[k]; })); var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { Object.defineProperty(o, "default", { enumerable: true, value: v }); }) : function(o, v) { o["default"] = v; }); var __importStar = (this && this.__importStar) || function (mod) { if (mod && mod.__esModule) return mod; var result = {}; if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); __setModuleDefault(result, mod); return result; }; var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } return new (P || (P = Promise))(function (resolve, reject) { function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } step((generator = generator.apply(thisArg, _arguments || [])).next()); }); }; var __importDefault = (this && this.__importDefault) || function (mod) { return (mod && mod.__esModule) ? mod : { "default": mod }; }; Object.defineProperty(exports, "__esModule", ({ value: true })); const core = __importStar(__webpack_require__(42186)); const model_1 = __webpack_require__(41359); const platform_setup_1 = __importDefault(__webpack_require__(64423)); function run() { return __awaiter(this, void 0, void 0, function* () { try { model_1.Action.checkCompatibility(); model_1.Cache.verify(); const { dockerfile, workspace, actionFolder } = model_1.Action; const buildParameters = yield model_1.BuildParameters.create(); const baseImage = new model_1.ImageTag(buildParameters); let builtImage; switch (buildParameters.remoteBuildCluster) { case 'k8s': core.info('Building with Kubernetes'); yield model_1.Kubernetes.runBuildJob(buildParameters, baseImage); break; case 'aws': core.info('Building with AWS'); yield model_1.RemoteBuilder.build(buildParameters, baseImage); break; // default and local case default: core.info('Building locally'); platform_setup_1.default.setup(buildParameters); builtImage = yield model_1.Docker.build({ path: actionFolder, dockerfile, baseImage }); yield model_1.Docker.run(builtImage, Object.assign({ workspace }, buildParameters)); break; } // Set output yield model_1.Output.setBuildVersion(buildParameters.buildVersion); } catch (error) { core.setFailed(error.message); } }); } run(); /***/ }), /***/ 89088: /***/ (function(__unused_webpack_module, exports, __webpack_require__) { "use strict"; var __importDefault = (this && this.__importDefault) || function (mod) { return (mod && mod.__esModule) ? mod : { "default": mod }; }; Object.defineProperty(exports, "__esModule", ({ value: true })); const path_1 = __importDefault(__webpack_require__(85622)); class Action { static get supportedPlatforms() { return ['linux', 'win32']; } static get isRunningLocally() { return process.env.RUNNER_WORKSPACE === undefined; } static get isRunningFromSource() { return path_1.default.basename(__dirname) === 'model'; } static get canonicalName() { return 'unity-builder'; } static get rootFolder() { if (Action.isRunningFromSource) { return path_1.default.dirname(path_1.default.dirname(path_1.default.dirname(__filename))); } return path_1.default.dirname(path_1.default.dirname(__filename)); } static get actionFolder() { return `${Action.rootFolder}/dist`; } static get dockerfile() { const currentPlatform = process.platform; switch (currentPlatform) { case 'linux': return `${Action.actionFolder}/platforms/ubuntu/Dockerfile`; case 'win32': return `${Action.actionFolder}/platforms/windows/Dockerfile`; default: throw new Error(`No Dockerfile for currently unsupported platform: ${currentPlatform}`); } } static get workspace() { return process.env.GITHUB_WORKSPACE; } static checkCompatibility() { const currentPlatform = process.platform; if (!Action.supportedPlatforms.includes(currentPlatform)) { throw new Error(`Currently ${currentPlatform}-platform is not supported`); } } } exports.default = Action; /***/ }), /***/ 43059: /***/ (function(__unused_webpack_module, exports, __webpack_require__) { "use strict"; var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { if (k2 === undefined) k2 = k; Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); }) : (function(o, m, k, k2) { if (k2 === undefined) k2 = k; o[k2] = m[k]; })); var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { Object.defineProperty(o, "default", { enumerable: true, value: v }); }) : function(o, v) { o["default"] = v; }); var __importStar = (this && this.__importStar) || function (mod) { if (mod && mod.__esModule) return mod; var result = {}; if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); __setModuleDefault(result, mod); return result; }; Object.defineProperty(exports, "__esModule", ({ value: true })); const core = __importStar(__webpack_require__(42186)); const semver = __importStar(__webpack_require__(11383)); class AndroidVersioning { static determineVersionCode(version, inputVersionCode) { if (!inputVersionCode) { return AndroidVersioning.versionToVersionCode(version); } return inputVersionCode; } static versionToVersionCode(version) { if (version === 'none') { core.info(`Versioning strategy is set to ${version}, so android version code should not be applied.`); return 0; } const parsedVersion = semver.parse(version); if (!parsedVersion) { core.warning(`Could not parse "${version}" to semver, defaulting android version code to 1`); return 1; } // The greatest value Google Plays allows is 2100000000. // Allow for 3 patch digits, 3 minor digits and 3 major digits. const versionCode = parsedVersion.major * 1000000 + parsedVersion.minor * 1000 + parsedVersion.patch; if (versionCode >= 2050000000) { throw new Error(`Generated versionCode ${versionCode} is dangerously close to the maximum allowed number 2100000000. Consider a different versioning scheme to be able to continue updating your application.`); } core.info(`Using android versionCode ${versionCode}`); return versionCode; } static determineSdkManagerParameters(targetSdkVersion) { const parsedVersion = Number.parseInt(targetSdkVersion.slice(-2), 10); return Number.isNaN(parsedVersion) ? '' : `platforms;android-${parsedVersion}`; } } exports.default = AndroidVersioning; /***/ }), /***/ 80787: /***/ (function(__unused_webpack_module, exports, __webpack_require__) { "use strict"; var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { if (k2 === undefined) k2 = k; Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); }) : (function(o, m, k, k2) { if (k2 === undefined) k2 = k; o[k2] = m[k]; })); var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { Object.defineProperty(o, "default", { enumerable: true, value: v }); }) : function(o, v) { o["default"] = v; }); var __importStar = (this && this.__importStar) || function (mod) { if (mod && mod.__esModule) return mod; var result = {}; if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); __setModuleDefault(result, mod); return result; }; var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } return new (P || (P = Promise))(function (resolve, reject) { function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } step((generator = generator.apply(thisArg, _arguments || [])).next()); }); }; var __importDefault = (this && this.__importDefault) || function (mod) { return (mod && mod.__esModule) ? mod : { "default": mod }; }; Object.defineProperty(exports, "__esModule", ({ value: true })); const core = __importStar(__webpack_require__(42186)); const android_versioning_1 = __importDefault(__webpack_require__(43059)); const input_1 = __importDefault(__webpack_require__(91933)); const platform_1 = __importDefault(__webpack_require__(9707)); const unity_versioning_1 = __importDefault(__webpack_require__(17146)); const versioning_1 = __importDefault(__webpack_require__(88729)); class BuildParameters { static create() { return __awaiter(this, void 0, void 0, function* () { const buildFile = this.parseBuildFile(input_1.default.buildName, input_1.default.targetPlatform, input_1.default.androidAppBundle); const unityVersion = unity_versioning_1.default.determineUnityVersion(input_1.default.projectPath, input_1.default.unityVersion); const buildVersion = yield versioning_1.default.determineVersion(input_1.default.versioningStrategy, input_1.default.specifiedVersion); const androidVersionCode = android_versioning_1.default.determineVersionCode(buildVersion, input_1.default.androidVersionCode); const androidSdkManagerParameters = android_versioning_1.default.determineSdkManagerParameters(input_1.default.androidTargetSdkVersion); let unitySerial = ''; if (!process.env.UNITY_SERIAL) { //No serial was present so it is a personal license that we need to convert if (!process.env.UNITY_LICENSE) { throw new Error(`Missing Unity License File and no Serial was found. If this is a personal license, make sure to follow the activation steps and set the UNITY_LICENSE GitHub secret or enter a Unity serial number inside the UNITY_SERIAL GitHub secret.`); } unitySerial = this.getSerialFromLicenseFile(process.env.UNITY_LICENSE); } else { unitySerial = process.env.UNITY_SERIAL; } core.setSecret(unitySerial); return { version: unityVersion, customImage: input_1.default.customImage, unitySerial, runnerTempPath: process.env.RUNNER_TEMP, platform: input_1.default.targetPlatform, projectPath: input_1.default.projectPath, buildName: input_1.default.buildName, buildPath: `${input_1.default.buildsPath}/${input_1.default.targetPlatform}`, buildFile, buildMethod: input_1.default.buildMethod, buildVersion, androidVersionCode, androidKeystoreName: input_1.default.androidKeystoreName, androidKeystoreBase64: input_1.default.androidKeystoreBase64, androidKeystorePass: input_1.default.androidKeystorePass, androidKeyaliasName: input_1.default.androidKeyaliasName, androidKeyaliasPass: input_1.default.androidKeyaliasPass, androidTargetSdkVersion: input_1.default.androidTargetSdkVersion, androidSdkManagerParameters, customParameters: input_1.default.customParameters, sshAgent: input_1.default.sshAgent, gitPrivateToken: input_1.default.gitPrivateToken, chownFilesTo: input_1.default.chownFilesTo, remoteBuildCluster: input_1.default.remoteBuildCluster, awsStackName: input_1.default.awsStackName, kubeConfig: input_1.default.kubeConfig, githubToken: input_1.default.githubToken, remoteBuildMemory: input_1.default.remoteBuildMemory, remoteBuildCpu: input_1.default.remoteBuildCpu, kubeVolumeSize: input_1.default.kubeVolumeSize, kubeVolume: input_1.default.kubeVolume, }; }); } static parseBuildFile(filename, platform, androidAppBundle) { if (platform_1.default.isWindows(platform)) { return `${filename}.exe`; } if (platform_1.default.isAndroid(platform)) { return androidAppBundle ? `${filename}.aab` : `${filename}.apk`; } return filename; } static getSerialFromLicenseFile(license) { const startKey = ``; const startIndex = license.indexOf(startKey) + startKey.length; if (startIndex < 0) { throw new Error(`License File was corrupted, unable to locate serial`); } const endIndex = license.indexOf(endKey, startIndex); // Slice off the first 4 characters as they are garbage values return Buffer.from(license.slice(startIndex, endIndex), 'base64').toString('binary').slice(4); } } exports.default = BuildParameters; /***/ }), /***/ 97134: /***/ (function(__unused_webpack_module, exports, __webpack_require__) { "use strict"; var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { if (k2 === undefined) k2 = k; Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); }) : (function(o, m, k, k2) { if (k2 === undefined) k2 = k; o[k2] = m[k]; })); var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { Object.defineProperty(o, "default", { enumerable: true, value: v }); }) : function(o, v) { o["default"] = v; }); var __importStar = (this && this.__importStar) || function (mod) { if (mod && mod.__esModule) return mod; var result = {}; if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); __setModuleDefault(result, mod); return result; }; var __importDefault = (this && this.__importDefault) || function (mod) { return (mod && mod.__esModule) ? mod : { "default": mod }; }; Object.defineProperty(exports, "__esModule", ({ value: true })); const core = __importStar(__webpack_require__(42186)); const fs_1 = __importDefault(__webpack_require__(35747)); const action_1 = __importDefault(__webpack_require__(89088)); const project_1 = __importDefault(__webpack_require__(88666)); class Cache { static verify() { if (!fs_1.default.existsSync(project_1.default.libraryFolder)) { this.notifyAboutCachingPossibility(); } } static notifyAboutCachingPossibility() { if (action_1.default.isRunningLocally) { return; } core.warning(` Library folder does not exist. Consider setting up caching to speed up your workflow, if this is not your first build. `); } } exports.default = Cache; /***/ }), /***/ 16934: /***/ (function(__unused_webpack_module, exports, __webpack_require__) { "use strict"; var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } return new (P || (P = Promise))(function (resolve, reject) { function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } step((generator = generator.apply(thisArg, _arguments || [])).next()); }); }; var __importDefault = (this && this.__importDefault) || function (mod) { return (mod && mod.__esModule) ? mod : { "default": mod }; }; Object.defineProperty(exports, "__esModule", ({ value: true })); const exec_1 = __webpack_require__(71514); const image_tag_1 = __importDefault(__webpack_require__(57648)); class Docker { static build(buildParameters, silent = false) { return __awaiter(this, void 0, void 0, function* () { const { path, dockerfile, baseImage } = buildParameters; const { version, platform } = baseImage; const tag = new image_tag_1.default({ repository: '', name: 'unity-builder', version, platform }); const command = `docker build ${path} \ --file ${dockerfile} \ --build-arg IMAGE=${baseImage} \ --tag ${tag}`; yield exec_1.exec(command, undefined, { silent }); return tag; }); } static run(image, parameters, silent = false) { return __awaiter(this, void 0, void 0, function* () { const { version, workspace, unitySerial, runnerTempPath, platform, projectPath, buildName, buildPath, buildFile, buildMethod, buildVersion, androidVersionCode, androidKeystoreName, androidKeystoreBase64, androidKeystorePass, androidKeyaliasName, androidKeyaliasPass, androidTargetSdkVersion, androidSdkManagerParameters, customParameters, sshAgent, gitPrivateToken, chownFilesTo, } = parameters; const baseOsSpecificArguments = this.getBaseOsSpecificArguments(process.platform, workspace, unitySerial, runnerTempPath, sshAgent); const runCommand = `docker run \ --workdir /github/workspace \ --rm \ --env UNITY_LICENSE \ --env UNITY_LICENSE_FILE \ --env UNITY_EMAIL \ --env UNITY_PASSWORD \ --env UNITY_VERSION="${version}" \ --env USYM_UPLOAD_AUTH_TOKEN \ --env PROJECT_PATH="${projectPath}" \ --env BUILD_TARGET="${platform}" \ --env BUILD_NAME="${buildName}" \ --env BUILD_PATH="${buildPath}" \ --env BUILD_FILE="${buildFile}" \ --env BUILD_METHOD="${buildMethod}" \ --env VERSION="${buildVersion}" \ --env ANDROID_VERSION_CODE="${androidVersionCode}" \ --env ANDROID_KEYSTORE_NAME="${androidKeystoreName}" \ --env ANDROID_KEYSTORE_BASE64="${androidKeystoreBase64}" \ --env ANDROID_KEYSTORE_PASS="${androidKeystorePass}" \ --env ANDROID_KEYALIAS_NAME="${androidKeyaliasName}" \ --env ANDROID_KEYALIAS_PASS="${androidKeyaliasPass}" \ --env ANDROID_TARGET_SDK_VERSION="${androidTargetSdkVersion}" \ --env ANDROID_SDK_MANAGER_PARAMETERS="${androidSdkManagerParameters}" \ --env CUSTOM_PARAMETERS="${customParameters}" \ --env CHOWN_FILES_TO="${chownFilesTo}" \ --env GITHUB_REF \ --env GITHUB_SHA \ --env GITHUB_REPOSITORY \ --env GITHUB_ACTOR \ --env GITHUB_WORKFLOW \ --env GITHUB_HEAD_REF \ --env GITHUB_BASE_REF \ --env GITHUB_EVENT_NAME \ --env GITHUB_WORKSPACE=/github/workspace \ --env GITHUB_ACTION \ --env GITHUB_EVENT_PATH \ --env RUNNER_OS \ --env RUNNER_TOOL_CACHE \ --env RUNNER_TEMP \ --env RUNNER_WORKSPACE \ --env GIT_PRIVATE_TOKEN="${gitPrivateToken}" \ ${baseOsSpecificArguments} \ ${image}`; yield exec_1.exec(runCommand, undefined, { silent }); }); } static getBaseOsSpecificArguments(baseOs, workspace, unitySerial, runnerTemporaryPath, sshAgent) { switch (baseOs) { case 'linux': return `--env UNITY_SERIAL \ ${sshAgent ? '--env SSH_AUTH_SOCK=/ssh-agent' : ''} \ --volume "/var/run/docker.sock":"/var/run/docker.sock" \ --volume "${runnerTemporaryPath}/_github_home":"/root" \ --volume "${runnerTemporaryPath}/_github_workflow":"/github/workflow" \ --volume "${workspace}":"/github/workspace" \ ${sshAgent ? `--volume ${sshAgent}:/ssh-agent` : ''} \ ${sshAgent ? '--volume /home/runner/.ssh/known_hosts:/root/.ssh/known_hosts:ro' : ''}`; case 'win32': return `--env UNITY_SERIAL="${unitySerial}" \ --volume "${workspace}":"c:/github/workspace" \ --volume "c:/regkeys":"c:/regkeys" \ --volume "C:/Program Files (x86)/Microsoft Visual Studio":"C:/Program Files (x86)/Microsoft Visual Studio" \ --volume "C:/Program Files (x86)/Windows Kits":"C:/Program Files (x86)/Windows Kits" \ --volume "C:/ProgramData/Microsoft/VisualStudio":"C:/ProgramData/Microsoft/VisualStudio"`; //Note: When upgrading to Server 2022, we will need to move to just "program files" since VS will be 64-bit } return ''; } } exports.default = Docker; /***/ }), /***/ 26574: /***/ ((__unused_webpack_module, exports) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); class NotImplementedException extends Error { constructor(message = '') { super(message); this.name = 'NotImplementedException'; } } exports.default = NotImplementedException; /***/ }), /***/ 97266: /***/ ((__unused_webpack_module, exports) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); class ValidationError extends Error { constructor(message = '') { super(message); this.name = 'ValidationError'; } } exports.default = ValidationError; /***/ }), /***/ 57648: /***/ (function(__unused_webpack_module, exports, __webpack_require__) { "use strict"; var __importDefault = (this && this.__importDefault) || function (mod) { return (mod && mod.__esModule) ? mod : { "default": mod }; }; Object.defineProperty(exports, "__esModule", ({ value: true })); const platform_1 = __importDefault(__webpack_require__(9707)); class ImageTag { constructor(imageProperties) { const { repository = 'unityci', name = 'editor', version = '2019.2.11f1', platform, customImage } = imageProperties; if (!ImageTag.versionPattern.test(version)) { throw new Error(`Invalid version "${version}".`); } const builderPlatform = ImageTag.getTargetPlatformToImageSuffixMap(platform, version); this.repository = repository; this.name = name; this.version = version; this.platform = platform; this.builderPlatform = builderPlatform; this.customImage = customImage; } static get versionPattern() { return /^20\d{2}\.\d\.\w{3,4}|3$/; } static get imageSuffixes() { return { generic: '', webgl: 'webgl', mac: 'mac-mono', windows: 'windows-mono', windowsIl2cpp: 'windows-il2cpp', wsaPlayer: 'universal-windows-platform', linux: 'base', linuxIl2cpp: 'linux-il2cpp', android: 'android', ios: 'ios', tvos: 'appletv', facebook: 'facebook', }; } static getTargetPlatformToImageSuffixMap(platform, version) { const { generic, webgl, mac, windows, windowsIl2cpp, wsaPlayer, linux, linuxIl2cpp, android, ios, tvos, facebook, } = ImageTag.imageSuffixes; const [major, minor] = version.split('.').map((digit) => Number(digit)); // @see: https://docs.unity3d.com/ScriptReference/BuildTarget.html switch (platform) { case platform_1.default.types.StandaloneOSX: return mac; case platform_1.default.types.StandaloneWindows: case platform_1.default.types.StandaloneWindows64: // Can only build windows-il2cpp on a windows based system if (process.platform === 'win32') { // Unity versions before 2019.3 do not support il2cpp if (major >= 2020 || (major === 2019 && minor >= 3)) { return windowsIl2cpp; } else { throw new Error(`Windows-based builds are only supported on 2019.3.X+ versions of Unity. If you are trying to build for windows-mono, please use a Linux based OS.`); } } return windows; case platform_1.default.types.StandaloneLinux64: { // Unity versions before 2019.3 do not support il2cpp if (major >= 2020 || (major === 2019 && minor >= 3)) { return linuxIl2cpp; } return linux; } case platform_1.default.types.iOS: return ios; case platform_1.default.types.Android: return android; case platform_1.default.types.WebGL: return webgl; case platform_1.default.types.WSAPlayer: if (process.platform !== 'win32') { throw new Error(`WSAPlayer can only be built on a windows base OS`); } return wsaPlayer; case platform_1.default.types.PS4: return windows; case platform_1.default.types.XboxOne: return windows; case platform_1.default.types.tvOS: if (process.platform !== 'win32') { throw new Error(`tvOS can only be built on a windows base OS`); } return tvos; case platform_1.default.types.Switch: return windows; // Unsupported case platform_1.default.types.Lumin: return windows; case platform_1.default.types.BJM: return windows; case platform_1.default.types.Stadia: return windows; case platform_1.default.types.Facebook: return facebook; case platform_1.default.types.NoTarget: return generic; // Test specific case platform_1.default.types.Test: return generic; default: throw new Error(` Platform must be one of the ones described in the documentation. "${platform}" is currently not supported.`); } } get tag() { //We check the host os so we know what type of the images we need to pull switch (process.platform) { case 'win32': return `windows-${this.version}-${this.builderPlatform}`.replace(/-+$/, ''); case 'linux': return `${this.version}-${this.builderPlatform}`.replace(/-+$/, ''); default: break; } } get image() { return `${this.repository}/${this.name}`.replace(/^\/+/, ''); } toString() { const { image, tag, customImage } = this; if (customImage && customImage !== '') { return customImage; } return `${image}:${tag}-0`; // '0' here represents the docker repo version } } exports.default = ImageTag; /***/ }), /***/ 41359: /***/ (function(__unused_webpack_module, exports, __webpack_require__) { "use strict"; var __importDefault = (this && this.__importDefault) || function (mod) { return (mod && mod.__esModule) ? mod : { "default": mod }; }; Object.defineProperty(exports, "__esModule", ({ value: true })); exports.RemoteBuilder = exports.Kubernetes = exports.Versioning = exports.Unity = exports.Project = exports.Platform = exports.Output = exports.ImageTag = exports.Input = exports.Docker = exports.Cache = exports.BuildParameters = exports.Action = void 0; const action_1 = __importDefault(__webpack_require__(89088)); exports.Action = action_1.default; const build_parameters_1 = __importDefault(__webpack_require__(80787)); exports.BuildParameters = build_parameters_1.default; const cache_1 = __importDefault(__webpack_require__(97134)); exports.Cache = cache_1.default; const docker_1 = __importDefault(__webpack_require__(16934)); exports.Docker = docker_1.default; const input_1 = __importDefault(__webpack_require__(91933)); exports.Input = input_1.default; const image_tag_1 = __importDefault(__webpack_require__(57648)); exports.ImageTag = image_tag_1.default; const output_1 = __importDefault(__webpack_require__(85487)); exports.Output = output_1.default; const platform_1 = __importDefault(__webpack_require__(9707)); exports.Platform = platform_1.default; const project_1 = __importDefault(__webpack_require__(88666)); exports.Project = project_1.default; const unity_1 = __importDefault(__webpack_require__(70498)); exports.Unity = unity_1.default; const versioning_1 = __importDefault(__webpack_require__(88729)); exports.Versioning = versioning_1.default; const kubernetes_1 = __importDefault(__webpack_require__(7352)); exports.Kubernetes = kubernetes_1.default; const remote_builder_1 = __importDefault(__webpack_require__(49358)); exports.RemoteBuilder = remote_builder_1.default; /***/ }), /***/ 91933: /***/ (function(__unused_webpack_module, exports, __webpack_require__) { "use strict"; var __importDefault = (this && this.__importDefault) || function (mod) { return (mod && mod.__esModule) ? mod : { "default": mod }; }; Object.defineProperty(exports, "__esModule", ({ value: true })); const platform_1 = __importDefault(__webpack_require__(9707)); const core = __webpack_require__(42186); /** * Input variables specified in workflows using "with" prop. * * Note that input is always passed as a string, even booleans. */ class Input { static get unityVersion() { return core.getInput('unityVersion') || 'auto'; } static get customImage() { return core.getInput('customImage'); } static get targetPlatform() { return core.getInput('targetPlatform') || platform_1.default.default; } static get projectPath() { const rawProjectPath = core.getInput('projectPath') || '.'; return rawProjectPath.replace(/\/$/, ''); } static get buildName() { return core.getInput('buildName') || this.targetPlatform; } static get buildsPath() { return core.getInput('buildsPath') || 'build'; } static get buildMethod() { return core.getInput('buildMethod'); // processed in docker file } static get versioningStrategy() { return core.getInput('versioning') || 'Semantic'; } static get specifiedVersion() { return core.getInput('version') || ''; } static get androidVersionCode() { return core.getInput('androidVersionCode'); } static get androidAppBundle() { const input = core.getInput('androidAppBundle') || false; return input === 'true'; } static get androidKeystoreName() { return core.getInput('androidKeystoreName') || ''; } static get androidKeystoreBase64() { return core.getInput('androidKeystoreBase64') || ''; } static get androidKeystorePass() { return core.getInput('androidKeystorePass') || ''; } static get androidKeyaliasName() { return core.getInput('androidKeyaliasName') || ''; } static get androidKeyaliasPass() { return core.getInput('androidKeyaliasPass') || ''; } static get androidTargetSdkVersion() { return core.getInput('androidTargetSdkVersion') || ''; } static get allowDirtyBuild() { const input = core.getInput('allowDirtyBuild') || false; return input === 'true'; } static get customParameters() { return core.getInput('customParameters') || ''; } static get sshAgent() { return core.getInput('sshAgent') || ''; } static get gitPrivateToken() { return core.getInput('gitPrivateToken') || ''; } static get chownFilesTo() { return core.getInput('chownFilesTo') || ''; } static get remoteBuildCluster() { return core.getInput('remoteBuildCluster') || ''; } static get awsStackName() { return core.getInput('awsStackName') || ''; } static get kubeConfig() { return core.getInput('kubeConfig') || ''; } static get githubToken() { return core.getInput('githubToken') || ''; } static get remoteBuildMemory() { return core.getInput('remoteBuildMemory') || '800M'; } static get remoteBuildCpu() { return core.getInput('remoteBuildCpu') || '0.25'; } static get kubeVolumeSize() { return core.getInput('kubeVolumeSize') || '5Gi'; } static get kubeVolume() { return core.getInput('kubeVolume') || ''; } } exports.default = Input; /***/ }), /***/ 7352: /***/ (function(__unused_webpack_module, exports, __webpack_require__) { "use strict"; var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } return new (P || (P = Promise))(function (resolve, reject) { function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } step((generator = generator.apply(thisArg, _arguments || [])).next()); }); }; var __importDefault = (this && this.__importDefault) || function (mod) { return (mod && mod.__esModule) ? mod : { "default": mod }; }; Object.defineProperty(exports, "__esModule", ({ value: true })); // @ts-ignore const kubernetes_client_1 = __webpack_require__(98862); const request_1 = __importDefault(__webpack_require__(67002)); const core = __webpack_require__(42186); const base64 = __webpack_require__(85848); const pollInterval = 10000; class Kubernetes { static runBuildJob(buildParameters, baseImage) { return __awaiter(this, void 0, void 0, function* () { const kubeconfig = new kubernetes_client_1.KubeConfig(); kubeconfig.loadFromString(base64.decode(buildParameters.kubeConfig)); const backend = new request_1.default({ kubeconfig }); const kubeClient = new kubernetes_client_1.Client(backend); yield kubeClient.loadSpec(); const buildId = Kubernetes.uuidv4(); const pvcName = `unity-builder-pvc-${buildId}`; const secretName = `build-credentials-${buildId}`; const jobName = `unity-builder-job-${buildId}`; const namespace = 'default'; this.kubeClient = kubeClient; this.buildId = buildId; this.buildParameters = buildParameters; this.baseImage = baseImage; this.pvcName = pvcName; this.secretName = secretName; this.jobName = jobName; this.namespace = namespace; yield Kubernetes.createSecret(); yield Kubernetes.createPersistentVolumeClaim(); yield Kubernetes.scheduleBuildJob(); yield Kubernetes.watchBuildJobUntilFinished(); yield Kubernetes.cleanup(); core.setOutput('volume', pvcName); }); } static createSecret() { return __awaiter(this, void 0, void 0, function* () { const secretManifest = { apiVersion: 'v1', kind: 'Secret', metadata: { name: this.secretName, }, type: 'Opaque', data: { GITHUB_TOKEN: base64.encode(this.buildParameters.githubToken), UNITY_LICENSE: base64.encode(process.env.UNITY_LICENSE), ANDROID_KEYSTORE_BASE64: base64.encode(this.buildParameters.androidKeystoreBase64), ANDROID_KEYSTORE_PASS: base64.encode(this.buildParameters.androidKeystorePass), ANDROID_KEYALIAS_PASS: base64.encode(this.buildParameters.androidKeyaliasPass), }, }; yield this.kubeClient.api.v1.namespaces(this.namespace).secrets.post({ body: secretManifest }); }); } static createPersistentVolumeClaim() { return __awaiter(this, void 0, void 0, function* () { if (this.buildParameters.kubeVolume) { core.info(this.buildParameters.kubeVolume); this.pvcName = this.buildParameters.kubeVolume; return; } const pvcManifest = { apiVersion: 'v1', kind: 'PersistentVolumeClaim', metadata: { name: this.pvcName, }, spec: { accessModes: ['ReadWriteOnce'], volumeMode: 'Filesystem', resources: { requests: { storage: this.buildParameters.kubeVolumeSize, }, }, }, }; yield this.kubeClient.api.v1.namespaces(this.namespace).persistentvolumeclaims.post({ body: pvcManifest }); core.info('Persistent Volume created, waiting for ready state...'); yield Kubernetes.watchPersistentVolumeClaimUntilReady(); core.info('Persistent Volume ready for claims'); }); } static watchPersistentVolumeClaimUntilReady() { return __awaiter(this, void 0, void 0, function* () { yield new Promise((resolve) => setTimeout(resolve, pollInterval)); const queryResult = yield this.kubeClient.api.v1 .namespaces(this.namespace) .persistentvolumeclaims(this.pvcName) .get(); if (queryResult.body.status.phase === 'Pending') { yield Kubernetes.watchPersistentVolumeClaimUntilReady(); } }); } static scheduleBuildJob() { return __awaiter(this, void 0, void 0, function* () { core.info('Creating build job'); const jobManifest = { apiVersion: 'batch/v1', kind: 'Job', metadata: { name: this.jobName, labels: { app: 'unity-builder', }, }, spec: { template: { backoffLimit: 1, spec: { volumes: [ { name: 'data', persistentVolumeClaim: { claimName: this.pvcName, }, }, { name: 'credentials', secret: { secretName: this.secretName, }, }, ], initContainers: [ { name: 'clone', image: 'alpine/git', command: [ '/bin/sh', '-c', `apk update; apk add git-lfs; export GITHUB_TOKEN=$(cat /credentials/GITHUB_TOKEN); cd /data; git clone https://github.com/${process.env.GITHUB_REPOSITORY}.git repo; git clone https://github.com/webbertakken/unity-builder.git builder; cd repo; git checkout $GITHUB_SHA; ls`, ], volumeMounts: [ { name: 'data', mountPath: '/data', }, { name: 'credentials', mountPath: '/credentials', readOnly: true, }, ], env: [ { name: 'GITHUB_SHA', value: this.buildId, }, ], }, ], containers: [ { name: 'main', image: `${this.baseImage.toString()}`, command: [ 'bin/bash', '-c', `for f in ./credentials/*; do export $(basename $f)="$(cat $f)"; done cp -r /data/builder/action/default-build-script /UnityBuilderAction cp -r /data/builder/action/entrypoint.sh /entrypoint.sh cp -r /data/builder/action/steps /steps chmod -R +x /entrypoint.sh; chmod -R +x /steps; /entrypoint.sh; `, ], resources: { requests: { memory: this.buildParameters.kubeContainerMemory, cpu: this.buildParameters.kubeContainerCPU, }, }, env: [ { name: 'GITHUB_WORKSPACE', value: '/data/repo', }, { name: 'PROJECT_PATH', value: this.buildParameters.projectPath, }, { name: 'BUILD_PATH', value: this.buildParameters.buildPath, }, { name: 'BUILD_FILE', value: this.buildParameters.buildFile, }, { name: 'BUILD_NAME', value: this.buildParameters.buildName, }, { name: 'BUILD_METHOD', value: this.buildParameters.buildMethod, }, { name: 'CUSTOM_PARAMETERS', value: this.buildParameters.customParameters, }, { name: 'CHOWN_FILES_TO', value: this.buildParameters.chownFilesTo, }, { name: 'BUILD_TARGET', value: this.buildParameters.platform, }, { name: 'ANDROID_VERSION_CODE', value: this.buildParameters.androidVersionCode.toString(), }, { name: 'ANDROID_KEYSTORE_NAME', value: this.buildParameters.androidKeystoreName, }, { name: 'ANDROID_KEYALIAS_NAME', value: this.buildParameters.androidKeyaliasName, }, ], volumeMounts: [ { name: 'data', mountPath: '/data', }, { name: 'credentials', mountPath: '/credentials', readOnly: true, }, ], lifeCycle: { preStop: { exec: { command: [ 'bin/bash', '-c', `cd /data/builder/action/steps; chmod +x /return_license.sh; /return_license.sh;`, ], }, }, }, }, ], restartPolicy: 'Never', }, }, }, }; yield this.kubeClient.apis.batch.v1.namespaces(this.namespace).jobs.post({ body: jobManifest }); core.info('Job created'); }); } static watchBuildJobUntilFinished() { return __awaiter(this, void 0, void 0, function* () { let podname; let ready = false; while (!ready) { yield new Promise((resolve) => setTimeout(resolve, pollInterval)); const pods = yield this.kubeClient.api.v1.namespaces(this.namespace).pods.get(); for (let index = 0; index < pods.body.items.length; index++) { const element = pods.body.items[index]; if (element.metadata.labels['job-name'] === this.jobName && element.status.phase !== 'Pending') { core.info('Pod no longer pending'); if (element.status.phase === 'Failure') { core.error('Kubernetes job failed'); } else { ready = true; podname = element.metadata.name; } } } } core.info(`Watching build job ${podname}`); let logQueryTime; let complete = false; while (!complete) { yield new Promise((resolve) => setTimeout(resolve, pollInterval)); const podStatus = yield this.kubeClient.api.v1.namespaces(this.namespace).pod(podname).get(); if (podStatus.body.status.phase !== 'Running') { complete = true; } const logs = yield this.kubeClient.api.v1 .namespaces(this.namespace) .pod(podname) .log.get({ qs: { sinceTime: logQueryTime, timestamps: true, }, }); if (logs.body !== undefined) { const arrayOfLines = logs.body.match(/[^\n\r]+/g).reverse(); for (const element of arrayOfLines) { const [time, ...line] = element.split(' '); if (time !== logQueryTime) { core.info(line.join(' ')); } else { break; } } if (podStatus.body.status.phase === 'Failed') { throw new Error('Kubernetes job failed'); } logQueryTime = arrayOfLines[0].split(' ')[0]; } } }); } static cleanup() { return __awaiter(this, void 0, void 0, function* () { yield this.kubeClient.apis.batch.v1.namespaces(this.namespace).jobs(this.jobName).delete(); yield this.kubeClient.api.v1.namespaces(this.namespace).secrets(this.secretName).delete(); }); } static uuidv4() { return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, (c) => { const r = Math.trunc(Math.random() * 16); const v = c === 'x' ? r : (r & 0x3) | 0x8; return v.toString(16); }); } } exports.default = Kubernetes; /***/ }), /***/ 85487: /***/ (function(__unused_webpack_module, exports, __webpack_require__) { "use strict"; var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } return new (P || (P = Promise))(function (resolve, reject) { function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } step((generator = generator.apply(thisArg, _arguments || [])).next()); }); }; Object.defineProperty(exports, "__esModule", ({ value: true })); const core = __webpack_require__(42186); class Output { static setBuildVersion(buildVersion) { return __awaiter(this, void 0, void 0, function* () { yield core.setOutput('buildVersion', buildVersion); }); } } exports.default = Output; /***/ }), /***/ 64423: /***/ (function(__unused_webpack_module, exports, __webpack_require__) { "use strict"; var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } return new (P || (P = Promise))(function (resolve, reject) { function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } step((generator = generator.apply(thisArg, _arguments || [])).next()); }); }; var __importDefault = (this && this.__importDefault) || function (mod) { return (mod && mod.__esModule) ? mod : { "default": mod }; }; Object.defineProperty(exports, "__esModule", ({ value: true })); const setup_windows_1 = __importDefault(__webpack_require__(37449)); const validate_windows_1 = __importDefault(__webpack_require__(41563)); class PlatformSetup { static setup(buildParameters) { return __awaiter(this, void 0, void 0, function* () { switch (process.platform) { case 'win32': validate_windows_1.default.validate(buildParameters); setup_windows_1.default.setup(buildParameters); break; //Add other baseOS's here } }); } } exports.default = PlatformSetup; /***/ }), /***/ 37449: /***/ (function(__unused_webpack_module, exports, __webpack_require__) { "use strict"; var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } return new (P || (P = Promise))(function (resolve, reject) { function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } step((generator = generator.apply(thisArg, _arguments || [])).next()); }); }; var __importDefault = (this && this.__importDefault) || function (mod) { return (mod && mod.__esModule) ? mod : { "default": mod }; }; Object.defineProperty(exports, "__esModule", ({ value: true })); const exec_1 = __webpack_require__(71514); const fs_1 = __importDefault(__webpack_require__(35747)); class SetupWindows { static setup(buildParameters) { return __awaiter(this, void 0, void 0, function* () { yield SetupWindows.setupWindowsRun(buildParameters.platform); }); } //Setup prerequisite files/folders for a windows-based docker run static setupWindowsRun(platform, silent = false) { return __awaiter(this, void 0, void 0, function* () { if (!fs_1.default.existsSync('c:/regkeys')) { fs_1.default.mkdirSync('c:/regkeys'); } switch (platform) { //These all need the Windows 10 SDK case 'StandaloneWindows': case 'StandaloneWindows64': case 'WSAPlayer': this.generateWinSDKRegKeys(silent); break; } }); } static generateWinSDKRegKeys(silent = false) { return __awaiter(this, void 0, void 0, function* () { // Export registry keys that point to the location of the windows 10 sdk const exportWinSDKRegKeysCommand = 'reg export "HKLM\\SOFTWARE\\WOW6432Node\\Microsoft\\Microsoft SDKs\\Windows\\v10.0" c:/regkeys/winsdk.reg /y'; yield exec_1.exec(exportWinSDKRegKeysCommand, undefined, { silent }); }); } } exports.default = SetupWindows; /***/ }), /***/ 41563: /***/ (function(__unused_webpack_module, exports, __webpack_require__) { "use strict"; var __importDefault = (this && this.__importDefault) || function (mod) { return (mod && mod.__esModule) ? mod : { "default": mod }; }; Object.defineProperty(exports, "__esModule", ({ value: true })); const fs_1 = __importDefault(__webpack_require__(35747)); class ValidateWindows { static validate(buildParameters) { ValidateWindows.validateWindowsPlatformRequirements(buildParameters.platform); if (!(process.env.UNITY_EMAIL && process.env.UNITY_PASSWORD)) { throw new Error(`Unity email and password must be set for Windows based builds to authenticate the license. Make sure to set them inside UNITY_EMAIL and UNITY_PASSWORD in Github Secrets and pass them into the environment.`); } } static validateWindowsPlatformRequirements(platform) { switch (platform) { case 'StandaloneWindows': this.checkForVisualStudio(); this.checkForWin10SDK(); break; case 'StandaloneWindows64': this.checkForVisualStudio(); this.checkForWin10SDK(); break; case 'WSAPlayer': this.checkForVisualStudio(); this.checkForWin10SDK(); break; case 'tvOS': this.checkForVisualStudio(); break; } } static checkForWin10SDK() { //Check for Windows 10 SDK on runner const windows10SDKPathExists = fs_1.default.existsSync('C:/Program Files (x86)/Windows Kits'); if (!windows10SDKPathExists) { throw new Error(`Windows 10 SDK not found in default location. Make sure the runner has a Windows 10 SDK installed in the default location.`); } } static checkForVisualStudio() { //Note: When upgrading to Server 2022, we will need to move to just "program files" since VS will be 64-bit const visualStudioInstallPathExists = fs_1.default.existsSync('C:/Program Files (x86)/Microsoft Visual Studio'); const visualStudioDataPathExists = fs_1.default.existsSync('C:/ProgramData/Microsoft/VisualStudio'); if (!visualStudioInstallPathExists || !visualStudioDataPathExists) { throw new Error(`Visual Studio not found at the default location. Make sure the runner has Visual Studio installed in the default location`); } } } exports.default = ValidateWindows; /***/ }), /***/ 9707: /***/ ((__unused_webpack_module, exports) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); class Platform { static get default() { return Platform.types.StandaloneWindows64; } static get types() { return { StandaloneOSX: 'StandaloneOSX', StandaloneWindows: 'StandaloneWindows', StandaloneWindows64: 'StandaloneWindows64', StandaloneLinux64: 'StandaloneLinux64', iOS: 'iOS', Android: 'Android', WebGL: 'WebGL', WSAPlayer: 'WSAPlayer', PS4: 'PS4', XboxOne: 'XboxOne', tvOS: 'tvOS', Switch: 'Switch', // Unsupported Lumin: 'Lumin', BJM: 'BJM', Stadia: 'Stadia', Facebook: 'Facebook', NoTarget: 'NoTarget', // Test specific Test: 'Test', }; } static isWindows(platform) { switch (platform) { case Platform.types.StandaloneWindows: case Platform.types.StandaloneWindows64: return true; default: return false; } } static isAndroid(platform) { switch (platform) { case Platform.types.Android: return true; default: return false; } } } exports.default = Platform; /***/ }), /***/ 88666: /***/ (function(__unused_webpack_module, exports, __webpack_require__) { "use strict"; var __importDefault = (this && this.__importDefault) || function (mod) { return (mod && mod.__esModule) ? mod : { "default": mod }; }; Object.defineProperty(exports, "__esModule", ({ value: true })); const input_1 = __importDefault(__webpack_require__(91933)); const unity_1 = __importDefault(__webpack_require__(70498)); const action_1 = __importDefault(__webpack_require__(89088)); class Project { static get relativePath() { const { projectPath } = input_1.default; return `${projectPath}`; } static get absolutePath() { const { workspace } = action_1.default; return `${workspace}/${this.relativePath}`; } static get libraryFolder() { return `${this.relativePath}/${unity_1.default.libraryFolder}`; } } exports.default = Project; /***/ }), /***/ 70187: /***/ (function(__unused_webpack_module, exports, __webpack_require__) { "use strict"; var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { if (k2 === undefined) k2 = k; Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); }) : (function(o, m, k, k2) { if (k2 === undefined) k2 = k; o[k2] = m[k]; })); var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { Object.defineProperty(o, "default", { enumerable: true, value: v }); }) : function(o, v) { o["default"] = v; }); var __importStar = (this && this.__importStar) || function (mod) { if (mod && mod.__esModule) return mod; var result = {}; if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); __setModuleDefault(result, mod); return result; }; var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } return new (P || (P = Promise))(function (resolve, reject) { function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } step((generator = generator.apply(thisArg, _arguments || [])).next()); }); }; var __importDefault = (this && this.__importDefault) || function (mod) { return (mod && mod.__esModule) ? mod : { "default": mod }; }; Object.defineProperty(exports, "__esModule", ({ value: true })); const SDK = __importStar(__webpack_require__(71786)); const nanoid_1 = __webpack_require__(39140); const fs = __importStar(__webpack_require__(35747)); const core = __importStar(__webpack_require__(42186)); const remote_builder_constants_1 = __importDefault(__webpack_require__(92560)); const aws_build_runner_1 = __importDefault(__webpack_require__(11201)); class AWSBuildEnvironment { static runBuild(buildId, stackName, image, commands, mountdir, workingdir, environment, secrets) { return __awaiter(this, void 0, void 0, function* () { const ECS = new SDK.ECS(); const CF = new SDK.CloudFormation(); const entrypoint = ['/bin/sh']; const taskDef = yield this.setupCloudFormations(CF, buildId, stackName, image, entrypoint, commands, mountdir, workingdir, secrets); try { yield aws_build_runner_1.default.runTask(taskDef, ECS, CF, environment, buildId); } finally { yield this.cleanupResources(CF, taskDef); } }); } // static async setupPlatformResources() { // throw new Error('Method not implemented.'); // } static getParameterTemplate(p1) { return ` ${p1}: Type: String Default: '' `; } static getSecretTemplate(p1) { return ` ${p1}Secret: Type: AWS::SecretsManager::Secret Properties: Name: !Join [ "", [ '${p1}', !Ref BUILDID ] ] SecretString: !Ref ${p1} `; } static getSecretDefinitionTemplate(p1, p2) { return ` - Name: '${p1}' ValueFrom: !Ref ${p2}Secret `; } static insertAtTemplate(template, insertionKey, insertion) { const index = template.search(insertionKey) + insertionKey.length + '\n'.length; template = [template.slice(0, index), insertion, template.slice(index)].join(''); return template; } static setupCloudFormations(CF, buildUid, stackName, image, entrypoint, commands, mountdir, workingdir, secrets) { return __awaiter(this, void 0, void 0, function* () { const logid = nanoid_1.customAlphabet(remote_builder_constants_1.default.alphabet, 9)(); commands[1] += ` echo "${logid}" `; const taskDefStackName = `${stackName}-${buildUid}`; let taskDefCloudFormation = this.readTaskCloudFormationTemplate(); const cleanupTaskDefStackName = `${taskDefStackName}-cleanup`; const cleanupCloudFormation = fs.readFileSync(`${__dirname}/cloud-formations/cloudformation-stack-ttl.yml`, 'utf8'); try { for (const secret of secrets) { taskDefCloudFormation = this.insertAtTemplate(taskDefCloudFormation, 'p1 - input', this.getParameterTemplate(secret.ParameterKey.replace(/[^\dA-Za-z]/g, ''))); taskDefCloudFormation = this.insertAtTemplate(taskDefCloudFormation, 'p2 - secret', this.getSecretTemplate(secret.ParameterKey.replace(/[^\dA-Za-z]/g, ''))); taskDefCloudFormation = this.insertAtTemplate(taskDefCloudFormation, 'p3 - container def', this.getSecretDefinitionTemplate(secret.EnvironmentVariable, secret.ParameterKey.replace(/[^\dA-Za-z]/g, ''))); } const mappedSecrets = secrets.map((x) => { return { ParameterKey: x.ParameterKey.replace(/[^\dA-Za-z]/g, ''), ParameterValue: x.ParameterValue }; }); yield CF.createStack({ StackName: taskDefStackName, TemplateBody: taskDefCloudFormation, Parameters: [ { ParameterKey: 'ImageUrl', ParameterValue: image, }, { ParameterKey: 'ServiceName', ParameterValue: taskDefStackName, }, { ParameterKey: 'Command', ParameterValue: commands.join(','), }, { ParameterKey: 'EntryPoint', ParameterValue: entrypoint.join(','), }, { ParameterKey: 'WorkingDirectory', ParameterValue: workingdir, }, { ParameterKey: 'EFSMountDirectory', ParameterValue: mountdir, }, { ParameterKey: 'BUILDID', ParameterValue: buildUid, }, ...mappedSecrets, ], }).promise(); core.info('Creating worker cluster...'); yield CF.createStack({ StackName: cleanupTaskDefStackName, TemplateBody: cleanupCloudFormation, Capabilities: ['CAPABILITY_IAM'], Parameters: [ { ParameterKey: 'StackName', ParameterValue: taskDefStackName, }, { ParameterKey: 'DeleteStackName', ParameterValue: cleanupTaskDefStackName, }, { ParameterKey: 'TTL', ParameterValue: '100', }, { ParameterKey: 'BUILDID', ParameterValue: buildUid, }, ], }).promise(); core.info('Creating cleanup cluster...'); yield CF.waitFor('stackCreateComplete', { StackName: taskDefStackName }).promise(); } catch (error) { yield AWSBuildEnvironment.handleStackCreationFailure(error, CF, taskDefStackName, taskDefCloudFormation, secrets); throw error; } const taskDefResources = (yield CF.describeStackResources({ StackName: taskDefStackName, }).promise()).StackResources; const baseResources = (yield CF.describeStackResources({ StackName: stackName }).promise()).StackResources; // in the future we should offer a parameter to choose if you want the guarnteed shutdown. core.info('Worker cluster created successfully (skipping wait for cleanup cluster to be ready)'); return { taskDefStackName, taskDefCloudFormation, taskDefStackNameTTL: cleanupTaskDefStackName, ttlCloudFormation: cleanupCloudFormation, taskDefResources, baseResources, logid, }; }); } static handleStackCreationFailure(error, CF, taskDefStackName, taskDefCloudFormation, secrets) { return __awaiter(this, void 0, void 0, function* () { core.info(JSON.stringify(secrets, undefined, 4)); core.info(taskDefCloudFormation); const events = (yield CF.describeStackEvents({ StackName: taskDefStackName }).promise()).StackEvents; const resources = (yield CF.describeStackResources({ StackName: taskDefStackName }).promise()).StackResources; core.info(JSON.stringify(events, undefined, 4)); core.info(JSON.stringify(resources, undefined, 4)); core.error(error); }); } static readTaskCloudFormationTemplate() { return fs.readFileSync(`${__dirname}/cloud-formations/task-def-formation.yml`, 'utf8'); } static cleanupResources(CF, taskDef) { return __awaiter(this, void 0, void 0, function* () { core.info('Cleanup starting'); yield CF.deleteStack({ StackName: taskDef.taskDefStackName, }).promise(); yield CF.deleteStack({ StackName: taskDef.taskDefStackNameTTL, }).promise(); yield CF.waitFor('stackDeleteComplete', { StackName: taskDef.taskDefStackName, }).promise(); // Currently too slow and causes too much waiting yield CF.waitFor('stackDeleteComplete', { StackName: taskDef.taskDefStackNameTTL, }).promise(); core.info('Cleanup complete'); }); } } exports.default = AWSBuildEnvironment; /***/ }), /***/ 11201: /***/ (function(__unused_webpack_module, exports, __webpack_require__) { "use strict"; var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { if (k2 === undefined) k2 = k; Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); }) : (function(o, m, k, k2) { if (k2 === undefined) k2 = k; o[k2] = m[k]; })); var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { Object.defineProperty(o, "default", { enumerable: true, value: v }); }) : function(o, v) { o["default"] = v; }); var __importStar = (this && this.__importStar) || function (mod) { if (mod && mod.__esModule) return mod; var result = {}; if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); __setModuleDefault(result, mod); return result; }; var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } return new (P || (P = Promise))(function (resolve, reject) { function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } step((generator = generator.apply(thisArg, _arguments || [])).next()); }); }; Object.defineProperty(exports, "__esModule", ({ value: true })); const AWS = __importStar(__webpack_require__(71786)); const core = __importStar(__webpack_require__(42186)); const zlib = __importStar(__webpack_require__(78761)); class AWSBuildRunner { static runTask(taskDef, ECS, CF, environment, buildUid) { var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s; return __awaiter(this, void 0, void 0, function* () { const cluster = ((_b = (_a = taskDef.baseResources) === null || _a === void 0 ? void 0 : _a.find((x) => x.LogicalResourceId === 'ECSCluster')) === null || _b === void 0 ? void 0 : _b.PhysicalResourceId) || ''; const taskDefinition = ((_d = (_c = taskDef.taskDefResources) === null || _c === void 0 ? void 0 : _c.find((x) => x.LogicalResourceId === 'TaskDefinition')) === null || _d === void 0 ? void 0 : _d.PhysicalResourceId) || ''; const SubnetOne = ((_f = (_e = taskDef.baseResources) === null || _e === void 0 ? void 0 : _e.find((x) => x.LogicalResourceId === 'PublicSubnetOne')) === null || _f === void 0 ? void 0 : _f.PhysicalResourceId) || ''; const SubnetTwo = ((_h = (_g = taskDef.baseResources) === null || _g === void 0 ? void 0 : _g.find((x) => x.LogicalResourceId === 'PublicSubnetTwo')) === null || _h === void 0 ? void 0 : _h.PhysicalResourceId) || ''; const ContainerSecurityGroup = ((_k = (_j = taskDef.baseResources) === null || _j === void 0 ? void 0 : _j.find((x) => x.LogicalResourceId === 'ContainerSecurityGroup')) === null || _k === void 0 ? void 0 : _k.PhysicalResourceId) || ''; const streamName = ((_m = (_l = taskDef.taskDefResources) === null || _l === void 0 ? void 0 : _l.find((x) => x.LogicalResourceId === 'KinesisStream')) === null || _m === void 0 ? void 0 : _m.PhysicalResourceId) || ''; const task = yield ECS.runTask({ cluster, taskDefinition, platformVersion: '1.4.0', overrides: { containerOverrides: [ { name: taskDef.taskDefStackName, environment: [...environment, { name: 'BUILDID', value: buildUid }], }, ], }, launchType: 'FARGATE', networkConfiguration: { awsvpcConfiguration: { subnets: [SubnetOne, SubnetTwo], assignPublicIp: 'ENABLED', securityGroups: [ContainerSecurityGroup], }, }, }).promise(); core.info('Task is starting on worker cluster'); const taskArn = ((_o = task.tasks) === null || _o === void 0 ? void 0 : _o[0].taskArn) || ''; try { yield ECS.waitFor('tasksRunning', { tasks: [taskArn], cluster }).promise(); } catch (error) { yield new Promise((resolve) => setTimeout(resolve, 3000)); const describeTasks = yield ECS.describeTasks({ tasks: [taskArn], cluster, }).promise(); core.info(`Task has ended ${(_q = (_p = describeTasks.tasks) === null || _p === void 0 ? void 0 : _p[0].containers) === null || _q === void 0 ? void 0 : _q[0].lastStatus}`); core.setFailed(error); core.error(error); } core.info(`Task is running on worker cluster`); yield this.streamLogsUntilTaskStops(ECS, CF, taskDef, cluster, taskArn, streamName); yield ECS.waitFor('tasksStopped', { cluster, tasks: [taskArn] }).promise(); const exitCode = (_s = (_r = (yield ECS.describeTasks({ tasks: [taskArn], cluster, }).promise()).tasks) === null || _r === void 0 ? void 0 : _r[0].containers) === null || _s === void 0 ? void 0 : _s[0].exitCode; if (exitCode !== 0) { core.error(`job failed with exit code ${exitCode}`); throw new Error(`job failed with exit code ${exitCode}`); } else { core.info(`Task has finished successfully`); } }); } static streamLogsUntilTaskStops(ECS, CF, taskDef, clusterName, taskArn, kinesisStreamName) { var _a; return __awaiter(this, void 0, void 0, function* () { // watching logs const kinesis = new AWS.Kinesis(); const getTaskData = () => __awaiter(this, void 0, void 0, function* () { var _b; const tasks = yield ECS.describeTasks({ cluster: clusterName, tasks: [taskArn], }).promise(); return (_b = tasks.tasks) === null || _b === void 0 ? void 0 : _b[0]; }); const stream = yield kinesis .describeStream({ StreamName: kinesisStreamName, }) .promise(); let iterator = (yield kinesis .getShardIterator({ ShardIteratorType: 'TRIM_HORIZON', StreamName: stream.StreamDescription.StreamName, ShardId: stream.StreamDescription.Shards[0].ShardId, }) .promise()).ShardIterator || ''; yield CF.waitFor('stackCreateComplete', { StackName: taskDef.taskDefStackNameTTL }).promise(); core.info(`Task status is ${(_a = (yield getTaskData())) === null || _a === void 0 ? void 0 : _a.lastStatus}`); const logBaseUrl = `https://${AWS.config.region}.console.aws.amazon.com/cloudwatch/home?region=${AWS.config.region}#logsV2:log-groups/log-group/${taskDef.taskDefStackName}`; core.info(`You can also see the logs at AWS Cloud Watch: ${logBaseUrl}`); let readingLogs = true; let timestamp = 0; while (readingLogs) { yield new Promise((resolve) => setTimeout(resolve, 1500)); const taskData = yield getTaskData(); if ((taskData === null || taskData === void 0 ? void 0 : taskData.lastStatus) !== 'RUNNING') { if (timestamp === 0) { core.info('Task stopped, streaming end of logs'); timestamp = Date.now(); } if (timestamp !== 0 && Date.now() - timestamp < 30000) { core.info('Task status is not RUNNING for 30 seconds, last query for logs'); readingLogs = false; } } const records = yield kinesis .getRecords({ ShardIterator: iterator, }) .promise(); iterator = records.NextShardIterator || ''; if (records.Records.length > 0 && iterator) { for (let index = 0; index < records.Records.length; index++) { const json = JSON.parse(zlib.gunzipSync(Buffer.from(records.Records[index].Data, 'base64')).toString('utf8')); if (json.messageType === 'DATA_MESSAGE') { for (let logEventsIndex = 0; logEventsIndex < json.logEvents.length; logEventsIndex++) { if (json.logEvents[logEventsIndex].message.includes(taskDef.logid)) { core.info('End of task logs'); readingLogs = false; } else { core.info(json.logEvents[logEventsIndex].message); } } } } } } }); } } exports.default = AWSBuildRunner; /***/ }), /***/ 92560: /***/ ((__unused_webpack_module, exports) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); class RemoteBuilderConstants { } RemoteBuilderConstants.alphabet = '0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz'; exports.default = RemoteBuilderConstants; /***/ }), /***/ 49358: /***/ (function(__unused_webpack_module, exports, __webpack_require__) { "use strict"; var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { if (k2 === undefined) k2 = k; Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); }) : (function(o, m, k, k2) { if (k2 === undefined) k2 = k; o[k2] = m[k]; })); var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { Object.defineProperty(o, "default", { enumerable: true, value: v }); }) : function(o, v) { o["default"] = v; }); var __importStar = (this && this.__importStar) || function (mod) { if (mod && mod.__esModule) return mod; var result = {}; if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); __setModuleDefault(result, mod); return result; }; var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } return new (P || (P = Promise))(function (resolve, reject) { function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } step((generator = generator.apply(thisArg, _arguments || [])).next()); }); }; var __importDefault = (this && this.__importDefault) || function (mod) { return (mod && mod.__esModule) ? mod : { "default": mod }; }; Object.defineProperty(exports, "__esModule", ({ value: true })); const nanoid_1 = __webpack_require__(39140); const aws_build_platform_1 = __importDefault(__webpack_require__(70187)); const core = __importStar(__webpack_require__(42186)); const remote_builder_constants_1 = __importDefault(__webpack_require__(92560)); const repositoryDirectoryName = 'repo'; const efsDirectoryName = 'data'; const cacheDirectoryName = 'cache'; class RemoteBuilder { static build(buildParameters, baseImage) { var _a; return __awaiter(this, void 0, void 0, function* () { try { this.SteamDeploy = process.env.STEAM_DEPLOY !== undefined || false; const nanoid = nanoid_1.customAlphabet(remote_builder_constants_1.default.alphabet, 4); const buildUid = `${process.env.GITHUB_RUN_NUMBER}-${buildParameters.platform .replace('Standalone', '') .replace('standalone', '')}-${nanoid()}`; const defaultBranchName = ((_a = process.env.GITHUB_REF) === null || _a === void 0 ? void 0 : _a.split('/').filter((x) => { x = x[0].toUpperCase() + x.slice(1); return x; }).join('')) || ''; const branchName = process.env.REMOTE_BUILDER_CACHE !== undefined ? process.env.REMOTE_BUILDER_CACHE : defaultBranchName; const token = buildParameters.githubToken; const defaultSecretsArray = [ { ParameterKey: 'GithubToken', EnvironmentVariable: 'GITHUB_TOKEN', ParameterValue: token, }, ]; yield RemoteBuilder.SetupStep(buildUid, buildParameters, branchName, defaultSecretsArray); yield RemoteBuilder.BuildStep(buildUid, buildParameters, baseImage, defaultSecretsArray); yield RemoteBuilder.CompressionStep(buildUid, buildParameters, branchName, defaultSecretsArray); yield RemoteBuilder.UploadArtifacts(buildUid, buildParameters, branchName, defaultSecretsArray); if (this.SteamDeploy) { yield RemoteBuilder.DeployToSteam(buildUid, buildParameters, defaultSecretsArray); } } catch (error) { core.setFailed(error); core.error(error); } }); } static SetupStep(buildUid, buildParameters, branchName, defaultSecretsArray) { return __awaiter(this, void 0, void 0, function* () { core.info('Starting step 1/4 clone and restore cache)'); yield aws_build_platform_1.default.runBuild(buildUid, buildParameters.awsStackName, 'alpine/git', [ '-c', `apk update; apk add unzip; apk add git-lfs; apk add jq; # Get source repo for project to be built and game-ci repo for utilties git clone https://${buildParameters.githubToken}@github.com/${process.env.GITHUB_REPOSITORY}.git ${buildUid}/${repositoryDirectoryName} -q git clone https://${buildParameters.githubToken}@github.com/game-ci/unity-builder.git ${buildUid}/builder -q git clone https://${buildParameters.githubToken}@github.com/game-ci/steam-deploy.git ${buildUid}/steam -q cd /${efsDirectoryName}/${buildUid}/${repositoryDirectoryName}/ git checkout $GITHUB_SHA cd /${efsDirectoryName}/ # Look for usable cache if [ ! -d ${cacheDirectoryName} ]; then mkdir ${cacheDirectoryName} fi cd ${cacheDirectoryName} if [ ! -d "${branchName}" ]; then mkdir "${branchName}" fi cd "${branchName}" echo '' echo "Cached Libraries for ${branchName} from previous builds:" ls echo '' ls "/${efsDirectoryName}/${buildUid}/${repositoryDirectoryName}/${buildParameters.projectPath}" libDir="/${efsDirectoryName}/${buildUid}/${repositoryDirectoryName}/${buildParameters.projectPath}/Library" if [ -d "$libDir" ]; then rm -r "$libDir" echo "Setup .gitignore to ignore Library folder and remove it from builds" fi echo 'Checking cache' # Restore cache latest=$(ls -t | head -1) if [ ! -z "$latest" ]; then echo "Library cache exists from build $latest from ${branchName}" echo 'Creating empty Library folder for cache' mkdir $libDir unzip -q $latest -d $libDir # purge cache ${process.env.PURGE_REMOTE_BUILDER_CACHE === undefined ? '#' : ''} rm -r $libDir else echo 'Cache does not exist' fi # Print out important directories echo '' echo 'Repo:' ls /${efsDirectoryName}/${buildUid}/${repositoryDirectoryName}/ echo '' echo 'Project:' ls /${efsDirectoryName}/${buildUid}/${repositoryDirectoryName}/${buildParameters.projectPath} echo '' echo 'Library:' ls /${efsDirectoryName}/${buildUid}/${repositoryDirectoryName}/${buildParameters.projectPath}/Library/ echo '' `, ], `/${efsDirectoryName}`, `/${efsDirectoryName}/`, [ { name: 'GITHUB_SHA', value: process.env.GITHUB_SHA || '', }, ], defaultSecretsArray); }); } static BuildStep(buildUid, buildParameters, baseImage, defaultSecretsArray) { return __awaiter(this, void 0, void 0, function* () { const buildSecrets = new Array(); buildSecrets.push(...defaultSecretsArray); if (process.env.UNITY_LICENSE) buildSecrets.push({ ParameterKey: 'UnityLicense', EnvironmentVariable: 'UNITY_LICENSE', ParameterValue: process.env.UNITY_LICENSE, }); if (process.env.UNITY_EMAIL) buildSecrets.push({ ParameterKey: 'UnityEmail', EnvironmentVariable: 'UNITY_EMAIL', ParameterValue: process.env.UNITY_EMAIL, }); if (process.env.UNITY_PASSWORD) buildSecrets.push({ ParameterKey: 'UnityPassword', EnvironmentVariable: 'UNITY_PASSWORD', ParameterValue: process.env.UNITY_PASSWORD, }); if (process.env.UNITY_SERIAL) buildSecrets.push({ ParameterKey: 'UnitySerial', EnvironmentVariable: 'UNITY_SERIAL', ParameterValue: process.env.UNITY_SERIAL, }); if (buildParameters.androidKeystoreBase64) buildSecrets.push({ ParameterKey: 'AndroidKeystoreBase64', EnvironmentVariable: 'ANDROID_KEYSTORE_BASE64', ParameterValue: buildParameters.androidKeystoreBase64, }); if (buildParameters.androidKeystorePass) buildSecrets.push({ ParameterKey: 'AndroidKeystorePass', EnvironmentVariable: 'ANDROID_KEYSTORE_PASS', ParameterValue: buildParameters.androidKeystorePass, }); if (buildParameters.androidKeyaliasPass) buildSecrets.push({ ParameterKey: 'AndroidKeyAliasPass', EnvironmentVariable: 'AWS_ACCESS_KEY_ALIAS_PASS', ParameterValue: buildParameters.androidKeyaliasPass, }); core.info('Starting part 2/4 (build unity project)'); yield aws_build_platform_1.default.runBuild(buildUid, buildParameters.awsStackName, baseImage.toString(), [ '-c', ` cp -r /${efsDirectoryName}/${buildUid}/builder/dist/default-build-script/ /UnityBuilderAction; cp -r /${efsDirectoryName}/${buildUid}/builder/dist/entrypoint.sh /entrypoint.sh; cp -r /${efsDirectoryName}/${buildUid}/builder/dist/steps/ /steps; chmod -R +x /entrypoint.sh; chmod -R +x /steps; /entrypoint.sh; `, ], `/${efsDirectoryName}`, `/${efsDirectoryName}/${buildUid}/${repositoryDirectoryName}/`, [ { name: 'ContainerMemory', value: buildParameters.remoteBuildMemory, }, { name: 'ContainerCpu', value: buildParameters.remoteBuildCpu, }, { name: 'GITHUB_WORKSPACE', value: `/${efsDirectoryName}/${buildUid}/${repositoryDirectoryName}/`, }, { name: 'PROJECT_PATH', value: buildParameters.projectPath, }, { name: 'BUILD_PATH', value: buildParameters.buildPath, }, { name: 'BUILD_FILE', value: buildParameters.buildFile, }, { name: 'BUILD_NAME', value: buildParameters.buildName, }, { name: 'BUILD_METHOD', value: buildParameters.buildMethod, }, { name: 'CUSTOM_PARAMETERS', value: buildParameters.customParameters, }, { name: 'BUILD_TARGET', value: buildParameters.platform, }, { name: 'ANDROID_VERSION_CODE', value: buildParameters.androidVersionCode.toString(), }, { name: 'ANDROID_KEYSTORE_NAME', value: buildParameters.androidKeystoreName, }, { name: 'ANDROID_KEYALIAS_NAME', value: buildParameters.androidKeyaliasName, }, ], buildSecrets); }); } static CompressionStep(buildUid, buildParameters, branchName, defaultSecretsArray) { return __awaiter(this, void 0, void 0, function* () { core.info('Starting step 3/4 build compression'); // Cleanup yield aws_build_platform_1.default.runBuild(buildUid, buildParameters.awsStackName, 'alpine', [ '-c', ` apk update apk add zip cd Library zip -r lib-${buildUid}.zip .* mv lib-${buildUid}.zip /${efsDirectoryName}/${cacheDirectoryName}/${branchName}/lib-${buildUid}.zip cd ../../ zip -r build-${buildUid}.zip ${buildParameters.buildPath}/* mv build-${buildUid}.zip /${efsDirectoryName}/${buildUid}/build-${buildUid}.zip `, ], `/${efsDirectoryName}`, `/${efsDirectoryName}/${buildUid}/${repositoryDirectoryName}/${buildParameters.projectPath}`, [ { name: 'GITHUB_SHA', value: process.env.GITHUB_SHA || '', }, ], defaultSecretsArray); core.info('compression step complete'); }); } static UploadArtifacts(buildUid, buildParameters, branchName, defaultSecretsArray) { return __awaiter(this, void 0, void 0, function* () { core.info('Starting step 4/4 upload build to s3'); yield aws_build_platform_1.default.runBuild(buildUid, buildParameters.awsStackName, 'amazon/aws-cli', [ '-c', ` aws s3 cp ${buildUid}/build-${buildUid}.zip s3://game-ci-storage/ # no need to upload Library cache for now # aws s3 cp /${efsDirectoryName}/${cacheDirectoryName}/${branchName}/lib-${buildUid}.zip s3://game-ci-storage/ ${this.SteamDeploy ? '#' : ''} rm -r ${buildUid} `, ], `/${efsDirectoryName}`, `/${efsDirectoryName}/`, [ { name: 'GITHUB_SHA', value: process.env.GITHUB_SHA || '', }, { name: 'AWS_DEFAULT_REGION', value: process.env.AWS_DEFAULT_REGION || '', }, ], [ { ParameterKey: 'AWSAccessKeyID', EnvironmentVariable: 'AWS_ACCESS_KEY_ID', ParameterValue: process.env.AWS_ACCESS_KEY_ID || '', }, { ParameterKey: 'AWSSecretAccessKey', EnvironmentVariable: 'AWS_SECRET_ACCESS_KEY', ParameterValue: process.env.AWS_SECRET_ACCESS_KEY || '', }, ...defaultSecretsArray, ]); }); } static DeployToSteam(buildUid, buildParameters, defaultSecretsArray) { return __awaiter(this, void 0, void 0, function* () { core.info('Starting steam deployment'); yield aws_build_platform_1.default.runBuild(buildUid, buildParameters.awsStackName, 'cm2network/steamcmd:root', [ '-c', ` ls ls / cp -r /${efsDirectoryName}/${buildUid}/steam/action/entrypoint.sh /entrypoint.sh; cp -r /${efsDirectoryName}/${buildUid}/steam/action/steps/ /steps; chmod -R +x /entrypoint.sh; chmod -R +x /steps; /entrypoint.sh; rm -r /${efsDirectoryName}/${buildUid} `, ], `/${efsDirectoryName}`, `/${efsDirectoryName}/${buildUid}/steam/action/`, [ { name: 'GITHUB_SHA', value: process.env.GITHUB_SHA || '', }, ], [ { EnvironmentVariable: 'INPUT_APPID', ParameterKey: 'appId', ParameterValue: process.env.APP_ID || '', }, { EnvironmentVariable: 'INPUT_BUILDDESCRIPTION', ParameterKey: 'buildDescription', ParameterValue: process.env.BUILD_DESCRIPTION || '', }, { EnvironmentVariable: 'INPUT_ROOTPATH', ParameterKey: 'rootPath', ParameterValue: process.env.ROOT_PATH || '', }, { EnvironmentVariable: 'INPUT_RELEASEBRANCH', ParameterKey: 'releaseBranch', ParameterValue: process.env.RELEASE_BRANCH || '', }, { EnvironmentVariable: 'INPUT_LOCALCONTENTSERVER', ParameterKey: 'localContentServer', ParameterValue: process.env.LOCAL_CONTENT_SERVER || '', }, { EnvironmentVariable: 'INPUT_PREVIEWENABLED', ParameterKey: 'previewEnabled', ParameterValue: process.env.PREVIEW_ENABLED || '', }, ...defaultSecretsArray, ]); }); } } RemoteBuilder.SteamDeploy = false; exports.default = RemoteBuilder; /***/ }), /***/ 62177: /***/ (function(__unused_webpack_module, exports, __webpack_require__) { "use strict"; var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { if (k2 === undefined) k2 = k; Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); }) : (function(o, m, k, k2) { if (k2 === undefined) k2 = k; o[k2] = m[k]; })); var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { Object.defineProperty(o, "default", { enumerable: true, value: v }); }) : function(o, v) { o["default"] = v; }); var __importStar = (this && this.__importStar) || function (mod) { if (mod && mod.__esModule) return mod; var result = {}; if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); __setModuleDefault(result, mod); return result; }; var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } return new (P || (P = Promise))(function (resolve, reject) { function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } step((generator = generator.apply(thisArg, _arguments || [])).next()); }); }; Object.defineProperty(exports, "__esModule", ({ value: true })); const core = __importStar(__webpack_require__(42186)); const exec_1 = __webpack_require__(71514); class System { static run(command, arguments_ = [], options = {}) { return __awaiter(this, void 0, void 0, function* () { let result = ''; let error = ''; let debug = ''; const listeners = { stdout: (dataBuffer) => { result += dataBuffer.toString(); }, stderr: (dataBuffer) => { error += dataBuffer.toString(); }, debug: (dataString) => { debug += dataString.toString(); }, }; const showOutput = () => { if (debug !== '') { core.debug(debug); } if (result !== '') { core.info(result); } if (error !== '') { core.warning(error); } }; const throwContextualError = (message) => { let commandAsString = command; if (Array.isArray(arguments_)) { commandAsString += ` ${arguments_.join(' ')}`; } else if (typeof arguments_ === 'string') { commandAsString += ` ${arguments_}`; } throw new Error(`Failed to run "${commandAsString}".\n ${message}`); }; try { const exitCode = yield exec_1.exec(command, arguments_, Object.assign({ silent: true, listeners }, options)); showOutput(); if (exitCode !== 0) { throwContextualError(`Command returned non-zero exit code.\nError: ${error}`); } } catch (inCommandError) { showOutput(); throwContextualError(`In-command error caught: ${inCommandError}`); } return result; }); } } exports.default = System; /***/ }), /***/ 17146: /***/ (function(__unused_webpack_module, exports, __webpack_require__) { "use strict"; var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { if (k2 === undefined) k2 = k; Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); }) : (function(o, m, k, k2) { if (k2 === undefined) k2 = k; o[k2] = m[k]; })); var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { Object.defineProperty(o, "default", { enumerable: true, value: v }); }) : function(o, v) { o["default"] = v; }); var __importStar = (this && this.__importStar) || function (mod) { if (mod && mod.__esModule) return mod; var result = {}; if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); __setModuleDefault(result, mod); return result; }; var __importDefault = (this && this.__importDefault) || function (mod) { return (mod && mod.__esModule) ? mod : { "default": mod }; }; Object.defineProperty(exports, "__esModule", ({ value: true })); const fs = __importStar(__webpack_require__(35747)); const path_1 = __importDefault(__webpack_require__(85622)); class UnityVersioning { static get versionPattern() { return /20\d{2}\.\d\.\w{3,4}|3/; } static determineUnityVersion(projectPath, unityVersion) { if (unityVersion === 'auto') { return UnityVersioning.read(projectPath); } return unityVersion; } static read(projectPath) { const filePath = path_1.default.join(projectPath, 'ProjectSettings', 'ProjectVersion.txt'); if (!fs.existsSync(filePath)) { throw new Error(`Project settings file not found at "${filePath}". Have you correctly set the projectPath?`); } return UnityVersioning.parse(fs.readFileSync(filePath, 'utf8')); } static parse(projectVersionTxt) { const matches = projectVersionTxt.match(UnityVersioning.versionPattern); if (!matches || matches.length === 0) { throw new Error(`Failed to parse version from "${projectVersionTxt}".`); } return matches[0]; } } exports.default = UnityVersioning; /***/ }), /***/ 70498: /***/ ((__unused_webpack_module, exports) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); class Unity { static get libraryFolder() { return 'Library'; } } exports.default = Unity; /***/ }), /***/ 88729: /***/ (function(__unused_webpack_module, exports, __webpack_require__) { "use strict"; var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { if (k2 === undefined) k2 = k; Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); }) : (function(o, m, k, k2) { if (k2 === undefined) k2 = k; o[k2] = m[k]; })); var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { Object.defineProperty(o, "default", { enumerable: true, value: v }); }) : function(o, v) { o["default"] = v; }); var __importStar = (this && this.__importStar) || function (mod) { if (mod && mod.__esModule) return mod; var result = {}; if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); __setModuleDefault(result, mod); return result; }; var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } return new (P || (P = Promise))(function (resolve, reject) { function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } step((generator = generator.apply(thisArg, _arguments || [])).next()); }); }; var __importDefault = (this && this.__importDefault) || function (mod) { return (mod && mod.__esModule) ? mod : { "default": mod }; }; Object.defineProperty(exports, "__esModule", ({ value: true })); const core = __importStar(__webpack_require__(42186)); const not_implemented_exception_1 = __importDefault(__webpack_require__(26574)); const validation_error_1 = __importDefault(__webpack_require__(97266)); const input_1 = __importDefault(__webpack_require__(91933)); const system_1 = __importDefault(__webpack_require__(62177)); class Versioning { static get projectPath() { return input_1.default.projectPath; } static get isDirtyAllowed() { return input_1.default.allowDirtyBuild; } static get strategies() { return { None: 'None', Semantic: 'Semantic', Tag: 'Tag', Custom: 'Custom' }; } /** * Get the branch name of the (related) branch */ static get branch() { // Todo - use optional chaining (https://github.com/zeit/ncc/issues/534) return this.headRef || (this.ref && this.ref.slice(11)); } /** * For pull requests we can reliably use GITHUB_HEAD_REF */ static get headRef() { return process.env.GITHUB_HEAD_REF; } /** * For branches GITHUB_REF will have format `refs/heads/feature-branch-1` */ static get ref() { return process.env.GITHUB_REF; } /** * The commit SHA that triggered the workflow run. */ static get sha() { return process.env.GITHUB_SHA; } /** * Maximum number of lines to print when logging the git diff */ static get maxDiffLines() { return 60; } /** * Log up to maxDiffLines of the git diff. */ static logDiff() { return __awaiter(this, void 0, void 0, function* () { const diffCommand = `git --no-pager diff | head -n ${this.maxDiffLines.toString()}`; yield system_1.default.run('sh', undefined, { input: Buffer.from(diffCommand), silent: true, }); }); } /** * Regex to parse version description into separate fields */ static get descriptionRegex1() { return /^v?([\d.]+)-(\d+)-g(\w+)-?(\w+)*/g; } static get descriptionRegex2() { return /^v?([\d.]+-\w+)-(\d+)-g(\w+)-?(\w+)*/g; } static get descriptionRegex3() { return /^v?([\d.]+-\w+\.\d+)-(\d+)-g(\w+)-?(\w+)*/g; } static determineVersion(strategy, inputVersion) { return __awaiter(this, void 0, void 0, function* () { // Validate input if (!Object.hasOwnProperty.call(this.strategies, strategy)) { throw new validation_error_1.default(`Versioning strategy should be one of ${Object.values(this.strategies).join(', ')}.`); } let version; switch (strategy) { case this.strategies.None: version = 'none'; break; case this.strategies.Custom: version = inputVersion; break; case this.strategies.Semantic: version = yield this.generateSemanticVersion(); break; case this.strategies.Tag: version = yield this.generateTagVersion(); break; default: throw new not_implemented_exception_1.default(`Strategy ${strategy} is not implemented.`); } return version; }); } /** * Automatically generates a version based on SemVer out of the box. * * The version works as follows: `..` for example `0.1.2`. * * The latest tag dictates `.` * The number of commits since that tag dictates``. * * @See: https://semver.org/ */ static generateSemanticVersion() { return __awaiter(this, void 0, void 0, function* () { if (yield this.isShallow()) { yield this.fetch(); } yield this.logDiff(); if ((yield this.isDirty()) && !this.isDirtyAllowed) { throw new Error('Branch is dirty. Refusing to base semantic version on uncommitted changes'); } if (!(yield this.hasAnyVersionTags())) { const version = `0.0.${yield this.getTotalNumberOfCommits()}`; core.info(`Generated version ${version} (no version tags found).`); return version; } const versionDescriptor = yield this.parseSemanticVersion(); if (versionDescriptor) { const { tag, commits, hash } = versionDescriptor; // Ensure 3 digits (commits should always be patch level) const [major, minor, patch] = `${tag}.${commits}`.split('.'); const threeDigitVersion = /^\d+$/.test(patch) ? `${major}.${minor}.${patch}` : `${major}.0.${minor}`; core.info(`Found semantic version ${threeDigitVersion} for ${this.branch}@${hash}`); return `${threeDigitVersion}`; } const version = `0.0.${yield this.getTotalNumberOfCommits()}`; core.info(`Generated version ${version} (semantic version couldn't be determined).`); return version; }); } /** * Generate the proper version for unity based on an existing tag. */ static generateTagVersion() { return __awaiter(this, void 0, void 0, function* () { let tag = yield this.getTag(); if (tag.charAt(0) === 'v') { tag = tag.slice(1); } return tag; }); } /** * Parses the versionDescription into their named parts. */ static parseSemanticVersion() { return __awaiter(this, void 0, void 0, function* () { const description = yield this.getVersionDescription(); try { const [match, tag, commits, hash] = this.descriptionRegex1.exec(description); return { match, tag, commits, hash, }; } catch (_a) { try { const [match, tag, commits, hash] = this.descriptionRegex2.exec(description); return { match, tag, commits, hash, }; } catch (_b) { try { const [match, tag, commits, hash] = this.descriptionRegex3.exec(description); return { match, tag, commits, hash, }; } catch (_c) { core.warning(`Failed to parse git describe output or version can not be determined through: "${description}".`); return false; } } } }); } /** * Returns whether the repository is shallow. */ static isShallow() { return __awaiter(this, void 0, void 0, function* () { const output = yield this.git(['rev-parse', '--is-shallow-repository']); return output !== 'false\n'; }); } /** * Retrieves refs from the configured remote. * * Fetch unshallow for incomplete repository, but fall back to normal fetch. * * Note: `--all` should not be used, and would break fetching for push event. */ static fetch() { return __awaiter(this, void 0, void 0, function* () { try { yield this.git(['fetch', '--unshallow']); } catch (error) { core.warning(`Fetch --unshallow caught: ${error}`); yield this.git(['fetch']); } }); } /** * Retrieves information about the branch. * * Format: `v0.12-24-gd2198ab` * * In this format v0.12 is the latest tag, 24 are the number of commits since, and gd2198ab * identifies the current commit. */ static getVersionDescription() { return __awaiter(this, void 0, void 0, function* () { return this.git(['describe', '--long', '--tags', '--always', this.sha]); }); } /** * Returns whether there are uncommitted changes that are not ignored. */ static isDirty() { return __awaiter(this, void 0, void 0, function* () { const output = yield this.git(['status', '--porcelain']); const isDirty = output !== ''; if (isDirty) { core.warning('Changes were made to the following files and folders:\n'); core.warning(output); } return isDirty; }); } /** * Get the tag if there is one pointing at HEAD */ static getTag() { return __awaiter(this, void 0, void 0, function* () { return (yield this.git(['tag', '--points-at', 'HEAD'])).trim(); }); } /** * Whether or not the repository has any version tags yet. */ static hasAnyVersionTags() { return __awaiter(this, void 0, void 0, function* () { const numberOfCommitsAsString = yield system_1.default.run('sh', undefined, { input: Buffer.from('git tag --list --merged HEAD | grep v[0-9]* | wc -l'), cwd: this.projectPath, silent: false, }); const numberOfCommits = Number.parseInt(numberOfCommitsAsString, 10); return numberOfCommits !== 0; }); } /** * Get the total number of commits on head. * * Note: HEAD should not be used, as it may be detached, resulting in an additional count. */ static getTotalNumberOfCommits() { return __awaiter(this, void 0, void 0, function* () { const numberOfCommitsAsString = yield this.git(['rev-list', '--count', this.sha]); return Number.parseInt(numberOfCommitsAsString, 10); }); } /** * Run git in the specified project path */ static git(arguments_, options = {}) { return __awaiter(this, void 0, void 0, function* () { return system_1.default.run('git', arguments_, Object.assign({ cwd: this.projectPath }, options)); }); } } exports.default = Versioning; /***/ }), /***/ 87351: /***/ (function(__unused_webpack_module, exports, __webpack_require__) { "use strict"; var __importStar = (this && this.__importStar) || function (mod) { if (mod && mod.__esModule) return mod; var result = {}; if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k]; result["default"] = mod; return result; }; Object.defineProperty(exports, "__esModule", ({ value: true })); const os = __importStar(__webpack_require__(12087)); const utils_1 = __webpack_require__(5278); /** * Commands * * Command Format: * ::name key=value,key=value::message * * Examples: * ::warning::This is the message * ::set-env name=MY_VAR::some value */ function issueCommand(command, properties, message) { const cmd = new Command(command, properties, message); process.stdout.write(cmd.toString() + os.EOL); } exports.issueCommand = issueCommand; function issue(name, message = '') { issueCommand(name, {}, message); } exports.issue = issue; const CMD_STRING = '::'; class Command { constructor(command, properties, message) { if (!command) { command = 'missing.command'; } this.command = command; this.properties = properties; this.message = message; } toString() { let cmdStr = CMD_STRING + this.command; if (this.properties && Object.keys(this.properties).length > 0) { cmdStr += ' '; let first = true; for (const key in this.properties) { if (this.properties.hasOwnProperty(key)) { const val = this.properties[key]; if (val) { if (first) { first = false; } else { cmdStr += ','; } cmdStr += `${key}=${escapeProperty(val)}`; } } } } cmdStr += `${CMD_STRING}${escapeData(this.message)}`; return cmdStr; } } function escapeData(s) { return utils_1.toCommandValue(s) .replace(/%/g, '%25') .replace(/\r/g, '%0D') .replace(/\n/g, '%0A'); } function escapeProperty(s) { return utils_1.toCommandValue(s) .replace(/%/g, '%25') .replace(/\r/g, '%0D') .replace(/\n/g, '%0A') .replace(/:/g, '%3A') .replace(/,/g, '%2C'); } //# sourceMappingURL=command.js.map /***/ }), /***/ 42186: /***/ (function(__unused_webpack_module, exports, __webpack_require__) { "use strict"; var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } return new (P || (P = Promise))(function (resolve, reject) { function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } step((generator = generator.apply(thisArg, _arguments || [])).next()); }); }; var __importStar = (this && this.__importStar) || function (mod) { if (mod && mod.__esModule) return mod; var result = {}; if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k]; result["default"] = mod; return result; }; Object.defineProperty(exports, "__esModule", ({ value: true })); const command_1 = __webpack_require__(87351); const file_command_1 = __webpack_require__(717); const utils_1 = __webpack_require__(5278); const os = __importStar(__webpack_require__(12087)); const path = __importStar(__webpack_require__(85622)); /** * The code to exit an action */ var ExitCode; (function (ExitCode) { /** * A code indicating that the action was successful */ ExitCode[ExitCode["Success"] = 0] = "Success"; /** * A code indicating that the action was a failure */ ExitCode[ExitCode["Failure"] = 1] = "Failure"; })(ExitCode = exports.ExitCode || (exports.ExitCode = {})); //----------------------------------------------------------------------- // Variables //----------------------------------------------------------------------- /** * Sets env variable for this action and future actions in the job * @param name the name of the variable to set * @param val the value of the variable. Non-string values will be converted to a string via JSON.stringify */ // eslint-disable-next-line @typescript-eslint/no-explicit-any function exportVariable(name, val) { const convertedVal = utils_1.toCommandValue(val); process.env[name] = convertedVal; const filePath = process.env['GITHUB_ENV'] || ''; if (filePath) { const delimiter = '_GitHubActionsFileCommandDelimeter_'; const commandValue = `${name}<<${delimiter}${os.EOL}${convertedVal}${os.EOL}${delimiter}`; file_command_1.issueCommand('ENV', commandValue); } else { command_1.issueCommand('set-env', { name }, convertedVal); } } exports.exportVariable = exportVariable; /** * Registers a secret which will get masked from logs * @param secret value of the secret */ function setSecret(secret) { command_1.issueCommand('add-mask', {}, secret); } exports.setSecret = setSecret; /** * Prepends inputPath to the PATH (for this action and future actions) * @param inputPath */ function addPath(inputPath) { const filePath = process.env['GITHUB_PATH'] || ''; if (filePath) { file_command_1.issueCommand('PATH', inputPath); } else { command_1.issueCommand('add-path', {}, inputPath); } process.env['PATH'] = `${inputPath}${path.delimiter}${process.env['PATH']}`; } exports.addPath = addPath; /** * Gets the value of an input. The value is also trimmed. * * @param name name of the input to get * @param options optional. See InputOptions. * @returns string */ function getInput(name, options) { const val = process.env[`INPUT_${name.replace(/ /g, '_').toUpperCase()}`] || ''; if (options && options.required && !val) { throw new Error(`Input required and not supplied: ${name}`); } return val.trim(); } exports.getInput = getInput; /** * Sets the value of an output. * * @param name name of the output to set * @param value value to store. Non-string values will be converted to a string via JSON.stringify */ // eslint-disable-next-line @typescript-eslint/no-explicit-any function setOutput(name, value) { process.stdout.write(os.EOL); command_1.issueCommand('set-output', { name }, value); } exports.setOutput = setOutput; /** * Enables or disables the echoing of commands into stdout for the rest of the step. * Echoing is disabled by default if ACTIONS_STEP_DEBUG is not set. * */ function setCommandEcho(enabled) { command_1.issue('echo', enabled ? 'on' : 'off'); } exports.setCommandEcho = setCommandEcho; //----------------------------------------------------------------------- // Results //----------------------------------------------------------------------- /** * Sets the action status to failed. * When the action exits it will be with an exit code of 1 * @param message add error issue message */ function setFailed(message) { process.exitCode = ExitCode.Failure; error(message); } exports.setFailed = setFailed; //----------------------------------------------------------------------- // Logging Commands //----------------------------------------------------------------------- /** * Gets whether Actions Step Debug is on or not */ function isDebug() { return process.env['RUNNER_DEBUG'] === '1'; } exports.isDebug = isDebug; /** * Writes debug message to user log * @param message debug message */ function debug(message) { command_1.issueCommand('debug', {}, message); } exports.debug = debug; /** * Adds an error issue * @param message error issue message. Errors will be converted to string via toString() */ function error(message) { command_1.issue('error', message instanceof Error ? message.toString() : message); } exports.error = error; /** * Adds an warning issue * @param message warning issue message. Errors will be converted to string via toString() */ function warning(message) { command_1.issue('warning', message instanceof Error ? message.toString() : message); } exports.warning = warning; /** * Writes info to log with console.log. * @param message info message */ function info(message) { process.stdout.write(message + os.EOL); } exports.info = info; /** * Begin an output group. * * Output until the next `groupEnd` will be foldable in this group * * @param name The name of the output group */ function startGroup(name) { command_1.issue('group', name); } exports.startGroup = startGroup; /** * End an output group. */ function endGroup() { command_1.issue('endgroup'); } exports.endGroup = endGroup; /** * Wrap an asynchronous function call in a group. * * Returns the same type as the function itself. * * @param name The name of the group * @param fn The function to wrap in the group */ function group(name, fn) { return __awaiter(this, void 0, void 0, function* () { startGroup(name); let result; try { result = yield fn(); } finally { endGroup(); } return result; }); } exports.group = group; //----------------------------------------------------------------------- // Wrapper action state //----------------------------------------------------------------------- /** * Saves state for current action, the state can only be retrieved by this action's post job execution. * * @param name name of the state to store * @param value value to store. Non-string values will be converted to a string via JSON.stringify */ // eslint-disable-next-line @typescript-eslint/no-explicit-any function saveState(name, value) { command_1.issueCommand('save-state', { name }, value); } exports.saveState = saveState; /** * Gets the value of an state set by this action's main execution. * * @param name name of the state to get * @returns string */ function getState(name) { return process.env[`STATE_${name}`] || ''; } exports.getState = getState; //# sourceMappingURL=core.js.map /***/ }), /***/ 717: /***/ (function(__unused_webpack_module, exports, __webpack_require__) { "use strict"; // For internal use, subject to change. var __importStar = (this && this.__importStar) || function (mod) { if (mod && mod.__esModule) return mod; var result = {}; if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k]; result["default"] = mod; return result; }; Object.defineProperty(exports, "__esModule", ({ value: true })); // We use any as a valid input type /* eslint-disable @typescript-eslint/no-explicit-any */ const fs = __importStar(__webpack_require__(35747)); const os = __importStar(__webpack_require__(12087)); const utils_1 = __webpack_require__(5278); function issueCommand(command, message) { const filePath = process.env[`GITHUB_${command}`]; if (!filePath) { throw new Error(`Unable to find environment variable for file command ${command}`); } if (!fs.existsSync(filePath)) { throw new Error(`Missing file at path: ${filePath}`); } fs.appendFileSync(filePath, `${utils_1.toCommandValue(message)}${os.EOL}`, { encoding: 'utf8' }); } exports.issueCommand = issueCommand; //# sourceMappingURL=file-command.js.map /***/ }), /***/ 5278: /***/ ((__unused_webpack_module, exports) => { "use strict"; // We use any as a valid input type /* eslint-disable @typescript-eslint/no-explicit-any */ Object.defineProperty(exports, "__esModule", ({ value: true })); /** * Sanitizes an input into a string so it can be passed into issueCommand safely * @param input input to sanitize into a string */ function toCommandValue(input) { if (input === null || input === undefined) { return ''; } else if (typeof input === 'string' || input instanceof String) { return input; } return JSON.stringify(input); } exports.toCommandValue = toCommandValue; //# sourceMappingURL=utils.js.map /***/ }), /***/ 71514: /***/ (function(__unused_webpack_module, exports, __webpack_require__) { "use strict"; var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } return new (P || (P = Promise))(function (resolve, reject) { function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } step((generator = generator.apply(thisArg, _arguments || [])).next()); }); }; var __importStar = (this && this.__importStar) || function (mod) { if (mod && mod.__esModule) return mod; var result = {}; if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k]; result["default"] = mod; return result; }; Object.defineProperty(exports, "__esModule", ({ value: true })); const tr = __importStar(__webpack_require__(88159)); /** * Exec a command. * Output will be streamed to the live console. * Returns promise with return code * * @param commandLine command to execute (can include additional args). Must be correctly escaped. * @param args optional arguments for tool. Escaping is handled by the lib. * @param options optional exec options. See ExecOptions * @returns Promise exit code */ function exec(commandLine, args, options) { return __awaiter(this, void 0, void 0, function* () { const commandArgs = tr.argStringToArray(commandLine); if (commandArgs.length === 0) { throw new Error(`Parameter 'commandLine' cannot be null or empty.`); } // Path to tool to execute should be first arg const toolPath = commandArgs[0]; args = commandArgs.slice(1).concat(args || []); const runner = new tr.ToolRunner(toolPath, args, options); return runner.exec(); }); } exports.exec = exec; //# sourceMappingURL=exec.js.map /***/ }), /***/ 88159: /***/ (function(__unused_webpack_module, exports, __webpack_require__) { "use strict"; var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } return new (P || (P = Promise))(function (resolve, reject) { function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } step((generator = generator.apply(thisArg, _arguments || [])).next()); }); }; var __importStar = (this && this.__importStar) || function (mod) { if (mod && mod.__esModule) return mod; var result = {}; if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k]; result["default"] = mod; return result; }; Object.defineProperty(exports, "__esModule", ({ value: true })); const os = __importStar(__webpack_require__(12087)); const events = __importStar(__webpack_require__(28614)); const child = __importStar(__webpack_require__(63129)); const path = __importStar(__webpack_require__(85622)); const io = __importStar(__webpack_require__(47351)); const ioUtil = __importStar(__webpack_require__(81962)); /* eslint-disable @typescript-eslint/unbound-method */ const IS_WINDOWS = process.platform === 'win32'; /* * Class for running command line tools. Handles quoting and arg parsing in a platform agnostic way. */ class ToolRunner extends events.EventEmitter { constructor(toolPath, args, options) { super(); if (!toolPath) { throw new Error("Parameter 'toolPath' cannot be null or empty."); } this.toolPath = toolPath; this.args = args || []; this.options = options || {}; } _debug(message) { if (this.options.listeners && this.options.listeners.debug) { this.options.listeners.debug(message); } } _getCommandString(options, noPrefix) { const toolPath = this._getSpawnFileName(); const args = this._getSpawnArgs(options); let cmd = noPrefix ? '' : '[command]'; // omit prefix when piped to a second tool if (IS_WINDOWS) { // Windows + cmd file if (this._isCmdFile()) { cmd += toolPath; for (const a of args) { cmd += ` ${a}`; } } // Windows + verbatim else if (options.windowsVerbatimArguments) { cmd += `"${toolPath}"`; for (const a of args) { cmd += ` ${a}`; } } // Windows (regular) else { cmd += this._windowsQuoteCmdArg(toolPath); for (const a of args) { cmd += ` ${this._windowsQuoteCmdArg(a)}`; } } } else { // OSX/Linux - this can likely be improved with some form of quoting. // creating processes on Unix is fundamentally different than Windows. // on Unix, execvp() takes an arg array. cmd += toolPath; for (const a of args) { cmd += ` ${a}`; } } return cmd; } _processLineBuffer(data, strBuffer, onLine) { try { let s = strBuffer + data.toString(); let n = s.indexOf(os.EOL); while (n > -1) { const line = s.substring(0, n); onLine(line); // the rest of the string ... s = s.substring(n + os.EOL.length); n = s.indexOf(os.EOL); } strBuffer = s; } catch (err) { // streaming lines to console is best effort. Don't fail a build. this._debug(`error processing line. Failed with error ${err}`); } } _getSpawnFileName() { if (IS_WINDOWS) { if (this._isCmdFile()) { return process.env['COMSPEC'] || 'cmd.exe'; } } return this.toolPath; } _getSpawnArgs(options) { if (IS_WINDOWS) { if (this._isCmdFile()) { let argline = `/D /S /C "${this._windowsQuoteCmdArg(this.toolPath)}`; for (const a of this.args) { argline += ' '; argline += options.windowsVerbatimArguments ? a : this._windowsQuoteCmdArg(a); } argline += '"'; return [argline]; } } return this.args; } _endsWith(str, end) { return str.endsWith(end); } _isCmdFile() { const upperToolPath = this.toolPath.toUpperCase(); return (this._endsWith(upperToolPath, '.CMD') || this._endsWith(upperToolPath, '.BAT')); } _windowsQuoteCmdArg(arg) { // for .exe, apply the normal quoting rules that libuv applies if (!this._isCmdFile()) { return this._uvQuoteCmdArg(arg); } // otherwise apply quoting rules specific to the cmd.exe command line parser. // the libuv rules are generic and are not designed specifically for cmd.exe // command line parser. // // for a detailed description of the cmd.exe command line parser, refer to // http://stackoverflow.com/questions/4094699/how-does-the-windows-command-interpreter-cmd-exe-parse-scripts/7970912#7970912 // need quotes for empty arg if (!arg) { return '""'; } // determine whether the arg needs to be quoted const cmdSpecialChars = [ ' ', '\t', '&', '(', ')', '[', ']', '{', '}', '^', '=', ';', '!', "'", '+', ',', '`', '~', '|', '<', '>', '"' ]; let needsQuotes = false; for (const char of arg) { if (cmdSpecialChars.some(x => x === char)) { needsQuotes = true; break; } } // short-circuit if quotes not needed if (!needsQuotes) { return arg; } // the following quoting rules are very similar to the rules that by libuv applies. // // 1) wrap the string in quotes // // 2) double-up quotes - i.e. " => "" // // this is different from the libuv quoting rules. libuv replaces " with \", which unfortunately // doesn't work well with a cmd.exe command line. // // note, replacing " with "" also works well if the arg is passed to a downstream .NET console app. // for example, the command line: // foo.exe "myarg:""my val""" // is parsed by a .NET console app into an arg array: // [ "myarg:\"my val\"" ] // which is the same end result when applying libuv quoting rules. although the actual // command line from libuv quoting rules would look like: // foo.exe "myarg:\"my val\"" // // 3) double-up slashes that precede a quote, // e.g. hello \world => "hello \world" // hello\"world => "hello\\""world" // hello\\"world => "hello\\\\""world" // hello world\ => "hello world\\" // // technically this is not required for a cmd.exe command line, or the batch argument parser. // the reasons for including this as a .cmd quoting rule are: // // a) this is optimized for the scenario where the argument is passed from the .cmd file to an // external program. many programs (e.g. .NET console apps) rely on the slash-doubling rule. // // b) it's what we've been doing previously (by deferring to node default behavior) and we // haven't heard any complaints about that aspect. // // note, a weakness of the quoting rules chosen here, is that % is not escaped. in fact, % cannot be // escaped when used on the command line directly - even though within a .cmd file % can be escaped // by using %%. // // the saving grace is, on the command line, %var% is left as-is if var is not defined. this contrasts // the line parsing rules within a .cmd file, where if var is not defined it is replaced with nothing. // // one option that was explored was replacing % with ^% - i.e. %var% => ^%var^%. this hack would // often work, since it is unlikely that var^ would exist, and the ^ character is removed when the // variable is used. the problem, however, is that ^ is not removed when %* is used to pass the args // to an external program. // // an unexplored potential solution for the % escaping problem, is to create a wrapper .cmd file. // % can be escaped within a .cmd file. let reverse = '"'; let quoteHit = true; for (let i = arg.length; i > 0; i--) { // walk the string in reverse reverse += arg[i - 1]; if (quoteHit && arg[i - 1] === '\\') { reverse += '\\'; // double the slash } else if (arg[i - 1] === '"') { quoteHit = true; reverse += '"'; // double the quote } else { quoteHit = false; } } reverse += '"'; return reverse .split('') .reverse() .join(''); } _uvQuoteCmdArg(arg) { // Tool runner wraps child_process.spawn() and needs to apply the same quoting as // Node in certain cases where the undocumented spawn option windowsVerbatimArguments // is used. // // Since this function is a port of quote_cmd_arg from Node 4.x (technically, lib UV, // see https://github.com/nodejs/node/blob/v4.x/deps/uv/src/win/process.c for details), // pasting copyright notice from Node within this function: // // Copyright Joyent, Inc. and other Node contributors. All rights reserved. // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to // deal in the Software without restriction, including without limitation the // rights to use, copy, modify, merge, publish, distribute, sublicense, and/or // sell copies of the Software, and to permit persons to whom the Software is // furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included in // all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS // IN THE SOFTWARE. if (!arg) { // Need double quotation for empty argument return '""'; } if (!arg.includes(' ') && !arg.includes('\t') && !arg.includes('"')) { // No quotation needed return arg; } if (!arg.includes('"') && !arg.includes('\\')) { // No embedded double quotes or backslashes, so I can just wrap // quote marks around the whole thing. return `"${arg}"`; } // Expected input/output: // input : hello"world // output: "hello\"world" // input : hello""world // output: "hello\"\"world" // input : hello\world // output: hello\world // input : hello\\world // output: hello\\world // input : hello\"world // output: "hello\\\"world" // input : hello\\"world // output: "hello\\\\\"world" // input : hello world\ // output: "hello world\\" - note the comment in libuv actually reads "hello world\" // but it appears the comment is wrong, it should be "hello world\\" let reverse = '"'; let quoteHit = true; for (let i = arg.length; i > 0; i--) { // walk the string in reverse reverse += arg[i - 1]; if (quoteHit && arg[i - 1] === '\\') { reverse += '\\'; } else if (arg[i - 1] === '"') { quoteHit = true; reverse += '\\'; } else { quoteHit = false; } } reverse += '"'; return reverse .split('') .reverse() .join(''); } _cloneExecOptions(options) { options = options || {}; const result = { cwd: options.cwd || process.cwd(), env: options.env || process.env, silent: options.silent || false, windowsVerbatimArguments: options.windowsVerbatimArguments || false, failOnStdErr: options.failOnStdErr || false, ignoreReturnCode: options.ignoreReturnCode || false, delay: options.delay || 10000 }; result.outStream = options.outStream || process.stdout; result.errStream = options.errStream || process.stderr; return result; } _getSpawnOptions(options, toolPath) { options = options || {}; const result = {}; result.cwd = options.cwd; result.env = options.env; result['windowsVerbatimArguments'] = options.windowsVerbatimArguments || this._isCmdFile(); if (options.windowsVerbatimArguments) { result.argv0 = `"${toolPath}"`; } return result; } /** * Exec a tool. * Output will be streamed to the live console. * Returns promise with return code * * @param tool path to tool to exec * @param options optional exec options. See ExecOptions * @returns number */ exec() { return __awaiter(this, void 0, void 0, function* () { // root the tool path if it is unrooted and contains relative pathing if (!ioUtil.isRooted(this.toolPath) && (this.toolPath.includes('/') || (IS_WINDOWS && this.toolPath.includes('\\')))) { // prefer options.cwd if it is specified, however options.cwd may also need to be rooted this.toolPath = path.resolve(process.cwd(), this.options.cwd || process.cwd(), this.toolPath); } // if the tool is only a file name, then resolve it from the PATH // otherwise verify it exists (add extension on Windows if necessary) this.toolPath = yield io.which(this.toolPath, true); return new Promise((resolve, reject) => { this._debug(`exec tool: ${this.toolPath}`); this._debug('arguments:'); for (const arg of this.args) { this._debug(` ${arg}`); } const optionsNonNull = this._cloneExecOptions(this.options); if (!optionsNonNull.silent && optionsNonNull.outStream) { optionsNonNull.outStream.write(this._getCommandString(optionsNonNull) + os.EOL); } const state = new ExecState(optionsNonNull, this.toolPath); state.on('debug', (message) => { this._debug(message); }); const fileName = this._getSpawnFileName(); const cp = child.spawn(fileName, this._getSpawnArgs(optionsNonNull), this._getSpawnOptions(this.options, fileName)); const stdbuffer = ''; if (cp.stdout) { cp.stdout.on('data', (data) => { if (this.options.listeners && this.options.listeners.stdout) { this.options.listeners.stdout(data); } if (!optionsNonNull.silent && optionsNonNull.outStream) { optionsNonNull.outStream.write(data); } this._processLineBuffer(data, stdbuffer, (line) => { if (this.options.listeners && this.options.listeners.stdline) { this.options.listeners.stdline(line); } }); }); } const errbuffer = ''; if (cp.stderr) { cp.stderr.on('data', (data) => { state.processStderr = true; if (this.options.listeners && this.options.listeners.stderr) { this.options.listeners.stderr(data); } if (!optionsNonNull.silent && optionsNonNull.errStream && optionsNonNull.outStream) { const s = optionsNonNull.failOnStdErr ? optionsNonNull.errStream : optionsNonNull.outStream; s.write(data); } this._processLineBuffer(data, errbuffer, (line) => { if (this.options.listeners && this.options.listeners.errline) { this.options.listeners.errline(line); } }); }); } cp.on('error', (err) => { state.processError = err.message; state.processExited = true; state.processClosed = true; state.CheckComplete(); }); cp.on('exit', (code) => { state.processExitCode = code; state.processExited = true; this._debug(`Exit code ${code} received from tool '${this.toolPath}'`); state.CheckComplete(); }); cp.on('close', (code) => { state.processExitCode = code; state.processExited = true; state.processClosed = true; this._debug(`STDIO streams have closed for tool '${this.toolPath}'`); state.CheckComplete(); }); state.on('done', (error, exitCode) => { if (stdbuffer.length > 0) { this.emit('stdline', stdbuffer); } if (errbuffer.length > 0) { this.emit('errline', errbuffer); } cp.removeAllListeners(); if (error) { reject(error); } else { resolve(exitCode); } }); if (this.options.input) { if (!cp.stdin) { throw new Error('child process missing stdin'); } cp.stdin.end(this.options.input); } }); }); } } exports.ToolRunner = ToolRunner; /** * Convert an arg string to an array of args. Handles escaping * * @param argString string of arguments * @returns string[] array of arguments */ function argStringToArray(argString) { const args = []; let inQuotes = false; let escaped = false; let arg = ''; function append(c) { // we only escape double quotes. if (escaped && c !== '"') { arg += '\\'; } arg += c; escaped = false; } for (let i = 0; i < argString.length; i++) { const c = argString.charAt(i); if (c === '"') { if (!escaped) { inQuotes = !inQuotes; } else { append(c); } continue; } if (c === '\\' && escaped) { append(c); continue; } if (c === '\\' && inQuotes) { escaped = true; continue; } if (c === ' ' && !inQuotes) { if (arg.length > 0) { args.push(arg); arg = ''; } continue; } append(c); } if (arg.length > 0) { args.push(arg.trim()); } return args; } exports.argStringToArray = argStringToArray; class ExecState extends events.EventEmitter { constructor(options, toolPath) { super(); this.processClosed = false; // tracks whether the process has exited and stdio is closed this.processError = ''; this.processExitCode = 0; this.processExited = false; // tracks whether the process has exited this.processStderr = false; // tracks whether stderr was written to this.delay = 10000; // 10 seconds this.done = false; this.timeout = null; if (!toolPath) { throw new Error('toolPath must not be empty'); } this.options = options; this.toolPath = toolPath; if (options.delay) { this.delay = options.delay; } } CheckComplete() { if (this.done) { return; } if (this.processClosed) { this._setResult(); } else if (this.processExited) { this.timeout = setTimeout(ExecState.HandleTimeout, this.delay, this); } } _debug(message) { this.emit('debug', message); } _setResult() { // determine whether there is an error let error; if (this.processExited) { if (this.processError) { error = new Error(`There was an error when attempting to execute the process '${this.toolPath}'. This may indicate the process failed to start. Error: ${this.processError}`); } else if (this.processExitCode !== 0 && !this.options.ignoreReturnCode) { error = new Error(`The process '${this.toolPath}' failed with exit code ${this.processExitCode}`); } else if (this.processStderr && this.options.failOnStdErr) { error = new Error(`The process '${this.toolPath}' failed because one or more lines were written to the STDERR stream`); } } // clear the timeout if (this.timeout) { clearTimeout(this.timeout); this.timeout = null; } this.done = true; this.emit('done', error, this.processExitCode); } static HandleTimeout(state) { if (state.done) { return; } if (!state.processClosed && state.processExited) { const message = `The STDIO streams did not close within ${state.delay / 1000} seconds of the exit event from process '${state.toolPath}'. This may indicate a child process inherited the STDIO streams and has not yet exited.`; state._debug(message); } state._setResult(); } } //# sourceMappingURL=toolrunner.js.map /***/ }), /***/ 81962: /***/ (function(__unused_webpack_module, exports, __webpack_require__) { "use strict"; var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } return new (P || (P = Promise))(function (resolve, reject) { function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } step((generator = generator.apply(thisArg, _arguments || [])).next()); }); }; var __importStar = (this && this.__importStar) || function (mod) { if (mod && mod.__esModule) return mod; var result = {}; if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k]; result["default"] = mod; return result; }; var _a; Object.defineProperty(exports, "__esModule", ({ value: true })); const assert_1 = __webpack_require__(42357); const fs = __importStar(__webpack_require__(35747)); const path = __importStar(__webpack_require__(85622)); _a = fs.promises, exports.chmod = _a.chmod, exports.copyFile = _a.copyFile, exports.lstat = _a.lstat, exports.mkdir = _a.mkdir, exports.readdir = _a.readdir, exports.readlink = _a.readlink, exports.rename = _a.rename, exports.rmdir = _a.rmdir, exports.stat = _a.stat, exports.symlink = _a.symlink, exports.unlink = _a.unlink; exports.IS_WINDOWS = process.platform === 'win32'; function exists(fsPath) { return __awaiter(this, void 0, void 0, function* () { try { yield exports.stat(fsPath); } catch (err) { if (err.code === 'ENOENT') { return false; } throw err; } return true; }); } exports.exists = exists; function isDirectory(fsPath, useStat = false) { return __awaiter(this, void 0, void 0, function* () { const stats = useStat ? yield exports.stat(fsPath) : yield exports.lstat(fsPath); return stats.isDirectory(); }); } exports.isDirectory = isDirectory; /** * On OSX/Linux, true if path starts with '/'. On Windows, true for paths like: * \, \hello, \\hello\share, C:, and C:\hello (and corresponding alternate separator cases). */ function isRooted(p) { p = normalizeSeparators(p); if (!p) { throw new Error('isRooted() parameter "p" cannot be empty'); } if (exports.IS_WINDOWS) { return (p.startsWith('\\') || /^[A-Z]:/i.test(p) // e.g. \ or \hello or \\hello ); // e.g. C: or C:\hello } return p.startsWith('/'); } exports.isRooted = isRooted; /** * Recursively create a directory at `fsPath`. * * This implementation is optimistic, meaning it attempts to create the full * path first, and backs up the path stack from there. * * @param fsPath The path to create * @param maxDepth The maximum recursion depth * @param depth The current recursion depth */ function mkdirP(fsPath, maxDepth = 1000, depth = 1) { return __awaiter(this, void 0, void 0, function* () { assert_1.ok(fsPath, 'a path argument must be provided'); fsPath = path.resolve(fsPath); if (depth >= maxDepth) return exports.mkdir(fsPath); try { yield exports.mkdir(fsPath); return; } catch (err) { switch (err.code) { case 'ENOENT': { yield mkdirP(path.dirname(fsPath), maxDepth, depth + 1); yield exports.mkdir(fsPath); return; } default: { let stats; try { stats = yield exports.stat(fsPath); } catch (err2) { throw err; } if (!stats.isDirectory()) throw err; } } } }); } exports.mkdirP = mkdirP; /** * Best effort attempt to determine whether a file exists and is executable. * @param filePath file path to check * @param extensions additional file extensions to try * @return if file exists and is executable, returns the file path. otherwise empty string. */ function tryGetExecutablePath(filePath, extensions) { return __awaiter(this, void 0, void 0, function* () { let stats = undefined; try { // test file exists stats = yield exports.stat(filePath); } catch (err) { if (err.code !== 'ENOENT') { // eslint-disable-next-line no-console console.log(`Unexpected error attempting to determine if executable file exists '${filePath}': ${err}`); } } if (stats && stats.isFile()) { if (exports.IS_WINDOWS) { // on Windows, test for valid extension const upperExt = path.extname(filePath).toUpperCase(); if (extensions.some(validExt => validExt.toUpperCase() === upperExt)) { return filePath; } } else { if (isUnixExecutable(stats)) { return filePath; } } } // try each extension const originalFilePath = filePath; for (const extension of extensions) { filePath = originalFilePath + extension; stats = undefined; try { stats = yield exports.stat(filePath); } catch (err) { if (err.code !== 'ENOENT') { // eslint-disable-next-line no-console console.log(`Unexpected error attempting to determine if executable file exists '${filePath}': ${err}`); } } if (stats && stats.isFile()) { if (exports.IS_WINDOWS) { // preserve the case of the actual file (since an extension was appended) try { const directory = path.dirname(filePath); const upperName = path.basename(filePath).toUpperCase(); for (const actualName of yield exports.readdir(directory)) { if (upperName === actualName.toUpperCase()) { filePath = path.join(directory, actualName); break; } } } catch (err) { // eslint-disable-next-line no-console console.log(`Unexpected error attempting to determine the actual case of the file '${filePath}': ${err}`); } return filePath; } else { if (isUnixExecutable(stats)) { return filePath; } } } } return ''; }); } exports.tryGetExecutablePath = tryGetExecutablePath; function normalizeSeparators(p) { p = p || ''; if (exports.IS_WINDOWS) { // convert slashes on Windows p = p.replace(/\//g, '\\'); // remove redundant slashes return p.replace(/\\\\+/g, '\\'); } // remove redundant slashes return p.replace(/\/\/+/g, '/'); } // on Mac/Linux, test the execute bit // R W X R W X R W X // 256 128 64 32 16 8 4 2 1 function isUnixExecutable(stats) { return ((stats.mode & 1) > 0 || ((stats.mode & 8) > 0 && stats.gid === process.getgid()) || ((stats.mode & 64) > 0 && stats.uid === process.getuid())); } //# sourceMappingURL=io-util.js.map /***/ }), /***/ 47351: /***/ (function(__unused_webpack_module, exports, __webpack_require__) { "use strict"; var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } return new (P || (P = Promise))(function (resolve, reject) { function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } step((generator = generator.apply(thisArg, _arguments || [])).next()); }); }; var __importStar = (this && this.__importStar) || function (mod) { if (mod && mod.__esModule) return mod; var result = {}; if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k]; result["default"] = mod; return result; }; Object.defineProperty(exports, "__esModule", ({ value: true })); const childProcess = __importStar(__webpack_require__(63129)); const path = __importStar(__webpack_require__(85622)); const util_1 = __webpack_require__(31669); const ioUtil = __importStar(__webpack_require__(81962)); const exec = util_1.promisify(childProcess.exec); /** * Copies a file or folder. * Based off of shelljs - https://github.com/shelljs/shelljs/blob/9237f66c52e5daa40458f94f9565e18e8132f5a6/src/cp.js * * @param source source path * @param dest destination path * @param options optional. See CopyOptions. */ function cp(source, dest, options = {}) { return __awaiter(this, void 0, void 0, function* () { const { force, recursive } = readCopyOptions(options); const destStat = (yield ioUtil.exists(dest)) ? yield ioUtil.stat(dest) : null; // Dest is an existing file, but not forcing if (destStat && destStat.isFile() && !force) { return; } // If dest is an existing directory, should copy inside. const newDest = destStat && destStat.isDirectory() ? path.join(dest, path.basename(source)) : dest; if (!(yield ioUtil.exists(source))) { throw new Error(`no such file or directory: ${source}`); } const sourceStat = yield ioUtil.stat(source); if (sourceStat.isDirectory()) { if (!recursive) { throw new Error(`Failed to copy. ${source} is a directory, but tried to copy without recursive flag.`); } else { yield cpDirRecursive(source, newDest, 0, force); } } else { if (path.relative(source, newDest) === '') { // a file cannot be copied to itself throw new Error(`'${newDest}' and '${source}' are the same file`); } yield copyFile(source, newDest, force); } }); } exports.cp = cp; /** * Moves a path. * * @param source source path * @param dest destination path * @param options optional. See MoveOptions. */ function mv(source, dest, options = {}) { return __awaiter(this, void 0, void 0, function* () { if (yield ioUtil.exists(dest)) { let destExists = true; if (yield ioUtil.isDirectory(dest)) { // If dest is directory copy src into dest dest = path.join(dest, path.basename(source)); destExists = yield ioUtil.exists(dest); } if (destExists) { if (options.force == null || options.force) { yield rmRF(dest); } else { throw new Error('Destination already exists'); } } } yield mkdirP(path.dirname(dest)); yield ioUtil.rename(source, dest); }); } exports.mv = mv; /** * Remove a path recursively with force * * @param inputPath path to remove */ function rmRF(inputPath) { return __awaiter(this, void 0, void 0, function* () { if (ioUtil.IS_WINDOWS) { // Node doesn't provide a delete operation, only an unlink function. This means that if the file is being used by another // program (e.g. antivirus), it won't be deleted. To address this, we shell out the work to rd/del. try { if (yield ioUtil.isDirectory(inputPath, true)) { yield exec(`rd /s /q "${inputPath}"`); } else { yield exec(`del /f /a "${inputPath}"`); } } catch (err) { // if you try to delete a file that doesn't exist, desired result is achieved // other errors are valid if (err.code !== 'ENOENT') throw err; } // Shelling out fails to remove a symlink folder with missing source, this unlink catches that try { yield ioUtil.unlink(inputPath); } catch (err) { // if you try to delete a file that doesn't exist, desired result is achieved // other errors are valid if (err.code !== 'ENOENT') throw err; } } else { let isDir = false; try { isDir = yield ioUtil.isDirectory(inputPath); } catch (err) { // if you try to delete a file that doesn't exist, desired result is achieved // other errors are valid if (err.code !== 'ENOENT') throw err; return; } if (isDir) { yield exec(`rm -rf "${inputPath}"`); } else { yield ioUtil.unlink(inputPath); } } }); } exports.rmRF = rmRF; /** * Make a directory. Creates the full path with folders in between * Will throw if it fails * * @param fsPath path to create * @returns Promise */ function mkdirP(fsPath) { return __awaiter(this, void 0, void 0, function* () { yield ioUtil.mkdirP(fsPath); }); } exports.mkdirP = mkdirP; /** * Returns path of a tool had the tool actually been invoked. Resolves via paths. * If you check and the tool does not exist, it will throw. * * @param tool name of the tool * @param check whether to check if tool exists * @returns Promise path to tool */ function which(tool, check) { return __awaiter(this, void 0, void 0, function* () { if (!tool) { throw new Error("parameter 'tool' is required"); } // recursive when check=true if (check) { const result = yield which(tool, false); if (!result) { if (ioUtil.IS_WINDOWS) { throw new Error(`Unable to locate executable file: ${tool}. Please verify either the file path exists or the file can be found within a directory specified by the PATH environment variable. Also verify the file has a valid extension for an executable file.`); } else { throw new Error(`Unable to locate executable file: ${tool}. Please verify either the file path exists or the file can be found within a directory specified by the PATH environment variable. Also check the file mode to verify the file is executable.`); } } return result; } const matches = yield findInPath(tool); if (matches && matches.length > 0) { return matches[0]; } return ''; }); } exports.which = which; /** * Returns a list of all occurrences of the given tool on the system path. * * @returns Promise the paths of the tool */ function findInPath(tool) { return __awaiter(this, void 0, void 0, function* () { if (!tool) { throw new Error("parameter 'tool' is required"); } // build the list of extensions to try const extensions = []; if (ioUtil.IS_WINDOWS && process.env['PATHEXT']) { for (const extension of process.env['PATHEXT'].split(path.delimiter)) { if (extension) { extensions.push(extension); } } } // if it's rooted, return it if exists. otherwise return empty. if (ioUtil.isRooted(tool)) { const filePath = yield ioUtil.tryGetExecutablePath(tool, extensions); if (filePath) { return [filePath]; } return []; } // if any path separators, return empty if (tool.includes(path.sep)) { return []; } // build the list of directories // // Note, technically "where" checks the current directory on Windows. From a toolkit perspective, // it feels like we should not do this. Checking the current directory seems like more of a use // case of a shell, and the which() function exposed by the toolkit should strive for consistency // across platforms. const directories = []; if (process.env.PATH) { for (const p of process.env.PATH.split(path.delimiter)) { if (p) { directories.push(p); } } } // find all matches const matches = []; for (const directory of directories) { const filePath = yield ioUtil.tryGetExecutablePath(path.join(directory, tool), extensions); if (filePath) { matches.push(filePath); } } return matches; }); } exports.findInPath = findInPath; function readCopyOptions(options) { const force = options.force == null ? true : options.force; const recursive = Boolean(options.recursive); return { force, recursive }; } function cpDirRecursive(sourceDir, destDir, currentDepth, force) { return __awaiter(this, void 0, void 0, function* () { // Ensure there is not a run away recursive copy if (currentDepth >= 255) return; currentDepth++; yield mkdirP(destDir); const files = yield ioUtil.readdir(sourceDir); for (const fileName of files) { const srcFile = `${sourceDir}/${fileName}`; const destFile = `${destDir}/${fileName}`; const srcFileStat = yield ioUtil.lstat(srcFile); if (srcFileStat.isDirectory()) { // Recurse yield cpDirRecursive(srcFile, destFile, currentDepth, force); } else { yield copyFile(srcFile, destFile, force); } } // Change the mode for the newly created directory yield ioUtil.chmod(destDir, (yield ioUtil.stat(sourceDir)).mode); }); } // Buffered file copy function copyFile(srcFile, destFile, force) { return __awaiter(this, void 0, void 0, function* () { if ((yield ioUtil.lstat(srcFile)).isSymbolicLink()) { // unlink/re-link it try { yield ioUtil.lstat(destFile); yield ioUtil.unlink(destFile); } catch (e) { // Try to override file permission if (e.code === 'EPERM') { yield ioUtil.chmod(destFile, '0666'); yield ioUtil.unlink(destFile); } // other errors = it doesn't exist, no work to do } // Copy over symlink const symlinkFull = yield ioUtil.readlink(srcFile); yield ioUtil.symlink(symlinkFull, destFile, ioUtil.IS_WINDOWS ? 'junction' : null); } else if (!(yield ioUtil.exists(destFile)) || force) { yield ioUtil.copyFile(srcFile, destFile); } }); } //# sourceMappingURL=io.js.map /***/ }), /***/ 56664: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; /** * Kubernetes * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) * * OpenAPI spec version: v1.13.7 * * * NOTE: This class is auto generated by the swagger code generator program. * https://github.com/swagger-api/swagger-codegen.git * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", ({ value: true })); const localVarRequest = __webpack_require__(48699); let defaultBasePath = 'https://localhost'; // =============================================== // This file is autogenerated - Please do not edit // =============================================== /* tslint:disable:no-unused-variable */ let primitives = [ "string", "boolean", "double", "integer", "long", "float", "number", "any" ]; class ObjectSerializer { static findCorrectType(data, expectedType) { if (data == undefined) { return expectedType; } else if (primitives.indexOf(expectedType.toLowerCase()) !== -1) { return expectedType; } else if (expectedType === "Date") { return expectedType; } else { if (enumsMap[expectedType]) { return expectedType; } if (!typeMap[expectedType]) { return expectedType; // w/e we don't know the type } // Check the discriminator let discriminatorProperty = typeMap[expectedType].discriminator; if (discriminatorProperty == null) { return expectedType; // the type does not have a discriminator. use it. } else { if (data[discriminatorProperty]) { return data[discriminatorProperty]; // use the type given in the discriminator } else { return expectedType; // discriminator was not present (or an empty string) } } } } static serialize(data, type) { if (data == undefined) { return data; } else if (primitives.indexOf(type.toLowerCase()) !== -1) { return data; } else if (type.lastIndexOf("Array<", 0) === 0) { // string.startsWith pre es6 let subType = type.replace("Array<", ""); // Array => Type> subType = subType.substring(0, subType.length - 1); // Type> => Type let transformedData = []; for (let index in data) { let date = data[index]; transformedData.push(ObjectSerializer.serialize(date, subType)); } return transformedData; } else if (type === "Date") { return data.toString(); } else { if (enumsMap[type]) { return data; } if (!typeMap[type]) { // in case we dont know the type return data; } // get the map for the correct type. let attributeTypes = typeMap[type].getAttributeTypeMap(); let instance = {}; for (let index in attributeTypes) { let attributeType = attributeTypes[index]; instance[attributeType.baseName] = ObjectSerializer.serialize(data[attributeType.name], attributeType.type); } return instance; } } static deserialize(data, type) { // polymorphism may change the actual type. type = ObjectSerializer.findCorrectType(data, type); if (data == undefined) { return data; } else if (primitives.indexOf(type.toLowerCase()) !== -1) { return data; } else if (type.lastIndexOf("Array<", 0) === 0) { // string.startsWith pre es6 let subType = type.replace("Array<", ""); // Array => Type> subType = subType.substring(0, subType.length - 1); // Type> => Type let transformedData = []; for (let index in data) { let date = data[index]; transformedData.push(ObjectSerializer.deserialize(date, subType)); } return transformedData; } else if (type === "Date") { return new Date(data); } else { if (enumsMap[type]) { // is Enum return data; } if (!typeMap[type]) { // dont know the type return data; } let instance = new typeMap[type](); let attributeTypes = typeMap[type].getAttributeTypeMap(); for (let index in attributeTypes) { let attributeType = attributeTypes[index]; instance[attributeType.name] = ObjectSerializer.deserialize(data[attributeType.baseName], attributeType.type); } return instance; } } } /** * ServiceReference holds a reference to Service.legacy.k8s.io */ class AdmissionregistrationV1beta1ServiceReference { static getAttributeTypeMap() { return AdmissionregistrationV1beta1ServiceReference.attributeTypeMap; } } AdmissionregistrationV1beta1ServiceReference.discriminator = undefined; AdmissionregistrationV1beta1ServiceReference.attributeTypeMap = [ { "name": "name", "baseName": "name", "type": "string" }, { "name": "namespace", "baseName": "namespace", "type": "string" }, { "name": "path", "baseName": "path", "type": "string" } ]; exports.AdmissionregistrationV1beta1ServiceReference = AdmissionregistrationV1beta1ServiceReference; /** * WebhookClientConfig contains the information to make a TLS connection with the webhook */ class AdmissionregistrationV1beta1WebhookClientConfig { static getAttributeTypeMap() { return AdmissionregistrationV1beta1WebhookClientConfig.attributeTypeMap; } } AdmissionregistrationV1beta1WebhookClientConfig.discriminator = undefined; AdmissionregistrationV1beta1WebhookClientConfig.attributeTypeMap = [ { "name": "caBundle", "baseName": "caBundle", "type": "string" }, { "name": "service", "baseName": "service", "type": "AdmissionregistrationV1beta1ServiceReference" }, { "name": "url", "baseName": "url", "type": "string" } ]; exports.AdmissionregistrationV1beta1WebhookClientConfig = AdmissionregistrationV1beta1WebhookClientConfig; /** * ServiceReference holds a reference to Service.legacy.k8s.io */ class ApiextensionsV1beta1ServiceReference { static getAttributeTypeMap() { return ApiextensionsV1beta1ServiceReference.attributeTypeMap; } } ApiextensionsV1beta1ServiceReference.discriminator = undefined; ApiextensionsV1beta1ServiceReference.attributeTypeMap = [ { "name": "name", "baseName": "name", "type": "string" }, { "name": "namespace", "baseName": "namespace", "type": "string" }, { "name": "path", "baseName": "path", "type": "string" } ]; exports.ApiextensionsV1beta1ServiceReference = ApiextensionsV1beta1ServiceReference; /** * WebhookClientConfig contains the information to make a TLS connection with the webhook. It has the same field as admissionregistration.v1beta1.WebhookClientConfig. */ class ApiextensionsV1beta1WebhookClientConfig { static getAttributeTypeMap() { return ApiextensionsV1beta1WebhookClientConfig.attributeTypeMap; } } ApiextensionsV1beta1WebhookClientConfig.discriminator = undefined; ApiextensionsV1beta1WebhookClientConfig.attributeTypeMap = [ { "name": "caBundle", "baseName": "caBundle", "type": "string" }, { "name": "service", "baseName": "service", "type": "ApiextensionsV1beta1ServiceReference" }, { "name": "url", "baseName": "url", "type": "string" } ]; exports.ApiextensionsV1beta1WebhookClientConfig = ApiextensionsV1beta1WebhookClientConfig; /** * ServiceReference holds a reference to Service.legacy.k8s.io */ class ApiregistrationV1beta1ServiceReference { static getAttributeTypeMap() { return ApiregistrationV1beta1ServiceReference.attributeTypeMap; } } ApiregistrationV1beta1ServiceReference.discriminator = undefined; ApiregistrationV1beta1ServiceReference.attributeTypeMap = [ { "name": "name", "baseName": "name", "type": "string" }, { "name": "namespace", "baseName": "namespace", "type": "string" } ]; exports.ApiregistrationV1beta1ServiceReference = ApiregistrationV1beta1ServiceReference; /** * DEPRECATED - This group version of Deployment is deprecated by apps/v1beta2/Deployment. See the release notes for more information. Deployment enables declarative updates for Pods and ReplicaSets. */ class AppsV1beta1Deployment { static getAttributeTypeMap() { return AppsV1beta1Deployment.attributeTypeMap; } } AppsV1beta1Deployment.discriminator = undefined; AppsV1beta1Deployment.attributeTypeMap = [ { "name": "apiVersion", "baseName": "apiVersion", "type": "string" }, { "name": "kind", "baseName": "kind", "type": "string" }, { "name": "metadata", "baseName": "metadata", "type": "V1ObjectMeta" }, { "name": "spec", "baseName": "spec", "type": "AppsV1beta1DeploymentSpec" }, { "name": "status", "baseName": "status", "type": "AppsV1beta1DeploymentStatus" } ]; exports.AppsV1beta1Deployment = AppsV1beta1Deployment; /** * DeploymentCondition describes the state of a deployment at a certain point. */ class AppsV1beta1DeploymentCondition { static getAttributeTypeMap() { return AppsV1beta1DeploymentCondition.attributeTypeMap; } } AppsV1beta1DeploymentCondition.discriminator = undefined; AppsV1beta1DeploymentCondition.attributeTypeMap = [ { "name": "lastTransitionTime", "baseName": "lastTransitionTime", "type": "Date" }, { "name": "lastUpdateTime", "baseName": "lastUpdateTime", "type": "Date" }, { "name": "message", "baseName": "message", "type": "string" }, { "name": "reason", "baseName": "reason", "type": "string" }, { "name": "status", "baseName": "status", "type": "string" }, { "name": "type", "baseName": "type", "type": "string" } ]; exports.AppsV1beta1DeploymentCondition = AppsV1beta1DeploymentCondition; /** * DeploymentList is a list of Deployments. */ class AppsV1beta1DeploymentList { static getAttributeTypeMap() { return AppsV1beta1DeploymentList.attributeTypeMap; } } AppsV1beta1DeploymentList.discriminator = undefined; AppsV1beta1DeploymentList.attributeTypeMap = [ { "name": "apiVersion", "baseName": "apiVersion", "type": "string" }, { "name": "items", "baseName": "items", "type": "Array" }, { "name": "kind", "baseName": "kind", "type": "string" }, { "name": "metadata", "baseName": "metadata", "type": "V1ListMeta" } ]; exports.AppsV1beta1DeploymentList = AppsV1beta1DeploymentList; /** * DEPRECATED. DeploymentRollback stores the information required to rollback a deployment. */ class AppsV1beta1DeploymentRollback { static getAttributeTypeMap() { return AppsV1beta1DeploymentRollback.attributeTypeMap; } } AppsV1beta1DeploymentRollback.discriminator = undefined; AppsV1beta1DeploymentRollback.attributeTypeMap = [ { "name": "apiVersion", "baseName": "apiVersion", "type": "string" }, { "name": "kind", "baseName": "kind", "type": "string" }, { "name": "name", "baseName": "name", "type": "string" }, { "name": "rollbackTo", "baseName": "rollbackTo", "type": "AppsV1beta1RollbackConfig" }, { "name": "updatedAnnotations", "baseName": "updatedAnnotations", "type": "{ [key: string]: string; }" } ]; exports.AppsV1beta1DeploymentRollback = AppsV1beta1DeploymentRollback; /** * DeploymentSpec is the specification of the desired behavior of the Deployment. */ class AppsV1beta1DeploymentSpec { static getAttributeTypeMap() { return AppsV1beta1DeploymentSpec.attributeTypeMap; } } AppsV1beta1DeploymentSpec.discriminator = undefined; AppsV1beta1DeploymentSpec.attributeTypeMap = [ { "name": "minReadySeconds", "baseName": "minReadySeconds", "type": "number" }, { "name": "paused", "baseName": "paused", "type": "boolean" }, { "name": "progressDeadlineSeconds", "baseName": "progressDeadlineSeconds", "type": "number" }, { "name": "replicas", "baseName": "replicas", "type": "number" }, { "name": "revisionHistoryLimit", "baseName": "revisionHistoryLimit", "type": "number" }, { "name": "rollbackTo", "baseName": "rollbackTo", "type": "AppsV1beta1RollbackConfig" }, { "name": "selector", "baseName": "selector", "type": "V1LabelSelector" }, { "name": "strategy", "baseName": "strategy", "type": "AppsV1beta1DeploymentStrategy" }, { "name": "template", "baseName": "template", "type": "V1PodTemplateSpec" } ]; exports.AppsV1beta1DeploymentSpec = AppsV1beta1DeploymentSpec; /** * DeploymentStatus is the most recently observed status of the Deployment. */ class AppsV1beta1DeploymentStatus { static getAttributeTypeMap() { return AppsV1beta1DeploymentStatus.attributeTypeMap; } } AppsV1beta1DeploymentStatus.discriminator = undefined; AppsV1beta1DeploymentStatus.attributeTypeMap = [ { "name": "availableReplicas", "baseName": "availableReplicas", "type": "number" }, { "name": "collisionCount", "baseName": "collisionCount", "type": "number" }, { "name": "conditions", "baseName": "conditions", "type": "Array" }, { "name": "observedGeneration", "baseName": "observedGeneration", "type": "number" }, { "name": "readyReplicas", "baseName": "readyReplicas", "type": "number" }, { "name": "replicas", "baseName": "replicas", "type": "number" }, { "name": "unavailableReplicas", "baseName": "unavailableReplicas", "type": "number" }, { "name": "updatedReplicas", "baseName": "updatedReplicas", "type": "number" } ]; exports.AppsV1beta1DeploymentStatus = AppsV1beta1DeploymentStatus; /** * DeploymentStrategy describes how to replace existing pods with new ones. */ class AppsV1beta1DeploymentStrategy { static getAttributeTypeMap() { return AppsV1beta1DeploymentStrategy.attributeTypeMap; } } AppsV1beta1DeploymentStrategy.discriminator = undefined; AppsV1beta1DeploymentStrategy.attributeTypeMap = [ { "name": "rollingUpdate", "baseName": "rollingUpdate", "type": "AppsV1beta1RollingUpdateDeployment" }, { "name": "type", "baseName": "type", "type": "string" } ]; exports.AppsV1beta1DeploymentStrategy = AppsV1beta1DeploymentStrategy; /** * DEPRECATED. */ class AppsV1beta1RollbackConfig { static getAttributeTypeMap() { return AppsV1beta1RollbackConfig.attributeTypeMap; } } AppsV1beta1RollbackConfig.discriminator = undefined; AppsV1beta1RollbackConfig.attributeTypeMap = [ { "name": "revision", "baseName": "revision", "type": "number" } ]; exports.AppsV1beta1RollbackConfig = AppsV1beta1RollbackConfig; /** * Spec to control the desired behavior of rolling update. */ class AppsV1beta1RollingUpdateDeployment { static getAttributeTypeMap() { return AppsV1beta1RollingUpdateDeployment.attributeTypeMap; } } AppsV1beta1RollingUpdateDeployment.discriminator = undefined; AppsV1beta1RollingUpdateDeployment.attributeTypeMap = [ { "name": "maxSurge", "baseName": "maxSurge", "type": "any" }, { "name": "maxUnavailable", "baseName": "maxUnavailable", "type": "any" } ]; exports.AppsV1beta1RollingUpdateDeployment = AppsV1beta1RollingUpdateDeployment; /** * Scale represents a scaling request for a resource. */ class AppsV1beta1Scale { static getAttributeTypeMap() { return AppsV1beta1Scale.attributeTypeMap; } } AppsV1beta1Scale.discriminator = undefined; AppsV1beta1Scale.attributeTypeMap = [ { "name": "apiVersion", "baseName": "apiVersion", "type": "string" }, { "name": "kind", "baseName": "kind", "type": "string" }, { "name": "metadata", "baseName": "metadata", "type": "V1ObjectMeta" }, { "name": "spec", "baseName": "spec", "type": "AppsV1beta1ScaleSpec" }, { "name": "status", "baseName": "status", "type": "AppsV1beta1ScaleStatus" } ]; exports.AppsV1beta1Scale = AppsV1beta1Scale; /** * ScaleSpec describes the attributes of a scale subresource */ class AppsV1beta1ScaleSpec { static getAttributeTypeMap() { return AppsV1beta1ScaleSpec.attributeTypeMap; } } AppsV1beta1ScaleSpec.discriminator = undefined; AppsV1beta1ScaleSpec.attributeTypeMap = [ { "name": "replicas", "baseName": "replicas", "type": "number" } ]; exports.AppsV1beta1ScaleSpec = AppsV1beta1ScaleSpec; /** * ScaleStatus represents the current status of a scale subresource. */ class AppsV1beta1ScaleStatus { static getAttributeTypeMap() { return AppsV1beta1ScaleStatus.attributeTypeMap; } } AppsV1beta1ScaleStatus.discriminator = undefined; AppsV1beta1ScaleStatus.attributeTypeMap = [ { "name": "replicas", "baseName": "replicas", "type": "number" }, { "name": "selector", "baseName": "selector", "type": "{ [key: string]: string; }" }, { "name": "targetSelector", "baseName": "targetSelector", "type": "string" } ]; exports.AppsV1beta1ScaleStatus = AppsV1beta1ScaleStatus; /** * AllowedFlexVolume represents a single Flexvolume that is allowed to be used. Deprecated: use AllowedFlexVolume from policy API Group instead. */ class ExtensionsV1beta1AllowedFlexVolume { static getAttributeTypeMap() { return ExtensionsV1beta1AllowedFlexVolume.attributeTypeMap; } } ExtensionsV1beta1AllowedFlexVolume.discriminator = undefined; ExtensionsV1beta1AllowedFlexVolume.attributeTypeMap = [ { "name": "driver", "baseName": "driver", "type": "string" } ]; exports.ExtensionsV1beta1AllowedFlexVolume = ExtensionsV1beta1AllowedFlexVolume; /** * 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. Deprecated: use AllowedHostPath from policy API Group instead. */ class ExtensionsV1beta1AllowedHostPath { static getAttributeTypeMap() { return ExtensionsV1beta1AllowedHostPath.attributeTypeMap; } } ExtensionsV1beta1AllowedHostPath.discriminator = undefined; ExtensionsV1beta1AllowedHostPath.attributeTypeMap = [ { "name": "pathPrefix", "baseName": "pathPrefix", "type": "string" }, { "name": "readOnly", "baseName": "readOnly", "type": "boolean" } ]; exports.ExtensionsV1beta1AllowedHostPath = ExtensionsV1beta1AllowedHostPath; /** * DEPRECATED - This group version of Deployment is deprecated by apps/v1beta2/Deployment. See the release notes for more information. Deployment enables declarative updates for Pods and ReplicaSets. */ class ExtensionsV1beta1Deployment { static getAttributeTypeMap() { return ExtensionsV1beta1Deployment.attributeTypeMap; } } ExtensionsV1beta1Deployment.discriminator = undefined; ExtensionsV1beta1Deployment.attributeTypeMap = [ { "name": "apiVersion", "baseName": "apiVersion", "type": "string" }, { "name": "kind", "baseName": "kind", "type": "string" }, { "name": "metadata", "baseName": "metadata", "type": "V1ObjectMeta" }, { "name": "spec", "baseName": "spec", "type": "ExtensionsV1beta1DeploymentSpec" }, { "name": "status", "baseName": "status", "type": "ExtensionsV1beta1DeploymentStatus" } ]; exports.ExtensionsV1beta1Deployment = ExtensionsV1beta1Deployment; /** * DeploymentCondition describes the state of a deployment at a certain point. */ class ExtensionsV1beta1DeploymentCondition { static getAttributeTypeMap() { return ExtensionsV1beta1DeploymentCondition.attributeTypeMap; } } ExtensionsV1beta1DeploymentCondition.discriminator = undefined; ExtensionsV1beta1DeploymentCondition.attributeTypeMap = [ { "name": "lastTransitionTime", "baseName": "lastTransitionTime", "type": "Date" }, { "name": "lastUpdateTime", "baseName": "lastUpdateTime", "type": "Date" }, { "name": "message", "baseName": "message", "type": "string" }, { "name": "reason", "baseName": "reason", "type": "string" }, { "name": "status", "baseName": "status", "type": "string" }, { "name": "type", "baseName": "type", "type": "string" } ]; exports.ExtensionsV1beta1DeploymentCondition = ExtensionsV1beta1DeploymentCondition; /** * DeploymentList is a list of Deployments. */ class ExtensionsV1beta1DeploymentList { static getAttributeTypeMap() { return ExtensionsV1beta1DeploymentList.attributeTypeMap; } } ExtensionsV1beta1DeploymentList.discriminator = undefined; ExtensionsV1beta1DeploymentList.attributeTypeMap = [ { "name": "apiVersion", "baseName": "apiVersion", "type": "string" }, { "name": "items", "baseName": "items", "type": "Array" }, { "name": "kind", "baseName": "kind", "type": "string" }, { "name": "metadata", "baseName": "metadata", "type": "V1ListMeta" } ]; exports.ExtensionsV1beta1DeploymentList = ExtensionsV1beta1DeploymentList; /** * DEPRECATED. DeploymentRollback stores the information required to rollback a deployment. */ class ExtensionsV1beta1DeploymentRollback { static getAttributeTypeMap() { return ExtensionsV1beta1DeploymentRollback.attributeTypeMap; } } ExtensionsV1beta1DeploymentRollback.discriminator = undefined; ExtensionsV1beta1DeploymentRollback.attributeTypeMap = [ { "name": "apiVersion", "baseName": "apiVersion", "type": "string" }, { "name": "kind", "baseName": "kind", "type": "string" }, { "name": "name", "baseName": "name", "type": "string" }, { "name": "rollbackTo", "baseName": "rollbackTo", "type": "ExtensionsV1beta1RollbackConfig" }, { "name": "updatedAnnotations", "baseName": "updatedAnnotations", "type": "{ [key: string]: string; }" } ]; exports.ExtensionsV1beta1DeploymentRollback = ExtensionsV1beta1DeploymentRollback; /** * DeploymentSpec is the specification of the desired behavior of the Deployment. */ class ExtensionsV1beta1DeploymentSpec { static getAttributeTypeMap() { return ExtensionsV1beta1DeploymentSpec.attributeTypeMap; } } ExtensionsV1beta1DeploymentSpec.discriminator = undefined; ExtensionsV1beta1DeploymentSpec.attributeTypeMap = [ { "name": "minReadySeconds", "baseName": "minReadySeconds", "type": "number" }, { "name": "paused", "baseName": "paused", "type": "boolean" }, { "name": "progressDeadlineSeconds", "baseName": "progressDeadlineSeconds", "type": "number" }, { "name": "replicas", "baseName": "replicas", "type": "number" }, { "name": "revisionHistoryLimit", "baseName": "revisionHistoryLimit", "type": "number" }, { "name": "rollbackTo", "baseName": "rollbackTo", "type": "ExtensionsV1beta1RollbackConfig" }, { "name": "selector", "baseName": "selector", "type": "V1LabelSelector" }, { "name": "strategy", "baseName": "strategy", "type": "ExtensionsV1beta1DeploymentStrategy" }, { "name": "template", "baseName": "template", "type": "V1PodTemplateSpec" } ]; exports.ExtensionsV1beta1DeploymentSpec = ExtensionsV1beta1DeploymentSpec; /** * DeploymentStatus is the most recently observed status of the Deployment. */ class ExtensionsV1beta1DeploymentStatus { static getAttributeTypeMap() { return ExtensionsV1beta1DeploymentStatus.attributeTypeMap; } } ExtensionsV1beta1DeploymentStatus.discriminator = undefined; ExtensionsV1beta1DeploymentStatus.attributeTypeMap = [ { "name": "availableReplicas", "baseName": "availableReplicas", "type": "number" }, { "name": "collisionCount", "baseName": "collisionCount", "type": "number" }, { "name": "conditions", "baseName": "conditions", "type": "Array" }, { "name": "observedGeneration", "baseName": "observedGeneration", "type": "number" }, { "name": "readyReplicas", "baseName": "readyReplicas", "type": "number" }, { "name": "replicas", "baseName": "replicas", "type": "number" }, { "name": "unavailableReplicas", "baseName": "unavailableReplicas", "type": "number" }, { "name": "updatedReplicas", "baseName": "updatedReplicas", "type": "number" } ]; exports.ExtensionsV1beta1DeploymentStatus = ExtensionsV1beta1DeploymentStatus; /** * DeploymentStrategy describes how to replace existing pods with new ones. */ class ExtensionsV1beta1DeploymentStrategy { static getAttributeTypeMap() { return ExtensionsV1beta1DeploymentStrategy.attributeTypeMap; } } ExtensionsV1beta1DeploymentStrategy.discriminator = undefined; ExtensionsV1beta1DeploymentStrategy.attributeTypeMap = [ { "name": "rollingUpdate", "baseName": "rollingUpdate", "type": "ExtensionsV1beta1RollingUpdateDeployment" }, { "name": "type", "baseName": "type", "type": "string" } ]; exports.ExtensionsV1beta1DeploymentStrategy = ExtensionsV1beta1DeploymentStrategy; /** * FSGroupStrategyOptions defines the strategy type and options used to create the strategy. Deprecated: use FSGroupStrategyOptions from policy API Group instead. */ class ExtensionsV1beta1FSGroupStrategyOptions { static getAttributeTypeMap() { return ExtensionsV1beta1FSGroupStrategyOptions.attributeTypeMap; } } ExtensionsV1beta1FSGroupStrategyOptions.discriminator = undefined; ExtensionsV1beta1FSGroupStrategyOptions.attributeTypeMap = [ { "name": "ranges", "baseName": "ranges", "type": "Array" }, { "name": "rule", "baseName": "rule", "type": "string" } ]; exports.ExtensionsV1beta1FSGroupStrategyOptions = ExtensionsV1beta1FSGroupStrategyOptions; /** * 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. Deprecated: use HostPortRange from policy API Group instead. */ class ExtensionsV1beta1HostPortRange { static getAttributeTypeMap() { return ExtensionsV1beta1HostPortRange.attributeTypeMap; } } ExtensionsV1beta1HostPortRange.discriminator = undefined; ExtensionsV1beta1HostPortRange.attributeTypeMap = [ { "name": "max", "baseName": "max", "type": "number" }, { "name": "min", "baseName": "min", "type": "number" } ]; exports.ExtensionsV1beta1HostPortRange = ExtensionsV1beta1HostPortRange; /** * IDRange provides a min/max of an allowed range of IDs. Deprecated: use IDRange from policy API Group instead. */ class ExtensionsV1beta1IDRange { static getAttributeTypeMap() { return ExtensionsV1beta1IDRange.attributeTypeMap; } } ExtensionsV1beta1IDRange.discriminator = undefined; ExtensionsV1beta1IDRange.attributeTypeMap = [ { "name": "max", "baseName": "max", "type": "number" }, { "name": "min", "baseName": "min", "type": "number" } ]; exports.ExtensionsV1beta1IDRange = ExtensionsV1beta1IDRange; /** * PodSecurityPolicy governs the ability to make requests that affect the Security Context that will be applied to a pod and container. Deprecated: use PodSecurityPolicy from policy API Group instead. */ class ExtensionsV1beta1PodSecurityPolicy { static getAttributeTypeMap() { return ExtensionsV1beta1PodSecurityPolicy.attributeTypeMap; } } ExtensionsV1beta1PodSecurityPolicy.discriminator = undefined; ExtensionsV1beta1PodSecurityPolicy.attributeTypeMap = [ { "name": "apiVersion", "baseName": "apiVersion", "type": "string" }, { "name": "kind", "baseName": "kind", "type": "string" }, { "name": "metadata", "baseName": "metadata", "type": "V1ObjectMeta" }, { "name": "spec", "baseName": "spec", "type": "ExtensionsV1beta1PodSecurityPolicySpec" } ]; exports.ExtensionsV1beta1PodSecurityPolicy = ExtensionsV1beta1PodSecurityPolicy; /** * PodSecurityPolicyList is a list of PodSecurityPolicy objects. Deprecated: use PodSecurityPolicyList from policy API Group instead. */ class ExtensionsV1beta1PodSecurityPolicyList { static getAttributeTypeMap() { return ExtensionsV1beta1PodSecurityPolicyList.attributeTypeMap; } } ExtensionsV1beta1PodSecurityPolicyList.discriminator = undefined; ExtensionsV1beta1PodSecurityPolicyList.attributeTypeMap = [ { "name": "apiVersion", "baseName": "apiVersion", "type": "string" }, { "name": "items", "baseName": "items", "type": "Array" }, { "name": "kind", "baseName": "kind", "type": "string" }, { "name": "metadata", "baseName": "metadata", "type": "V1ListMeta" } ]; exports.ExtensionsV1beta1PodSecurityPolicyList = ExtensionsV1beta1PodSecurityPolicyList; /** * PodSecurityPolicySpec defines the policy enforced. Deprecated: use PodSecurityPolicySpec from policy API Group instead. */ class ExtensionsV1beta1PodSecurityPolicySpec { static getAttributeTypeMap() { return ExtensionsV1beta1PodSecurityPolicySpec.attributeTypeMap; } } ExtensionsV1beta1PodSecurityPolicySpec.discriminator = undefined; ExtensionsV1beta1PodSecurityPolicySpec.attributeTypeMap = [ { "name": "allowPrivilegeEscalation", "baseName": "allowPrivilegeEscalation", "type": "boolean" }, { "name": "allowedCapabilities", "baseName": "allowedCapabilities", "type": "Array" }, { "name": "allowedFlexVolumes", "baseName": "allowedFlexVolumes", "type": "Array" }, { "name": "allowedHostPaths", "baseName": "allowedHostPaths", "type": "Array" }, { "name": "allowedProcMountTypes", "baseName": "allowedProcMountTypes", "type": "Array" }, { "name": "allowedUnsafeSysctls", "baseName": "allowedUnsafeSysctls", "type": "Array" }, { "name": "defaultAddCapabilities", "baseName": "defaultAddCapabilities", "type": "Array" }, { "name": "defaultAllowPrivilegeEscalation", "baseName": "defaultAllowPrivilegeEscalation", "type": "boolean" }, { "name": "forbiddenSysctls", "baseName": "forbiddenSysctls", "type": "Array" }, { "name": "fsGroup", "baseName": "fsGroup", "type": "ExtensionsV1beta1FSGroupStrategyOptions" }, { "name": "hostIPC", "baseName": "hostIPC", "type": "boolean" }, { "name": "hostNetwork", "baseName": "hostNetwork", "type": "boolean" }, { "name": "hostPID", "baseName": "hostPID", "type": "boolean" }, { "name": "hostPorts", "baseName": "hostPorts", "type": "Array" }, { "name": "privileged", "baseName": "privileged", "type": "boolean" }, { "name": "readOnlyRootFilesystem", "baseName": "readOnlyRootFilesystem", "type": "boolean" }, { "name": "requiredDropCapabilities", "baseName": "requiredDropCapabilities", "type": "Array" }, { "name": "runAsGroup", "baseName": "runAsGroup", "type": "ExtensionsV1beta1RunAsGroupStrategyOptions" }, { "name": "runAsUser", "baseName": "runAsUser", "type": "ExtensionsV1beta1RunAsUserStrategyOptions" }, { "name": "seLinux", "baseName": "seLinux", "type": "ExtensionsV1beta1SELinuxStrategyOptions" }, { "name": "supplementalGroups", "baseName": "supplementalGroups", "type": "ExtensionsV1beta1SupplementalGroupsStrategyOptions" }, { "name": "volumes", "baseName": "volumes", "type": "Array" } ]; exports.ExtensionsV1beta1PodSecurityPolicySpec = ExtensionsV1beta1PodSecurityPolicySpec; /** * DEPRECATED. */ class ExtensionsV1beta1RollbackConfig { static getAttributeTypeMap() { return ExtensionsV1beta1RollbackConfig.attributeTypeMap; } } ExtensionsV1beta1RollbackConfig.discriminator = undefined; ExtensionsV1beta1RollbackConfig.attributeTypeMap = [ { "name": "revision", "baseName": "revision", "type": "number" } ]; exports.ExtensionsV1beta1RollbackConfig = ExtensionsV1beta1RollbackConfig; /** * Spec to control the desired behavior of rolling update. */ class ExtensionsV1beta1RollingUpdateDeployment { static getAttributeTypeMap() { return ExtensionsV1beta1RollingUpdateDeployment.attributeTypeMap; } } ExtensionsV1beta1RollingUpdateDeployment.discriminator = undefined; ExtensionsV1beta1RollingUpdateDeployment.attributeTypeMap = [ { "name": "maxSurge", "baseName": "maxSurge", "type": "any" }, { "name": "maxUnavailable", "baseName": "maxUnavailable", "type": "any" } ]; exports.ExtensionsV1beta1RollingUpdateDeployment = ExtensionsV1beta1RollingUpdateDeployment; /** * RunAsGroupStrategyOptions defines the strategy type and any options used to create the strategy. Deprecated: use RunAsGroupStrategyOptions from policy API Group instead. */ class ExtensionsV1beta1RunAsGroupStrategyOptions { static getAttributeTypeMap() { return ExtensionsV1beta1RunAsGroupStrategyOptions.attributeTypeMap; } } ExtensionsV1beta1RunAsGroupStrategyOptions.discriminator = undefined; ExtensionsV1beta1RunAsGroupStrategyOptions.attributeTypeMap = [ { "name": "ranges", "baseName": "ranges", "type": "Array" }, { "name": "rule", "baseName": "rule", "type": "string" } ]; exports.ExtensionsV1beta1RunAsGroupStrategyOptions = ExtensionsV1beta1RunAsGroupStrategyOptions; /** * RunAsUserStrategyOptions defines the strategy type and any options used to create the strategy. Deprecated: use RunAsUserStrategyOptions from policy API Group instead. */ class ExtensionsV1beta1RunAsUserStrategyOptions { static getAttributeTypeMap() { return ExtensionsV1beta1RunAsUserStrategyOptions.attributeTypeMap; } } ExtensionsV1beta1RunAsUserStrategyOptions.discriminator = undefined; ExtensionsV1beta1RunAsUserStrategyOptions.attributeTypeMap = [ { "name": "ranges", "baseName": "ranges", "type": "Array" }, { "name": "rule", "baseName": "rule", "type": "string" } ]; exports.ExtensionsV1beta1RunAsUserStrategyOptions = ExtensionsV1beta1RunAsUserStrategyOptions; /** * SELinuxStrategyOptions defines the strategy type and any options used to create the strategy. Deprecated: use SELinuxStrategyOptions from policy API Group instead. */ class ExtensionsV1beta1SELinuxStrategyOptions { static getAttributeTypeMap() { return ExtensionsV1beta1SELinuxStrategyOptions.attributeTypeMap; } } ExtensionsV1beta1SELinuxStrategyOptions.discriminator = undefined; ExtensionsV1beta1SELinuxStrategyOptions.attributeTypeMap = [ { "name": "rule", "baseName": "rule", "type": "string" }, { "name": "seLinuxOptions", "baseName": "seLinuxOptions", "type": "V1SELinuxOptions" } ]; exports.ExtensionsV1beta1SELinuxStrategyOptions = ExtensionsV1beta1SELinuxStrategyOptions; /** * represents a scaling request for a resource. */ class ExtensionsV1beta1Scale { static getAttributeTypeMap() { return ExtensionsV1beta1Scale.attributeTypeMap; } } ExtensionsV1beta1Scale.discriminator = undefined; ExtensionsV1beta1Scale.attributeTypeMap = [ { "name": "apiVersion", "baseName": "apiVersion", "type": "string" }, { "name": "kind", "baseName": "kind", "type": "string" }, { "name": "metadata", "baseName": "metadata", "type": "V1ObjectMeta" }, { "name": "spec", "baseName": "spec", "type": "ExtensionsV1beta1ScaleSpec" }, { "name": "status", "baseName": "status", "type": "ExtensionsV1beta1ScaleStatus" } ]; exports.ExtensionsV1beta1Scale = ExtensionsV1beta1Scale; /** * describes the attributes of a scale subresource */ class ExtensionsV1beta1ScaleSpec { static getAttributeTypeMap() { return ExtensionsV1beta1ScaleSpec.attributeTypeMap; } } ExtensionsV1beta1ScaleSpec.discriminator = undefined; ExtensionsV1beta1ScaleSpec.attributeTypeMap = [ { "name": "replicas", "baseName": "replicas", "type": "number" } ]; exports.ExtensionsV1beta1ScaleSpec = ExtensionsV1beta1ScaleSpec; /** * represents the current status of a scale subresource. */ class ExtensionsV1beta1ScaleStatus { static getAttributeTypeMap() { return ExtensionsV1beta1ScaleStatus.attributeTypeMap; } } ExtensionsV1beta1ScaleStatus.discriminator = undefined; ExtensionsV1beta1ScaleStatus.attributeTypeMap = [ { "name": "replicas", "baseName": "replicas", "type": "number" }, { "name": "selector", "baseName": "selector", "type": "{ [key: string]: string; }" }, { "name": "targetSelector", "baseName": "targetSelector", "type": "string" } ]; exports.ExtensionsV1beta1ScaleStatus = ExtensionsV1beta1ScaleStatus; /** * SupplementalGroupsStrategyOptions defines the strategy type and options used to create the strategy. Deprecated: use SupplementalGroupsStrategyOptions from policy API Group instead. */ class ExtensionsV1beta1SupplementalGroupsStrategyOptions { static getAttributeTypeMap() { return ExtensionsV1beta1SupplementalGroupsStrategyOptions.attributeTypeMap; } } ExtensionsV1beta1SupplementalGroupsStrategyOptions.discriminator = undefined; ExtensionsV1beta1SupplementalGroupsStrategyOptions.attributeTypeMap = [ { "name": "ranges", "baseName": "ranges", "type": "Array" }, { "name": "rule", "baseName": "rule", "type": "string" } ]; exports.ExtensionsV1beta1SupplementalGroupsStrategyOptions = ExtensionsV1beta1SupplementalGroupsStrategyOptions; /** * AllowedFlexVolume represents a single Flexvolume that is allowed to be used. */ class PolicyV1beta1AllowedFlexVolume { static getAttributeTypeMap() { return PolicyV1beta1AllowedFlexVolume.attributeTypeMap; } } PolicyV1beta1AllowedFlexVolume.discriminator = undefined; PolicyV1beta1AllowedFlexVolume.attributeTypeMap = [ { "name": "driver", "baseName": "driver", "type": "string" } ]; exports.PolicyV1beta1AllowedFlexVolume = PolicyV1beta1AllowedFlexVolume; /** * 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. */ class PolicyV1beta1AllowedHostPath { static getAttributeTypeMap() { return PolicyV1beta1AllowedHostPath.attributeTypeMap; } } PolicyV1beta1AllowedHostPath.discriminator = undefined; PolicyV1beta1AllowedHostPath.attributeTypeMap = [ { "name": "pathPrefix", "baseName": "pathPrefix", "type": "string" }, { "name": "readOnly", "baseName": "readOnly", "type": "boolean" } ]; exports.PolicyV1beta1AllowedHostPath = PolicyV1beta1AllowedHostPath; /** * FSGroupStrategyOptions defines the strategy type and options used to create the strategy. */ class PolicyV1beta1FSGroupStrategyOptions { static getAttributeTypeMap() { return PolicyV1beta1FSGroupStrategyOptions.attributeTypeMap; } } PolicyV1beta1FSGroupStrategyOptions.discriminator = undefined; PolicyV1beta1FSGroupStrategyOptions.attributeTypeMap = [ { "name": "ranges", "baseName": "ranges", "type": "Array" }, { "name": "rule", "baseName": "rule", "type": "string" } ]; exports.PolicyV1beta1FSGroupStrategyOptions = PolicyV1beta1FSGroupStrategyOptions; /** * 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. */ class PolicyV1beta1HostPortRange { static getAttributeTypeMap() { return PolicyV1beta1HostPortRange.attributeTypeMap; } } PolicyV1beta1HostPortRange.discriminator = undefined; PolicyV1beta1HostPortRange.attributeTypeMap = [ { "name": "max", "baseName": "max", "type": "number" }, { "name": "min", "baseName": "min", "type": "number" } ]; exports.PolicyV1beta1HostPortRange = PolicyV1beta1HostPortRange; /** * IDRange provides a min/max of an allowed range of IDs. */ class PolicyV1beta1IDRange { static getAttributeTypeMap() { return PolicyV1beta1IDRange.attributeTypeMap; } } PolicyV1beta1IDRange.discriminator = undefined; PolicyV1beta1IDRange.attributeTypeMap = [ { "name": "max", "baseName": "max", "type": "number" }, { "name": "min", "baseName": "min", "type": "number" } ]; exports.PolicyV1beta1IDRange = PolicyV1beta1IDRange; /** * PodSecurityPolicy governs the ability to make requests that affect the Security Context that will be applied to a pod and container. */ class PolicyV1beta1PodSecurityPolicy { static getAttributeTypeMap() { return PolicyV1beta1PodSecurityPolicy.attributeTypeMap; } } PolicyV1beta1PodSecurityPolicy.discriminator = undefined; PolicyV1beta1PodSecurityPolicy.attributeTypeMap = [ { "name": "apiVersion", "baseName": "apiVersion", "type": "string" }, { "name": "kind", "baseName": "kind", "type": "string" }, { "name": "metadata", "baseName": "metadata", "type": "V1ObjectMeta" }, { "name": "spec", "baseName": "spec", "type": "PolicyV1beta1PodSecurityPolicySpec" } ]; exports.PolicyV1beta1PodSecurityPolicy = PolicyV1beta1PodSecurityPolicy; /** * PodSecurityPolicyList is a list of PodSecurityPolicy objects. */ class PolicyV1beta1PodSecurityPolicyList { static getAttributeTypeMap() { return PolicyV1beta1PodSecurityPolicyList.attributeTypeMap; } } PolicyV1beta1PodSecurityPolicyList.discriminator = undefined; PolicyV1beta1PodSecurityPolicyList.attributeTypeMap = [ { "name": "apiVersion", "baseName": "apiVersion", "type": "string" }, { "name": "items", "baseName": "items", "type": "Array" }, { "name": "kind", "baseName": "kind", "type": "string" }, { "name": "metadata", "baseName": "metadata", "type": "V1ListMeta" } ]; exports.PolicyV1beta1PodSecurityPolicyList = PolicyV1beta1PodSecurityPolicyList; /** * PodSecurityPolicySpec defines the policy enforced. */ class PolicyV1beta1PodSecurityPolicySpec { static getAttributeTypeMap() { return PolicyV1beta1PodSecurityPolicySpec.attributeTypeMap; } } PolicyV1beta1PodSecurityPolicySpec.discriminator = undefined; PolicyV1beta1PodSecurityPolicySpec.attributeTypeMap = [ { "name": "allowPrivilegeEscalation", "baseName": "allowPrivilegeEscalation", "type": "boolean" }, { "name": "allowedCapabilities", "baseName": "allowedCapabilities", "type": "Array" }, { "name": "allowedFlexVolumes", "baseName": "allowedFlexVolumes", "type": "Array" }, { "name": "allowedHostPaths", "baseName": "allowedHostPaths", "type": "Array" }, { "name": "allowedProcMountTypes", "baseName": "allowedProcMountTypes", "type": "Array" }, { "name": "allowedUnsafeSysctls", "baseName": "allowedUnsafeSysctls", "type": "Array" }, { "name": "defaultAddCapabilities", "baseName": "defaultAddCapabilities", "type": "Array" }, { "name": "defaultAllowPrivilegeEscalation", "baseName": "defaultAllowPrivilegeEscalation", "type": "boolean" }, { "name": "forbiddenSysctls", "baseName": "forbiddenSysctls", "type": "Array" }, { "name": "fsGroup", "baseName": "fsGroup", "type": "PolicyV1beta1FSGroupStrategyOptions" }, { "name": "hostIPC", "baseName": "hostIPC", "type": "boolean" }, { "name": "hostNetwork", "baseName": "hostNetwork", "type": "boolean" }, { "name": "hostPID", "baseName": "hostPID", "type": "boolean" }, { "name": "hostPorts", "baseName": "hostPorts", "type": "Array" }, { "name": "privileged", "baseName": "privileged", "type": "boolean" }, { "name": "readOnlyRootFilesystem", "baseName": "readOnlyRootFilesystem", "type": "boolean" }, { "name": "requiredDropCapabilities", "baseName": "requiredDropCapabilities", "type": "Array" }, { "name": "runAsGroup", "baseName": "runAsGroup", "type": "PolicyV1beta1RunAsGroupStrategyOptions" }, { "name": "runAsUser", "baseName": "runAsUser", "type": "PolicyV1beta1RunAsUserStrategyOptions" }, { "name": "seLinux", "baseName": "seLinux", "type": "PolicyV1beta1SELinuxStrategyOptions" }, { "name": "supplementalGroups", "baseName": "supplementalGroups", "type": "PolicyV1beta1SupplementalGroupsStrategyOptions" }, { "name": "volumes", "baseName": "volumes", "type": "Array" } ]; exports.PolicyV1beta1PodSecurityPolicySpec = PolicyV1beta1PodSecurityPolicySpec; /** * RunAsGroupStrategyOptions defines the strategy type and any options used to create the strategy. */ class PolicyV1beta1RunAsGroupStrategyOptions { static getAttributeTypeMap() { return PolicyV1beta1RunAsGroupStrategyOptions.attributeTypeMap; } } PolicyV1beta1RunAsGroupStrategyOptions.discriminator = undefined; PolicyV1beta1RunAsGroupStrategyOptions.attributeTypeMap = [ { "name": "ranges", "baseName": "ranges", "type": "Array" }, { "name": "rule", "baseName": "rule", "type": "string" } ]; exports.PolicyV1beta1RunAsGroupStrategyOptions = PolicyV1beta1RunAsGroupStrategyOptions; /** * RunAsUserStrategyOptions defines the strategy type and any options used to create the strategy. */ class PolicyV1beta1RunAsUserStrategyOptions { static getAttributeTypeMap() { return PolicyV1beta1RunAsUserStrategyOptions.attributeTypeMap; } } PolicyV1beta1RunAsUserStrategyOptions.discriminator = undefined; PolicyV1beta1RunAsUserStrategyOptions.attributeTypeMap = [ { "name": "ranges", "baseName": "ranges", "type": "Array" }, { "name": "rule", "baseName": "rule", "type": "string" } ]; exports.PolicyV1beta1RunAsUserStrategyOptions = PolicyV1beta1RunAsUserStrategyOptions; /** * SELinuxStrategyOptions defines the strategy type and any options used to create the strategy. */ class PolicyV1beta1SELinuxStrategyOptions { static getAttributeTypeMap() { return PolicyV1beta1SELinuxStrategyOptions.attributeTypeMap; } } PolicyV1beta1SELinuxStrategyOptions.discriminator = undefined; PolicyV1beta1SELinuxStrategyOptions.attributeTypeMap = [ { "name": "rule", "baseName": "rule", "type": "string" }, { "name": "seLinuxOptions", "baseName": "seLinuxOptions", "type": "V1SELinuxOptions" } ]; exports.PolicyV1beta1SELinuxStrategyOptions = PolicyV1beta1SELinuxStrategyOptions; /** * SupplementalGroupsStrategyOptions defines the strategy type and options used to create the strategy. */ class PolicyV1beta1SupplementalGroupsStrategyOptions { static getAttributeTypeMap() { return PolicyV1beta1SupplementalGroupsStrategyOptions.attributeTypeMap; } } PolicyV1beta1SupplementalGroupsStrategyOptions.discriminator = undefined; PolicyV1beta1SupplementalGroupsStrategyOptions.attributeTypeMap = [ { "name": "ranges", "baseName": "ranges", "type": "Array" }, { "name": "rule", "baseName": "rule", "type": "string" } ]; exports.PolicyV1beta1SupplementalGroupsStrategyOptions = PolicyV1beta1SupplementalGroupsStrategyOptions; /** * RawExtension is used to hold extensions in external versions. To use this, make a field which has RawExtension as its type in your external, versioned struct, and Object in your internal struct. You also need to register your various plugin types. // Internal package: type MyAPIObject struct { runtime.TypeMeta `json:\",inline\"` MyPlugin runtime.Object `json:\"myPlugin\"` } type PluginA struct { AOption string `json:\"aOption\"` } // External package: type MyAPIObject struct { runtime.TypeMeta `json:\",inline\"` MyPlugin runtime.RawExtension `json:\"myPlugin\"` } type PluginA struct { AOption string `json:\"aOption\"` } // On the wire, the JSON will look something like this: { \"kind\":\"MyAPIObject\", \"apiVersion\":\"v1\", \"myPlugin\": { \"kind\":\"PluginA\", \"aOption\":\"foo\", }, } So what happens? Decode first uses json or yaml to unmarshal the serialized data into your external MyAPIObject. That causes the raw JSON to be stored, but not unpacked. The next step is to copy (using pkg/conversion) into the internal struct. The runtime package's DefaultScheme has conversion functions installed which will unpack the JSON stored in RawExtension, turning it into the correct object type, and storing it in the Object. (TODO: In the case where the object is of an unknown type, a runtime.Unknown object will be created and stored.) */ class RuntimeRawExtension { static getAttributeTypeMap() { return RuntimeRawExtension.attributeTypeMap; } } RuntimeRawExtension.discriminator = undefined; RuntimeRawExtension.attributeTypeMap = [ { "name": "raw", "baseName": "Raw", "type": "string" } ]; exports.RuntimeRawExtension = RuntimeRawExtension; /** * APIGroup contains the name, the supported versions, and the preferred version of a group. */ class V1APIGroup { static getAttributeTypeMap() { return V1APIGroup.attributeTypeMap; } } V1APIGroup.discriminator = undefined; V1APIGroup.attributeTypeMap = [ { "name": "apiVersion", "baseName": "apiVersion", "type": "string" }, { "name": "kind", "baseName": "kind", "type": "string" }, { "name": "name", "baseName": "name", "type": "string" }, { "name": "preferredVersion", "baseName": "preferredVersion", "type": "V1GroupVersionForDiscovery" }, { "name": "serverAddressByClientCIDRs", "baseName": "serverAddressByClientCIDRs", "type": "Array" }, { "name": "versions", "baseName": "versions", "type": "Array" } ]; exports.V1APIGroup = V1APIGroup; /** * APIGroupList is a list of APIGroup, to allow clients to discover the API at /apis. */ class V1APIGroupList { static getAttributeTypeMap() { return V1APIGroupList.attributeTypeMap; } } V1APIGroupList.discriminator = undefined; V1APIGroupList.attributeTypeMap = [ { "name": "apiVersion", "baseName": "apiVersion", "type": "string" }, { "name": "groups", "baseName": "groups", "type": "Array" }, { "name": "kind", "baseName": "kind", "type": "string" } ]; exports.V1APIGroupList = V1APIGroupList; /** * APIResource specifies the name of a resource and whether it is namespaced. */ class V1APIResource { static getAttributeTypeMap() { return V1APIResource.attributeTypeMap; } } V1APIResource.discriminator = undefined; V1APIResource.attributeTypeMap = [ { "name": "categories", "baseName": "categories", "type": "Array" }, { "name": "group", "baseName": "group", "type": "string" }, { "name": "kind", "baseName": "kind", "type": "string" }, { "name": "name", "baseName": "name", "type": "string" }, { "name": "namespaced", "baseName": "namespaced", "type": "boolean" }, { "name": "shortNames", "baseName": "shortNames", "type": "Array" }, { "name": "singularName", "baseName": "singularName", "type": "string" }, { "name": "verbs", "baseName": "verbs", "type": "Array" }, { "name": "version", "baseName": "version", "type": "string" } ]; exports.V1APIResource = V1APIResource; /** * 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. */ class V1APIResourceList { static getAttributeTypeMap() { return V1APIResourceList.attributeTypeMap; } } V1APIResourceList.discriminator = undefined; V1APIResourceList.attributeTypeMap = [ { "name": "apiVersion", "baseName": "apiVersion", "type": "string" }, { "name": "groupVersion", "baseName": "groupVersion", "type": "string" }, { "name": "kind", "baseName": "kind", "type": "string" }, { "name": "resources", "baseName": "resources", "type": "Array" } ]; exports.V1APIResourceList = V1APIResourceList; /** * APIService represents a server for a particular GroupVersion. Name must be \"version.group\". */ class V1APIService { static getAttributeTypeMap() { return V1APIService.attributeTypeMap; } } V1APIService.discriminator = undefined; V1APIService.attributeTypeMap = [ { "name": "apiVersion", "baseName": "apiVersion", "type": "string" }, { "name": "kind", "baseName": "kind", "type": "string" }, { "name": "metadata", "baseName": "metadata", "type": "V1ObjectMeta" }, { "name": "spec", "baseName": "spec", "type": "V1APIServiceSpec" }, { "name": "status", "baseName": "status", "type": "V1APIServiceStatus" } ]; exports.V1APIService = V1APIService; class V1APIServiceCondition { static getAttributeTypeMap() { return V1APIServiceCondition.attributeTypeMap; } } V1APIServiceCondition.discriminator = undefined; V1APIServiceCondition.attributeTypeMap = [ { "name": "lastTransitionTime", "baseName": "lastTransitionTime", "type": "Date" }, { "name": "message", "baseName": "message", "type": "string" }, { "name": "reason", "baseName": "reason", "type": "string" }, { "name": "status", "baseName": "status", "type": "string" }, { "name": "type", "baseName": "type", "type": "string" } ]; exports.V1APIServiceCondition = V1APIServiceCondition; /** * APIServiceList is a list of APIService objects. */ class V1APIServiceList { static getAttributeTypeMap() { return V1APIServiceList.attributeTypeMap; } } V1APIServiceList.discriminator = undefined; V1APIServiceList.attributeTypeMap = [ { "name": "apiVersion", "baseName": "apiVersion", "type": "string" }, { "name": "items", "baseName": "items", "type": "Array" }, { "name": "kind", "baseName": "kind", "type": "string" }, { "name": "metadata", "baseName": "metadata", "type": "V1ListMeta" } ]; exports.V1APIServiceList = V1APIServiceList; /** * APIServiceSpec contains information for locating and communicating with a server. Only https is supported, though you are able to disable certificate verification. */ class V1APIServiceSpec { static getAttributeTypeMap() { return V1APIServiceSpec.attributeTypeMap; } } V1APIServiceSpec.discriminator = undefined; V1APIServiceSpec.attributeTypeMap = [ { "name": "caBundle", "baseName": "caBundle", "type": "string" }, { "name": "group", "baseName": "group", "type": "string" }, { "name": "groupPriorityMinimum", "baseName": "groupPriorityMinimum", "type": "number" }, { "name": "insecureSkipTLSVerify", "baseName": "insecureSkipTLSVerify", "type": "boolean" }, { "name": "service", "baseName": "service", "type": "V1ServiceReference" }, { "name": "version", "baseName": "version", "type": "string" }, { "name": "versionPriority", "baseName": "versionPriority", "type": "number" } ]; exports.V1APIServiceSpec = V1APIServiceSpec; /** * APIServiceStatus contains derived information about an API server */ class V1APIServiceStatus { static getAttributeTypeMap() { return V1APIServiceStatus.attributeTypeMap; } } V1APIServiceStatus.discriminator = undefined; V1APIServiceStatus.attributeTypeMap = [ { "name": "conditions", "baseName": "conditions", "type": "Array" } ]; exports.V1APIServiceStatus = V1APIServiceStatus; /** * 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. */ class V1APIVersions { static getAttributeTypeMap() { return V1APIVersions.attributeTypeMap; } } V1APIVersions.discriminator = undefined; V1APIVersions.attributeTypeMap = [ { "name": "apiVersion", "baseName": "apiVersion", "type": "string" }, { "name": "kind", "baseName": "kind", "type": "string" }, { "name": "serverAddressByClientCIDRs", "baseName": "serverAddressByClientCIDRs", "type": "Array" }, { "name": "versions", "baseName": "versions", "type": "Array" } ]; exports.V1APIVersions = V1APIVersions; /** * 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. */ class V1AWSElasticBlockStoreVolumeSource { static getAttributeTypeMap() { return V1AWSElasticBlockStoreVolumeSource.attributeTypeMap; } } V1AWSElasticBlockStoreVolumeSource.discriminator = undefined; V1AWSElasticBlockStoreVolumeSource.attributeTypeMap = [ { "name": "fsType", "baseName": "fsType", "type": "string" }, { "name": "partition", "baseName": "partition", "type": "number" }, { "name": "readOnly", "baseName": "readOnly", "type": "boolean" }, { "name": "volumeID", "baseName": "volumeID", "type": "string" } ]; exports.V1AWSElasticBlockStoreVolumeSource = V1AWSElasticBlockStoreVolumeSource; /** * Affinity is a group of affinity scheduling rules. */ class V1Affinity { static getAttributeTypeMap() { return V1Affinity.attributeTypeMap; } } V1Affinity.discriminator = undefined; V1Affinity.attributeTypeMap = [ { "name": "nodeAffinity", "baseName": "nodeAffinity", "type": "V1NodeAffinity" }, { "name": "podAffinity", "baseName": "podAffinity", "type": "V1PodAffinity" }, { "name": "podAntiAffinity", "baseName": "podAntiAffinity", "type": "V1PodAntiAffinity" } ]; exports.V1Affinity = V1Affinity; /** * AggregationRule describes how to locate ClusterRoles to aggregate into the ClusterRole */ class V1AggregationRule { static getAttributeTypeMap() { return V1AggregationRule.attributeTypeMap; } } V1AggregationRule.discriminator = undefined; V1AggregationRule.attributeTypeMap = [ { "name": "clusterRoleSelectors", "baseName": "clusterRoleSelectors", "type": "Array" } ]; exports.V1AggregationRule = V1AggregationRule; /** * AttachedVolume describes a volume attached to a node */ class V1AttachedVolume { static getAttributeTypeMap() { return V1AttachedVolume.attributeTypeMap; } } V1AttachedVolume.discriminator = undefined; V1AttachedVolume.attributeTypeMap = [ { "name": "devicePath", "baseName": "devicePath", "type": "string" }, { "name": "name", "baseName": "name", "type": "string" } ]; exports.V1AttachedVolume = V1AttachedVolume; /** * AzureDisk represents an Azure Data Disk mount on the host and bind mount to the pod. */ class V1AzureDiskVolumeSource { static getAttributeTypeMap() { return V1AzureDiskVolumeSource.attributeTypeMap; } } V1AzureDiskVolumeSource.discriminator = undefined; V1AzureDiskVolumeSource.attributeTypeMap = [ { "name": "cachingMode", "baseName": "cachingMode", "type": "string" }, { "name": "diskName", "baseName": "diskName", "type": "string" }, { "name": "diskURI", "baseName": "diskURI", "type": "string" }, { "name": "fsType", "baseName": "fsType", "type": "string" }, { "name": "kind", "baseName": "kind", "type": "string" }, { "name": "readOnly", "baseName": "readOnly", "type": "boolean" } ]; exports.V1AzureDiskVolumeSource = V1AzureDiskVolumeSource; /** * AzureFile represents an Azure File Service mount on the host and bind mount to the pod. */ class V1AzureFilePersistentVolumeSource { static getAttributeTypeMap() { return V1AzureFilePersistentVolumeSource.attributeTypeMap; } } V1AzureFilePersistentVolumeSource.discriminator = undefined; V1AzureFilePersistentVolumeSource.attributeTypeMap = [ { "name": "readOnly", "baseName": "readOnly", "type": "boolean" }, { "name": "secretName", "baseName": "secretName", "type": "string" }, { "name": "secretNamespace", "baseName": "secretNamespace", "type": "string" }, { "name": "shareName", "baseName": "shareName", "type": "string" } ]; exports.V1AzureFilePersistentVolumeSource = V1AzureFilePersistentVolumeSource; /** * AzureFile represents an Azure File Service mount on the host and bind mount to the pod. */ class V1AzureFileVolumeSource { static getAttributeTypeMap() { return V1AzureFileVolumeSource.attributeTypeMap; } } V1AzureFileVolumeSource.discriminator = undefined; V1AzureFileVolumeSource.attributeTypeMap = [ { "name": "readOnly", "baseName": "readOnly", "type": "boolean" }, { "name": "secretName", "baseName": "secretName", "type": "string" }, { "name": "shareName", "baseName": "shareName", "type": "string" } ]; exports.V1AzureFileVolumeSource = V1AzureFileVolumeSource; /** * 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. */ class V1Binding { static getAttributeTypeMap() { return V1Binding.attributeTypeMap; } } V1Binding.discriminator = undefined; V1Binding.attributeTypeMap = [ { "name": "apiVersion", "baseName": "apiVersion", "type": "string" }, { "name": "kind", "baseName": "kind", "type": "string" }, { "name": "metadata", "baseName": "metadata", "type": "V1ObjectMeta" }, { "name": "target", "baseName": "target", "type": "V1ObjectReference" } ]; exports.V1Binding = V1Binding; /** * Represents storage that is managed by an external CSI volume driver (Beta feature) */ class V1CSIPersistentVolumeSource { static getAttributeTypeMap() { return V1CSIPersistentVolumeSource.attributeTypeMap; } } V1CSIPersistentVolumeSource.discriminator = undefined; V1CSIPersistentVolumeSource.attributeTypeMap = [ { "name": "controllerPublishSecretRef", "baseName": "controllerPublishSecretRef", "type": "V1SecretReference" }, { "name": "driver", "baseName": "driver", "type": "string" }, { "name": "fsType", "baseName": "fsType", "type": "string" }, { "name": "nodePublishSecretRef", "baseName": "nodePublishSecretRef", "type": "V1SecretReference" }, { "name": "nodeStageSecretRef", "baseName": "nodeStageSecretRef", "type": "V1SecretReference" }, { "name": "readOnly", "baseName": "readOnly", "type": "boolean" }, { "name": "volumeAttributes", "baseName": "volumeAttributes", "type": "{ [key: string]: string; }" }, { "name": "volumeHandle", "baseName": "volumeHandle", "type": "string" } ]; exports.V1CSIPersistentVolumeSource = V1CSIPersistentVolumeSource; /** * Adds and removes POSIX capabilities from running containers. */ class V1Capabilities { static getAttributeTypeMap() { return V1Capabilities.attributeTypeMap; } } V1Capabilities.discriminator = undefined; V1Capabilities.attributeTypeMap = [ { "name": "add", "baseName": "add", "type": "Array" }, { "name": "drop", "baseName": "drop", "type": "Array" } ]; exports.V1Capabilities = V1Capabilities; /** * Represents a Ceph Filesystem mount that lasts the lifetime of a pod Cephfs volumes do not support ownership management or SELinux relabeling. */ class V1CephFSPersistentVolumeSource { static getAttributeTypeMap() { return V1CephFSPersistentVolumeSource.attributeTypeMap; } } V1CephFSPersistentVolumeSource.discriminator = undefined; V1CephFSPersistentVolumeSource.attributeTypeMap = [ { "name": "monitors", "baseName": "monitors", "type": "Array" }, { "name": "path", "baseName": "path", "type": "string" }, { "name": "readOnly", "baseName": "readOnly", "type": "boolean" }, { "name": "secretFile", "baseName": "secretFile", "type": "string" }, { "name": "secretRef", "baseName": "secretRef", "type": "V1SecretReference" }, { "name": "user", "baseName": "user", "type": "string" } ]; exports.V1CephFSPersistentVolumeSource = V1CephFSPersistentVolumeSource; /** * Represents a Ceph Filesystem mount that lasts the lifetime of a pod Cephfs volumes do not support ownership management or SELinux relabeling. */ class V1CephFSVolumeSource { static getAttributeTypeMap() { return V1CephFSVolumeSource.attributeTypeMap; } } V1CephFSVolumeSource.discriminator = undefined; V1CephFSVolumeSource.attributeTypeMap = [ { "name": "monitors", "baseName": "monitors", "type": "Array" }, { "name": "path", "baseName": "path", "type": "string" }, { "name": "readOnly", "baseName": "readOnly", "type": "boolean" }, { "name": "secretFile", "baseName": "secretFile", "type": "string" }, { "name": "secretRef", "baseName": "secretRef", "type": "V1LocalObjectReference" }, { "name": "user", "baseName": "user", "type": "string" } ]; exports.V1CephFSVolumeSource = V1CephFSVolumeSource; /** * 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. */ class V1CinderPersistentVolumeSource { static getAttributeTypeMap() { return V1CinderPersistentVolumeSource.attributeTypeMap; } } V1CinderPersistentVolumeSource.discriminator = undefined; V1CinderPersistentVolumeSource.attributeTypeMap = [ { "name": "fsType", "baseName": "fsType", "type": "string" }, { "name": "readOnly", "baseName": "readOnly", "type": "boolean" }, { "name": "secretRef", "baseName": "secretRef", "type": "V1SecretReference" }, { "name": "volumeID", "baseName": "volumeID", "type": "string" } ]; exports.V1CinderPersistentVolumeSource = V1CinderPersistentVolumeSource; /** * 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. */ class V1CinderVolumeSource { static getAttributeTypeMap() { return V1CinderVolumeSource.attributeTypeMap; } } V1CinderVolumeSource.discriminator = undefined; V1CinderVolumeSource.attributeTypeMap = [ { "name": "fsType", "baseName": "fsType", "type": "string" }, { "name": "readOnly", "baseName": "readOnly", "type": "boolean" }, { "name": "secretRef", "baseName": "secretRef", "type": "V1LocalObjectReference" }, { "name": "volumeID", "baseName": "volumeID", "type": "string" } ]; exports.V1CinderVolumeSource = V1CinderVolumeSource; /** * ClientIPConfig represents the configurations of Client IP based session affinity. */ class V1ClientIPConfig { static getAttributeTypeMap() { return V1ClientIPConfig.attributeTypeMap; } } V1ClientIPConfig.discriminator = undefined; V1ClientIPConfig.attributeTypeMap = [ { "name": "timeoutSeconds", "baseName": "timeoutSeconds", "type": "number" } ]; exports.V1ClientIPConfig = V1ClientIPConfig; /** * ClusterRole is a cluster level, logical grouping of PolicyRules that can be referenced as a unit by a RoleBinding or ClusterRoleBinding. */ class V1ClusterRole { static getAttributeTypeMap() { return V1ClusterRole.attributeTypeMap; } } V1ClusterRole.discriminator = undefined; V1ClusterRole.attributeTypeMap = [ { "name": "aggregationRule", "baseName": "aggregationRule", "type": "V1AggregationRule" }, { "name": "apiVersion", "baseName": "apiVersion", "type": "string" }, { "name": "kind", "baseName": "kind", "type": "string" }, { "name": "metadata", "baseName": "metadata", "type": "V1ObjectMeta" }, { "name": "rules", "baseName": "rules", "type": "Array" } ]; exports.V1ClusterRole = V1ClusterRole; /** * ClusterRoleBinding references a ClusterRole, but not contain it. It can reference a ClusterRole in the global namespace, and adds who information via Subject. */ class V1ClusterRoleBinding { static getAttributeTypeMap() { return V1ClusterRoleBinding.attributeTypeMap; } } V1ClusterRoleBinding.discriminator = undefined; V1ClusterRoleBinding.attributeTypeMap = [ { "name": "apiVersion", "baseName": "apiVersion", "type": "string" }, { "name": "kind", "baseName": "kind", "type": "string" }, { "name": "metadata", "baseName": "metadata", "type": "V1ObjectMeta" }, { "name": "roleRef", "baseName": "roleRef", "type": "V1RoleRef" }, { "name": "subjects", "baseName": "subjects", "type": "Array" } ]; exports.V1ClusterRoleBinding = V1ClusterRoleBinding; /** * ClusterRoleBindingList is a collection of ClusterRoleBindings */ class V1ClusterRoleBindingList { static getAttributeTypeMap() { return V1ClusterRoleBindingList.attributeTypeMap; } } V1ClusterRoleBindingList.discriminator = undefined; V1ClusterRoleBindingList.attributeTypeMap = [ { "name": "apiVersion", "baseName": "apiVersion", "type": "string" }, { "name": "items", "baseName": "items", "type": "Array" }, { "name": "kind", "baseName": "kind", "type": "string" }, { "name": "metadata", "baseName": "metadata", "type": "V1ListMeta" } ]; exports.V1ClusterRoleBindingList = V1ClusterRoleBindingList; /** * ClusterRoleList is a collection of ClusterRoles */ class V1ClusterRoleList { static getAttributeTypeMap() { return V1ClusterRoleList.attributeTypeMap; } } V1ClusterRoleList.discriminator = undefined; V1ClusterRoleList.attributeTypeMap = [ { "name": "apiVersion", "baseName": "apiVersion", "type": "string" }, { "name": "items", "baseName": "items", "type": "Array" }, { "name": "kind", "baseName": "kind", "type": "string" }, { "name": "metadata", "baseName": "metadata", "type": "V1ListMeta" } ]; exports.V1ClusterRoleList = V1ClusterRoleList; /** * Information about the condition of a component. */ class V1ComponentCondition { static getAttributeTypeMap() { return V1ComponentCondition.attributeTypeMap; } } V1ComponentCondition.discriminator = undefined; V1ComponentCondition.attributeTypeMap = [ { "name": "error", "baseName": "error", "type": "string" }, { "name": "message", "baseName": "message", "type": "string" }, { "name": "status", "baseName": "status", "type": "string" }, { "name": "type", "baseName": "type", "type": "string" } ]; exports.V1ComponentCondition = V1ComponentCondition; /** * ComponentStatus (and ComponentStatusList) holds the cluster validation info. */ class V1ComponentStatus { static getAttributeTypeMap() { return V1ComponentStatus.attributeTypeMap; } } V1ComponentStatus.discriminator = undefined; V1ComponentStatus.attributeTypeMap = [ { "name": "apiVersion", "baseName": "apiVersion", "type": "string" }, { "name": "conditions", "baseName": "conditions", "type": "Array" }, { "name": "kind", "baseName": "kind", "type": "string" }, { "name": "metadata", "baseName": "metadata", "type": "V1ObjectMeta" } ]; exports.V1ComponentStatus = V1ComponentStatus; /** * Status of all the conditions for the component as a list of ComponentStatus objects. */ class V1ComponentStatusList { static getAttributeTypeMap() { return V1ComponentStatusList.attributeTypeMap; } } V1ComponentStatusList.discriminator = undefined; V1ComponentStatusList.attributeTypeMap = [ { "name": "apiVersion", "baseName": "apiVersion", "type": "string" }, { "name": "items", "baseName": "items", "type": "Array" }, { "name": "kind", "baseName": "kind", "type": "string" }, { "name": "metadata", "baseName": "metadata", "type": "V1ListMeta" } ]; exports.V1ComponentStatusList = V1ComponentStatusList; /** * ConfigMap holds configuration data for pods to consume. */ class V1ConfigMap { static getAttributeTypeMap() { return V1ConfigMap.attributeTypeMap; } } V1ConfigMap.discriminator = undefined; V1ConfigMap.attributeTypeMap = [ { "name": "apiVersion", "baseName": "apiVersion", "type": "string" }, { "name": "binaryData", "baseName": "binaryData", "type": "{ [key: string]: string; }" }, { "name": "data", "baseName": "data", "type": "{ [key: string]: string; }" }, { "name": "kind", "baseName": "kind", "type": "string" }, { "name": "metadata", "baseName": "metadata", "type": "V1ObjectMeta" } ]; exports.V1ConfigMap = V1ConfigMap; /** * 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. */ class V1ConfigMapEnvSource { static getAttributeTypeMap() { return V1ConfigMapEnvSource.attributeTypeMap; } } V1ConfigMapEnvSource.discriminator = undefined; V1ConfigMapEnvSource.attributeTypeMap = [ { "name": "name", "baseName": "name", "type": "string" }, { "name": "optional", "baseName": "optional", "type": "boolean" } ]; exports.V1ConfigMapEnvSource = V1ConfigMapEnvSource; /** * Selects a key from a ConfigMap. */ class V1ConfigMapKeySelector { static getAttributeTypeMap() { return V1ConfigMapKeySelector.attributeTypeMap; } } V1ConfigMapKeySelector.discriminator = undefined; V1ConfigMapKeySelector.attributeTypeMap = [ { "name": "key", "baseName": "key", "type": "string" }, { "name": "name", "baseName": "name", "type": "string" }, { "name": "optional", "baseName": "optional", "type": "boolean" } ]; exports.V1ConfigMapKeySelector = V1ConfigMapKeySelector; /** * ConfigMapList is a resource containing a list of ConfigMap objects. */ class V1ConfigMapList { static getAttributeTypeMap() { return V1ConfigMapList.attributeTypeMap; } } V1ConfigMapList.discriminator = undefined; V1ConfigMapList.attributeTypeMap = [ { "name": "apiVersion", "baseName": "apiVersion", "type": "string" }, { "name": "items", "baseName": "items", "type": "Array" }, { "name": "kind", "baseName": "kind", "type": "string" }, { "name": "metadata", "baseName": "metadata", "type": "V1ListMeta" } ]; exports.V1ConfigMapList = V1ConfigMapList; /** * ConfigMapNodeConfigSource contains the information to reference a ConfigMap as a config source for the Node. */ class V1ConfigMapNodeConfigSource { static getAttributeTypeMap() { return V1ConfigMapNodeConfigSource.attributeTypeMap; } } V1ConfigMapNodeConfigSource.discriminator = undefined; V1ConfigMapNodeConfigSource.attributeTypeMap = [ { "name": "kubeletConfigKey", "baseName": "kubeletConfigKey", "type": "string" }, { "name": "name", "baseName": "name", "type": "string" }, { "name": "namespace", "baseName": "namespace", "type": "string" }, { "name": "resourceVersion", "baseName": "resourceVersion", "type": "string" }, { "name": "uid", "baseName": "uid", "type": "string" } ]; exports.V1ConfigMapNodeConfigSource = V1ConfigMapNodeConfigSource; /** * 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. */ class V1ConfigMapProjection { static getAttributeTypeMap() { return V1ConfigMapProjection.attributeTypeMap; } } V1ConfigMapProjection.discriminator = undefined; V1ConfigMapProjection.attributeTypeMap = [ { "name": "items", "baseName": "items", "type": "Array" }, { "name": "name", "baseName": "name", "type": "string" }, { "name": "optional", "baseName": "optional", "type": "boolean" } ]; exports.V1ConfigMapProjection = V1ConfigMapProjection; /** * 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. */ class V1ConfigMapVolumeSource { static getAttributeTypeMap() { return V1ConfigMapVolumeSource.attributeTypeMap; } } V1ConfigMapVolumeSource.discriminator = undefined; V1ConfigMapVolumeSource.attributeTypeMap = [ { "name": "defaultMode", "baseName": "defaultMode", "type": "number" }, { "name": "items", "baseName": "items", "type": "Array" }, { "name": "name", "baseName": "name", "type": "string" }, { "name": "optional", "baseName": "optional", "type": "boolean" } ]; exports.V1ConfigMapVolumeSource = V1ConfigMapVolumeSource; /** * A single application container that you want to run within a pod. */ class V1Container { static getAttributeTypeMap() { return V1Container.attributeTypeMap; } } V1Container.discriminator = undefined; V1Container.attributeTypeMap = [ { "name": "args", "baseName": "args", "type": "Array" }, { "name": "command", "baseName": "command", "type": "Array" }, { "name": "env", "baseName": "env", "type": "Array" }, { "name": "envFrom", "baseName": "envFrom", "type": "Array" }, { "name": "image", "baseName": "image", "type": "string" }, { "name": "imagePullPolicy", "baseName": "imagePullPolicy", "type": "string" }, { "name": "lifecycle", "baseName": "lifecycle", "type": "V1Lifecycle" }, { "name": "livenessProbe", "baseName": "livenessProbe", "type": "V1Probe" }, { "name": "name", "baseName": "name", "type": "string" }, { "name": "ports", "baseName": "ports", "type": "Array" }, { "name": "readinessProbe", "baseName": "readinessProbe", "type": "V1Probe" }, { "name": "resources", "baseName": "resources", "type": "V1ResourceRequirements" }, { "name": "securityContext", "baseName": "securityContext", "type": "V1SecurityContext" }, { "name": "stdin", "baseName": "stdin", "type": "boolean" }, { "name": "stdinOnce", "baseName": "stdinOnce", "type": "boolean" }, { "name": "terminationMessagePath", "baseName": "terminationMessagePath", "type": "string" }, { "name": "terminationMessagePolicy", "baseName": "terminationMessagePolicy", "type": "string" }, { "name": "tty", "baseName": "tty", "type": "boolean" }, { "name": "volumeDevices", "baseName": "volumeDevices", "type": "Array" }, { "name": "volumeMounts", "baseName": "volumeMounts", "type": "Array" }, { "name": "workingDir", "baseName": "workingDir", "type": "string" } ]; exports.V1Container = V1Container; /** * Describe a container image */ class V1ContainerImage { static getAttributeTypeMap() { return V1ContainerImage.attributeTypeMap; } } V1ContainerImage.discriminator = undefined; V1ContainerImage.attributeTypeMap = [ { "name": "names", "baseName": "names", "type": "Array" }, { "name": "sizeBytes", "baseName": "sizeBytes", "type": "number" } ]; exports.V1ContainerImage = V1ContainerImage; /** * ContainerPort represents a network port in a single container. */ class V1ContainerPort { static getAttributeTypeMap() { return V1ContainerPort.attributeTypeMap; } } V1ContainerPort.discriminator = undefined; V1ContainerPort.attributeTypeMap = [ { "name": "containerPort", "baseName": "containerPort", "type": "number" }, { "name": "hostIP", "baseName": "hostIP", "type": "string" }, { "name": "hostPort", "baseName": "hostPort", "type": "number" }, { "name": "name", "baseName": "name", "type": "string" }, { "name": "protocol", "baseName": "protocol", "type": "string" } ]; exports.V1ContainerPort = V1ContainerPort; /** * 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. */ class V1ContainerState { static getAttributeTypeMap() { return V1ContainerState.attributeTypeMap; } } V1ContainerState.discriminator = undefined; V1ContainerState.attributeTypeMap = [ { "name": "running", "baseName": "running", "type": "V1ContainerStateRunning" }, { "name": "terminated", "baseName": "terminated", "type": "V1ContainerStateTerminated" }, { "name": "waiting", "baseName": "waiting", "type": "V1ContainerStateWaiting" } ]; exports.V1ContainerState = V1ContainerState; /** * ContainerStateRunning is a running state of a container. */ class V1ContainerStateRunning { static getAttributeTypeMap() { return V1ContainerStateRunning.attributeTypeMap; } } V1ContainerStateRunning.discriminator = undefined; V1ContainerStateRunning.attributeTypeMap = [ { "name": "startedAt", "baseName": "startedAt", "type": "Date" } ]; exports.V1ContainerStateRunning = V1ContainerStateRunning; /** * ContainerStateTerminated is a terminated state of a container. */ class V1ContainerStateTerminated { static getAttributeTypeMap() { return V1ContainerStateTerminated.attributeTypeMap; } } V1ContainerStateTerminated.discriminator = undefined; V1ContainerStateTerminated.attributeTypeMap = [ { "name": "containerID", "baseName": "containerID", "type": "string" }, { "name": "exitCode", "baseName": "exitCode", "type": "number" }, { "name": "finishedAt", "baseName": "finishedAt", "type": "Date" }, { "name": "message", "baseName": "message", "type": "string" }, { "name": "reason", "baseName": "reason", "type": "string" }, { "name": "signal", "baseName": "signal", "type": "number" }, { "name": "startedAt", "baseName": "startedAt", "type": "Date" } ]; exports.V1ContainerStateTerminated = V1ContainerStateTerminated; /** * ContainerStateWaiting is a waiting state of a container. */ class V1ContainerStateWaiting { static getAttributeTypeMap() { return V1ContainerStateWaiting.attributeTypeMap; } } V1ContainerStateWaiting.discriminator = undefined; V1ContainerStateWaiting.attributeTypeMap = [ { "name": "message", "baseName": "message", "type": "string" }, { "name": "reason", "baseName": "reason", "type": "string" } ]; exports.V1ContainerStateWaiting = V1ContainerStateWaiting; /** * ContainerStatus contains details for the current status of this container. */ class V1ContainerStatus { static getAttributeTypeMap() { return V1ContainerStatus.attributeTypeMap; } } V1ContainerStatus.discriminator = undefined; V1ContainerStatus.attributeTypeMap = [ { "name": "containerID", "baseName": "containerID", "type": "string" }, { "name": "image", "baseName": "image", "type": "string" }, { "name": "imageID", "baseName": "imageID", "type": "string" }, { "name": "lastState", "baseName": "lastState", "type": "V1ContainerState" }, { "name": "name", "baseName": "name", "type": "string" }, { "name": "ready", "baseName": "ready", "type": "boolean" }, { "name": "restartCount", "baseName": "restartCount", "type": "number" }, { "name": "state", "baseName": "state", "type": "V1ContainerState" } ]; exports.V1ContainerStatus = V1ContainerStatus; /** * 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. */ class V1ControllerRevision { static getAttributeTypeMap() { return V1ControllerRevision.attributeTypeMap; } } V1ControllerRevision.discriminator = undefined; V1ControllerRevision.attributeTypeMap = [ { "name": "apiVersion", "baseName": "apiVersion", "type": "string" }, { "name": "data", "baseName": "data", "type": "RuntimeRawExtension" }, { "name": "kind", "baseName": "kind", "type": "string" }, { "name": "metadata", "baseName": "metadata", "type": "V1ObjectMeta" }, { "name": "revision", "baseName": "revision", "type": "number" } ]; exports.V1ControllerRevision = V1ControllerRevision; /** * ControllerRevisionList is a resource containing a list of ControllerRevision objects. */ class V1ControllerRevisionList { static getAttributeTypeMap() { return V1ControllerRevisionList.attributeTypeMap; } } V1ControllerRevisionList.discriminator = undefined; V1ControllerRevisionList.attributeTypeMap = [ { "name": "apiVersion", "baseName": "apiVersion", "type": "string" }, { "name": "items", "baseName": "items", "type": "Array" }, { "name": "kind", "baseName": "kind", "type": "string" }, { "name": "metadata", "baseName": "metadata", "type": "V1ListMeta" } ]; exports.V1ControllerRevisionList = V1ControllerRevisionList; /** * CrossVersionObjectReference contains enough information to let you identify the referred resource. */ class V1CrossVersionObjectReference { static getAttributeTypeMap() { return V1CrossVersionObjectReference.attributeTypeMap; } } V1CrossVersionObjectReference.discriminator = undefined; V1CrossVersionObjectReference.attributeTypeMap = [ { "name": "apiVersion", "baseName": "apiVersion", "type": "string" }, { "name": "kind", "baseName": "kind", "type": "string" }, { "name": "name", "baseName": "name", "type": "string" } ]; exports.V1CrossVersionObjectReference = V1CrossVersionObjectReference; /** * DaemonEndpoint contains information about a single Daemon endpoint. */ class V1DaemonEndpoint { static getAttributeTypeMap() { return V1DaemonEndpoint.attributeTypeMap; } } V1DaemonEndpoint.discriminator = undefined; V1DaemonEndpoint.attributeTypeMap = [ { "name": "port", "baseName": "Port", "type": "number" } ]; exports.V1DaemonEndpoint = V1DaemonEndpoint; /** * DaemonSet represents the configuration of a daemon set. */ class V1DaemonSet { static getAttributeTypeMap() { return V1DaemonSet.attributeTypeMap; } } V1DaemonSet.discriminator = undefined; V1DaemonSet.attributeTypeMap = [ { "name": "apiVersion", "baseName": "apiVersion", "type": "string" }, { "name": "kind", "baseName": "kind", "type": "string" }, { "name": "metadata", "baseName": "metadata", "type": "V1ObjectMeta" }, { "name": "spec", "baseName": "spec", "type": "V1DaemonSetSpec" }, { "name": "status", "baseName": "status", "type": "V1DaemonSetStatus" } ]; exports.V1DaemonSet = V1DaemonSet; /** * DaemonSetCondition describes the state of a DaemonSet at a certain point. */ class V1DaemonSetCondition { static getAttributeTypeMap() { return V1DaemonSetCondition.attributeTypeMap; } } V1DaemonSetCondition.discriminator = undefined; V1DaemonSetCondition.attributeTypeMap = [ { "name": "lastTransitionTime", "baseName": "lastTransitionTime", "type": "Date" }, { "name": "message", "baseName": "message", "type": "string" }, { "name": "reason", "baseName": "reason", "type": "string" }, { "name": "status", "baseName": "status", "type": "string" }, { "name": "type", "baseName": "type", "type": "string" } ]; exports.V1DaemonSetCondition = V1DaemonSetCondition; /** * DaemonSetList is a collection of daemon sets. */ class V1DaemonSetList { static getAttributeTypeMap() { return V1DaemonSetList.attributeTypeMap; } } V1DaemonSetList.discriminator = undefined; V1DaemonSetList.attributeTypeMap = [ { "name": "apiVersion", "baseName": "apiVersion", "type": "string" }, { "name": "items", "baseName": "items", "type": "Array" }, { "name": "kind", "baseName": "kind", "type": "string" }, { "name": "metadata", "baseName": "metadata", "type": "V1ListMeta" } ]; exports.V1DaemonSetList = V1DaemonSetList; /** * DaemonSetSpec is the specification of a daemon set. */ class V1DaemonSetSpec { static getAttributeTypeMap() { return V1DaemonSetSpec.attributeTypeMap; } } V1DaemonSetSpec.discriminator = undefined; V1DaemonSetSpec.attributeTypeMap = [ { "name": "minReadySeconds", "baseName": "minReadySeconds", "type": "number" }, { "name": "revisionHistoryLimit", "baseName": "revisionHistoryLimit", "type": "number" }, { "name": "selector", "baseName": "selector", "type": "V1LabelSelector" }, { "name": "template", "baseName": "template", "type": "V1PodTemplateSpec" }, { "name": "updateStrategy", "baseName": "updateStrategy", "type": "V1DaemonSetUpdateStrategy" } ]; exports.V1DaemonSetSpec = V1DaemonSetSpec; /** * DaemonSetStatus represents the current status of a daemon set. */ class V1DaemonSetStatus { static getAttributeTypeMap() { return V1DaemonSetStatus.attributeTypeMap; } } V1DaemonSetStatus.discriminator = undefined; V1DaemonSetStatus.attributeTypeMap = [ { "name": "collisionCount", "baseName": "collisionCount", "type": "number" }, { "name": "conditions", "baseName": "conditions", "type": "Array" }, { "name": "currentNumberScheduled", "baseName": "currentNumberScheduled", "type": "number" }, { "name": "desiredNumberScheduled", "baseName": "desiredNumberScheduled", "type": "number" }, { "name": "numberAvailable", "baseName": "numberAvailable", "type": "number" }, { "name": "numberMisscheduled", "baseName": "numberMisscheduled", "type": "number" }, { "name": "numberReady", "baseName": "numberReady", "type": "number" }, { "name": "numberUnavailable", "baseName": "numberUnavailable", "type": "number" }, { "name": "observedGeneration", "baseName": "observedGeneration", "type": "number" }, { "name": "updatedNumberScheduled", "baseName": "updatedNumberScheduled", "type": "number" } ]; exports.V1DaemonSetStatus = V1DaemonSetStatus; /** * DaemonSetUpdateStrategy is a struct used to control the update strategy for a DaemonSet. */ class V1DaemonSetUpdateStrategy { static getAttributeTypeMap() { return V1DaemonSetUpdateStrategy.attributeTypeMap; } } V1DaemonSetUpdateStrategy.discriminator = undefined; V1DaemonSetUpdateStrategy.attributeTypeMap = [ { "name": "rollingUpdate", "baseName": "rollingUpdate", "type": "V1RollingUpdateDaemonSet" }, { "name": "type", "baseName": "type", "type": "string" } ]; exports.V1DaemonSetUpdateStrategy = V1DaemonSetUpdateStrategy; /** * DeleteOptions may be provided when deleting an API object. */ class V1DeleteOptions { static getAttributeTypeMap() { return V1DeleteOptions.attributeTypeMap; } } V1DeleteOptions.discriminator = undefined; V1DeleteOptions.attributeTypeMap = [ { "name": "apiVersion", "baseName": "apiVersion", "type": "string" }, { "name": "dryRun", "baseName": "dryRun", "type": "Array" }, { "name": "gracePeriodSeconds", "baseName": "gracePeriodSeconds", "type": "number" }, { "name": "kind", "baseName": "kind", "type": "string" }, { "name": "orphanDependents", "baseName": "orphanDependents", "type": "boolean" }, { "name": "preconditions", "baseName": "preconditions", "type": "V1Preconditions" }, { "name": "propagationPolicy", "baseName": "propagationPolicy", "type": "string" } ]; exports.V1DeleteOptions = V1DeleteOptions; /** * Deployment enables declarative updates for Pods and ReplicaSets. */ class V1Deployment { static getAttributeTypeMap() { return V1Deployment.attributeTypeMap; } } V1Deployment.discriminator = undefined; V1Deployment.attributeTypeMap = [ { "name": "apiVersion", "baseName": "apiVersion", "type": "string" }, { "name": "kind", "baseName": "kind", "type": "string" }, { "name": "metadata", "baseName": "metadata", "type": "V1ObjectMeta" }, { "name": "spec", "baseName": "spec", "type": "V1DeploymentSpec" }, { "name": "status", "baseName": "status", "type": "V1DeploymentStatus" } ]; exports.V1Deployment = V1Deployment; /** * DeploymentCondition describes the state of a deployment at a certain point. */ class V1DeploymentCondition { static getAttributeTypeMap() { return V1DeploymentCondition.attributeTypeMap; } } V1DeploymentCondition.discriminator = undefined; V1DeploymentCondition.attributeTypeMap = [ { "name": "lastTransitionTime", "baseName": "lastTransitionTime", "type": "Date" }, { "name": "lastUpdateTime", "baseName": "lastUpdateTime", "type": "Date" }, { "name": "message", "baseName": "message", "type": "string" }, { "name": "reason", "baseName": "reason", "type": "string" }, { "name": "status", "baseName": "status", "type": "string" }, { "name": "type", "baseName": "type", "type": "string" } ]; exports.V1DeploymentCondition = V1DeploymentCondition; /** * DeploymentList is a list of Deployments. */ class V1DeploymentList { static getAttributeTypeMap() { return V1DeploymentList.attributeTypeMap; } } V1DeploymentList.discriminator = undefined; V1DeploymentList.attributeTypeMap = [ { "name": "apiVersion", "baseName": "apiVersion", "type": "string" }, { "name": "items", "baseName": "items", "type": "Array" }, { "name": "kind", "baseName": "kind", "type": "string" }, { "name": "metadata", "baseName": "metadata", "type": "V1ListMeta" } ]; exports.V1DeploymentList = V1DeploymentList; /** * DeploymentSpec is the specification of the desired behavior of the Deployment. */ class V1DeploymentSpec { static getAttributeTypeMap() { return V1DeploymentSpec.attributeTypeMap; } } V1DeploymentSpec.discriminator = undefined; V1DeploymentSpec.attributeTypeMap = [ { "name": "minReadySeconds", "baseName": "minReadySeconds", "type": "number" }, { "name": "paused", "baseName": "paused", "type": "boolean" }, { "name": "progressDeadlineSeconds", "baseName": "progressDeadlineSeconds", "type": "number" }, { "name": "replicas", "baseName": "replicas", "type": "number" }, { "name": "revisionHistoryLimit", "baseName": "revisionHistoryLimit", "type": "number" }, { "name": "selector", "baseName": "selector", "type": "V1LabelSelector" }, { "name": "strategy", "baseName": "strategy", "type": "V1DeploymentStrategy" }, { "name": "template", "baseName": "template", "type": "V1PodTemplateSpec" } ]; exports.V1DeploymentSpec = V1DeploymentSpec; /** * DeploymentStatus is the most recently observed status of the Deployment. */ class V1DeploymentStatus { static getAttributeTypeMap() { return V1DeploymentStatus.attributeTypeMap; } } V1DeploymentStatus.discriminator = undefined; V1DeploymentStatus.attributeTypeMap = [ { "name": "availableReplicas", "baseName": "availableReplicas", "type": "number" }, { "name": "collisionCount", "baseName": "collisionCount", "type": "number" }, { "name": "conditions", "baseName": "conditions", "type": "Array" }, { "name": "observedGeneration", "baseName": "observedGeneration", "type": "number" }, { "name": "readyReplicas", "baseName": "readyReplicas", "type": "number" }, { "name": "replicas", "baseName": "replicas", "type": "number" }, { "name": "unavailableReplicas", "baseName": "unavailableReplicas", "type": "number" }, { "name": "updatedReplicas", "baseName": "updatedReplicas", "type": "number" } ]; exports.V1DeploymentStatus = V1DeploymentStatus; /** * DeploymentStrategy describes how to replace existing pods with new ones. */ class V1DeploymentStrategy { static getAttributeTypeMap() { return V1DeploymentStrategy.attributeTypeMap; } } V1DeploymentStrategy.discriminator = undefined; V1DeploymentStrategy.attributeTypeMap = [ { "name": "rollingUpdate", "baseName": "rollingUpdate", "type": "V1RollingUpdateDeployment" }, { "name": "type", "baseName": "type", "type": "string" } ]; exports.V1DeploymentStrategy = V1DeploymentStrategy; /** * Represents downward API info for projecting into a projected volume. Note that this is identical to a downwardAPI volume source without the default mode. */ class V1DownwardAPIProjection { static getAttributeTypeMap() { return V1DownwardAPIProjection.attributeTypeMap; } } V1DownwardAPIProjection.discriminator = undefined; V1DownwardAPIProjection.attributeTypeMap = [ { "name": "items", "baseName": "items", "type": "Array" } ]; exports.V1DownwardAPIProjection = V1DownwardAPIProjection; /** * DownwardAPIVolumeFile represents information to create the file containing the pod field */ class V1DownwardAPIVolumeFile { static getAttributeTypeMap() { return V1DownwardAPIVolumeFile.attributeTypeMap; } } V1DownwardAPIVolumeFile.discriminator = undefined; V1DownwardAPIVolumeFile.attributeTypeMap = [ { "name": "fieldRef", "baseName": "fieldRef", "type": "V1ObjectFieldSelector" }, { "name": "mode", "baseName": "mode", "type": "number" }, { "name": "path", "baseName": "path", "type": "string" }, { "name": "resourceFieldRef", "baseName": "resourceFieldRef", "type": "V1ResourceFieldSelector" } ]; exports.V1DownwardAPIVolumeFile = V1DownwardAPIVolumeFile; /** * DownwardAPIVolumeSource represents a volume containing downward API info. Downward API volumes support ownership management and SELinux relabeling. */ class V1DownwardAPIVolumeSource { static getAttributeTypeMap() { return V1DownwardAPIVolumeSource.attributeTypeMap; } } V1DownwardAPIVolumeSource.discriminator = undefined; V1DownwardAPIVolumeSource.attributeTypeMap = [ { "name": "defaultMode", "baseName": "defaultMode", "type": "number" }, { "name": "items", "baseName": "items", "type": "Array" } ]; exports.V1DownwardAPIVolumeSource = V1DownwardAPIVolumeSource; /** * Represents an empty directory for a pod. Empty directory volumes support ownership management and SELinux relabeling. */ class V1EmptyDirVolumeSource { static getAttributeTypeMap() { return V1EmptyDirVolumeSource.attributeTypeMap; } } V1EmptyDirVolumeSource.discriminator = undefined; V1EmptyDirVolumeSource.attributeTypeMap = [ { "name": "medium", "baseName": "medium", "type": "string" }, { "name": "sizeLimit", "baseName": "sizeLimit", "type": "string" } ]; exports.V1EmptyDirVolumeSource = V1EmptyDirVolumeSource; /** * EndpointAddress is a tuple that describes single IP address. */ class V1EndpointAddress { static getAttributeTypeMap() { return V1EndpointAddress.attributeTypeMap; } } V1EndpointAddress.discriminator = undefined; V1EndpointAddress.attributeTypeMap = [ { "name": "hostname", "baseName": "hostname", "type": "string" }, { "name": "ip", "baseName": "ip", "type": "string" }, { "name": "nodeName", "baseName": "nodeName", "type": "string" }, { "name": "targetRef", "baseName": "targetRef", "type": "V1ObjectReference" } ]; exports.V1EndpointAddress = V1EndpointAddress; /** * EndpointPort is a tuple that describes a single port. */ class V1EndpointPort { static getAttributeTypeMap() { return V1EndpointPort.attributeTypeMap; } } V1EndpointPort.discriminator = undefined; V1EndpointPort.attributeTypeMap = [ { "name": "name", "baseName": "name", "type": "string" }, { "name": "port", "baseName": "port", "type": "number" }, { "name": "protocol", "baseName": "protocol", "type": "string" } ]; exports.V1EndpointPort = V1EndpointPort; /** * 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 ] */ class V1EndpointSubset { static getAttributeTypeMap() { return V1EndpointSubset.attributeTypeMap; } } V1EndpointSubset.discriminator = undefined; V1EndpointSubset.attributeTypeMap = [ { "name": "addresses", "baseName": "addresses", "type": "Array" }, { "name": "notReadyAddresses", "baseName": "notReadyAddresses", "type": "Array" }, { "name": "ports", "baseName": "ports", "type": "Array" } ]; exports.V1EndpointSubset = V1EndpointSubset; /** * 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}] }, ] */ class V1Endpoints { static getAttributeTypeMap() { return V1Endpoints.attributeTypeMap; } } V1Endpoints.discriminator = undefined; V1Endpoints.attributeTypeMap = [ { "name": "apiVersion", "baseName": "apiVersion", "type": "string" }, { "name": "kind", "baseName": "kind", "type": "string" }, { "name": "metadata", "baseName": "metadata", "type": "V1ObjectMeta" }, { "name": "subsets", "baseName": "subsets", "type": "Array" } ]; exports.V1Endpoints = V1Endpoints; /** * EndpointsList is a list of endpoints. */ class V1EndpointsList { static getAttributeTypeMap() { return V1EndpointsList.attributeTypeMap; } } V1EndpointsList.discriminator = undefined; V1EndpointsList.attributeTypeMap = [ { "name": "apiVersion", "baseName": "apiVersion", "type": "string" }, { "name": "items", "baseName": "items", "type": "Array" }, { "name": "kind", "baseName": "kind", "type": "string" }, { "name": "metadata", "baseName": "metadata", "type": "V1ListMeta" } ]; exports.V1EndpointsList = V1EndpointsList; /** * EnvFromSource represents the source of a set of ConfigMaps */ class V1EnvFromSource { static getAttributeTypeMap() { return V1EnvFromSource.attributeTypeMap; } } V1EnvFromSource.discriminator = undefined; V1EnvFromSource.attributeTypeMap = [ { "name": "configMapRef", "baseName": "configMapRef", "type": "V1ConfigMapEnvSource" }, { "name": "prefix", "baseName": "prefix", "type": "string" }, { "name": "secretRef", "baseName": "secretRef", "type": "V1SecretEnvSource" } ]; exports.V1EnvFromSource = V1EnvFromSource; /** * EnvVar represents an environment variable present in a Container. */ class V1EnvVar { static getAttributeTypeMap() { return V1EnvVar.attributeTypeMap; } } V1EnvVar.discriminator = undefined; V1EnvVar.attributeTypeMap = [ { "name": "name", "baseName": "name", "type": "string" }, { "name": "value", "baseName": "value", "type": "string" }, { "name": "valueFrom", "baseName": "valueFrom", "type": "V1EnvVarSource" } ]; exports.V1EnvVar = V1EnvVar; /** * EnvVarSource represents a source for the value of an EnvVar. */ class V1EnvVarSource { static getAttributeTypeMap() { return V1EnvVarSource.attributeTypeMap; } } V1EnvVarSource.discriminator = undefined; V1EnvVarSource.attributeTypeMap = [ { "name": "configMapKeyRef", "baseName": "configMapKeyRef", "type": "V1ConfigMapKeySelector" }, { "name": "fieldRef", "baseName": "fieldRef", "type": "V1ObjectFieldSelector" }, { "name": "resourceFieldRef", "baseName": "resourceFieldRef", "type": "V1ResourceFieldSelector" }, { "name": "secretKeyRef", "baseName": "secretKeyRef", "type": "V1SecretKeySelector" } ]; exports.V1EnvVarSource = V1EnvVarSource; /** * Event is a report of an event somewhere in the cluster. */ class V1Event { static getAttributeTypeMap() { return V1Event.attributeTypeMap; } } V1Event.discriminator = undefined; V1Event.attributeTypeMap = [ { "name": "action", "baseName": "action", "type": "string" }, { "name": "apiVersion", "baseName": "apiVersion", "type": "string" }, { "name": "count", "baseName": "count", "type": "number" }, { "name": "eventTime", "baseName": "eventTime", "type": "Date" }, { "name": "firstTimestamp", "baseName": "firstTimestamp", "type": "Date" }, { "name": "involvedObject", "baseName": "involvedObject", "type": "V1ObjectReference" }, { "name": "kind", "baseName": "kind", "type": "string" }, { "name": "lastTimestamp", "baseName": "lastTimestamp", "type": "Date" }, { "name": "message", "baseName": "message", "type": "string" }, { "name": "metadata", "baseName": "metadata", "type": "V1ObjectMeta" }, { "name": "reason", "baseName": "reason", "type": "string" }, { "name": "related", "baseName": "related", "type": "V1ObjectReference" }, { "name": "reportingComponent", "baseName": "reportingComponent", "type": "string" }, { "name": "reportingInstance", "baseName": "reportingInstance", "type": "string" }, { "name": "series", "baseName": "series", "type": "V1EventSeries" }, { "name": "source", "baseName": "source", "type": "V1EventSource" }, { "name": "type", "baseName": "type", "type": "string" } ]; exports.V1Event = V1Event; /** * EventList is a list of events. */ class V1EventList { static getAttributeTypeMap() { return V1EventList.attributeTypeMap; } } V1EventList.discriminator = undefined; V1EventList.attributeTypeMap = [ { "name": "apiVersion", "baseName": "apiVersion", "type": "string" }, { "name": "items", "baseName": "items", "type": "Array" }, { "name": "kind", "baseName": "kind", "type": "string" }, { "name": "metadata", "baseName": "metadata", "type": "V1ListMeta" } ]; exports.V1EventList = V1EventList; /** * EventSeries contain information on series of events, i.e. thing that was/is happening continuously for some time. */ class V1EventSeries { static getAttributeTypeMap() { return V1EventSeries.attributeTypeMap; } } V1EventSeries.discriminator = undefined; V1EventSeries.attributeTypeMap = [ { "name": "count", "baseName": "count", "type": "number" }, { "name": "lastObservedTime", "baseName": "lastObservedTime", "type": "Date" }, { "name": "state", "baseName": "state", "type": "string" } ]; exports.V1EventSeries = V1EventSeries; /** * EventSource contains information for an event. */ class V1EventSource { static getAttributeTypeMap() { return V1EventSource.attributeTypeMap; } } V1EventSource.discriminator = undefined; V1EventSource.attributeTypeMap = [ { "name": "component", "baseName": "component", "type": "string" }, { "name": "host", "baseName": "host", "type": "string" } ]; exports.V1EventSource = V1EventSource; /** * ExecAction describes a \"run in container\" action. */ class V1ExecAction { static getAttributeTypeMap() { return V1ExecAction.attributeTypeMap; } } V1ExecAction.discriminator = undefined; V1ExecAction.attributeTypeMap = [ { "name": "command", "baseName": "command", "type": "Array" } ]; exports.V1ExecAction = V1ExecAction; /** * 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. */ class V1FCVolumeSource { static getAttributeTypeMap() { return V1FCVolumeSource.attributeTypeMap; } } V1FCVolumeSource.discriminator = undefined; V1FCVolumeSource.attributeTypeMap = [ { "name": "fsType", "baseName": "fsType", "type": "string" }, { "name": "lun", "baseName": "lun", "type": "number" }, { "name": "readOnly", "baseName": "readOnly", "type": "boolean" }, { "name": "targetWWNs", "baseName": "targetWWNs", "type": "Array" }, { "name": "wwids", "baseName": "wwids", "type": "Array" } ]; exports.V1FCVolumeSource = V1FCVolumeSource; /** * FlexPersistentVolumeSource represents a generic persistent volume resource that is provisioned/attached using an exec based plugin. */ class V1FlexPersistentVolumeSource { static getAttributeTypeMap() { return V1FlexPersistentVolumeSource.attributeTypeMap; } } V1FlexPersistentVolumeSource.discriminator = undefined; V1FlexPersistentVolumeSource.attributeTypeMap = [ { "name": "driver", "baseName": "driver", "type": "string" }, { "name": "fsType", "baseName": "fsType", "type": "string" }, { "name": "options", "baseName": "options", "type": "{ [key: string]: string; }" }, { "name": "readOnly", "baseName": "readOnly", "type": "boolean" }, { "name": "secretRef", "baseName": "secretRef", "type": "V1SecretReference" } ]; exports.V1FlexPersistentVolumeSource = V1FlexPersistentVolumeSource; /** * FlexVolume represents a generic volume resource that is provisioned/attached using an exec based plugin. */ class V1FlexVolumeSource { static getAttributeTypeMap() { return V1FlexVolumeSource.attributeTypeMap; } } V1FlexVolumeSource.discriminator = undefined; V1FlexVolumeSource.attributeTypeMap = [ { "name": "driver", "baseName": "driver", "type": "string" }, { "name": "fsType", "baseName": "fsType", "type": "string" }, { "name": "options", "baseName": "options", "type": "{ [key: string]: string; }" }, { "name": "readOnly", "baseName": "readOnly", "type": "boolean" }, { "name": "secretRef", "baseName": "secretRef", "type": "V1LocalObjectReference" } ]; exports.V1FlexVolumeSource = V1FlexVolumeSource; /** * 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. */ class V1FlockerVolumeSource { static getAttributeTypeMap() { return V1FlockerVolumeSource.attributeTypeMap; } } V1FlockerVolumeSource.discriminator = undefined; V1FlockerVolumeSource.attributeTypeMap = [ { "name": "datasetName", "baseName": "datasetName", "type": "string" }, { "name": "datasetUUID", "baseName": "datasetUUID", "type": "string" } ]; exports.V1FlockerVolumeSource = V1FlockerVolumeSource; /** * 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. */ class V1GCEPersistentDiskVolumeSource { static getAttributeTypeMap() { return V1GCEPersistentDiskVolumeSource.attributeTypeMap; } } V1GCEPersistentDiskVolumeSource.discriminator = undefined; V1GCEPersistentDiskVolumeSource.attributeTypeMap = [ { "name": "fsType", "baseName": "fsType", "type": "string" }, { "name": "partition", "baseName": "partition", "type": "number" }, { "name": "pdName", "baseName": "pdName", "type": "string" }, { "name": "readOnly", "baseName": "readOnly", "type": "boolean" } ]; exports.V1GCEPersistentDiskVolumeSource = V1GCEPersistentDiskVolumeSource; /** * 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. */ class V1GitRepoVolumeSource { static getAttributeTypeMap() { return V1GitRepoVolumeSource.attributeTypeMap; } } V1GitRepoVolumeSource.discriminator = undefined; V1GitRepoVolumeSource.attributeTypeMap = [ { "name": "directory", "baseName": "directory", "type": "string" }, { "name": "repository", "baseName": "repository", "type": "string" }, { "name": "revision", "baseName": "revision", "type": "string" } ]; exports.V1GitRepoVolumeSource = V1GitRepoVolumeSource; /** * Represents a Glusterfs mount that lasts the lifetime of a pod. Glusterfs volumes do not support ownership management or SELinux relabeling. */ class V1GlusterfsPersistentVolumeSource { static getAttributeTypeMap() { return V1GlusterfsPersistentVolumeSource.attributeTypeMap; } } V1GlusterfsPersistentVolumeSource.discriminator = undefined; V1GlusterfsPersistentVolumeSource.attributeTypeMap = [ { "name": "endpoints", "baseName": "endpoints", "type": "string" }, { "name": "endpointsNamespace", "baseName": "endpointsNamespace", "type": "string" }, { "name": "path", "baseName": "path", "type": "string" }, { "name": "readOnly", "baseName": "readOnly", "type": "boolean" } ]; exports.V1GlusterfsPersistentVolumeSource = V1GlusterfsPersistentVolumeSource; /** * Represents a Glusterfs mount that lasts the lifetime of a pod. Glusterfs volumes do not support ownership management or SELinux relabeling. */ class V1GlusterfsVolumeSource { static getAttributeTypeMap() { return V1GlusterfsVolumeSource.attributeTypeMap; } } V1GlusterfsVolumeSource.discriminator = undefined; V1GlusterfsVolumeSource.attributeTypeMap = [ { "name": "endpoints", "baseName": "endpoints", "type": "string" }, { "name": "path", "baseName": "path", "type": "string" }, { "name": "readOnly", "baseName": "readOnly", "type": "boolean" } ]; exports.V1GlusterfsVolumeSource = V1GlusterfsVolumeSource; /** * GroupVersion contains the \"group/version\" and \"version\" string of a version. It is made a struct to keep extensibility. */ class V1GroupVersionForDiscovery { static getAttributeTypeMap() { return V1GroupVersionForDiscovery.attributeTypeMap; } } V1GroupVersionForDiscovery.discriminator = undefined; V1GroupVersionForDiscovery.attributeTypeMap = [ { "name": "groupVersion", "baseName": "groupVersion", "type": "string" }, { "name": "version", "baseName": "version", "type": "string" } ]; exports.V1GroupVersionForDiscovery = V1GroupVersionForDiscovery; /** * HTTPGetAction describes an action based on HTTP Get requests. */ class V1HTTPGetAction { static getAttributeTypeMap() { return V1HTTPGetAction.attributeTypeMap; } } V1HTTPGetAction.discriminator = undefined; V1HTTPGetAction.attributeTypeMap = [ { "name": "host", "baseName": "host", "type": "string" }, { "name": "httpHeaders", "baseName": "httpHeaders", "type": "Array" }, { "name": "path", "baseName": "path", "type": "string" }, { "name": "port", "baseName": "port", "type": "any" }, { "name": "scheme", "baseName": "scheme", "type": "string" } ]; exports.V1HTTPGetAction = V1HTTPGetAction; /** * HTTPHeader describes a custom header to be used in HTTP probes */ class V1HTTPHeader { static getAttributeTypeMap() { return V1HTTPHeader.attributeTypeMap; } } V1HTTPHeader.discriminator = undefined; V1HTTPHeader.attributeTypeMap = [ { "name": "name", "baseName": "name", "type": "string" }, { "name": "value", "baseName": "value", "type": "string" } ]; exports.V1HTTPHeader = V1HTTPHeader; /** * Handler defines a specific action that should be taken */ class V1Handler { static getAttributeTypeMap() { return V1Handler.attributeTypeMap; } } V1Handler.discriminator = undefined; V1Handler.attributeTypeMap = [ { "name": "exec", "baseName": "exec", "type": "V1ExecAction" }, { "name": "httpGet", "baseName": "httpGet", "type": "V1HTTPGetAction" }, { "name": "tcpSocket", "baseName": "tcpSocket", "type": "V1TCPSocketAction" } ]; exports.V1Handler = V1Handler; /** * configuration of a horizontal pod autoscaler. */ class V1HorizontalPodAutoscaler { static getAttributeTypeMap() { return V1HorizontalPodAutoscaler.attributeTypeMap; } } V1HorizontalPodAutoscaler.discriminator = undefined; V1HorizontalPodAutoscaler.attributeTypeMap = [ { "name": "apiVersion", "baseName": "apiVersion", "type": "string" }, { "name": "kind", "baseName": "kind", "type": "string" }, { "name": "metadata", "baseName": "metadata", "type": "V1ObjectMeta" }, { "name": "spec", "baseName": "spec", "type": "V1HorizontalPodAutoscalerSpec" }, { "name": "status", "baseName": "status", "type": "V1HorizontalPodAutoscalerStatus" } ]; exports.V1HorizontalPodAutoscaler = V1HorizontalPodAutoscaler; /** * list of horizontal pod autoscaler objects. */ class V1HorizontalPodAutoscalerList { static getAttributeTypeMap() { return V1HorizontalPodAutoscalerList.attributeTypeMap; } } V1HorizontalPodAutoscalerList.discriminator = undefined; V1HorizontalPodAutoscalerList.attributeTypeMap = [ { "name": "apiVersion", "baseName": "apiVersion", "type": "string" }, { "name": "items", "baseName": "items", "type": "Array" }, { "name": "kind", "baseName": "kind", "type": "string" }, { "name": "metadata", "baseName": "metadata", "type": "V1ListMeta" } ]; exports.V1HorizontalPodAutoscalerList = V1HorizontalPodAutoscalerList; /** * specification of a horizontal pod autoscaler. */ class V1HorizontalPodAutoscalerSpec { static getAttributeTypeMap() { return V1HorizontalPodAutoscalerSpec.attributeTypeMap; } } V1HorizontalPodAutoscalerSpec.discriminator = undefined; V1HorizontalPodAutoscalerSpec.attributeTypeMap = [ { "name": "maxReplicas", "baseName": "maxReplicas", "type": "number" }, { "name": "minReplicas", "baseName": "minReplicas", "type": "number" }, { "name": "scaleTargetRef", "baseName": "scaleTargetRef", "type": "V1CrossVersionObjectReference" }, { "name": "targetCPUUtilizationPercentage", "baseName": "targetCPUUtilizationPercentage", "type": "number" } ]; exports.V1HorizontalPodAutoscalerSpec = V1HorizontalPodAutoscalerSpec; /** * current status of a horizontal pod autoscaler */ class V1HorizontalPodAutoscalerStatus { static getAttributeTypeMap() { return V1HorizontalPodAutoscalerStatus.attributeTypeMap; } } V1HorizontalPodAutoscalerStatus.discriminator = undefined; V1HorizontalPodAutoscalerStatus.attributeTypeMap = [ { "name": "currentCPUUtilizationPercentage", "baseName": "currentCPUUtilizationPercentage", "type": "number" }, { "name": "currentReplicas", "baseName": "currentReplicas", "type": "number" }, { "name": "desiredReplicas", "baseName": "desiredReplicas", "type": "number" }, { "name": "lastScaleTime", "baseName": "lastScaleTime", "type": "Date" }, { "name": "observedGeneration", "baseName": "observedGeneration", "type": "number" } ]; exports.V1HorizontalPodAutoscalerStatus = V1HorizontalPodAutoscalerStatus; /** * HostAlias holds the mapping between IP and hostnames that will be injected as an entry in the pod's hosts file. */ class V1HostAlias { static getAttributeTypeMap() { return V1HostAlias.attributeTypeMap; } } V1HostAlias.discriminator = undefined; V1HostAlias.attributeTypeMap = [ { "name": "hostnames", "baseName": "hostnames", "type": "Array" }, { "name": "ip", "baseName": "ip", "type": "string" } ]; exports.V1HostAlias = V1HostAlias; /** * Represents a host path mapped into a pod. Host path volumes do not support ownership management or SELinux relabeling. */ class V1HostPathVolumeSource { static getAttributeTypeMap() { return V1HostPathVolumeSource.attributeTypeMap; } } V1HostPathVolumeSource.discriminator = undefined; V1HostPathVolumeSource.attributeTypeMap = [ { "name": "path", "baseName": "path", "type": "string" }, { "name": "type", "baseName": "type", "type": "string" } ]; exports.V1HostPathVolumeSource = V1HostPathVolumeSource; /** * IPBlock describes a particular CIDR (Ex. \"192.168.1.1/24\") 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. */ class V1IPBlock { static getAttributeTypeMap() { return V1IPBlock.attributeTypeMap; } } V1IPBlock.discriminator = undefined; V1IPBlock.attributeTypeMap = [ { "name": "cidr", "baseName": "cidr", "type": "string" }, { "name": "except", "baseName": "except", "type": "Array" } ]; exports.V1IPBlock = V1IPBlock; /** * ISCSIPersistentVolumeSource represents an ISCSI disk. ISCSI volumes can only be mounted as read/write once. ISCSI volumes support ownership management and SELinux relabeling. */ class V1ISCSIPersistentVolumeSource { static getAttributeTypeMap() { return V1ISCSIPersistentVolumeSource.attributeTypeMap; } } V1ISCSIPersistentVolumeSource.discriminator = undefined; V1ISCSIPersistentVolumeSource.attributeTypeMap = [ { "name": "chapAuthDiscovery", "baseName": "chapAuthDiscovery", "type": "boolean" }, { "name": "chapAuthSession", "baseName": "chapAuthSession", "type": "boolean" }, { "name": "fsType", "baseName": "fsType", "type": "string" }, { "name": "initiatorName", "baseName": "initiatorName", "type": "string" }, { "name": "iqn", "baseName": "iqn", "type": "string" }, { "name": "iscsiInterface", "baseName": "iscsiInterface", "type": "string" }, { "name": "lun", "baseName": "lun", "type": "number" }, { "name": "portals", "baseName": "portals", "type": "Array" }, { "name": "readOnly", "baseName": "readOnly", "type": "boolean" }, { "name": "secretRef", "baseName": "secretRef", "type": "V1SecretReference" }, { "name": "targetPortal", "baseName": "targetPortal", "type": "string" } ]; exports.V1ISCSIPersistentVolumeSource = V1ISCSIPersistentVolumeSource; /** * Represents an ISCSI disk. ISCSI volumes can only be mounted as read/write once. ISCSI volumes support ownership management and SELinux relabeling. */ class V1ISCSIVolumeSource { static getAttributeTypeMap() { return V1ISCSIVolumeSource.attributeTypeMap; } } V1ISCSIVolumeSource.discriminator = undefined; V1ISCSIVolumeSource.attributeTypeMap = [ { "name": "chapAuthDiscovery", "baseName": "chapAuthDiscovery", "type": "boolean" }, { "name": "chapAuthSession", "baseName": "chapAuthSession", "type": "boolean" }, { "name": "fsType", "baseName": "fsType", "type": "string" }, { "name": "initiatorName", "baseName": "initiatorName", "type": "string" }, { "name": "iqn", "baseName": "iqn", "type": "string" }, { "name": "iscsiInterface", "baseName": "iscsiInterface", "type": "string" }, { "name": "lun", "baseName": "lun", "type": "number" }, { "name": "portals", "baseName": "portals", "type": "Array" }, { "name": "readOnly", "baseName": "readOnly", "type": "boolean" }, { "name": "secretRef", "baseName": "secretRef", "type": "V1LocalObjectReference" }, { "name": "targetPortal", "baseName": "targetPortal", "type": "string" } ]; exports.V1ISCSIVolumeSource = V1ISCSIVolumeSource; /** * Initializer is information about an initializer that has not yet completed. */ class V1Initializer { static getAttributeTypeMap() { return V1Initializer.attributeTypeMap; } } V1Initializer.discriminator = undefined; V1Initializer.attributeTypeMap = [ { "name": "name", "baseName": "name", "type": "string" } ]; exports.V1Initializer = V1Initializer; /** * Initializers tracks the progress of initialization. */ class V1Initializers { static getAttributeTypeMap() { return V1Initializers.attributeTypeMap; } } V1Initializers.discriminator = undefined; V1Initializers.attributeTypeMap = [ { "name": "pending", "baseName": "pending", "type": "Array" }, { "name": "result", "baseName": "result", "type": "V1Status" } ]; exports.V1Initializers = V1Initializers; /** * Job represents the configuration of a single job. */ class V1Job { static getAttributeTypeMap() { return V1Job.attributeTypeMap; } } V1Job.discriminator = undefined; V1Job.attributeTypeMap = [ { "name": "apiVersion", "baseName": "apiVersion", "type": "string" }, { "name": "kind", "baseName": "kind", "type": "string" }, { "name": "metadata", "baseName": "metadata", "type": "V1ObjectMeta" }, { "name": "spec", "baseName": "spec", "type": "V1JobSpec" }, { "name": "status", "baseName": "status", "type": "V1JobStatus" } ]; exports.V1Job = V1Job; /** * JobCondition describes current state of a job. */ class V1JobCondition { static getAttributeTypeMap() { return V1JobCondition.attributeTypeMap; } } V1JobCondition.discriminator = undefined; V1JobCondition.attributeTypeMap = [ { "name": "lastProbeTime", "baseName": "lastProbeTime", "type": "Date" }, { "name": "lastTransitionTime", "baseName": "lastTransitionTime", "type": "Date" }, { "name": "message", "baseName": "message", "type": "string" }, { "name": "reason", "baseName": "reason", "type": "string" }, { "name": "status", "baseName": "status", "type": "string" }, { "name": "type", "baseName": "type", "type": "string" } ]; exports.V1JobCondition = V1JobCondition; /** * JobList is a collection of jobs. */ class V1JobList { static getAttributeTypeMap() { return V1JobList.attributeTypeMap; } } V1JobList.discriminator = undefined; V1JobList.attributeTypeMap = [ { "name": "apiVersion", "baseName": "apiVersion", "type": "string" }, { "name": "items", "baseName": "items", "type": "Array" }, { "name": "kind", "baseName": "kind", "type": "string" }, { "name": "metadata", "baseName": "metadata", "type": "V1ListMeta" } ]; exports.V1JobList = V1JobList; /** * JobSpec describes how the job execution will look like. */ class V1JobSpec { static getAttributeTypeMap() { return V1JobSpec.attributeTypeMap; } } V1JobSpec.discriminator = undefined; V1JobSpec.attributeTypeMap = [ { "name": "activeDeadlineSeconds", "baseName": "activeDeadlineSeconds", "type": "number" }, { "name": "backoffLimit", "baseName": "backoffLimit", "type": "number" }, { "name": "completions", "baseName": "completions", "type": "number" }, { "name": "manualSelector", "baseName": "manualSelector", "type": "boolean" }, { "name": "parallelism", "baseName": "parallelism", "type": "number" }, { "name": "selector", "baseName": "selector", "type": "V1LabelSelector" }, { "name": "template", "baseName": "template", "type": "V1PodTemplateSpec" }, { "name": "ttlSecondsAfterFinished", "baseName": "ttlSecondsAfterFinished", "type": "number" } ]; exports.V1JobSpec = V1JobSpec; /** * JobStatus represents the current state of a Job. */ class V1JobStatus { static getAttributeTypeMap() { return V1JobStatus.attributeTypeMap; } } V1JobStatus.discriminator = undefined; V1JobStatus.attributeTypeMap = [ { "name": "active", "baseName": "active", "type": "number" }, { "name": "completionTime", "baseName": "completionTime", "type": "Date" }, { "name": "conditions", "baseName": "conditions", "type": "Array" }, { "name": "failed", "baseName": "failed", "type": "number" }, { "name": "startTime", "baseName": "startTime", "type": "Date" }, { "name": "succeeded", "baseName": "succeeded", "type": "number" } ]; exports.V1JobStatus = V1JobStatus; /** * Maps a string key to a path within a volume. */ class V1KeyToPath { static getAttributeTypeMap() { return V1KeyToPath.attributeTypeMap; } } V1KeyToPath.discriminator = undefined; V1KeyToPath.attributeTypeMap = [ { "name": "key", "baseName": "key", "type": "string" }, { "name": "mode", "baseName": "mode", "type": "number" }, { "name": "path", "baseName": "path", "type": "string" } ]; exports.V1KeyToPath = V1KeyToPath; /** * 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. */ class V1LabelSelector { static getAttributeTypeMap() { return V1LabelSelector.attributeTypeMap; } } V1LabelSelector.discriminator = undefined; V1LabelSelector.attributeTypeMap = [ { "name": "matchExpressions", "baseName": "matchExpressions", "type": "Array" }, { "name": "matchLabels", "baseName": "matchLabels", "type": "{ [key: string]: string; }" } ]; exports.V1LabelSelector = V1LabelSelector; /** * A label selector requirement is a selector that contains values, a key, and an operator that relates the key and values. */ class V1LabelSelectorRequirement { static getAttributeTypeMap() { return V1LabelSelectorRequirement.attributeTypeMap; } } V1LabelSelectorRequirement.discriminator = undefined; V1LabelSelectorRequirement.attributeTypeMap = [ { "name": "key", "baseName": "key", "type": "string" }, { "name": "operator", "baseName": "operator", "type": "string" }, { "name": "values", "baseName": "values", "type": "Array" } ]; exports.V1LabelSelectorRequirement = V1LabelSelectorRequirement; /** * 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. */ class V1Lifecycle { static getAttributeTypeMap() { return V1Lifecycle.attributeTypeMap; } } V1Lifecycle.discriminator = undefined; V1Lifecycle.attributeTypeMap = [ { "name": "postStart", "baseName": "postStart", "type": "V1Handler" }, { "name": "preStop", "baseName": "preStop", "type": "V1Handler" } ]; exports.V1Lifecycle = V1Lifecycle; /** * LimitRange sets resource usage limits for each kind of resource in a Namespace. */ class V1LimitRange { static getAttributeTypeMap() { return V1LimitRange.attributeTypeMap; } } V1LimitRange.discriminator = undefined; V1LimitRange.attributeTypeMap = [ { "name": "apiVersion", "baseName": "apiVersion", "type": "string" }, { "name": "kind", "baseName": "kind", "type": "string" }, { "name": "metadata", "baseName": "metadata", "type": "V1ObjectMeta" }, { "name": "spec", "baseName": "spec", "type": "V1LimitRangeSpec" } ]; exports.V1LimitRange = V1LimitRange; /** * LimitRangeItem defines a min/max usage limit for any resource that matches on kind. */ class V1LimitRangeItem { static getAttributeTypeMap() { return V1LimitRangeItem.attributeTypeMap; } } V1LimitRangeItem.discriminator = undefined; V1LimitRangeItem.attributeTypeMap = [ { "name": "_default", "baseName": "default", "type": "{ [key: string]: string; }" }, { "name": "defaultRequest", "baseName": "defaultRequest", "type": "{ [key: string]: string; }" }, { "name": "max", "baseName": "max", "type": "{ [key: string]: string; }" }, { "name": "maxLimitRequestRatio", "baseName": "maxLimitRequestRatio", "type": "{ [key: string]: string; }" }, { "name": "min", "baseName": "min", "type": "{ [key: string]: string; }" }, { "name": "type", "baseName": "type", "type": "string" } ]; exports.V1LimitRangeItem = V1LimitRangeItem; /** * LimitRangeList is a list of LimitRange items. */ class V1LimitRangeList { static getAttributeTypeMap() { return V1LimitRangeList.attributeTypeMap; } } V1LimitRangeList.discriminator = undefined; V1LimitRangeList.attributeTypeMap = [ { "name": "apiVersion", "baseName": "apiVersion", "type": "string" }, { "name": "items", "baseName": "items", "type": "Array" }, { "name": "kind", "baseName": "kind", "type": "string" }, { "name": "metadata", "baseName": "metadata", "type": "V1ListMeta" } ]; exports.V1LimitRangeList = V1LimitRangeList; /** * LimitRangeSpec defines a min/max usage limit for resources that match on kind. */ class V1LimitRangeSpec { static getAttributeTypeMap() { return V1LimitRangeSpec.attributeTypeMap; } } V1LimitRangeSpec.discriminator = undefined; V1LimitRangeSpec.attributeTypeMap = [ { "name": "limits", "baseName": "limits", "type": "Array" } ]; exports.V1LimitRangeSpec = V1LimitRangeSpec; /** * ListMeta describes metadata that synthetic resources must have, including lists and various status objects. A resource may have only one of {ObjectMeta, ListMeta}. */ class V1ListMeta { static getAttributeTypeMap() { return V1ListMeta.attributeTypeMap; } } V1ListMeta.discriminator = undefined; V1ListMeta.attributeTypeMap = [ { "name": "_continue", "baseName": "continue", "type": "string" }, { "name": "resourceVersion", "baseName": "resourceVersion", "type": "string" }, { "name": "selfLink", "baseName": "selfLink", "type": "string" } ]; exports.V1ListMeta = V1ListMeta; /** * LoadBalancerIngress represents the status of a load-balancer ingress point: traffic intended for the service should be sent to an ingress point. */ class V1LoadBalancerIngress { static getAttributeTypeMap() { return V1LoadBalancerIngress.attributeTypeMap; } } V1LoadBalancerIngress.discriminator = undefined; V1LoadBalancerIngress.attributeTypeMap = [ { "name": "hostname", "baseName": "hostname", "type": "string" }, { "name": "ip", "baseName": "ip", "type": "string" } ]; exports.V1LoadBalancerIngress = V1LoadBalancerIngress; /** * LoadBalancerStatus represents the status of a load-balancer. */ class V1LoadBalancerStatus { static getAttributeTypeMap() { return V1LoadBalancerStatus.attributeTypeMap; } } V1LoadBalancerStatus.discriminator = undefined; V1LoadBalancerStatus.attributeTypeMap = [ { "name": "ingress", "baseName": "ingress", "type": "Array" } ]; exports.V1LoadBalancerStatus = V1LoadBalancerStatus; /** * LocalObjectReference contains enough information to let you locate the referenced object inside the same namespace. */ class V1LocalObjectReference { static getAttributeTypeMap() { return V1LocalObjectReference.attributeTypeMap; } } V1LocalObjectReference.discriminator = undefined; V1LocalObjectReference.attributeTypeMap = [ { "name": "name", "baseName": "name", "type": "string" } ]; exports.V1LocalObjectReference = V1LocalObjectReference; /** * 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. */ class V1LocalSubjectAccessReview { static getAttributeTypeMap() { return V1LocalSubjectAccessReview.attributeTypeMap; } } V1LocalSubjectAccessReview.discriminator = undefined; V1LocalSubjectAccessReview.attributeTypeMap = [ { "name": "apiVersion", "baseName": "apiVersion", "type": "string" }, { "name": "kind", "baseName": "kind", "type": "string" }, { "name": "metadata", "baseName": "metadata", "type": "V1ObjectMeta" }, { "name": "spec", "baseName": "spec", "type": "V1SubjectAccessReviewSpec" }, { "name": "status", "baseName": "status", "type": "V1SubjectAccessReviewStatus" } ]; exports.V1LocalSubjectAccessReview = V1LocalSubjectAccessReview; /** * Local represents directly-attached storage with node affinity (Beta feature) */ class V1LocalVolumeSource { static getAttributeTypeMap() { return V1LocalVolumeSource.attributeTypeMap; } } V1LocalVolumeSource.discriminator = undefined; V1LocalVolumeSource.attributeTypeMap = [ { "name": "fsType", "baseName": "fsType", "type": "string" }, { "name": "path", "baseName": "path", "type": "string" } ]; exports.V1LocalVolumeSource = V1LocalVolumeSource; /** * Represents an NFS mount that lasts the lifetime of a pod. NFS volumes do not support ownership management or SELinux relabeling. */ class V1NFSVolumeSource { static getAttributeTypeMap() { return V1NFSVolumeSource.attributeTypeMap; } } V1NFSVolumeSource.discriminator = undefined; V1NFSVolumeSource.attributeTypeMap = [ { "name": "path", "baseName": "path", "type": "string" }, { "name": "readOnly", "baseName": "readOnly", "type": "boolean" }, { "name": "server", "baseName": "server", "type": "string" } ]; exports.V1NFSVolumeSource = V1NFSVolumeSource; /** * Namespace provides a scope for Names. Use of multiple namespaces is optional. */ class V1Namespace { static getAttributeTypeMap() { return V1Namespace.attributeTypeMap; } } V1Namespace.discriminator = undefined; V1Namespace.attributeTypeMap = [ { "name": "apiVersion", "baseName": "apiVersion", "type": "string" }, { "name": "kind", "baseName": "kind", "type": "string" }, { "name": "metadata", "baseName": "metadata", "type": "V1ObjectMeta" }, { "name": "spec", "baseName": "spec", "type": "V1NamespaceSpec" }, { "name": "status", "baseName": "status", "type": "V1NamespaceStatus" } ]; exports.V1Namespace = V1Namespace; /** * NamespaceList is a list of Namespaces. */ class V1NamespaceList { static getAttributeTypeMap() { return V1NamespaceList.attributeTypeMap; } } V1NamespaceList.discriminator = undefined; V1NamespaceList.attributeTypeMap = [ { "name": "apiVersion", "baseName": "apiVersion", "type": "string" }, { "name": "items", "baseName": "items", "type": "Array" }, { "name": "kind", "baseName": "kind", "type": "string" }, { "name": "metadata", "baseName": "metadata", "type": "V1ListMeta" } ]; exports.V1NamespaceList = V1NamespaceList; /** * NamespaceSpec describes the attributes on a Namespace. */ class V1NamespaceSpec { static getAttributeTypeMap() { return V1NamespaceSpec.attributeTypeMap; } } V1NamespaceSpec.discriminator = undefined; V1NamespaceSpec.attributeTypeMap = [ { "name": "finalizers", "baseName": "finalizers", "type": "Array" } ]; exports.V1NamespaceSpec = V1NamespaceSpec; /** * NamespaceStatus is information about the current status of a Namespace. */ class V1NamespaceStatus { static getAttributeTypeMap() { return V1NamespaceStatus.attributeTypeMap; } } V1NamespaceStatus.discriminator = undefined; V1NamespaceStatus.attributeTypeMap = [ { "name": "phase", "baseName": "phase", "type": "string" } ]; exports.V1NamespaceStatus = V1NamespaceStatus; /** * NetworkPolicy describes what network traffic is allowed for a set of Pods */ class V1NetworkPolicy { static getAttributeTypeMap() { return V1NetworkPolicy.attributeTypeMap; } } V1NetworkPolicy.discriminator = undefined; V1NetworkPolicy.attributeTypeMap = [ { "name": "apiVersion", "baseName": "apiVersion", "type": "string" }, { "name": "kind", "baseName": "kind", "type": "string" }, { "name": "metadata", "baseName": "metadata", "type": "V1ObjectMeta" }, { "name": "spec", "baseName": "spec", "type": "V1NetworkPolicySpec" } ]; exports.V1NetworkPolicy = V1NetworkPolicy; /** * 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 */ class V1NetworkPolicyEgressRule { static getAttributeTypeMap() { return V1NetworkPolicyEgressRule.attributeTypeMap; } } V1NetworkPolicyEgressRule.discriminator = undefined; V1NetworkPolicyEgressRule.attributeTypeMap = [ { "name": "ports", "baseName": "ports", "type": "Array" }, { "name": "to", "baseName": "to", "type": "Array" } ]; exports.V1NetworkPolicyEgressRule = V1NetworkPolicyEgressRule; /** * 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. */ class V1NetworkPolicyIngressRule { static getAttributeTypeMap() { return V1NetworkPolicyIngressRule.attributeTypeMap; } } V1NetworkPolicyIngressRule.discriminator = undefined; V1NetworkPolicyIngressRule.attributeTypeMap = [ { "name": "from", "baseName": "from", "type": "Array" }, { "name": "ports", "baseName": "ports", "type": "Array" } ]; exports.V1NetworkPolicyIngressRule = V1NetworkPolicyIngressRule; /** * NetworkPolicyList is a list of NetworkPolicy objects. */ class V1NetworkPolicyList { static getAttributeTypeMap() { return V1NetworkPolicyList.attributeTypeMap; } } V1NetworkPolicyList.discriminator = undefined; V1NetworkPolicyList.attributeTypeMap = [ { "name": "apiVersion", "baseName": "apiVersion", "type": "string" }, { "name": "items", "baseName": "items", "type": "Array" }, { "name": "kind", "baseName": "kind", "type": "string" }, { "name": "metadata", "baseName": "metadata", "type": "V1ListMeta" } ]; exports.V1NetworkPolicyList = V1NetworkPolicyList; /** * NetworkPolicyPeer describes a peer to allow traffic from. Only certain combinations of fields are allowed */ class V1NetworkPolicyPeer { static getAttributeTypeMap() { return V1NetworkPolicyPeer.attributeTypeMap; } } V1NetworkPolicyPeer.discriminator = undefined; V1NetworkPolicyPeer.attributeTypeMap = [ { "name": "ipBlock", "baseName": "ipBlock", "type": "V1IPBlock" }, { "name": "namespaceSelector", "baseName": "namespaceSelector", "type": "V1LabelSelector" }, { "name": "podSelector", "baseName": "podSelector", "type": "V1LabelSelector" } ]; exports.V1NetworkPolicyPeer = V1NetworkPolicyPeer; /** * NetworkPolicyPort describes a port to allow traffic on */ class V1NetworkPolicyPort { static getAttributeTypeMap() { return V1NetworkPolicyPort.attributeTypeMap; } } V1NetworkPolicyPort.discriminator = undefined; V1NetworkPolicyPort.attributeTypeMap = [ { "name": "port", "baseName": "port", "type": "any" }, { "name": "protocol", "baseName": "protocol", "type": "string" } ]; exports.V1NetworkPolicyPort = V1NetworkPolicyPort; /** * NetworkPolicySpec provides the specification of a NetworkPolicy */ class V1NetworkPolicySpec { static getAttributeTypeMap() { return V1NetworkPolicySpec.attributeTypeMap; } } V1NetworkPolicySpec.discriminator = undefined; V1NetworkPolicySpec.attributeTypeMap = [ { "name": "egress", "baseName": "egress", "type": "Array" }, { "name": "ingress", "baseName": "ingress", "type": "Array" }, { "name": "podSelector", "baseName": "podSelector", "type": "V1LabelSelector" }, { "name": "policyTypes", "baseName": "policyTypes", "type": "Array" } ]; exports.V1NetworkPolicySpec = V1NetworkPolicySpec; /** * Node is a worker node in Kubernetes. Each node will have a unique identifier in the cache (i.e. in etcd). */ class V1Node { static getAttributeTypeMap() { return V1Node.attributeTypeMap; } } V1Node.discriminator = undefined; V1Node.attributeTypeMap = [ { "name": "apiVersion", "baseName": "apiVersion", "type": "string" }, { "name": "kind", "baseName": "kind", "type": "string" }, { "name": "metadata", "baseName": "metadata", "type": "V1ObjectMeta" }, { "name": "spec", "baseName": "spec", "type": "V1NodeSpec" }, { "name": "status", "baseName": "status", "type": "V1NodeStatus" } ]; exports.V1Node = V1Node; /** * NodeAddress contains information for the node's address. */ class V1NodeAddress { static getAttributeTypeMap() { return V1NodeAddress.attributeTypeMap; } } V1NodeAddress.discriminator = undefined; V1NodeAddress.attributeTypeMap = [ { "name": "address", "baseName": "address", "type": "string" }, { "name": "type", "baseName": "type", "type": "string" } ]; exports.V1NodeAddress = V1NodeAddress; /** * Node affinity is a group of node affinity scheduling rules. */ class V1NodeAffinity { static getAttributeTypeMap() { return V1NodeAffinity.attributeTypeMap; } } V1NodeAffinity.discriminator = undefined; V1NodeAffinity.attributeTypeMap = [ { "name": "preferredDuringSchedulingIgnoredDuringExecution", "baseName": "preferredDuringSchedulingIgnoredDuringExecution", "type": "Array" }, { "name": "requiredDuringSchedulingIgnoredDuringExecution", "baseName": "requiredDuringSchedulingIgnoredDuringExecution", "type": "V1NodeSelector" } ]; exports.V1NodeAffinity = V1NodeAffinity; /** * NodeCondition contains condition information for a node. */ class V1NodeCondition { static getAttributeTypeMap() { return V1NodeCondition.attributeTypeMap; } } V1NodeCondition.discriminator = undefined; V1NodeCondition.attributeTypeMap = [ { "name": "lastHeartbeatTime", "baseName": "lastHeartbeatTime", "type": "Date" }, { "name": "lastTransitionTime", "baseName": "lastTransitionTime", "type": "Date" }, { "name": "message", "baseName": "message", "type": "string" }, { "name": "reason", "baseName": "reason", "type": "string" }, { "name": "status", "baseName": "status", "type": "string" }, { "name": "type", "baseName": "type", "type": "string" } ]; exports.V1NodeCondition = V1NodeCondition; /** * NodeConfigSource specifies a source of node configuration. Exactly one subfield (excluding metadata) must be non-nil. */ class V1NodeConfigSource { static getAttributeTypeMap() { return V1NodeConfigSource.attributeTypeMap; } } V1NodeConfigSource.discriminator = undefined; V1NodeConfigSource.attributeTypeMap = [ { "name": "configMap", "baseName": "configMap", "type": "V1ConfigMapNodeConfigSource" } ]; exports.V1NodeConfigSource = V1NodeConfigSource; /** * NodeConfigStatus describes the status of the config assigned by Node.Spec.ConfigSource. */ class V1NodeConfigStatus { static getAttributeTypeMap() { return V1NodeConfigStatus.attributeTypeMap; } } V1NodeConfigStatus.discriminator = undefined; V1NodeConfigStatus.attributeTypeMap = [ { "name": "active", "baseName": "active", "type": "V1NodeConfigSource" }, { "name": "assigned", "baseName": "assigned", "type": "V1NodeConfigSource" }, { "name": "error", "baseName": "error", "type": "string" }, { "name": "lastKnownGood", "baseName": "lastKnownGood", "type": "V1NodeConfigSource" } ]; exports.V1NodeConfigStatus = V1NodeConfigStatus; /** * NodeDaemonEndpoints lists ports opened by daemons running on the Node. */ class V1NodeDaemonEndpoints { static getAttributeTypeMap() { return V1NodeDaemonEndpoints.attributeTypeMap; } } V1NodeDaemonEndpoints.discriminator = undefined; V1NodeDaemonEndpoints.attributeTypeMap = [ { "name": "kubeletEndpoint", "baseName": "kubeletEndpoint", "type": "V1DaemonEndpoint" } ]; exports.V1NodeDaemonEndpoints = V1NodeDaemonEndpoints; /** * NodeList is the whole list of all Nodes which have been registered with master. */ class V1NodeList { static getAttributeTypeMap() { return V1NodeList.attributeTypeMap; } } V1NodeList.discriminator = undefined; V1NodeList.attributeTypeMap = [ { "name": "apiVersion", "baseName": "apiVersion", "type": "string" }, { "name": "items", "baseName": "items", "type": "Array" }, { "name": "kind", "baseName": "kind", "type": "string" }, { "name": "metadata", "baseName": "metadata", "type": "V1ListMeta" } ]; exports.V1NodeList = V1NodeList; /** * 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. */ class V1NodeSelector { static getAttributeTypeMap() { return V1NodeSelector.attributeTypeMap; } } V1NodeSelector.discriminator = undefined; V1NodeSelector.attributeTypeMap = [ { "name": "nodeSelectorTerms", "baseName": "nodeSelectorTerms", "type": "Array" } ]; exports.V1NodeSelector = V1NodeSelector; /** * A node selector requirement is a selector that contains values, a key, and an operator that relates the key and values. */ class V1NodeSelectorRequirement { static getAttributeTypeMap() { return V1NodeSelectorRequirement.attributeTypeMap; } } V1NodeSelectorRequirement.discriminator = undefined; V1NodeSelectorRequirement.attributeTypeMap = [ { "name": "key", "baseName": "key", "type": "string" }, { "name": "operator", "baseName": "operator", "type": "string" }, { "name": "values", "baseName": "values", "type": "Array" } ]; exports.V1NodeSelectorRequirement = V1NodeSelectorRequirement; /** * 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. */ class V1NodeSelectorTerm { static getAttributeTypeMap() { return V1NodeSelectorTerm.attributeTypeMap; } } V1NodeSelectorTerm.discriminator = undefined; V1NodeSelectorTerm.attributeTypeMap = [ { "name": "matchExpressions", "baseName": "matchExpressions", "type": "Array" }, { "name": "matchFields", "baseName": "matchFields", "type": "Array" } ]; exports.V1NodeSelectorTerm = V1NodeSelectorTerm; /** * NodeSpec describes the attributes that a node is created with. */ class V1NodeSpec { static getAttributeTypeMap() { return V1NodeSpec.attributeTypeMap; } } V1NodeSpec.discriminator = undefined; V1NodeSpec.attributeTypeMap = [ { "name": "configSource", "baseName": "configSource", "type": "V1NodeConfigSource" }, { "name": "externalID", "baseName": "externalID", "type": "string" }, { "name": "podCIDR", "baseName": "podCIDR", "type": "string" }, { "name": "providerID", "baseName": "providerID", "type": "string" }, { "name": "taints", "baseName": "taints", "type": "Array" }, { "name": "unschedulable", "baseName": "unschedulable", "type": "boolean" } ]; exports.V1NodeSpec = V1NodeSpec; /** * NodeStatus is information about the current status of a node. */ class V1NodeStatus { static getAttributeTypeMap() { return V1NodeStatus.attributeTypeMap; } } V1NodeStatus.discriminator = undefined; V1NodeStatus.attributeTypeMap = [ { "name": "addresses", "baseName": "addresses", "type": "Array" }, { "name": "allocatable", "baseName": "allocatable", "type": "{ [key: string]: string; }" }, { "name": "capacity", "baseName": "capacity", "type": "{ [key: string]: string; }" }, { "name": "conditions", "baseName": "conditions", "type": "Array" }, { "name": "config", "baseName": "config", "type": "V1NodeConfigStatus" }, { "name": "daemonEndpoints", "baseName": "daemonEndpoints", "type": "V1NodeDaemonEndpoints" }, { "name": "images", "baseName": "images", "type": "Array" }, { "name": "nodeInfo", "baseName": "nodeInfo", "type": "V1NodeSystemInfo" }, { "name": "phase", "baseName": "phase", "type": "string" }, { "name": "volumesAttached", "baseName": "volumesAttached", "type": "Array" }, { "name": "volumesInUse", "baseName": "volumesInUse", "type": "Array" } ]; exports.V1NodeStatus = V1NodeStatus; /** * NodeSystemInfo is a set of ids/uuids to uniquely identify the node. */ class V1NodeSystemInfo { static getAttributeTypeMap() { return V1NodeSystemInfo.attributeTypeMap; } } V1NodeSystemInfo.discriminator = undefined; V1NodeSystemInfo.attributeTypeMap = [ { "name": "architecture", "baseName": "architecture", "type": "string" }, { "name": "bootID", "baseName": "bootID", "type": "string" }, { "name": "containerRuntimeVersion", "baseName": "containerRuntimeVersion", "type": "string" }, { "name": "kernelVersion", "baseName": "kernelVersion", "type": "string" }, { "name": "kubeProxyVersion", "baseName": "kubeProxyVersion", "type": "string" }, { "name": "kubeletVersion", "baseName": "kubeletVersion", "type": "string" }, { "name": "machineID", "baseName": "machineID", "type": "string" }, { "name": "operatingSystem", "baseName": "operatingSystem", "type": "string" }, { "name": "osImage", "baseName": "osImage", "type": "string" }, { "name": "systemUUID", "baseName": "systemUUID", "type": "string" } ]; exports.V1NodeSystemInfo = V1NodeSystemInfo; /** * NonResourceAttributes includes the authorization attributes available for non-resource requests to the Authorizer interface */ class V1NonResourceAttributes { static getAttributeTypeMap() { return V1NonResourceAttributes.attributeTypeMap; } } V1NonResourceAttributes.discriminator = undefined; V1NonResourceAttributes.attributeTypeMap = [ { "name": "path", "baseName": "path", "type": "string" }, { "name": "verb", "baseName": "verb", "type": "string" } ]; exports.V1NonResourceAttributes = V1NonResourceAttributes; /** * NonResourceRule holds information that describes a rule for the non-resource */ class V1NonResourceRule { static getAttributeTypeMap() { return V1NonResourceRule.attributeTypeMap; } } V1NonResourceRule.discriminator = undefined; V1NonResourceRule.attributeTypeMap = [ { "name": "nonResourceURLs", "baseName": "nonResourceURLs", "type": "Array" }, { "name": "verbs", "baseName": "verbs", "type": "Array" } ]; exports.V1NonResourceRule = V1NonResourceRule; /** * ObjectFieldSelector selects an APIVersioned field of an object. */ class V1ObjectFieldSelector { static getAttributeTypeMap() { return V1ObjectFieldSelector.attributeTypeMap; } } V1ObjectFieldSelector.discriminator = undefined; V1ObjectFieldSelector.attributeTypeMap = [ { "name": "apiVersion", "baseName": "apiVersion", "type": "string" }, { "name": "fieldPath", "baseName": "fieldPath", "type": "string" } ]; exports.V1ObjectFieldSelector = V1ObjectFieldSelector; /** * ObjectMeta is metadata that all persisted resources must have, which includes all objects users must create. */ class V1ObjectMeta { static getAttributeTypeMap() { return V1ObjectMeta.attributeTypeMap; } } V1ObjectMeta.discriminator = undefined; V1ObjectMeta.attributeTypeMap = [ { "name": "annotations", "baseName": "annotations", "type": "{ [key: string]: string; }" }, { "name": "clusterName", "baseName": "clusterName", "type": "string" }, { "name": "creationTimestamp", "baseName": "creationTimestamp", "type": "Date" }, { "name": "deletionGracePeriodSeconds", "baseName": "deletionGracePeriodSeconds", "type": "number" }, { "name": "deletionTimestamp", "baseName": "deletionTimestamp", "type": "Date" }, { "name": "finalizers", "baseName": "finalizers", "type": "Array" }, { "name": "generateName", "baseName": "generateName", "type": "string" }, { "name": "generation", "baseName": "generation", "type": "number" }, { "name": "initializers", "baseName": "initializers", "type": "V1Initializers" }, { "name": "labels", "baseName": "labels", "type": "{ [key: string]: string; }" }, { "name": "name", "baseName": "name", "type": "string" }, { "name": "namespace", "baseName": "namespace", "type": "string" }, { "name": "ownerReferences", "baseName": "ownerReferences", "type": "Array" }, { "name": "resourceVersion", "baseName": "resourceVersion", "type": "string" }, { "name": "selfLink", "baseName": "selfLink", "type": "string" }, { "name": "uid", "baseName": "uid", "type": "string" } ]; exports.V1ObjectMeta = V1ObjectMeta; /** * ObjectReference contains enough information to let you inspect or modify the referred object. */ class V1ObjectReference { static getAttributeTypeMap() { return V1ObjectReference.attributeTypeMap; } } V1ObjectReference.discriminator = undefined; V1ObjectReference.attributeTypeMap = [ { "name": "apiVersion", "baseName": "apiVersion", "type": "string" }, { "name": "fieldPath", "baseName": "fieldPath", "type": "string" }, { "name": "kind", "baseName": "kind", "type": "string" }, { "name": "name", "baseName": "name", "type": "string" }, { "name": "namespace", "baseName": "namespace", "type": "string" }, { "name": "resourceVersion", "baseName": "resourceVersion", "type": "string" }, { "name": "uid", "baseName": "uid", "type": "string" } ]; exports.V1ObjectReference = V1ObjectReference; /** * 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. */ class V1OwnerReference { static getAttributeTypeMap() { return V1OwnerReference.attributeTypeMap; } } V1OwnerReference.discriminator = undefined; V1OwnerReference.attributeTypeMap = [ { "name": "apiVersion", "baseName": "apiVersion", "type": "string" }, { "name": "blockOwnerDeletion", "baseName": "blockOwnerDeletion", "type": "boolean" }, { "name": "controller", "baseName": "controller", "type": "boolean" }, { "name": "kind", "baseName": "kind", "type": "string" }, { "name": "name", "baseName": "name", "type": "string" }, { "name": "uid", "baseName": "uid", "type": "string" } ]; exports.V1OwnerReference = V1OwnerReference; /** * 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 */ class V1PersistentVolume { static getAttributeTypeMap() { return V1PersistentVolume.attributeTypeMap; } } V1PersistentVolume.discriminator = undefined; V1PersistentVolume.attributeTypeMap = [ { "name": "apiVersion", "baseName": "apiVersion", "type": "string" }, { "name": "kind", "baseName": "kind", "type": "string" }, { "name": "metadata", "baseName": "metadata", "type": "V1ObjectMeta" }, { "name": "spec", "baseName": "spec", "type": "V1PersistentVolumeSpec" }, { "name": "status", "baseName": "status", "type": "V1PersistentVolumeStatus" } ]; exports.V1PersistentVolume = V1PersistentVolume; /** * PersistentVolumeClaim is a user's request for and claim to a persistent volume */ class V1PersistentVolumeClaim { static getAttributeTypeMap() { return V1PersistentVolumeClaim.attributeTypeMap; } } V1PersistentVolumeClaim.discriminator = undefined; V1PersistentVolumeClaim.attributeTypeMap = [ { "name": "apiVersion", "baseName": "apiVersion", "type": "string" }, { "name": "kind", "baseName": "kind", "type": "string" }, { "name": "metadata", "baseName": "metadata", "type": "V1ObjectMeta" }, { "name": "spec", "baseName": "spec", "type": "V1PersistentVolumeClaimSpec" }, { "name": "status", "baseName": "status", "type": "V1PersistentVolumeClaimStatus" } ]; exports.V1PersistentVolumeClaim = V1PersistentVolumeClaim; /** * PersistentVolumeClaimCondition contails details about state of pvc */ class V1PersistentVolumeClaimCondition { static getAttributeTypeMap() { return V1PersistentVolumeClaimCondition.attributeTypeMap; } } V1PersistentVolumeClaimCondition.discriminator = undefined; V1PersistentVolumeClaimCondition.attributeTypeMap = [ { "name": "lastProbeTime", "baseName": "lastProbeTime", "type": "Date" }, { "name": "lastTransitionTime", "baseName": "lastTransitionTime", "type": "Date" }, { "name": "message", "baseName": "message", "type": "string" }, { "name": "reason", "baseName": "reason", "type": "string" }, { "name": "status", "baseName": "status", "type": "string" }, { "name": "type", "baseName": "type", "type": "string" } ]; exports.V1PersistentVolumeClaimCondition = V1PersistentVolumeClaimCondition; /** * PersistentVolumeClaimList is a list of PersistentVolumeClaim items. */ class V1PersistentVolumeClaimList { static getAttributeTypeMap() { return V1PersistentVolumeClaimList.attributeTypeMap; } } V1PersistentVolumeClaimList.discriminator = undefined; V1PersistentVolumeClaimList.attributeTypeMap = [ { "name": "apiVersion", "baseName": "apiVersion", "type": "string" }, { "name": "items", "baseName": "items", "type": "Array" }, { "name": "kind", "baseName": "kind", "type": "string" }, { "name": "metadata", "baseName": "metadata", "type": "V1ListMeta" } ]; exports.V1PersistentVolumeClaimList = V1PersistentVolumeClaimList; /** * PersistentVolumeClaimSpec describes the common attributes of storage devices and allows a Source for provider-specific attributes */ class V1PersistentVolumeClaimSpec { static getAttributeTypeMap() { return V1PersistentVolumeClaimSpec.attributeTypeMap; } } V1PersistentVolumeClaimSpec.discriminator = undefined; V1PersistentVolumeClaimSpec.attributeTypeMap = [ { "name": "accessModes", "baseName": "accessModes", "type": "Array" }, { "name": "dataSource", "baseName": "dataSource", "type": "V1TypedLocalObjectReference" }, { "name": "resources", "baseName": "resources", "type": "V1ResourceRequirements" }, { "name": "selector", "baseName": "selector", "type": "V1LabelSelector" }, { "name": "storageClassName", "baseName": "storageClassName", "type": "string" }, { "name": "volumeMode", "baseName": "volumeMode", "type": "string" }, { "name": "volumeName", "baseName": "volumeName", "type": "string" } ]; exports.V1PersistentVolumeClaimSpec = V1PersistentVolumeClaimSpec; /** * PersistentVolumeClaimStatus is the current status of a persistent volume claim. */ class V1PersistentVolumeClaimStatus { static getAttributeTypeMap() { return V1PersistentVolumeClaimStatus.attributeTypeMap; } } V1PersistentVolumeClaimStatus.discriminator = undefined; V1PersistentVolumeClaimStatus.attributeTypeMap = [ { "name": "accessModes", "baseName": "accessModes", "type": "Array" }, { "name": "capacity", "baseName": "capacity", "type": "{ [key: string]: string; }" }, { "name": "conditions", "baseName": "conditions", "type": "Array" }, { "name": "phase", "baseName": "phase", "type": "string" } ]; exports.V1PersistentVolumeClaimStatus = V1PersistentVolumeClaimStatus; /** * 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). */ class V1PersistentVolumeClaimVolumeSource { static getAttributeTypeMap() { return V1PersistentVolumeClaimVolumeSource.attributeTypeMap; } } V1PersistentVolumeClaimVolumeSource.discriminator = undefined; V1PersistentVolumeClaimVolumeSource.attributeTypeMap = [ { "name": "claimName", "baseName": "claimName", "type": "string" }, { "name": "readOnly", "baseName": "readOnly", "type": "boolean" } ]; exports.V1PersistentVolumeClaimVolumeSource = V1PersistentVolumeClaimVolumeSource; /** * PersistentVolumeList is a list of PersistentVolume items. */ class V1PersistentVolumeList { static getAttributeTypeMap() { return V1PersistentVolumeList.attributeTypeMap; } } V1PersistentVolumeList.discriminator = undefined; V1PersistentVolumeList.attributeTypeMap = [ { "name": "apiVersion", "baseName": "apiVersion", "type": "string" }, { "name": "items", "baseName": "items", "type": "Array" }, { "name": "kind", "baseName": "kind", "type": "string" }, { "name": "metadata", "baseName": "metadata", "type": "V1ListMeta" } ]; exports.V1PersistentVolumeList = V1PersistentVolumeList; /** * PersistentVolumeSpec is the specification of a persistent volume. */ class V1PersistentVolumeSpec { static getAttributeTypeMap() { return V1PersistentVolumeSpec.attributeTypeMap; } } V1PersistentVolumeSpec.discriminator = undefined; V1PersistentVolumeSpec.attributeTypeMap = [ { "name": "accessModes", "baseName": "accessModes", "type": "Array" }, { "name": "awsElasticBlockStore", "baseName": "awsElasticBlockStore", "type": "V1AWSElasticBlockStoreVolumeSource" }, { "name": "azureDisk", "baseName": "azureDisk", "type": "V1AzureDiskVolumeSource" }, { "name": "azureFile", "baseName": "azureFile", "type": "V1AzureFilePersistentVolumeSource" }, { "name": "capacity", "baseName": "capacity", "type": "{ [key: string]: string; }" }, { "name": "cephfs", "baseName": "cephfs", "type": "V1CephFSPersistentVolumeSource" }, { "name": "cinder", "baseName": "cinder", "type": "V1CinderPersistentVolumeSource" }, { "name": "claimRef", "baseName": "claimRef", "type": "V1ObjectReference" }, { "name": "csi", "baseName": "csi", "type": "V1CSIPersistentVolumeSource" }, { "name": "fc", "baseName": "fc", "type": "V1FCVolumeSource" }, { "name": "flexVolume", "baseName": "flexVolume", "type": "V1FlexPersistentVolumeSource" }, { "name": "flocker", "baseName": "flocker", "type": "V1FlockerVolumeSource" }, { "name": "gcePersistentDisk", "baseName": "gcePersistentDisk", "type": "V1GCEPersistentDiskVolumeSource" }, { "name": "glusterfs", "baseName": "glusterfs", "type": "V1GlusterfsPersistentVolumeSource" }, { "name": "hostPath", "baseName": "hostPath", "type": "V1HostPathVolumeSource" }, { "name": "iscsi", "baseName": "iscsi", "type": "V1ISCSIPersistentVolumeSource" }, { "name": "local", "baseName": "local", "type": "V1LocalVolumeSource" }, { "name": "mountOptions", "baseName": "mountOptions", "type": "Array" }, { "name": "nfs", "baseName": "nfs", "type": "V1NFSVolumeSource" }, { "name": "nodeAffinity", "baseName": "nodeAffinity", "type": "V1VolumeNodeAffinity" }, { "name": "persistentVolumeReclaimPolicy", "baseName": "persistentVolumeReclaimPolicy", "type": "string" }, { "name": "photonPersistentDisk", "baseName": "photonPersistentDisk", "type": "V1PhotonPersistentDiskVolumeSource" }, { "name": "portworxVolume", "baseName": "portworxVolume", "type": "V1PortworxVolumeSource" }, { "name": "quobyte", "baseName": "quobyte", "type": "V1QuobyteVolumeSource" }, { "name": "rbd", "baseName": "rbd", "type": "V1RBDPersistentVolumeSource" }, { "name": "scaleIO", "baseName": "scaleIO", "type": "V1ScaleIOPersistentVolumeSource" }, { "name": "storageClassName", "baseName": "storageClassName", "type": "string" }, { "name": "storageos", "baseName": "storageos", "type": "V1StorageOSPersistentVolumeSource" }, { "name": "volumeMode", "baseName": "volumeMode", "type": "string" }, { "name": "vsphereVolume", "baseName": "vsphereVolume", "type": "V1VsphereVirtualDiskVolumeSource" } ]; exports.V1PersistentVolumeSpec = V1PersistentVolumeSpec; /** * PersistentVolumeStatus is the current status of a persistent volume. */ class V1PersistentVolumeStatus { static getAttributeTypeMap() { return V1PersistentVolumeStatus.attributeTypeMap; } } V1PersistentVolumeStatus.discriminator = undefined; V1PersistentVolumeStatus.attributeTypeMap = [ { "name": "message", "baseName": "message", "type": "string" }, { "name": "phase", "baseName": "phase", "type": "string" }, { "name": "reason", "baseName": "reason", "type": "string" } ]; exports.V1PersistentVolumeStatus = V1PersistentVolumeStatus; /** * Represents a Photon Controller persistent disk resource. */ class V1PhotonPersistentDiskVolumeSource { static getAttributeTypeMap() { return V1PhotonPersistentDiskVolumeSource.attributeTypeMap; } } V1PhotonPersistentDiskVolumeSource.discriminator = undefined; V1PhotonPersistentDiskVolumeSource.attributeTypeMap = [ { "name": "fsType", "baseName": "fsType", "type": "string" }, { "name": "pdID", "baseName": "pdID", "type": "string" } ]; exports.V1PhotonPersistentDiskVolumeSource = V1PhotonPersistentDiskVolumeSource; /** * Pod is a collection of containers that can run on a host. This resource is created by clients and scheduled onto hosts. */ class V1Pod { static getAttributeTypeMap() { return V1Pod.attributeTypeMap; } } V1Pod.discriminator = undefined; V1Pod.attributeTypeMap = [ { "name": "apiVersion", "baseName": "apiVersion", "type": "string" }, { "name": "kind", "baseName": "kind", "type": "string" }, { "name": "metadata", "baseName": "metadata", "type": "V1ObjectMeta" }, { "name": "spec", "baseName": "spec", "type": "V1PodSpec" }, { "name": "status", "baseName": "status", "type": "V1PodStatus" } ]; exports.V1Pod = V1Pod; /** * Pod affinity is a group of inter pod affinity scheduling rules. */ class V1PodAffinity { static getAttributeTypeMap() { return V1PodAffinity.attributeTypeMap; } } V1PodAffinity.discriminator = undefined; V1PodAffinity.attributeTypeMap = [ { "name": "preferredDuringSchedulingIgnoredDuringExecution", "baseName": "preferredDuringSchedulingIgnoredDuringExecution", "type": "Array" }, { "name": "requiredDuringSchedulingIgnoredDuringExecution", "baseName": "requiredDuringSchedulingIgnoredDuringExecution", "type": "Array" } ]; exports.V1PodAffinity = V1PodAffinity; /** * 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 */ class V1PodAffinityTerm { static getAttributeTypeMap() { return V1PodAffinityTerm.attributeTypeMap; } } V1PodAffinityTerm.discriminator = undefined; V1PodAffinityTerm.attributeTypeMap = [ { "name": "labelSelector", "baseName": "labelSelector", "type": "V1LabelSelector" }, { "name": "namespaces", "baseName": "namespaces", "type": "Array" }, { "name": "topologyKey", "baseName": "topologyKey", "type": "string" } ]; exports.V1PodAffinityTerm = V1PodAffinityTerm; /** * Pod anti affinity is a group of inter pod anti affinity scheduling rules. */ class V1PodAntiAffinity { static getAttributeTypeMap() { return V1PodAntiAffinity.attributeTypeMap; } } V1PodAntiAffinity.discriminator = undefined; V1PodAntiAffinity.attributeTypeMap = [ { "name": "preferredDuringSchedulingIgnoredDuringExecution", "baseName": "preferredDuringSchedulingIgnoredDuringExecution", "type": "Array" }, { "name": "requiredDuringSchedulingIgnoredDuringExecution", "baseName": "requiredDuringSchedulingIgnoredDuringExecution", "type": "Array" } ]; exports.V1PodAntiAffinity = V1PodAntiAffinity; /** * PodCondition contains details for the current condition of this pod. */ class V1PodCondition { static getAttributeTypeMap() { return V1PodCondition.attributeTypeMap; } } V1PodCondition.discriminator = undefined; V1PodCondition.attributeTypeMap = [ { "name": "lastProbeTime", "baseName": "lastProbeTime", "type": "Date" }, { "name": "lastTransitionTime", "baseName": "lastTransitionTime", "type": "Date" }, { "name": "message", "baseName": "message", "type": "string" }, { "name": "reason", "baseName": "reason", "type": "string" }, { "name": "status", "baseName": "status", "type": "string" }, { "name": "type", "baseName": "type", "type": "string" } ]; exports.V1PodCondition = V1PodCondition; /** * PodDNSConfig defines the DNS parameters of a pod in addition to those generated from DNSPolicy. */ class V1PodDNSConfig { static getAttributeTypeMap() { return V1PodDNSConfig.attributeTypeMap; } } V1PodDNSConfig.discriminator = undefined; V1PodDNSConfig.attributeTypeMap = [ { "name": "nameservers", "baseName": "nameservers", "type": "Array" }, { "name": "options", "baseName": "options", "type": "Array" }, { "name": "searches", "baseName": "searches", "type": "Array" } ]; exports.V1PodDNSConfig = V1PodDNSConfig; /** * PodDNSConfigOption defines DNS resolver options of a pod. */ class V1PodDNSConfigOption { static getAttributeTypeMap() { return V1PodDNSConfigOption.attributeTypeMap; } } V1PodDNSConfigOption.discriminator = undefined; V1PodDNSConfigOption.attributeTypeMap = [ { "name": "name", "baseName": "name", "type": "string" }, { "name": "value", "baseName": "value", "type": "string" } ]; exports.V1PodDNSConfigOption = V1PodDNSConfigOption; /** * PodList is a list of Pods. */ class V1PodList { static getAttributeTypeMap() { return V1PodList.attributeTypeMap; } } V1PodList.discriminator = undefined; V1PodList.attributeTypeMap = [ { "name": "apiVersion", "baseName": "apiVersion", "type": "string" }, { "name": "items", "baseName": "items", "type": "Array" }, { "name": "kind", "baseName": "kind", "type": "string" }, { "name": "metadata", "baseName": "metadata", "type": "V1ListMeta" } ]; exports.V1PodList = V1PodList; /** * PodReadinessGate contains the reference to a pod condition */ class V1PodReadinessGate { static getAttributeTypeMap() { return V1PodReadinessGate.attributeTypeMap; } } V1PodReadinessGate.discriminator = undefined; V1PodReadinessGate.attributeTypeMap = [ { "name": "conditionType", "baseName": "conditionType", "type": "string" } ]; exports.V1PodReadinessGate = V1PodReadinessGate; /** * 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. */ class V1PodSecurityContext { static getAttributeTypeMap() { return V1PodSecurityContext.attributeTypeMap; } } V1PodSecurityContext.discriminator = undefined; V1PodSecurityContext.attributeTypeMap = [ { "name": "fsGroup", "baseName": "fsGroup", "type": "number" }, { "name": "runAsGroup", "baseName": "runAsGroup", "type": "number" }, { "name": "runAsNonRoot", "baseName": "runAsNonRoot", "type": "boolean" }, { "name": "runAsUser", "baseName": "runAsUser", "type": "number" }, { "name": "seLinuxOptions", "baseName": "seLinuxOptions", "type": "V1SELinuxOptions" }, { "name": "supplementalGroups", "baseName": "supplementalGroups", "type": "Array" }, { "name": "sysctls", "baseName": "sysctls", "type": "Array" } ]; exports.V1PodSecurityContext = V1PodSecurityContext; /** * PodSpec is a description of a pod. */ class V1PodSpec { static getAttributeTypeMap() { return V1PodSpec.attributeTypeMap; } } V1PodSpec.discriminator = undefined; V1PodSpec.attributeTypeMap = [ { "name": "activeDeadlineSeconds", "baseName": "activeDeadlineSeconds", "type": "number" }, { "name": "affinity", "baseName": "affinity", "type": "V1Affinity" }, { "name": "automountServiceAccountToken", "baseName": "automountServiceAccountToken", "type": "boolean" }, { "name": "containers", "baseName": "containers", "type": "Array" }, { "name": "dnsConfig", "baseName": "dnsConfig", "type": "V1PodDNSConfig" }, { "name": "dnsPolicy", "baseName": "dnsPolicy", "type": "string" }, { "name": "enableServiceLinks", "baseName": "enableServiceLinks", "type": "boolean" }, { "name": "hostAliases", "baseName": "hostAliases", "type": "Array" }, { "name": "hostIPC", "baseName": "hostIPC", "type": "boolean" }, { "name": "hostNetwork", "baseName": "hostNetwork", "type": "boolean" }, { "name": "hostPID", "baseName": "hostPID", "type": "boolean" }, { "name": "hostname", "baseName": "hostname", "type": "string" }, { "name": "imagePullSecrets", "baseName": "imagePullSecrets", "type": "Array" }, { "name": "initContainers", "baseName": "initContainers", "type": "Array" }, { "name": "nodeName", "baseName": "nodeName", "type": "string" }, { "name": "nodeSelector", "baseName": "nodeSelector", "type": "{ [key: string]: string; }" }, { "name": "priority", "baseName": "priority", "type": "number" }, { "name": "priorityClassName", "baseName": "priorityClassName", "type": "string" }, { "name": "readinessGates", "baseName": "readinessGates", "type": "Array" }, { "name": "restartPolicy", "baseName": "restartPolicy", "type": "string" }, { "name": "runtimeClassName", "baseName": "runtimeClassName", "type": "string" }, { "name": "schedulerName", "baseName": "schedulerName", "type": "string" }, { "name": "securityContext", "baseName": "securityContext", "type": "V1PodSecurityContext" }, { "name": "serviceAccount", "baseName": "serviceAccount", "type": "string" }, { "name": "serviceAccountName", "baseName": "serviceAccountName", "type": "string" }, { "name": "shareProcessNamespace", "baseName": "shareProcessNamespace", "type": "boolean" }, { "name": "subdomain", "baseName": "subdomain", "type": "string" }, { "name": "terminationGracePeriodSeconds", "baseName": "terminationGracePeriodSeconds", "type": "number" }, { "name": "tolerations", "baseName": "tolerations", "type": "Array" }, { "name": "volumes", "baseName": "volumes", "type": "Array" } ]; exports.V1PodSpec = V1PodSpec; /** * 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. */ class V1PodStatus { static getAttributeTypeMap() { return V1PodStatus.attributeTypeMap; } } V1PodStatus.discriminator = undefined; V1PodStatus.attributeTypeMap = [ { "name": "conditions", "baseName": "conditions", "type": "Array" }, { "name": "containerStatuses", "baseName": "containerStatuses", "type": "Array" }, { "name": "hostIP", "baseName": "hostIP", "type": "string" }, { "name": "initContainerStatuses", "baseName": "initContainerStatuses", "type": "Array" }, { "name": "message", "baseName": "message", "type": "string" }, { "name": "nominatedNodeName", "baseName": "nominatedNodeName", "type": "string" }, { "name": "phase", "baseName": "phase", "type": "string" }, { "name": "podIP", "baseName": "podIP", "type": "string" }, { "name": "qosClass", "baseName": "qosClass", "type": "string" }, { "name": "reason", "baseName": "reason", "type": "string" }, { "name": "startTime", "baseName": "startTime", "type": "Date" } ]; exports.V1PodStatus = V1PodStatus; /** * PodTemplate describes a template for creating copies of a predefined pod. */ class V1PodTemplate { static getAttributeTypeMap() { return V1PodTemplate.attributeTypeMap; } } V1PodTemplate.discriminator = undefined; V1PodTemplate.attributeTypeMap = [ { "name": "apiVersion", "baseName": "apiVersion", "type": "string" }, { "name": "kind", "baseName": "kind", "type": "string" }, { "name": "metadata", "baseName": "metadata", "type": "V1ObjectMeta" }, { "name": "template", "baseName": "template", "type": "V1PodTemplateSpec" } ]; exports.V1PodTemplate = V1PodTemplate; /** * PodTemplateList is a list of PodTemplates. */ class V1PodTemplateList { static getAttributeTypeMap() { return V1PodTemplateList.attributeTypeMap; } } V1PodTemplateList.discriminator = undefined; V1PodTemplateList.attributeTypeMap = [ { "name": "apiVersion", "baseName": "apiVersion", "type": "string" }, { "name": "items", "baseName": "items", "type": "Array" }, { "name": "kind", "baseName": "kind", "type": "string" }, { "name": "metadata", "baseName": "metadata", "type": "V1ListMeta" } ]; exports.V1PodTemplateList = V1PodTemplateList; /** * PodTemplateSpec describes the data a pod should have when created from a template */ class V1PodTemplateSpec { static getAttributeTypeMap() { return V1PodTemplateSpec.attributeTypeMap; } } V1PodTemplateSpec.discriminator = undefined; V1PodTemplateSpec.attributeTypeMap = [ { "name": "metadata", "baseName": "metadata", "type": "V1ObjectMeta" }, { "name": "spec", "baseName": "spec", "type": "V1PodSpec" } ]; exports.V1PodTemplateSpec = V1PodTemplateSpec; /** * 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. */ class V1PolicyRule { static getAttributeTypeMap() { return V1PolicyRule.attributeTypeMap; } } V1PolicyRule.discriminator = undefined; V1PolicyRule.attributeTypeMap = [ { "name": "apiGroups", "baseName": "apiGroups", "type": "Array" }, { "name": "nonResourceURLs", "baseName": "nonResourceURLs", "type": "Array" }, { "name": "resourceNames", "baseName": "resourceNames", "type": "Array" }, { "name": "resources", "baseName": "resources", "type": "Array" }, { "name": "verbs", "baseName": "verbs", "type": "Array" } ]; exports.V1PolicyRule = V1PolicyRule; /** * PortworxVolumeSource represents a Portworx volume resource. */ class V1PortworxVolumeSource { static getAttributeTypeMap() { return V1PortworxVolumeSource.attributeTypeMap; } } V1PortworxVolumeSource.discriminator = undefined; V1PortworxVolumeSource.attributeTypeMap = [ { "name": "fsType", "baseName": "fsType", "type": "string" }, { "name": "readOnly", "baseName": "readOnly", "type": "boolean" }, { "name": "volumeID", "baseName": "volumeID", "type": "string" } ]; exports.V1PortworxVolumeSource = V1PortworxVolumeSource; /** * Preconditions must be fulfilled before an operation (update, delete, etc.) is carried out. */ class V1Preconditions { static getAttributeTypeMap() { return V1Preconditions.attributeTypeMap; } } V1Preconditions.discriminator = undefined; V1Preconditions.attributeTypeMap = [ { "name": "uid", "baseName": "uid", "type": "string" } ]; exports.V1Preconditions = V1Preconditions; /** * 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). */ class V1PreferredSchedulingTerm { static getAttributeTypeMap() { return V1PreferredSchedulingTerm.attributeTypeMap; } } V1PreferredSchedulingTerm.discriminator = undefined; V1PreferredSchedulingTerm.attributeTypeMap = [ { "name": "preference", "baseName": "preference", "type": "V1NodeSelectorTerm" }, { "name": "weight", "baseName": "weight", "type": "number" } ]; exports.V1PreferredSchedulingTerm = V1PreferredSchedulingTerm; /** * Probe describes a health check to be performed against a container to determine whether it is alive or ready to receive traffic. */ class V1Probe { static getAttributeTypeMap() { return V1Probe.attributeTypeMap; } } V1Probe.discriminator = undefined; V1Probe.attributeTypeMap = [ { "name": "exec", "baseName": "exec", "type": "V1ExecAction" }, { "name": "failureThreshold", "baseName": "failureThreshold", "type": "number" }, { "name": "httpGet", "baseName": "httpGet", "type": "V1HTTPGetAction" }, { "name": "initialDelaySeconds", "baseName": "initialDelaySeconds", "type": "number" }, { "name": "periodSeconds", "baseName": "periodSeconds", "type": "number" }, { "name": "successThreshold", "baseName": "successThreshold", "type": "number" }, { "name": "tcpSocket", "baseName": "tcpSocket", "type": "V1TCPSocketAction" }, { "name": "timeoutSeconds", "baseName": "timeoutSeconds", "type": "number" } ]; exports.V1Probe = V1Probe; /** * Represents a projected volume source */ class V1ProjectedVolumeSource { static getAttributeTypeMap() { return V1ProjectedVolumeSource.attributeTypeMap; } } V1ProjectedVolumeSource.discriminator = undefined; V1ProjectedVolumeSource.attributeTypeMap = [ { "name": "defaultMode", "baseName": "defaultMode", "type": "number" }, { "name": "sources", "baseName": "sources", "type": "Array" } ]; exports.V1ProjectedVolumeSource = V1ProjectedVolumeSource; /** * Represents a Quobyte mount that lasts the lifetime of a pod. Quobyte volumes do not support ownership management or SELinux relabeling. */ class V1QuobyteVolumeSource { static getAttributeTypeMap() { return V1QuobyteVolumeSource.attributeTypeMap; } } V1QuobyteVolumeSource.discriminator = undefined; V1QuobyteVolumeSource.attributeTypeMap = [ { "name": "group", "baseName": "group", "type": "string" }, { "name": "readOnly", "baseName": "readOnly", "type": "boolean" }, { "name": "registry", "baseName": "registry", "type": "string" }, { "name": "user", "baseName": "user", "type": "string" }, { "name": "volume", "baseName": "volume", "type": "string" } ]; exports.V1QuobyteVolumeSource = V1QuobyteVolumeSource; /** * Represents a Rados Block Device mount that lasts the lifetime of a pod. RBD volumes support ownership management and SELinux relabeling. */ class V1RBDPersistentVolumeSource { static getAttributeTypeMap() { return V1RBDPersistentVolumeSource.attributeTypeMap; } } V1RBDPersistentVolumeSource.discriminator = undefined; V1RBDPersistentVolumeSource.attributeTypeMap = [ { "name": "fsType", "baseName": "fsType", "type": "string" }, { "name": "image", "baseName": "image", "type": "string" }, { "name": "keyring", "baseName": "keyring", "type": "string" }, { "name": "monitors", "baseName": "monitors", "type": "Array" }, { "name": "pool", "baseName": "pool", "type": "string" }, { "name": "readOnly", "baseName": "readOnly", "type": "boolean" }, { "name": "secretRef", "baseName": "secretRef", "type": "V1SecretReference" }, { "name": "user", "baseName": "user", "type": "string" } ]; exports.V1RBDPersistentVolumeSource = V1RBDPersistentVolumeSource; /** * Represents a Rados Block Device mount that lasts the lifetime of a pod. RBD volumes support ownership management and SELinux relabeling. */ class V1RBDVolumeSource { static getAttributeTypeMap() { return V1RBDVolumeSource.attributeTypeMap; } } V1RBDVolumeSource.discriminator = undefined; V1RBDVolumeSource.attributeTypeMap = [ { "name": "fsType", "baseName": "fsType", "type": "string" }, { "name": "image", "baseName": "image", "type": "string" }, { "name": "keyring", "baseName": "keyring", "type": "string" }, { "name": "monitors", "baseName": "monitors", "type": "Array" }, { "name": "pool", "baseName": "pool", "type": "string" }, { "name": "readOnly", "baseName": "readOnly", "type": "boolean" }, { "name": "secretRef", "baseName": "secretRef", "type": "V1LocalObjectReference" }, { "name": "user", "baseName": "user", "type": "string" } ]; exports.V1RBDVolumeSource = V1RBDVolumeSource; /** * ReplicaSet ensures that a specified number of pod replicas are running at any given time. */ class V1ReplicaSet { static getAttributeTypeMap() { return V1ReplicaSet.attributeTypeMap; } } V1ReplicaSet.discriminator = undefined; V1ReplicaSet.attributeTypeMap = [ { "name": "apiVersion", "baseName": "apiVersion", "type": "string" }, { "name": "kind", "baseName": "kind", "type": "string" }, { "name": "metadata", "baseName": "metadata", "type": "V1ObjectMeta" }, { "name": "spec", "baseName": "spec", "type": "V1ReplicaSetSpec" }, { "name": "status", "baseName": "status", "type": "V1ReplicaSetStatus" } ]; exports.V1ReplicaSet = V1ReplicaSet; /** * ReplicaSetCondition describes the state of a replica set at a certain point. */ class V1ReplicaSetCondition { static getAttributeTypeMap() { return V1ReplicaSetCondition.attributeTypeMap; } } V1ReplicaSetCondition.discriminator = undefined; V1ReplicaSetCondition.attributeTypeMap = [ { "name": "lastTransitionTime", "baseName": "lastTransitionTime", "type": "Date" }, { "name": "message", "baseName": "message", "type": "string" }, { "name": "reason", "baseName": "reason", "type": "string" }, { "name": "status", "baseName": "status", "type": "string" }, { "name": "type", "baseName": "type", "type": "string" } ]; exports.V1ReplicaSetCondition = V1ReplicaSetCondition; /** * ReplicaSetList is a collection of ReplicaSets. */ class V1ReplicaSetList { static getAttributeTypeMap() { return V1ReplicaSetList.attributeTypeMap; } } V1ReplicaSetList.discriminator = undefined; V1ReplicaSetList.attributeTypeMap = [ { "name": "apiVersion", "baseName": "apiVersion", "type": "string" }, { "name": "items", "baseName": "items", "type": "Array" }, { "name": "kind", "baseName": "kind", "type": "string" }, { "name": "metadata", "baseName": "metadata", "type": "V1ListMeta" } ]; exports.V1ReplicaSetList = V1ReplicaSetList; /** * ReplicaSetSpec is the specification of a ReplicaSet. */ class V1ReplicaSetSpec { static getAttributeTypeMap() { return V1ReplicaSetSpec.attributeTypeMap; } } V1ReplicaSetSpec.discriminator = undefined; V1ReplicaSetSpec.attributeTypeMap = [ { "name": "minReadySeconds", "baseName": "minReadySeconds", "type": "number" }, { "name": "replicas", "baseName": "replicas", "type": "number" }, { "name": "selector", "baseName": "selector", "type": "V1LabelSelector" }, { "name": "template", "baseName": "template", "type": "V1PodTemplateSpec" } ]; exports.V1ReplicaSetSpec = V1ReplicaSetSpec; /** * ReplicaSetStatus represents the current status of a ReplicaSet. */ class V1ReplicaSetStatus { static getAttributeTypeMap() { return V1ReplicaSetStatus.attributeTypeMap; } } V1ReplicaSetStatus.discriminator = undefined; V1ReplicaSetStatus.attributeTypeMap = [ { "name": "availableReplicas", "baseName": "availableReplicas", "type": "number" }, { "name": "conditions", "baseName": "conditions", "type": "Array" }, { "name": "fullyLabeledReplicas", "baseName": "fullyLabeledReplicas", "type": "number" }, { "name": "observedGeneration", "baseName": "observedGeneration", "type": "number" }, { "name": "readyReplicas", "baseName": "readyReplicas", "type": "number" }, { "name": "replicas", "baseName": "replicas", "type": "number" } ]; exports.V1ReplicaSetStatus = V1ReplicaSetStatus; /** * ReplicationController represents the configuration of a replication controller. */ class V1ReplicationController { static getAttributeTypeMap() { return V1ReplicationController.attributeTypeMap; } } V1ReplicationController.discriminator = undefined; V1ReplicationController.attributeTypeMap = [ { "name": "apiVersion", "baseName": "apiVersion", "type": "string" }, { "name": "kind", "baseName": "kind", "type": "string" }, { "name": "metadata", "baseName": "metadata", "type": "V1ObjectMeta" }, { "name": "spec", "baseName": "spec", "type": "V1ReplicationControllerSpec" }, { "name": "status", "baseName": "status", "type": "V1ReplicationControllerStatus" } ]; exports.V1ReplicationController = V1ReplicationController; /** * ReplicationControllerCondition describes the state of a replication controller at a certain point. */ class V1ReplicationControllerCondition { static getAttributeTypeMap() { return V1ReplicationControllerCondition.attributeTypeMap; } } V1ReplicationControllerCondition.discriminator = undefined; V1ReplicationControllerCondition.attributeTypeMap = [ { "name": "lastTransitionTime", "baseName": "lastTransitionTime", "type": "Date" }, { "name": "message", "baseName": "message", "type": "string" }, { "name": "reason", "baseName": "reason", "type": "string" }, { "name": "status", "baseName": "status", "type": "string" }, { "name": "type", "baseName": "type", "type": "string" } ]; exports.V1ReplicationControllerCondition = V1ReplicationControllerCondition; /** * ReplicationControllerList is a collection of replication controllers. */ class V1ReplicationControllerList { static getAttributeTypeMap() { return V1ReplicationControllerList.attributeTypeMap; } } V1ReplicationControllerList.discriminator = undefined; V1ReplicationControllerList.attributeTypeMap = [ { "name": "apiVersion", "baseName": "apiVersion", "type": "string" }, { "name": "items", "baseName": "items", "type": "Array" }, { "name": "kind", "baseName": "kind", "type": "string" }, { "name": "metadata", "baseName": "metadata", "type": "V1ListMeta" } ]; exports.V1ReplicationControllerList = V1ReplicationControllerList; /** * ReplicationControllerSpec is the specification of a replication controller. */ class V1ReplicationControllerSpec { static getAttributeTypeMap() { return V1ReplicationControllerSpec.attributeTypeMap; } } V1ReplicationControllerSpec.discriminator = undefined; V1ReplicationControllerSpec.attributeTypeMap = [ { "name": "minReadySeconds", "baseName": "minReadySeconds", "type": "number" }, { "name": "replicas", "baseName": "replicas", "type": "number" }, { "name": "selector", "baseName": "selector", "type": "{ [key: string]: string; }" }, { "name": "template", "baseName": "template", "type": "V1PodTemplateSpec" } ]; exports.V1ReplicationControllerSpec = V1ReplicationControllerSpec; /** * ReplicationControllerStatus represents the current status of a replication controller. */ class V1ReplicationControllerStatus { static getAttributeTypeMap() { return V1ReplicationControllerStatus.attributeTypeMap; } } V1ReplicationControllerStatus.discriminator = undefined; V1ReplicationControllerStatus.attributeTypeMap = [ { "name": "availableReplicas", "baseName": "availableReplicas", "type": "number" }, { "name": "conditions", "baseName": "conditions", "type": "Array" }, { "name": "fullyLabeledReplicas", "baseName": "fullyLabeledReplicas", "type": "number" }, { "name": "observedGeneration", "baseName": "observedGeneration", "type": "number" }, { "name": "readyReplicas", "baseName": "readyReplicas", "type": "number" }, { "name": "replicas", "baseName": "replicas", "type": "number" } ]; exports.V1ReplicationControllerStatus = V1ReplicationControllerStatus; /** * ResourceAttributes includes the authorization attributes available for resource requests to the Authorizer interface */ class V1ResourceAttributes { static getAttributeTypeMap() { return V1ResourceAttributes.attributeTypeMap; } } V1ResourceAttributes.discriminator = undefined; V1ResourceAttributes.attributeTypeMap = [ { "name": "group", "baseName": "group", "type": "string" }, { "name": "name", "baseName": "name", "type": "string" }, { "name": "namespace", "baseName": "namespace", "type": "string" }, { "name": "resource", "baseName": "resource", "type": "string" }, { "name": "subresource", "baseName": "subresource", "type": "string" }, { "name": "verb", "baseName": "verb", "type": "string" }, { "name": "version", "baseName": "version", "type": "string" } ]; exports.V1ResourceAttributes = V1ResourceAttributes; /** * ResourceFieldSelector represents container resources (cpu, memory) and their output format */ class V1ResourceFieldSelector { static getAttributeTypeMap() { return V1ResourceFieldSelector.attributeTypeMap; } } V1ResourceFieldSelector.discriminator = undefined; V1ResourceFieldSelector.attributeTypeMap = [ { "name": "containerName", "baseName": "containerName", "type": "string" }, { "name": "divisor", "baseName": "divisor", "type": "string" }, { "name": "resource", "baseName": "resource", "type": "string" } ]; exports.V1ResourceFieldSelector = V1ResourceFieldSelector; /** * ResourceQuota sets aggregate quota restrictions enforced per namespace */ class V1ResourceQuota { static getAttributeTypeMap() { return V1ResourceQuota.attributeTypeMap; } } V1ResourceQuota.discriminator = undefined; V1ResourceQuota.attributeTypeMap = [ { "name": "apiVersion", "baseName": "apiVersion", "type": "string" }, { "name": "kind", "baseName": "kind", "type": "string" }, { "name": "metadata", "baseName": "metadata", "type": "V1ObjectMeta" }, { "name": "spec", "baseName": "spec", "type": "V1ResourceQuotaSpec" }, { "name": "status", "baseName": "status", "type": "V1ResourceQuotaStatus" } ]; exports.V1ResourceQuota = V1ResourceQuota; /** * ResourceQuotaList is a list of ResourceQuota items. */ class V1ResourceQuotaList { static getAttributeTypeMap() { return V1ResourceQuotaList.attributeTypeMap; } } V1ResourceQuotaList.discriminator = undefined; V1ResourceQuotaList.attributeTypeMap = [ { "name": "apiVersion", "baseName": "apiVersion", "type": "string" }, { "name": "items", "baseName": "items", "type": "Array" }, { "name": "kind", "baseName": "kind", "type": "string" }, { "name": "metadata", "baseName": "metadata", "type": "V1ListMeta" } ]; exports.V1ResourceQuotaList = V1ResourceQuotaList; /** * ResourceQuotaSpec defines the desired hard limits to enforce for Quota. */ class V1ResourceQuotaSpec { static getAttributeTypeMap() { return V1ResourceQuotaSpec.attributeTypeMap; } } V1ResourceQuotaSpec.discriminator = undefined; V1ResourceQuotaSpec.attributeTypeMap = [ { "name": "hard", "baseName": "hard", "type": "{ [key: string]: string; }" }, { "name": "scopeSelector", "baseName": "scopeSelector", "type": "V1ScopeSelector" }, { "name": "scopes", "baseName": "scopes", "type": "Array" } ]; exports.V1ResourceQuotaSpec = V1ResourceQuotaSpec; /** * ResourceQuotaStatus defines the enforced hard limits and observed use. */ class V1ResourceQuotaStatus { static getAttributeTypeMap() { return V1ResourceQuotaStatus.attributeTypeMap; } } V1ResourceQuotaStatus.discriminator = undefined; V1ResourceQuotaStatus.attributeTypeMap = [ { "name": "hard", "baseName": "hard", "type": "{ [key: string]: string; }" }, { "name": "used", "baseName": "used", "type": "{ [key: string]: string; }" } ]; exports.V1ResourceQuotaStatus = V1ResourceQuotaStatus; /** * ResourceRequirements describes the compute resource requirements. */ class V1ResourceRequirements { static getAttributeTypeMap() { return V1ResourceRequirements.attributeTypeMap; } } V1ResourceRequirements.discriminator = undefined; V1ResourceRequirements.attributeTypeMap = [ { "name": "limits", "baseName": "limits", "type": "{ [key: string]: string; }" }, { "name": "requests", "baseName": "requests", "type": "{ [key: string]: string; }" } ]; exports.V1ResourceRequirements = V1ResourceRequirements; /** * 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. */ class V1ResourceRule { static getAttributeTypeMap() { return V1ResourceRule.attributeTypeMap; } } V1ResourceRule.discriminator = undefined; V1ResourceRule.attributeTypeMap = [ { "name": "apiGroups", "baseName": "apiGroups", "type": "Array" }, { "name": "resourceNames", "baseName": "resourceNames", "type": "Array" }, { "name": "resources", "baseName": "resources", "type": "Array" }, { "name": "verbs", "baseName": "verbs", "type": "Array" } ]; exports.V1ResourceRule = V1ResourceRule; /** * Role is a namespaced, logical grouping of PolicyRules that can be referenced as a unit by a RoleBinding. */ class V1Role { static getAttributeTypeMap() { return V1Role.attributeTypeMap; } } V1Role.discriminator = undefined; V1Role.attributeTypeMap = [ { "name": "apiVersion", "baseName": "apiVersion", "type": "string" }, { "name": "kind", "baseName": "kind", "type": "string" }, { "name": "metadata", "baseName": "metadata", "type": "V1ObjectMeta" }, { "name": "rules", "baseName": "rules", "type": "Array" } ]; exports.V1Role = V1Role; /** * 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. */ class V1RoleBinding { static getAttributeTypeMap() { return V1RoleBinding.attributeTypeMap; } } V1RoleBinding.discriminator = undefined; V1RoleBinding.attributeTypeMap = [ { "name": "apiVersion", "baseName": "apiVersion", "type": "string" }, { "name": "kind", "baseName": "kind", "type": "string" }, { "name": "metadata", "baseName": "metadata", "type": "V1ObjectMeta" }, { "name": "roleRef", "baseName": "roleRef", "type": "V1RoleRef" }, { "name": "subjects", "baseName": "subjects", "type": "Array" } ]; exports.V1RoleBinding = V1RoleBinding; /** * RoleBindingList is a collection of RoleBindings */ class V1RoleBindingList { static getAttributeTypeMap() { return V1RoleBindingList.attributeTypeMap; } } V1RoleBindingList.discriminator = undefined; V1RoleBindingList.attributeTypeMap = [ { "name": "apiVersion", "baseName": "apiVersion", "type": "string" }, { "name": "items", "baseName": "items", "type": "Array" }, { "name": "kind", "baseName": "kind", "type": "string" }, { "name": "metadata", "baseName": "metadata", "type": "V1ListMeta" } ]; exports.V1RoleBindingList = V1RoleBindingList; /** * RoleList is a collection of Roles */ class V1RoleList { static getAttributeTypeMap() { return V1RoleList.attributeTypeMap; } } V1RoleList.discriminator = undefined; V1RoleList.attributeTypeMap = [ { "name": "apiVersion", "baseName": "apiVersion", "type": "string" }, { "name": "items", "baseName": "items", "type": "Array" }, { "name": "kind", "baseName": "kind", "type": "string" }, { "name": "metadata", "baseName": "metadata", "type": "V1ListMeta" } ]; exports.V1RoleList = V1RoleList; /** * RoleRef contains information that points to the role being used */ class V1RoleRef { static getAttributeTypeMap() { return V1RoleRef.attributeTypeMap; } } V1RoleRef.discriminator = undefined; V1RoleRef.attributeTypeMap = [ { "name": "apiGroup", "baseName": "apiGroup", "type": "string" }, { "name": "kind", "baseName": "kind", "type": "string" }, { "name": "name", "baseName": "name", "type": "string" } ]; exports.V1RoleRef = V1RoleRef; /** * Spec to control the desired behavior of daemon set rolling update. */ class V1RollingUpdateDaemonSet { static getAttributeTypeMap() { return V1RollingUpdateDaemonSet.attributeTypeMap; } } V1RollingUpdateDaemonSet.discriminator = undefined; V1RollingUpdateDaemonSet.attributeTypeMap = [ { "name": "maxUnavailable", "baseName": "maxUnavailable", "type": "any" } ]; exports.V1RollingUpdateDaemonSet = V1RollingUpdateDaemonSet; /** * Spec to control the desired behavior of rolling update. */ class V1RollingUpdateDeployment { static getAttributeTypeMap() { return V1RollingUpdateDeployment.attributeTypeMap; } } V1RollingUpdateDeployment.discriminator = undefined; V1RollingUpdateDeployment.attributeTypeMap = [ { "name": "maxSurge", "baseName": "maxSurge", "type": "any" }, { "name": "maxUnavailable", "baseName": "maxUnavailable", "type": "any" } ]; exports.V1RollingUpdateDeployment = V1RollingUpdateDeployment; /** * RollingUpdateStatefulSetStrategy is used to communicate parameter for RollingUpdateStatefulSetStrategyType. */ class V1RollingUpdateStatefulSetStrategy { static getAttributeTypeMap() { return V1RollingUpdateStatefulSetStrategy.attributeTypeMap; } } V1RollingUpdateStatefulSetStrategy.discriminator = undefined; V1RollingUpdateStatefulSetStrategy.attributeTypeMap = [ { "name": "partition", "baseName": "partition", "type": "number" } ]; exports.V1RollingUpdateStatefulSetStrategy = V1RollingUpdateStatefulSetStrategy; /** * SELinuxOptions are the labels to be applied to the container */ class V1SELinuxOptions { static getAttributeTypeMap() { return V1SELinuxOptions.attributeTypeMap; } } V1SELinuxOptions.discriminator = undefined; V1SELinuxOptions.attributeTypeMap = [ { "name": "level", "baseName": "level", "type": "string" }, { "name": "role", "baseName": "role", "type": "string" }, { "name": "type", "baseName": "type", "type": "string" }, { "name": "user", "baseName": "user", "type": "string" } ]; exports.V1SELinuxOptions = V1SELinuxOptions; /** * Scale represents a scaling request for a resource. */ class V1Scale { static getAttributeTypeMap() { return V1Scale.attributeTypeMap; } } V1Scale.discriminator = undefined; V1Scale.attributeTypeMap = [ { "name": "apiVersion", "baseName": "apiVersion", "type": "string" }, { "name": "kind", "baseName": "kind", "type": "string" }, { "name": "metadata", "baseName": "metadata", "type": "V1ObjectMeta" }, { "name": "spec", "baseName": "spec", "type": "V1ScaleSpec" }, { "name": "status", "baseName": "status", "type": "V1ScaleStatus" } ]; exports.V1Scale = V1Scale; /** * ScaleIOPersistentVolumeSource represents a persistent ScaleIO volume */ class V1ScaleIOPersistentVolumeSource { static getAttributeTypeMap() { return V1ScaleIOPersistentVolumeSource.attributeTypeMap; } } V1ScaleIOPersistentVolumeSource.discriminator = undefined; V1ScaleIOPersistentVolumeSource.attributeTypeMap = [ { "name": "fsType", "baseName": "fsType", "type": "string" }, { "name": "gateway", "baseName": "gateway", "type": "string" }, { "name": "protectionDomain", "baseName": "protectionDomain", "type": "string" }, { "name": "readOnly", "baseName": "readOnly", "type": "boolean" }, { "name": "secretRef", "baseName": "secretRef", "type": "V1SecretReference" }, { "name": "sslEnabled", "baseName": "sslEnabled", "type": "boolean" }, { "name": "storageMode", "baseName": "storageMode", "type": "string" }, { "name": "storagePool", "baseName": "storagePool", "type": "string" }, { "name": "system", "baseName": "system", "type": "string" }, { "name": "volumeName", "baseName": "volumeName", "type": "string" } ]; exports.V1ScaleIOPersistentVolumeSource = V1ScaleIOPersistentVolumeSource; /** * ScaleIOVolumeSource represents a persistent ScaleIO volume */ class V1ScaleIOVolumeSource { static getAttributeTypeMap() { return V1ScaleIOVolumeSource.attributeTypeMap; } } V1ScaleIOVolumeSource.discriminator = undefined; V1ScaleIOVolumeSource.attributeTypeMap = [ { "name": "fsType", "baseName": "fsType", "type": "string" }, { "name": "gateway", "baseName": "gateway", "type": "string" }, { "name": "protectionDomain", "baseName": "protectionDomain", "type": "string" }, { "name": "readOnly", "baseName": "readOnly", "type": "boolean" }, { "name": "secretRef", "baseName": "secretRef", "type": "V1LocalObjectReference" }, { "name": "sslEnabled", "baseName": "sslEnabled", "type": "boolean" }, { "name": "storageMode", "baseName": "storageMode", "type": "string" }, { "name": "storagePool", "baseName": "storagePool", "type": "string" }, { "name": "system", "baseName": "system", "type": "string" }, { "name": "volumeName", "baseName": "volumeName", "type": "string" } ]; exports.V1ScaleIOVolumeSource = V1ScaleIOVolumeSource; /** * ScaleSpec describes the attributes of a scale subresource. */ class V1ScaleSpec { static getAttributeTypeMap() { return V1ScaleSpec.attributeTypeMap; } } V1ScaleSpec.discriminator = undefined; V1ScaleSpec.attributeTypeMap = [ { "name": "replicas", "baseName": "replicas", "type": "number" } ]; exports.V1ScaleSpec = V1ScaleSpec; /** * ScaleStatus represents the current status of a scale subresource. */ class V1ScaleStatus { static getAttributeTypeMap() { return V1ScaleStatus.attributeTypeMap; } } V1ScaleStatus.discriminator = undefined; V1ScaleStatus.attributeTypeMap = [ { "name": "replicas", "baseName": "replicas", "type": "number" }, { "name": "selector", "baseName": "selector", "type": "string" } ]; exports.V1ScaleStatus = V1ScaleStatus; /** * A scope selector represents the AND of the selectors represented by the scoped-resource selector requirements. */ class V1ScopeSelector { static getAttributeTypeMap() { return V1ScopeSelector.attributeTypeMap; } } V1ScopeSelector.discriminator = undefined; V1ScopeSelector.attributeTypeMap = [ { "name": "matchExpressions", "baseName": "matchExpressions", "type": "Array" } ]; exports.V1ScopeSelector = V1ScopeSelector; /** * A scoped-resource selector requirement is a selector that contains values, a scope name, and an operator that relates the scope name and values. */ class V1ScopedResourceSelectorRequirement { static getAttributeTypeMap() { return V1ScopedResourceSelectorRequirement.attributeTypeMap; } } V1ScopedResourceSelectorRequirement.discriminator = undefined; V1ScopedResourceSelectorRequirement.attributeTypeMap = [ { "name": "operator", "baseName": "operator", "type": "string" }, { "name": "scopeName", "baseName": "scopeName", "type": "string" }, { "name": "values", "baseName": "values", "type": "Array" } ]; exports.V1ScopedResourceSelectorRequirement = V1ScopedResourceSelectorRequirement; /** * Secret holds secret data of a certain type. The total bytes of the values in the Data field must be less than MaxSecretSize bytes. */ class V1Secret { static getAttributeTypeMap() { return V1Secret.attributeTypeMap; } } V1Secret.discriminator = undefined; V1Secret.attributeTypeMap = [ { "name": "apiVersion", "baseName": "apiVersion", "type": "string" }, { "name": "data", "baseName": "data", "type": "{ [key: string]: string; }" }, { "name": "kind", "baseName": "kind", "type": "string" }, { "name": "metadata", "baseName": "metadata", "type": "V1ObjectMeta" }, { "name": "stringData", "baseName": "stringData", "type": "{ [key: string]: string; }" }, { "name": "type", "baseName": "type", "type": "string" } ]; exports.V1Secret = V1Secret; /** * 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. */ class V1SecretEnvSource { static getAttributeTypeMap() { return V1SecretEnvSource.attributeTypeMap; } } V1SecretEnvSource.discriminator = undefined; V1SecretEnvSource.attributeTypeMap = [ { "name": "name", "baseName": "name", "type": "string" }, { "name": "optional", "baseName": "optional", "type": "boolean" } ]; exports.V1SecretEnvSource = V1SecretEnvSource; /** * SecretKeySelector selects a key of a Secret. */ class V1SecretKeySelector { static getAttributeTypeMap() { return V1SecretKeySelector.attributeTypeMap; } } V1SecretKeySelector.discriminator = undefined; V1SecretKeySelector.attributeTypeMap = [ { "name": "key", "baseName": "key", "type": "string" }, { "name": "name", "baseName": "name", "type": "string" }, { "name": "optional", "baseName": "optional", "type": "boolean" } ]; exports.V1SecretKeySelector = V1SecretKeySelector; /** * SecretList is a list of Secret. */ class V1SecretList { static getAttributeTypeMap() { return V1SecretList.attributeTypeMap; } } V1SecretList.discriminator = undefined; V1SecretList.attributeTypeMap = [ { "name": "apiVersion", "baseName": "apiVersion", "type": "string" }, { "name": "items", "baseName": "items", "type": "Array" }, { "name": "kind", "baseName": "kind", "type": "string" }, { "name": "metadata", "baseName": "metadata", "type": "V1ListMeta" } ]; exports.V1SecretList = V1SecretList; /** * 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. */ class V1SecretProjection { static getAttributeTypeMap() { return V1SecretProjection.attributeTypeMap; } } V1SecretProjection.discriminator = undefined; V1SecretProjection.attributeTypeMap = [ { "name": "items", "baseName": "items", "type": "Array" }, { "name": "name", "baseName": "name", "type": "string" }, { "name": "optional", "baseName": "optional", "type": "boolean" } ]; exports.V1SecretProjection = V1SecretProjection; /** * SecretReference represents a Secret Reference. It has enough information to retrieve secret in any namespace */ class V1SecretReference { static getAttributeTypeMap() { return V1SecretReference.attributeTypeMap; } } V1SecretReference.discriminator = undefined; V1SecretReference.attributeTypeMap = [ { "name": "name", "baseName": "name", "type": "string" }, { "name": "namespace", "baseName": "namespace", "type": "string" } ]; exports.V1SecretReference = V1SecretReference; /** * 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. */ class V1SecretVolumeSource { static getAttributeTypeMap() { return V1SecretVolumeSource.attributeTypeMap; } } V1SecretVolumeSource.discriminator = undefined; V1SecretVolumeSource.attributeTypeMap = [ { "name": "defaultMode", "baseName": "defaultMode", "type": "number" }, { "name": "items", "baseName": "items", "type": "Array" }, { "name": "optional", "baseName": "optional", "type": "boolean" }, { "name": "secretName", "baseName": "secretName", "type": "string" } ]; exports.V1SecretVolumeSource = V1SecretVolumeSource; /** * 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. */ class V1SecurityContext { static getAttributeTypeMap() { return V1SecurityContext.attributeTypeMap; } } V1SecurityContext.discriminator = undefined; V1SecurityContext.attributeTypeMap = [ { "name": "allowPrivilegeEscalation", "baseName": "allowPrivilegeEscalation", "type": "boolean" }, { "name": "capabilities", "baseName": "capabilities", "type": "V1Capabilities" }, { "name": "privileged", "baseName": "privileged", "type": "boolean" }, { "name": "procMount", "baseName": "procMount", "type": "string" }, { "name": "readOnlyRootFilesystem", "baseName": "readOnlyRootFilesystem", "type": "boolean" }, { "name": "runAsGroup", "baseName": "runAsGroup", "type": "number" }, { "name": "runAsNonRoot", "baseName": "runAsNonRoot", "type": "boolean" }, { "name": "runAsUser", "baseName": "runAsUser", "type": "number" }, { "name": "seLinuxOptions", "baseName": "seLinuxOptions", "type": "V1SELinuxOptions" } ]; exports.V1SecurityContext = V1SecurityContext; /** * 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 */ class V1SelfSubjectAccessReview { static getAttributeTypeMap() { return V1SelfSubjectAccessReview.attributeTypeMap; } } V1SelfSubjectAccessReview.discriminator = undefined; V1SelfSubjectAccessReview.attributeTypeMap = [ { "name": "apiVersion", "baseName": "apiVersion", "type": "string" }, { "name": "kind", "baseName": "kind", "type": "string" }, { "name": "metadata", "baseName": "metadata", "type": "V1ObjectMeta" }, { "name": "spec", "baseName": "spec", "type": "V1SelfSubjectAccessReviewSpec" }, { "name": "status", "baseName": "status", "type": "V1SubjectAccessReviewStatus" } ]; exports.V1SelfSubjectAccessReview = V1SelfSubjectAccessReview; /** * SelfSubjectAccessReviewSpec is a description of the access request. Exactly one of ResourceAuthorizationAttributes and NonResourceAuthorizationAttributes must be set */ class V1SelfSubjectAccessReviewSpec { static getAttributeTypeMap() { return V1SelfSubjectAccessReviewSpec.attributeTypeMap; } } V1SelfSubjectAccessReviewSpec.discriminator = undefined; V1SelfSubjectAccessReviewSpec.attributeTypeMap = [ { "name": "nonResourceAttributes", "baseName": "nonResourceAttributes", "type": "V1NonResourceAttributes" }, { "name": "resourceAttributes", "baseName": "resourceAttributes", "type": "V1ResourceAttributes" } ]; exports.V1SelfSubjectAccessReviewSpec = V1SelfSubjectAccessReviewSpec; /** * 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. */ class V1SelfSubjectRulesReview { static getAttributeTypeMap() { return V1SelfSubjectRulesReview.attributeTypeMap; } } V1SelfSubjectRulesReview.discriminator = undefined; V1SelfSubjectRulesReview.attributeTypeMap = [ { "name": "apiVersion", "baseName": "apiVersion", "type": "string" }, { "name": "kind", "baseName": "kind", "type": "string" }, { "name": "metadata", "baseName": "metadata", "type": "V1ObjectMeta" }, { "name": "spec", "baseName": "spec", "type": "V1SelfSubjectRulesReviewSpec" }, { "name": "status", "baseName": "status", "type": "V1SubjectRulesReviewStatus" } ]; exports.V1SelfSubjectRulesReview = V1SelfSubjectRulesReview; class V1SelfSubjectRulesReviewSpec { static getAttributeTypeMap() { return V1SelfSubjectRulesReviewSpec.attributeTypeMap; } } V1SelfSubjectRulesReviewSpec.discriminator = undefined; V1SelfSubjectRulesReviewSpec.attributeTypeMap = [ { "name": "namespace", "baseName": "namespace", "type": "string" } ]; exports.V1SelfSubjectRulesReviewSpec = V1SelfSubjectRulesReviewSpec; /** * ServerAddressByClientCIDR helps the client to determine the server address that they should use, depending on the clientCIDR that they match. */ class V1ServerAddressByClientCIDR { static getAttributeTypeMap() { return V1ServerAddressByClientCIDR.attributeTypeMap; } } V1ServerAddressByClientCIDR.discriminator = undefined; V1ServerAddressByClientCIDR.attributeTypeMap = [ { "name": "clientCIDR", "baseName": "clientCIDR", "type": "string" }, { "name": "serverAddress", "baseName": "serverAddress", "type": "string" } ]; exports.V1ServerAddressByClientCIDR = V1ServerAddressByClientCIDR; /** * 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. */ class V1Service { static getAttributeTypeMap() { return V1Service.attributeTypeMap; } } V1Service.discriminator = undefined; V1Service.attributeTypeMap = [ { "name": "apiVersion", "baseName": "apiVersion", "type": "string" }, { "name": "kind", "baseName": "kind", "type": "string" }, { "name": "metadata", "baseName": "metadata", "type": "V1ObjectMeta" }, { "name": "spec", "baseName": "spec", "type": "V1ServiceSpec" }, { "name": "status", "baseName": "status", "type": "V1ServiceStatus" } ]; exports.V1Service = V1Service; /** * 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 */ class V1ServiceAccount { static getAttributeTypeMap() { return V1ServiceAccount.attributeTypeMap; } } V1ServiceAccount.discriminator = undefined; V1ServiceAccount.attributeTypeMap = [ { "name": "apiVersion", "baseName": "apiVersion", "type": "string" }, { "name": "automountServiceAccountToken", "baseName": "automountServiceAccountToken", "type": "boolean" }, { "name": "imagePullSecrets", "baseName": "imagePullSecrets", "type": "Array" }, { "name": "kind", "baseName": "kind", "type": "string" }, { "name": "metadata", "baseName": "metadata", "type": "V1ObjectMeta" }, { "name": "secrets", "baseName": "secrets", "type": "Array" } ]; exports.V1ServiceAccount = V1ServiceAccount; /** * ServiceAccountList is a list of ServiceAccount objects */ class V1ServiceAccountList { static getAttributeTypeMap() { return V1ServiceAccountList.attributeTypeMap; } } V1ServiceAccountList.discriminator = undefined; V1ServiceAccountList.attributeTypeMap = [ { "name": "apiVersion", "baseName": "apiVersion", "type": "string" }, { "name": "items", "baseName": "items", "type": "Array" }, { "name": "kind", "baseName": "kind", "type": "string" }, { "name": "metadata", "baseName": "metadata", "type": "V1ListMeta" } ]; exports.V1ServiceAccountList = V1ServiceAccountList; /** * 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). */ class V1ServiceAccountTokenProjection { static getAttributeTypeMap() { return V1ServiceAccountTokenProjection.attributeTypeMap; } } V1ServiceAccountTokenProjection.discriminator = undefined; V1ServiceAccountTokenProjection.attributeTypeMap = [ { "name": "audience", "baseName": "audience", "type": "string" }, { "name": "expirationSeconds", "baseName": "expirationSeconds", "type": "number" }, { "name": "path", "baseName": "path", "type": "string" } ]; exports.V1ServiceAccountTokenProjection = V1ServiceAccountTokenProjection; /** * ServiceList holds a list of services. */ class V1ServiceList { static getAttributeTypeMap() { return V1ServiceList.attributeTypeMap; } } V1ServiceList.discriminator = undefined; V1ServiceList.attributeTypeMap = [ { "name": "apiVersion", "baseName": "apiVersion", "type": "string" }, { "name": "items", "baseName": "items", "type": "Array" }, { "name": "kind", "baseName": "kind", "type": "string" }, { "name": "metadata", "baseName": "metadata", "type": "V1ListMeta" } ]; exports.V1ServiceList = V1ServiceList; /** * ServicePort contains information on service's port. */ class V1ServicePort { static getAttributeTypeMap() { return V1ServicePort.attributeTypeMap; } } V1ServicePort.discriminator = undefined; V1ServicePort.attributeTypeMap = [ { "name": "name", "baseName": "name", "type": "string" }, { "name": "nodePort", "baseName": "nodePort", "type": "number" }, { "name": "port", "baseName": "port", "type": "number" }, { "name": "protocol", "baseName": "protocol", "type": "string" }, { "name": "targetPort", "baseName": "targetPort", "type": "any" } ]; exports.V1ServicePort = V1ServicePort; /** * ServiceReference holds a reference to Service.legacy.k8s.io */ class V1ServiceReference { static getAttributeTypeMap() { return V1ServiceReference.attributeTypeMap; } } V1ServiceReference.discriminator = undefined; V1ServiceReference.attributeTypeMap = [ { "name": "name", "baseName": "name", "type": "string" }, { "name": "namespace", "baseName": "namespace", "type": "string" } ]; exports.V1ServiceReference = V1ServiceReference; /** * ServiceSpec describes the attributes that a user creates on a service. */ class V1ServiceSpec { static getAttributeTypeMap() { return V1ServiceSpec.attributeTypeMap; } } V1ServiceSpec.discriminator = undefined; V1ServiceSpec.attributeTypeMap = [ { "name": "clusterIP", "baseName": "clusterIP", "type": "string" }, { "name": "externalIPs", "baseName": "externalIPs", "type": "Array" }, { "name": "externalName", "baseName": "externalName", "type": "string" }, { "name": "externalTrafficPolicy", "baseName": "externalTrafficPolicy", "type": "string" }, { "name": "healthCheckNodePort", "baseName": "healthCheckNodePort", "type": "number" }, { "name": "loadBalancerIP", "baseName": "loadBalancerIP", "type": "string" }, { "name": "loadBalancerSourceRanges", "baseName": "loadBalancerSourceRanges", "type": "Array" }, { "name": "ports", "baseName": "ports", "type": "Array" }, { "name": "publishNotReadyAddresses", "baseName": "publishNotReadyAddresses", "type": "boolean" }, { "name": "selector", "baseName": "selector", "type": "{ [key: string]: string; }" }, { "name": "sessionAffinity", "baseName": "sessionAffinity", "type": "string" }, { "name": "sessionAffinityConfig", "baseName": "sessionAffinityConfig", "type": "V1SessionAffinityConfig" }, { "name": "type", "baseName": "type", "type": "string" } ]; exports.V1ServiceSpec = V1ServiceSpec; /** * ServiceStatus represents the current status of a service. */ class V1ServiceStatus { static getAttributeTypeMap() { return V1ServiceStatus.attributeTypeMap; } } V1ServiceStatus.discriminator = undefined; V1ServiceStatus.attributeTypeMap = [ { "name": "loadBalancer", "baseName": "loadBalancer", "type": "V1LoadBalancerStatus" } ]; exports.V1ServiceStatus = V1ServiceStatus; /** * SessionAffinityConfig represents the configurations of session affinity. */ class V1SessionAffinityConfig { static getAttributeTypeMap() { return V1SessionAffinityConfig.attributeTypeMap; } } V1SessionAffinityConfig.discriminator = undefined; V1SessionAffinityConfig.attributeTypeMap = [ { "name": "clientIP", "baseName": "clientIP", "type": "V1ClientIPConfig" } ]; exports.V1SessionAffinityConfig = V1SessionAffinityConfig; /** * 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. */ class V1StatefulSet { static getAttributeTypeMap() { return V1StatefulSet.attributeTypeMap; } } V1StatefulSet.discriminator = undefined; V1StatefulSet.attributeTypeMap = [ { "name": "apiVersion", "baseName": "apiVersion", "type": "string" }, { "name": "kind", "baseName": "kind", "type": "string" }, { "name": "metadata", "baseName": "metadata", "type": "V1ObjectMeta" }, { "name": "spec", "baseName": "spec", "type": "V1StatefulSetSpec" }, { "name": "status", "baseName": "status", "type": "V1StatefulSetStatus" } ]; exports.V1StatefulSet = V1StatefulSet; /** * StatefulSetCondition describes the state of a statefulset at a certain point. */ class V1StatefulSetCondition { static getAttributeTypeMap() { return V1StatefulSetCondition.attributeTypeMap; } } V1StatefulSetCondition.discriminator = undefined; V1StatefulSetCondition.attributeTypeMap = [ { "name": "lastTransitionTime", "baseName": "lastTransitionTime", "type": "Date" }, { "name": "message", "baseName": "message", "type": "string" }, { "name": "reason", "baseName": "reason", "type": "string" }, { "name": "status", "baseName": "status", "type": "string" }, { "name": "type", "baseName": "type", "type": "string" } ]; exports.V1StatefulSetCondition = V1StatefulSetCondition; /** * StatefulSetList is a collection of StatefulSets. */ class V1StatefulSetList { static getAttributeTypeMap() { return V1StatefulSetList.attributeTypeMap; } } V1StatefulSetList.discriminator = undefined; V1StatefulSetList.attributeTypeMap = [ { "name": "apiVersion", "baseName": "apiVersion", "type": "string" }, { "name": "items", "baseName": "items", "type": "Array" }, { "name": "kind", "baseName": "kind", "type": "string" }, { "name": "metadata", "baseName": "metadata", "type": "V1ListMeta" } ]; exports.V1StatefulSetList = V1StatefulSetList; /** * A StatefulSetSpec is the specification of a StatefulSet. */ class V1StatefulSetSpec { static getAttributeTypeMap() { return V1StatefulSetSpec.attributeTypeMap; } } V1StatefulSetSpec.discriminator = undefined; V1StatefulSetSpec.attributeTypeMap = [ { "name": "podManagementPolicy", "baseName": "podManagementPolicy", "type": "string" }, { "name": "replicas", "baseName": "replicas", "type": "number" }, { "name": "revisionHistoryLimit", "baseName": "revisionHistoryLimit", "type": "number" }, { "name": "selector", "baseName": "selector", "type": "V1LabelSelector" }, { "name": "serviceName", "baseName": "serviceName", "type": "string" }, { "name": "template", "baseName": "template", "type": "V1PodTemplateSpec" }, { "name": "updateStrategy", "baseName": "updateStrategy", "type": "V1StatefulSetUpdateStrategy" }, { "name": "volumeClaimTemplates", "baseName": "volumeClaimTemplates", "type": "Array" } ]; exports.V1StatefulSetSpec = V1StatefulSetSpec; /** * StatefulSetStatus represents the current state of a StatefulSet. */ class V1StatefulSetStatus { static getAttributeTypeMap() { return V1StatefulSetStatus.attributeTypeMap; } } V1StatefulSetStatus.discriminator = undefined; V1StatefulSetStatus.attributeTypeMap = [ { "name": "collisionCount", "baseName": "collisionCount", "type": "number" }, { "name": "conditions", "baseName": "conditions", "type": "Array" }, { "name": "currentReplicas", "baseName": "currentReplicas", "type": "number" }, { "name": "currentRevision", "baseName": "currentRevision", "type": "string" }, { "name": "observedGeneration", "baseName": "observedGeneration", "type": "number" }, { "name": "readyReplicas", "baseName": "readyReplicas", "type": "number" }, { "name": "replicas", "baseName": "replicas", "type": "number" }, { "name": "updateRevision", "baseName": "updateRevision", "type": "string" }, { "name": "updatedReplicas", "baseName": "updatedReplicas", "type": "number" } ]; exports.V1StatefulSetStatus = V1StatefulSetStatus; /** * 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. */ class V1StatefulSetUpdateStrategy { static getAttributeTypeMap() { return V1StatefulSetUpdateStrategy.attributeTypeMap; } } V1StatefulSetUpdateStrategy.discriminator = undefined; V1StatefulSetUpdateStrategy.attributeTypeMap = [ { "name": "rollingUpdate", "baseName": "rollingUpdate", "type": "V1RollingUpdateStatefulSetStrategy" }, { "name": "type", "baseName": "type", "type": "string" } ]; exports.V1StatefulSetUpdateStrategy = V1StatefulSetUpdateStrategy; /** * Status is a return value for calls that don't return other objects. */ class V1Status { static getAttributeTypeMap() { return V1Status.attributeTypeMap; } } V1Status.discriminator = undefined; V1Status.attributeTypeMap = [ { "name": "apiVersion", "baseName": "apiVersion", "type": "string" }, { "name": "code", "baseName": "code", "type": "number" }, { "name": "details", "baseName": "details", "type": "V1StatusDetails" }, { "name": "kind", "baseName": "kind", "type": "string" }, { "name": "message", "baseName": "message", "type": "string" }, { "name": "metadata", "baseName": "metadata", "type": "V1ListMeta" }, { "name": "reason", "baseName": "reason", "type": "string" }, { "name": "status", "baseName": "status", "type": "string" } ]; exports.V1Status = V1Status; /** * StatusCause provides more information about an api.Status failure, including cases when multiple errors are encountered. */ class V1StatusCause { static getAttributeTypeMap() { return V1StatusCause.attributeTypeMap; } } V1StatusCause.discriminator = undefined; V1StatusCause.attributeTypeMap = [ { "name": "field", "baseName": "field", "type": "string" }, { "name": "message", "baseName": "message", "type": "string" }, { "name": "reason", "baseName": "reason", "type": "string" } ]; exports.V1StatusCause = V1StatusCause; /** * 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. */ class V1StatusDetails { static getAttributeTypeMap() { return V1StatusDetails.attributeTypeMap; } } V1StatusDetails.discriminator = undefined; V1StatusDetails.attributeTypeMap = [ { "name": "causes", "baseName": "causes", "type": "Array" }, { "name": "group", "baseName": "group", "type": "string" }, { "name": "kind", "baseName": "kind", "type": "string" }, { "name": "name", "baseName": "name", "type": "string" }, { "name": "retryAfterSeconds", "baseName": "retryAfterSeconds", "type": "number" }, { "name": "uid", "baseName": "uid", "type": "string" } ]; exports.V1StatusDetails = V1StatusDetails; /** * 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. */ class V1StorageClass { static getAttributeTypeMap() { return V1StorageClass.attributeTypeMap; } } V1StorageClass.discriminator = undefined; V1StorageClass.attributeTypeMap = [ { "name": "allowVolumeExpansion", "baseName": "allowVolumeExpansion", "type": "boolean" }, { "name": "allowedTopologies", "baseName": "allowedTopologies", "type": "Array" }, { "name": "apiVersion", "baseName": "apiVersion", "type": "string" }, { "name": "kind", "baseName": "kind", "type": "string" }, { "name": "metadata", "baseName": "metadata", "type": "V1ObjectMeta" }, { "name": "mountOptions", "baseName": "mountOptions", "type": "Array" }, { "name": "parameters", "baseName": "parameters", "type": "{ [key: string]: string; }" }, { "name": "provisioner", "baseName": "provisioner", "type": "string" }, { "name": "reclaimPolicy", "baseName": "reclaimPolicy", "type": "string" }, { "name": "volumeBindingMode", "baseName": "volumeBindingMode", "type": "string" } ]; exports.V1StorageClass = V1StorageClass; /** * StorageClassList is a collection of storage classes. */ class V1StorageClassList { static getAttributeTypeMap() { return V1StorageClassList.attributeTypeMap; } } V1StorageClassList.discriminator = undefined; V1StorageClassList.attributeTypeMap = [ { "name": "apiVersion", "baseName": "apiVersion", "type": "string" }, { "name": "items", "baseName": "items", "type": "Array" }, { "name": "kind", "baseName": "kind", "type": "string" }, { "name": "metadata", "baseName": "metadata", "type": "V1ListMeta" } ]; exports.V1StorageClassList = V1StorageClassList; /** * Represents a StorageOS persistent volume resource. */ class V1StorageOSPersistentVolumeSource { static getAttributeTypeMap() { return V1StorageOSPersistentVolumeSource.attributeTypeMap; } } V1StorageOSPersistentVolumeSource.discriminator = undefined; V1StorageOSPersistentVolumeSource.attributeTypeMap = [ { "name": "fsType", "baseName": "fsType", "type": "string" }, { "name": "readOnly", "baseName": "readOnly", "type": "boolean" }, { "name": "secretRef", "baseName": "secretRef", "type": "V1ObjectReference" }, { "name": "volumeName", "baseName": "volumeName", "type": "string" }, { "name": "volumeNamespace", "baseName": "volumeNamespace", "type": "string" } ]; exports.V1StorageOSPersistentVolumeSource = V1StorageOSPersistentVolumeSource; /** * Represents a StorageOS persistent volume resource. */ class V1StorageOSVolumeSource { static getAttributeTypeMap() { return V1StorageOSVolumeSource.attributeTypeMap; } } V1StorageOSVolumeSource.discriminator = undefined; V1StorageOSVolumeSource.attributeTypeMap = [ { "name": "fsType", "baseName": "fsType", "type": "string" }, { "name": "readOnly", "baseName": "readOnly", "type": "boolean" }, { "name": "secretRef", "baseName": "secretRef", "type": "V1LocalObjectReference" }, { "name": "volumeName", "baseName": "volumeName", "type": "string" }, { "name": "volumeNamespace", "baseName": "volumeNamespace", "type": "string" } ]; exports.V1StorageOSVolumeSource = V1StorageOSVolumeSource; /** * 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. */ class V1Subject { static getAttributeTypeMap() { return V1Subject.attributeTypeMap; } } V1Subject.discriminator = undefined; V1Subject.attributeTypeMap = [ { "name": "apiGroup", "baseName": "apiGroup", "type": "string" }, { "name": "kind", "baseName": "kind", "type": "string" }, { "name": "name", "baseName": "name", "type": "string" }, { "name": "namespace", "baseName": "namespace", "type": "string" } ]; exports.V1Subject = V1Subject; /** * SubjectAccessReview checks whether or not a user or group can perform an action. */ class V1SubjectAccessReview { static getAttributeTypeMap() { return V1SubjectAccessReview.attributeTypeMap; } } V1SubjectAccessReview.discriminator = undefined; V1SubjectAccessReview.attributeTypeMap = [ { "name": "apiVersion", "baseName": "apiVersion", "type": "string" }, { "name": "kind", "baseName": "kind", "type": "string" }, { "name": "metadata", "baseName": "metadata", "type": "V1ObjectMeta" }, { "name": "spec", "baseName": "spec", "type": "V1SubjectAccessReviewSpec" }, { "name": "status", "baseName": "status", "type": "V1SubjectAccessReviewStatus" } ]; exports.V1SubjectAccessReview = V1SubjectAccessReview; /** * SubjectAccessReviewSpec is a description of the access request. Exactly one of ResourceAuthorizationAttributes and NonResourceAuthorizationAttributes must be set */ class V1SubjectAccessReviewSpec { static getAttributeTypeMap() { return V1SubjectAccessReviewSpec.attributeTypeMap; } } V1SubjectAccessReviewSpec.discriminator = undefined; V1SubjectAccessReviewSpec.attributeTypeMap = [ { "name": "extra", "baseName": "extra", "type": "{ [key: string]: Array; }" }, { "name": "groups", "baseName": "groups", "type": "Array" }, { "name": "nonResourceAttributes", "baseName": "nonResourceAttributes", "type": "V1NonResourceAttributes" }, { "name": "resourceAttributes", "baseName": "resourceAttributes", "type": "V1ResourceAttributes" }, { "name": "uid", "baseName": "uid", "type": "string" }, { "name": "user", "baseName": "user", "type": "string" } ]; exports.V1SubjectAccessReviewSpec = V1SubjectAccessReviewSpec; /** * SubjectAccessReviewStatus */ class V1SubjectAccessReviewStatus { static getAttributeTypeMap() { return V1SubjectAccessReviewStatus.attributeTypeMap; } } V1SubjectAccessReviewStatus.discriminator = undefined; V1SubjectAccessReviewStatus.attributeTypeMap = [ { "name": "allowed", "baseName": "allowed", "type": "boolean" }, { "name": "denied", "baseName": "denied", "type": "boolean" }, { "name": "evaluationError", "baseName": "evaluationError", "type": "string" }, { "name": "reason", "baseName": "reason", "type": "string" } ]; exports.V1SubjectAccessReviewStatus = V1SubjectAccessReviewStatus; /** * 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. */ class V1SubjectRulesReviewStatus { static getAttributeTypeMap() { return V1SubjectRulesReviewStatus.attributeTypeMap; } } V1SubjectRulesReviewStatus.discriminator = undefined; V1SubjectRulesReviewStatus.attributeTypeMap = [ { "name": "evaluationError", "baseName": "evaluationError", "type": "string" }, { "name": "incomplete", "baseName": "incomplete", "type": "boolean" }, { "name": "nonResourceRules", "baseName": "nonResourceRules", "type": "Array" }, { "name": "resourceRules", "baseName": "resourceRules", "type": "Array" } ]; exports.V1SubjectRulesReviewStatus = V1SubjectRulesReviewStatus; /** * Sysctl defines a kernel parameter to be set */ class V1Sysctl { static getAttributeTypeMap() { return V1Sysctl.attributeTypeMap; } } V1Sysctl.discriminator = undefined; V1Sysctl.attributeTypeMap = [ { "name": "name", "baseName": "name", "type": "string" }, { "name": "value", "baseName": "value", "type": "string" } ]; exports.V1Sysctl = V1Sysctl; /** * TCPSocketAction describes an action based on opening a socket */ class V1TCPSocketAction { static getAttributeTypeMap() { return V1TCPSocketAction.attributeTypeMap; } } V1TCPSocketAction.discriminator = undefined; V1TCPSocketAction.attributeTypeMap = [ { "name": "host", "baseName": "host", "type": "string" }, { "name": "port", "baseName": "port", "type": "any" } ]; exports.V1TCPSocketAction = V1TCPSocketAction; /** * The node this Taint is attached to has the \"effect\" on any pod that does not tolerate the Taint. */ class V1Taint { static getAttributeTypeMap() { return V1Taint.attributeTypeMap; } } V1Taint.discriminator = undefined; V1Taint.attributeTypeMap = [ { "name": "effect", "baseName": "effect", "type": "string" }, { "name": "key", "baseName": "key", "type": "string" }, { "name": "timeAdded", "baseName": "timeAdded", "type": "Date" }, { "name": "value", "baseName": "value", "type": "string" } ]; exports.V1Taint = V1Taint; /** * 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. */ class V1TokenReview { static getAttributeTypeMap() { return V1TokenReview.attributeTypeMap; } } V1TokenReview.discriminator = undefined; V1TokenReview.attributeTypeMap = [ { "name": "apiVersion", "baseName": "apiVersion", "type": "string" }, { "name": "kind", "baseName": "kind", "type": "string" }, { "name": "metadata", "baseName": "metadata", "type": "V1ObjectMeta" }, { "name": "spec", "baseName": "spec", "type": "V1TokenReviewSpec" }, { "name": "status", "baseName": "status", "type": "V1TokenReviewStatus" } ]; exports.V1TokenReview = V1TokenReview; /** * TokenReviewSpec is a description of the token authentication request. */ class V1TokenReviewSpec { static getAttributeTypeMap() { return V1TokenReviewSpec.attributeTypeMap; } } V1TokenReviewSpec.discriminator = undefined; V1TokenReviewSpec.attributeTypeMap = [ { "name": "audiences", "baseName": "audiences", "type": "Array" }, { "name": "token", "baseName": "token", "type": "string" } ]; exports.V1TokenReviewSpec = V1TokenReviewSpec; /** * TokenReviewStatus is the result of the token authentication request. */ class V1TokenReviewStatus { static getAttributeTypeMap() { return V1TokenReviewStatus.attributeTypeMap; } } V1TokenReviewStatus.discriminator = undefined; V1TokenReviewStatus.attributeTypeMap = [ { "name": "audiences", "baseName": "audiences", "type": "Array" }, { "name": "authenticated", "baseName": "authenticated", "type": "boolean" }, { "name": "error", "baseName": "error", "type": "string" }, { "name": "user", "baseName": "user", "type": "V1UserInfo" } ]; exports.V1TokenReviewStatus = V1TokenReviewStatus; /** * The pod this Toleration is attached to tolerates any taint that matches the triple using the matching operator . */ class V1Toleration { static getAttributeTypeMap() { return V1Toleration.attributeTypeMap; } } V1Toleration.discriminator = undefined; V1Toleration.attributeTypeMap = [ { "name": "effect", "baseName": "effect", "type": "string" }, { "name": "key", "baseName": "key", "type": "string" }, { "name": "operator", "baseName": "operator", "type": "string" }, { "name": "tolerationSeconds", "baseName": "tolerationSeconds", "type": "number" }, { "name": "value", "baseName": "value", "type": "string" } ]; exports.V1Toleration = V1Toleration; /** * A topology selector requirement is a selector that matches given label. This is an alpha feature and may change in the future. */ class V1TopologySelectorLabelRequirement { static getAttributeTypeMap() { return V1TopologySelectorLabelRequirement.attributeTypeMap; } } V1TopologySelectorLabelRequirement.discriminator = undefined; V1TopologySelectorLabelRequirement.attributeTypeMap = [ { "name": "key", "baseName": "key", "type": "string" }, { "name": "values", "baseName": "values", "type": "Array" } ]; exports.V1TopologySelectorLabelRequirement = V1TopologySelectorLabelRequirement; /** * 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. */ class V1TopologySelectorTerm { static getAttributeTypeMap() { return V1TopologySelectorTerm.attributeTypeMap; } } V1TopologySelectorTerm.discriminator = undefined; V1TopologySelectorTerm.attributeTypeMap = [ { "name": "matchLabelExpressions", "baseName": "matchLabelExpressions", "type": "Array" } ]; exports.V1TopologySelectorTerm = V1TopologySelectorTerm; /** * TypedLocalObjectReference contains enough information to let you locate the typed referenced object inside the same namespace. */ class V1TypedLocalObjectReference { static getAttributeTypeMap() { return V1TypedLocalObjectReference.attributeTypeMap; } } V1TypedLocalObjectReference.discriminator = undefined; V1TypedLocalObjectReference.attributeTypeMap = [ { "name": "apiGroup", "baseName": "apiGroup", "type": "string" }, { "name": "kind", "baseName": "kind", "type": "string" }, { "name": "name", "baseName": "name", "type": "string" } ]; exports.V1TypedLocalObjectReference = V1TypedLocalObjectReference; /** * UserInfo holds the information about the user needed to implement the user.Info interface. */ class V1UserInfo { static getAttributeTypeMap() { return V1UserInfo.attributeTypeMap; } } V1UserInfo.discriminator = undefined; V1UserInfo.attributeTypeMap = [ { "name": "extra", "baseName": "extra", "type": "{ [key: string]: Array; }" }, { "name": "groups", "baseName": "groups", "type": "Array" }, { "name": "uid", "baseName": "uid", "type": "string" }, { "name": "username", "baseName": "username", "type": "string" } ]; exports.V1UserInfo = V1UserInfo; /** * Volume represents a named volume in a pod that may be accessed by any container in the pod. */ class V1Volume { static getAttributeTypeMap() { return V1Volume.attributeTypeMap; } } V1Volume.discriminator = undefined; V1Volume.attributeTypeMap = [ { "name": "awsElasticBlockStore", "baseName": "awsElasticBlockStore", "type": "V1AWSElasticBlockStoreVolumeSource" }, { "name": "azureDisk", "baseName": "azureDisk", "type": "V1AzureDiskVolumeSource" }, { "name": "azureFile", "baseName": "azureFile", "type": "V1AzureFileVolumeSource" }, { "name": "cephfs", "baseName": "cephfs", "type": "V1CephFSVolumeSource" }, { "name": "cinder", "baseName": "cinder", "type": "V1CinderVolumeSource" }, { "name": "configMap", "baseName": "configMap", "type": "V1ConfigMapVolumeSource" }, { "name": "downwardAPI", "baseName": "downwardAPI", "type": "V1DownwardAPIVolumeSource" }, { "name": "emptyDir", "baseName": "emptyDir", "type": "V1EmptyDirVolumeSource" }, { "name": "fc", "baseName": "fc", "type": "V1FCVolumeSource" }, { "name": "flexVolume", "baseName": "flexVolume", "type": "V1FlexVolumeSource" }, { "name": "flocker", "baseName": "flocker", "type": "V1FlockerVolumeSource" }, { "name": "gcePersistentDisk", "baseName": "gcePersistentDisk", "type": "V1GCEPersistentDiskVolumeSource" }, { "name": "gitRepo", "baseName": "gitRepo", "type": "V1GitRepoVolumeSource" }, { "name": "glusterfs", "baseName": "glusterfs", "type": "V1GlusterfsVolumeSource" }, { "name": "hostPath", "baseName": "hostPath", "type": "V1HostPathVolumeSource" }, { "name": "iscsi", "baseName": "iscsi", "type": "V1ISCSIVolumeSource" }, { "name": "name", "baseName": "name", "type": "string" }, { "name": "nfs", "baseName": "nfs", "type": "V1NFSVolumeSource" }, { "name": "persistentVolumeClaim", "baseName": "persistentVolumeClaim", "type": "V1PersistentVolumeClaimVolumeSource" }, { "name": "photonPersistentDisk", "baseName": "photonPersistentDisk", "type": "V1PhotonPersistentDiskVolumeSource" }, { "name": "portworxVolume", "baseName": "portworxVolume", "type": "V1PortworxVolumeSource" }, { "name": "projected", "baseName": "projected", "type": "V1ProjectedVolumeSource" }, { "name": "quobyte", "baseName": "quobyte", "type": "V1QuobyteVolumeSource" }, { "name": "rbd", "baseName": "rbd", "type": "V1RBDVolumeSource" }, { "name": "scaleIO", "baseName": "scaleIO", "type": "V1ScaleIOVolumeSource" }, { "name": "secret", "baseName": "secret", "type": "V1SecretVolumeSource" }, { "name": "storageos", "baseName": "storageos", "type": "V1StorageOSVolumeSource" }, { "name": "vsphereVolume", "baseName": "vsphereVolume", "type": "V1VsphereVirtualDiskVolumeSource" } ]; exports.V1Volume = V1Volume; /** * VolumeAttachment captures the intent to attach or detach the specified volume to/from the specified node. VolumeAttachment objects are non-namespaced. */ class V1VolumeAttachment { static getAttributeTypeMap() { return V1VolumeAttachment.attributeTypeMap; } } V1VolumeAttachment.discriminator = undefined; V1VolumeAttachment.attributeTypeMap = [ { "name": "apiVersion", "baseName": "apiVersion", "type": "string" }, { "name": "kind", "baseName": "kind", "type": "string" }, { "name": "metadata", "baseName": "metadata", "type": "V1ObjectMeta" }, { "name": "spec", "baseName": "spec", "type": "V1VolumeAttachmentSpec" }, { "name": "status", "baseName": "status", "type": "V1VolumeAttachmentStatus" } ]; exports.V1VolumeAttachment = V1VolumeAttachment; /** * VolumeAttachmentList is a collection of VolumeAttachment objects. */ class V1VolumeAttachmentList { static getAttributeTypeMap() { return V1VolumeAttachmentList.attributeTypeMap; } } V1VolumeAttachmentList.discriminator = undefined; V1VolumeAttachmentList.attributeTypeMap = [ { "name": "apiVersion", "baseName": "apiVersion", "type": "string" }, { "name": "items", "baseName": "items", "type": "Array" }, { "name": "kind", "baseName": "kind", "type": "string" }, { "name": "metadata", "baseName": "metadata", "type": "V1ListMeta" } ]; exports.V1VolumeAttachmentList = V1VolumeAttachmentList; /** * 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. */ class V1VolumeAttachmentSource { static getAttributeTypeMap() { return V1VolumeAttachmentSource.attributeTypeMap; } } V1VolumeAttachmentSource.discriminator = undefined; V1VolumeAttachmentSource.attributeTypeMap = [ { "name": "persistentVolumeName", "baseName": "persistentVolumeName", "type": "string" } ]; exports.V1VolumeAttachmentSource = V1VolumeAttachmentSource; /** * VolumeAttachmentSpec is the specification of a VolumeAttachment request. */ class V1VolumeAttachmentSpec { static getAttributeTypeMap() { return V1VolumeAttachmentSpec.attributeTypeMap; } } V1VolumeAttachmentSpec.discriminator = undefined; V1VolumeAttachmentSpec.attributeTypeMap = [ { "name": "attacher", "baseName": "attacher", "type": "string" }, { "name": "nodeName", "baseName": "nodeName", "type": "string" }, { "name": "source", "baseName": "source", "type": "V1VolumeAttachmentSource" } ]; exports.V1VolumeAttachmentSpec = V1VolumeAttachmentSpec; /** * VolumeAttachmentStatus is the status of a VolumeAttachment request. */ class V1VolumeAttachmentStatus { static getAttributeTypeMap() { return V1VolumeAttachmentStatus.attributeTypeMap; } } V1VolumeAttachmentStatus.discriminator = undefined; V1VolumeAttachmentStatus.attributeTypeMap = [ { "name": "attachError", "baseName": "attachError", "type": "V1VolumeError" }, { "name": "attached", "baseName": "attached", "type": "boolean" }, { "name": "attachmentMetadata", "baseName": "attachmentMetadata", "type": "{ [key: string]: string; }" }, { "name": "detachError", "baseName": "detachError", "type": "V1VolumeError" } ]; exports.V1VolumeAttachmentStatus = V1VolumeAttachmentStatus; /** * volumeDevice describes a mapping of a raw block device within a container. */ class V1VolumeDevice { static getAttributeTypeMap() { return V1VolumeDevice.attributeTypeMap; } } V1VolumeDevice.discriminator = undefined; V1VolumeDevice.attributeTypeMap = [ { "name": "devicePath", "baseName": "devicePath", "type": "string" }, { "name": "name", "baseName": "name", "type": "string" } ]; exports.V1VolumeDevice = V1VolumeDevice; /** * VolumeError captures an error encountered during a volume operation. */ class V1VolumeError { static getAttributeTypeMap() { return V1VolumeError.attributeTypeMap; } } V1VolumeError.discriminator = undefined; V1VolumeError.attributeTypeMap = [ { "name": "message", "baseName": "message", "type": "string" }, { "name": "time", "baseName": "time", "type": "Date" } ]; exports.V1VolumeError = V1VolumeError; /** * VolumeMount describes a mounting of a Volume within a container. */ class V1VolumeMount { static getAttributeTypeMap() { return V1VolumeMount.attributeTypeMap; } } V1VolumeMount.discriminator = undefined; V1VolumeMount.attributeTypeMap = [ { "name": "mountPath", "baseName": "mountPath", "type": "string" }, { "name": "mountPropagation", "baseName": "mountPropagation", "type": "string" }, { "name": "name", "baseName": "name", "type": "string" }, { "name": "readOnly", "baseName": "readOnly", "type": "boolean" }, { "name": "subPath", "baseName": "subPath", "type": "string" } ]; exports.V1VolumeMount = V1VolumeMount; /** * VolumeNodeAffinity defines constraints that limit what nodes this volume can be accessed from. */ class V1VolumeNodeAffinity { static getAttributeTypeMap() { return V1VolumeNodeAffinity.attributeTypeMap; } } V1VolumeNodeAffinity.discriminator = undefined; V1VolumeNodeAffinity.attributeTypeMap = [ { "name": "required", "baseName": "required", "type": "V1NodeSelector" } ]; exports.V1VolumeNodeAffinity = V1VolumeNodeAffinity; /** * Projection that may be projected along with other supported volume types */ class V1VolumeProjection { static getAttributeTypeMap() { return V1VolumeProjection.attributeTypeMap; } } V1VolumeProjection.discriminator = undefined; V1VolumeProjection.attributeTypeMap = [ { "name": "configMap", "baseName": "configMap", "type": "V1ConfigMapProjection" }, { "name": "downwardAPI", "baseName": "downwardAPI", "type": "V1DownwardAPIProjection" }, { "name": "secret", "baseName": "secret", "type": "V1SecretProjection" }, { "name": "serviceAccountToken", "baseName": "serviceAccountToken", "type": "V1ServiceAccountTokenProjection" } ]; exports.V1VolumeProjection = V1VolumeProjection; /** * Represents a vSphere volume resource. */ class V1VsphereVirtualDiskVolumeSource { static getAttributeTypeMap() { return V1VsphereVirtualDiskVolumeSource.attributeTypeMap; } } V1VsphereVirtualDiskVolumeSource.discriminator = undefined; V1VsphereVirtualDiskVolumeSource.attributeTypeMap = [ { "name": "fsType", "baseName": "fsType", "type": "string" }, { "name": "storagePolicyID", "baseName": "storagePolicyID", "type": "string" }, { "name": "storagePolicyName", "baseName": "storagePolicyName", "type": "string" }, { "name": "volumePath", "baseName": "volumePath", "type": "string" } ]; exports.V1VsphereVirtualDiskVolumeSource = V1VsphereVirtualDiskVolumeSource; /** * Event represents a single event to a watched resource. */ class V1WatchEvent { static getAttributeTypeMap() { return V1WatchEvent.attributeTypeMap; } } V1WatchEvent.discriminator = undefined; V1WatchEvent.attributeTypeMap = [ { "name": "object", "baseName": "object", "type": "RuntimeRawExtension" }, { "name": "type", "baseName": "type", "type": "string" } ]; exports.V1WatchEvent = V1WatchEvent; /** * The weights of all of the matched WeightedPodAffinityTerm fields are added per-node to find the most preferred node(s) */ class V1WeightedPodAffinityTerm { static getAttributeTypeMap() { return V1WeightedPodAffinityTerm.attributeTypeMap; } } V1WeightedPodAffinityTerm.discriminator = undefined; V1WeightedPodAffinityTerm.attributeTypeMap = [ { "name": "podAffinityTerm", "baseName": "podAffinityTerm", "type": "V1PodAffinityTerm" }, { "name": "weight", "baseName": "weight", "type": "number" } ]; exports.V1WeightedPodAffinityTerm = V1WeightedPodAffinityTerm; /** * AggregationRule describes how to locate ClusterRoles to aggregate into the ClusterRole */ class V1alpha1AggregationRule { static getAttributeTypeMap() { return V1alpha1AggregationRule.attributeTypeMap; } } V1alpha1AggregationRule.discriminator = undefined; V1alpha1AggregationRule.attributeTypeMap = [ { "name": "clusterRoleSelectors", "baseName": "clusterRoleSelectors", "type": "Array" } ]; exports.V1alpha1AggregationRule = V1alpha1AggregationRule; /** * AuditSink represents a cluster level audit sink */ class V1alpha1AuditSink { static getAttributeTypeMap() { return V1alpha1AuditSink.attributeTypeMap; } } V1alpha1AuditSink.discriminator = undefined; V1alpha1AuditSink.attributeTypeMap = [ { "name": "apiVersion", "baseName": "apiVersion", "type": "string" }, { "name": "kind", "baseName": "kind", "type": "string" }, { "name": "metadata", "baseName": "metadata", "type": "V1ObjectMeta" }, { "name": "spec", "baseName": "spec", "type": "V1alpha1AuditSinkSpec" } ]; exports.V1alpha1AuditSink = V1alpha1AuditSink; /** * AuditSinkList is a list of AuditSink items. */ class V1alpha1AuditSinkList { static getAttributeTypeMap() { return V1alpha1AuditSinkList.attributeTypeMap; } } V1alpha1AuditSinkList.discriminator = undefined; V1alpha1AuditSinkList.attributeTypeMap = [ { "name": "apiVersion", "baseName": "apiVersion", "type": "string" }, { "name": "items", "baseName": "items", "type": "Array" }, { "name": "kind", "baseName": "kind", "type": "string" }, { "name": "metadata", "baseName": "metadata", "type": "V1ListMeta" } ]; exports.V1alpha1AuditSinkList = V1alpha1AuditSinkList; /** * AuditSinkSpec holds the spec for the audit sink */ class V1alpha1AuditSinkSpec { static getAttributeTypeMap() { return V1alpha1AuditSinkSpec.attributeTypeMap; } } V1alpha1AuditSinkSpec.discriminator = undefined; V1alpha1AuditSinkSpec.attributeTypeMap = [ { "name": "policy", "baseName": "policy", "type": "V1alpha1Policy" }, { "name": "webhook", "baseName": "webhook", "type": "V1alpha1Webhook" } ]; exports.V1alpha1AuditSinkSpec = V1alpha1AuditSinkSpec; /** * ClusterRole is a cluster level, logical grouping of PolicyRules that can be referenced as a unit by a RoleBinding or ClusterRoleBinding. */ class V1alpha1ClusterRole { static getAttributeTypeMap() { return V1alpha1ClusterRole.attributeTypeMap; } } V1alpha1ClusterRole.discriminator = undefined; V1alpha1ClusterRole.attributeTypeMap = [ { "name": "aggregationRule", "baseName": "aggregationRule", "type": "V1alpha1AggregationRule" }, { "name": "apiVersion", "baseName": "apiVersion", "type": "string" }, { "name": "kind", "baseName": "kind", "type": "string" }, { "name": "metadata", "baseName": "metadata", "type": "V1ObjectMeta" }, { "name": "rules", "baseName": "rules", "type": "Array" } ]; exports.V1alpha1ClusterRole = V1alpha1ClusterRole; /** * ClusterRoleBinding references a ClusterRole, but not contain it. It can reference a ClusterRole in the global namespace, and adds who information via Subject. */ class V1alpha1ClusterRoleBinding { static getAttributeTypeMap() { return V1alpha1ClusterRoleBinding.attributeTypeMap; } } V1alpha1ClusterRoleBinding.discriminator = undefined; V1alpha1ClusterRoleBinding.attributeTypeMap = [ { "name": "apiVersion", "baseName": "apiVersion", "type": "string" }, { "name": "kind", "baseName": "kind", "type": "string" }, { "name": "metadata", "baseName": "metadata", "type": "V1ObjectMeta" }, { "name": "roleRef", "baseName": "roleRef", "type": "V1alpha1RoleRef" }, { "name": "subjects", "baseName": "subjects", "type": "Array" } ]; exports.V1alpha1ClusterRoleBinding = V1alpha1ClusterRoleBinding; /** * ClusterRoleBindingList is a collection of ClusterRoleBindings */ class V1alpha1ClusterRoleBindingList { static getAttributeTypeMap() { return V1alpha1ClusterRoleBindingList.attributeTypeMap; } } V1alpha1ClusterRoleBindingList.discriminator = undefined; V1alpha1ClusterRoleBindingList.attributeTypeMap = [ { "name": "apiVersion", "baseName": "apiVersion", "type": "string" }, { "name": "items", "baseName": "items", "type": "Array" }, { "name": "kind", "baseName": "kind", "type": "string" }, { "name": "metadata", "baseName": "metadata", "type": "V1ListMeta" } ]; exports.V1alpha1ClusterRoleBindingList = V1alpha1ClusterRoleBindingList; /** * ClusterRoleList is a collection of ClusterRoles */ class V1alpha1ClusterRoleList { static getAttributeTypeMap() { return V1alpha1ClusterRoleList.attributeTypeMap; } } V1alpha1ClusterRoleList.discriminator = undefined; V1alpha1ClusterRoleList.attributeTypeMap = [ { "name": "apiVersion", "baseName": "apiVersion", "type": "string" }, { "name": "items", "baseName": "items", "type": "Array" }, { "name": "kind", "baseName": "kind", "type": "string" }, { "name": "metadata", "baseName": "metadata", "type": "V1ListMeta" } ]; exports.V1alpha1ClusterRoleList = V1alpha1ClusterRoleList; /** * Initializer describes the name and the failure policy of an initializer, and what resources it applies to. */ class V1alpha1Initializer { static getAttributeTypeMap() { return V1alpha1Initializer.attributeTypeMap; } } V1alpha1Initializer.discriminator = undefined; V1alpha1Initializer.attributeTypeMap = [ { "name": "name", "baseName": "name", "type": "string" }, { "name": "rules", "baseName": "rules", "type": "Array" } ]; exports.V1alpha1Initializer = V1alpha1Initializer; /** * InitializerConfiguration describes the configuration of initializers. */ class V1alpha1InitializerConfiguration { static getAttributeTypeMap() { return V1alpha1InitializerConfiguration.attributeTypeMap; } } V1alpha1InitializerConfiguration.discriminator = undefined; V1alpha1InitializerConfiguration.attributeTypeMap = [ { "name": "apiVersion", "baseName": "apiVersion", "type": "string" }, { "name": "initializers", "baseName": "initializers", "type": "Array" }, { "name": "kind", "baseName": "kind", "type": "string" }, { "name": "metadata", "baseName": "metadata", "type": "V1ObjectMeta" } ]; exports.V1alpha1InitializerConfiguration = V1alpha1InitializerConfiguration; /** * InitializerConfigurationList is a list of InitializerConfiguration. */ class V1alpha1InitializerConfigurationList { static getAttributeTypeMap() { return V1alpha1InitializerConfigurationList.attributeTypeMap; } } V1alpha1InitializerConfigurationList.discriminator = undefined; V1alpha1InitializerConfigurationList.attributeTypeMap = [ { "name": "apiVersion", "baseName": "apiVersion", "type": "string" }, { "name": "items", "baseName": "items", "type": "Array" }, { "name": "kind", "baseName": "kind", "type": "string" }, { "name": "metadata", "baseName": "metadata", "type": "V1ListMeta" } ]; exports.V1alpha1InitializerConfigurationList = V1alpha1InitializerConfigurationList; /** * PodPreset is a policy resource that defines additional runtime requirements for a Pod. */ class V1alpha1PodPreset { static getAttributeTypeMap() { return V1alpha1PodPreset.attributeTypeMap; } } V1alpha1PodPreset.discriminator = undefined; V1alpha1PodPreset.attributeTypeMap = [ { "name": "apiVersion", "baseName": "apiVersion", "type": "string" }, { "name": "kind", "baseName": "kind", "type": "string" }, { "name": "metadata", "baseName": "metadata", "type": "V1ObjectMeta" }, { "name": "spec", "baseName": "spec", "type": "V1alpha1PodPresetSpec" } ]; exports.V1alpha1PodPreset = V1alpha1PodPreset; /** * PodPresetList is a list of PodPreset objects. */ class V1alpha1PodPresetList { static getAttributeTypeMap() { return V1alpha1PodPresetList.attributeTypeMap; } } V1alpha1PodPresetList.discriminator = undefined; V1alpha1PodPresetList.attributeTypeMap = [ { "name": "apiVersion", "baseName": "apiVersion", "type": "string" }, { "name": "items", "baseName": "items", "type": "Array" }, { "name": "kind", "baseName": "kind", "type": "string" }, { "name": "metadata", "baseName": "metadata", "type": "V1ListMeta" } ]; exports.V1alpha1PodPresetList = V1alpha1PodPresetList; /** * PodPresetSpec is a description of a pod preset. */ class V1alpha1PodPresetSpec { static getAttributeTypeMap() { return V1alpha1PodPresetSpec.attributeTypeMap; } } V1alpha1PodPresetSpec.discriminator = undefined; V1alpha1PodPresetSpec.attributeTypeMap = [ { "name": "env", "baseName": "env", "type": "Array" }, { "name": "envFrom", "baseName": "envFrom", "type": "Array" }, { "name": "selector", "baseName": "selector", "type": "V1LabelSelector" }, { "name": "volumeMounts", "baseName": "volumeMounts", "type": "Array" }, { "name": "volumes", "baseName": "volumes", "type": "Array" } ]; exports.V1alpha1PodPresetSpec = V1alpha1PodPresetSpec; /** * Policy defines the configuration of how audit events are logged */ class V1alpha1Policy { static getAttributeTypeMap() { return V1alpha1Policy.attributeTypeMap; } } V1alpha1Policy.discriminator = undefined; V1alpha1Policy.attributeTypeMap = [ { "name": "level", "baseName": "level", "type": "string" }, { "name": "stages", "baseName": "stages", "type": "Array" } ]; exports.V1alpha1Policy = V1alpha1Policy; /** * 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. */ class V1alpha1PolicyRule { static getAttributeTypeMap() { return V1alpha1PolicyRule.attributeTypeMap; } } V1alpha1PolicyRule.discriminator = undefined; V1alpha1PolicyRule.attributeTypeMap = [ { "name": "apiGroups", "baseName": "apiGroups", "type": "Array" }, { "name": "nonResourceURLs", "baseName": "nonResourceURLs", "type": "Array" }, { "name": "resourceNames", "baseName": "resourceNames", "type": "Array" }, { "name": "resources", "baseName": "resources", "type": "Array" }, { "name": "verbs", "baseName": "verbs", "type": "Array" } ]; exports.V1alpha1PolicyRule = V1alpha1PolicyRule; /** * PriorityClass defines mapping from a priority class name to the priority integer value. The value can be any valid integer. */ class V1alpha1PriorityClass { static getAttributeTypeMap() { return V1alpha1PriorityClass.attributeTypeMap; } } V1alpha1PriorityClass.discriminator = undefined; V1alpha1PriorityClass.attributeTypeMap = [ { "name": "apiVersion", "baseName": "apiVersion", "type": "string" }, { "name": "description", "baseName": "description", "type": "string" }, { "name": "globalDefault", "baseName": "globalDefault", "type": "boolean" }, { "name": "kind", "baseName": "kind", "type": "string" }, { "name": "metadata", "baseName": "metadata", "type": "V1ObjectMeta" }, { "name": "value", "baseName": "value", "type": "number" } ]; exports.V1alpha1PriorityClass = V1alpha1PriorityClass; /** * PriorityClassList is a collection of priority classes. */ class V1alpha1PriorityClassList { static getAttributeTypeMap() { return V1alpha1PriorityClassList.attributeTypeMap; } } V1alpha1PriorityClassList.discriminator = undefined; V1alpha1PriorityClassList.attributeTypeMap = [ { "name": "apiVersion", "baseName": "apiVersion", "type": "string" }, { "name": "items", "baseName": "items", "type": "Array" }, { "name": "kind", "baseName": "kind", "type": "string" }, { "name": "metadata", "baseName": "metadata", "type": "V1ListMeta" } ]; exports.V1alpha1PriorityClassList = V1alpha1PriorityClassList; /** * Role is a namespaced, logical grouping of PolicyRules that can be referenced as a unit by a RoleBinding. */ class V1alpha1Role { static getAttributeTypeMap() { return V1alpha1Role.attributeTypeMap; } } V1alpha1Role.discriminator = undefined; V1alpha1Role.attributeTypeMap = [ { "name": "apiVersion", "baseName": "apiVersion", "type": "string" }, { "name": "kind", "baseName": "kind", "type": "string" }, { "name": "metadata", "baseName": "metadata", "type": "V1ObjectMeta" }, { "name": "rules", "baseName": "rules", "type": "Array" } ]; exports.V1alpha1Role = V1alpha1Role; /** * 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. */ class V1alpha1RoleBinding { static getAttributeTypeMap() { return V1alpha1RoleBinding.attributeTypeMap; } } V1alpha1RoleBinding.discriminator = undefined; V1alpha1RoleBinding.attributeTypeMap = [ { "name": "apiVersion", "baseName": "apiVersion", "type": "string" }, { "name": "kind", "baseName": "kind", "type": "string" }, { "name": "metadata", "baseName": "metadata", "type": "V1ObjectMeta" }, { "name": "roleRef", "baseName": "roleRef", "type": "V1alpha1RoleRef" }, { "name": "subjects", "baseName": "subjects", "type": "Array" } ]; exports.V1alpha1RoleBinding = V1alpha1RoleBinding; /** * RoleBindingList is a collection of RoleBindings */ class V1alpha1RoleBindingList { static getAttributeTypeMap() { return V1alpha1RoleBindingList.attributeTypeMap; } } V1alpha1RoleBindingList.discriminator = undefined; V1alpha1RoleBindingList.attributeTypeMap = [ { "name": "apiVersion", "baseName": "apiVersion", "type": "string" }, { "name": "items", "baseName": "items", "type": "Array" }, { "name": "kind", "baseName": "kind", "type": "string" }, { "name": "metadata", "baseName": "metadata", "type": "V1ListMeta" } ]; exports.V1alpha1RoleBindingList = V1alpha1RoleBindingList; /** * RoleList is a collection of Roles */ class V1alpha1RoleList { static getAttributeTypeMap() { return V1alpha1RoleList.attributeTypeMap; } } V1alpha1RoleList.discriminator = undefined; V1alpha1RoleList.attributeTypeMap = [ { "name": "apiVersion", "baseName": "apiVersion", "type": "string" }, { "name": "items", "baseName": "items", "type": "Array" }, { "name": "kind", "baseName": "kind", "type": "string" }, { "name": "metadata", "baseName": "metadata", "type": "V1ListMeta" } ]; exports.V1alpha1RoleList = V1alpha1RoleList; /** * RoleRef contains information that points to the role being used */ class V1alpha1RoleRef { static getAttributeTypeMap() { return V1alpha1RoleRef.attributeTypeMap; } } V1alpha1RoleRef.discriminator = undefined; V1alpha1RoleRef.attributeTypeMap = [ { "name": "apiGroup", "baseName": "apiGroup", "type": "string" }, { "name": "kind", "baseName": "kind", "type": "string" }, { "name": "name", "baseName": "name", "type": "string" } ]; exports.V1alpha1RoleRef = V1alpha1RoleRef; /** * Rule is a tuple of APIGroups, APIVersion, and Resources.It is recommended to make sure that all the tuple expansions are valid. */ class V1alpha1Rule { static getAttributeTypeMap() { return V1alpha1Rule.attributeTypeMap; } } V1alpha1Rule.discriminator = undefined; V1alpha1Rule.attributeTypeMap = [ { "name": "apiGroups", "baseName": "apiGroups", "type": "Array" }, { "name": "apiVersions", "baseName": "apiVersions", "type": "Array" }, { "name": "resources", "baseName": "resources", "type": "Array" } ]; exports.V1alpha1Rule = V1alpha1Rule; /** * ServiceReference holds a reference to Service.legacy.k8s.io */ class V1alpha1ServiceReference { static getAttributeTypeMap() { return V1alpha1ServiceReference.attributeTypeMap; } } V1alpha1ServiceReference.discriminator = undefined; V1alpha1ServiceReference.attributeTypeMap = [ { "name": "name", "baseName": "name", "type": "string" }, { "name": "namespace", "baseName": "namespace", "type": "string" }, { "name": "path", "baseName": "path", "type": "string" } ]; exports.V1alpha1ServiceReference = V1alpha1ServiceReference; /** * 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. */ class V1alpha1Subject { static getAttributeTypeMap() { return V1alpha1Subject.attributeTypeMap; } } V1alpha1Subject.discriminator = undefined; V1alpha1Subject.attributeTypeMap = [ { "name": "apiVersion", "baseName": "apiVersion", "type": "string" }, { "name": "kind", "baseName": "kind", "type": "string" }, { "name": "name", "baseName": "name", "type": "string" }, { "name": "namespace", "baseName": "namespace", "type": "string" } ]; exports.V1alpha1Subject = V1alpha1Subject; /** * VolumeAttachment captures the intent to attach or detach the specified volume to/from the specified node. VolumeAttachment objects are non-namespaced. */ class V1alpha1VolumeAttachment { static getAttributeTypeMap() { return V1alpha1VolumeAttachment.attributeTypeMap; } } V1alpha1VolumeAttachment.discriminator = undefined; V1alpha1VolumeAttachment.attributeTypeMap = [ { "name": "apiVersion", "baseName": "apiVersion", "type": "string" }, { "name": "kind", "baseName": "kind", "type": "string" }, { "name": "metadata", "baseName": "metadata", "type": "V1ObjectMeta" }, { "name": "spec", "baseName": "spec", "type": "V1alpha1VolumeAttachmentSpec" }, { "name": "status", "baseName": "status", "type": "V1alpha1VolumeAttachmentStatus" } ]; exports.V1alpha1VolumeAttachment = V1alpha1VolumeAttachment; /** * VolumeAttachmentList is a collection of VolumeAttachment objects. */ class V1alpha1VolumeAttachmentList { static getAttributeTypeMap() { return V1alpha1VolumeAttachmentList.attributeTypeMap; } } V1alpha1VolumeAttachmentList.discriminator = undefined; V1alpha1VolumeAttachmentList.attributeTypeMap = [ { "name": "apiVersion", "baseName": "apiVersion", "type": "string" }, { "name": "items", "baseName": "items", "type": "Array" }, { "name": "kind", "baseName": "kind", "type": "string" }, { "name": "metadata", "baseName": "metadata", "type": "V1ListMeta" } ]; exports.V1alpha1VolumeAttachmentList = V1alpha1VolumeAttachmentList; /** * 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. */ class V1alpha1VolumeAttachmentSource { static getAttributeTypeMap() { return V1alpha1VolumeAttachmentSource.attributeTypeMap; } } V1alpha1VolumeAttachmentSource.discriminator = undefined; V1alpha1VolumeAttachmentSource.attributeTypeMap = [ { "name": "persistentVolumeName", "baseName": "persistentVolumeName", "type": "string" } ]; exports.V1alpha1VolumeAttachmentSource = V1alpha1VolumeAttachmentSource; /** * VolumeAttachmentSpec is the specification of a VolumeAttachment request. */ class V1alpha1VolumeAttachmentSpec { static getAttributeTypeMap() { return V1alpha1VolumeAttachmentSpec.attributeTypeMap; } } V1alpha1VolumeAttachmentSpec.discriminator = undefined; V1alpha1VolumeAttachmentSpec.attributeTypeMap = [ { "name": "attacher", "baseName": "attacher", "type": "string" }, { "name": "nodeName", "baseName": "nodeName", "type": "string" }, { "name": "source", "baseName": "source", "type": "V1alpha1VolumeAttachmentSource" } ]; exports.V1alpha1VolumeAttachmentSpec = V1alpha1VolumeAttachmentSpec; /** * VolumeAttachmentStatus is the status of a VolumeAttachment request. */ class V1alpha1VolumeAttachmentStatus { static getAttributeTypeMap() { return V1alpha1VolumeAttachmentStatus.attributeTypeMap; } } V1alpha1VolumeAttachmentStatus.discriminator = undefined; V1alpha1VolumeAttachmentStatus.attributeTypeMap = [ { "name": "attachError", "baseName": "attachError", "type": "V1alpha1VolumeError" }, { "name": "attached", "baseName": "attached", "type": "boolean" }, { "name": "attachmentMetadata", "baseName": "attachmentMetadata", "type": "{ [key: string]: string; }" }, { "name": "detachError", "baseName": "detachError", "type": "V1alpha1VolumeError" } ]; exports.V1alpha1VolumeAttachmentStatus = V1alpha1VolumeAttachmentStatus; /** * VolumeError captures an error encountered during a volume operation. */ class V1alpha1VolumeError { static getAttributeTypeMap() { return V1alpha1VolumeError.attributeTypeMap; } } V1alpha1VolumeError.discriminator = undefined; V1alpha1VolumeError.attributeTypeMap = [ { "name": "message", "baseName": "message", "type": "string" }, { "name": "time", "baseName": "time", "type": "Date" } ]; exports.V1alpha1VolumeError = V1alpha1VolumeError; /** * Webhook holds the configuration of the webhook */ class V1alpha1Webhook { static getAttributeTypeMap() { return V1alpha1Webhook.attributeTypeMap; } } V1alpha1Webhook.discriminator = undefined; V1alpha1Webhook.attributeTypeMap = [ { "name": "clientConfig", "baseName": "clientConfig", "type": "V1alpha1WebhookClientConfig" }, { "name": "throttle", "baseName": "throttle", "type": "V1alpha1WebhookThrottleConfig" } ]; exports.V1alpha1Webhook = V1alpha1Webhook; /** * WebhookClientConfig contains the information to make a connection with the webhook */ class V1alpha1WebhookClientConfig { static getAttributeTypeMap() { return V1alpha1WebhookClientConfig.attributeTypeMap; } } V1alpha1WebhookClientConfig.discriminator = undefined; V1alpha1WebhookClientConfig.attributeTypeMap = [ { "name": "caBundle", "baseName": "caBundle", "type": "string" }, { "name": "service", "baseName": "service", "type": "V1alpha1ServiceReference" }, { "name": "url", "baseName": "url", "type": "string" } ]; exports.V1alpha1WebhookClientConfig = V1alpha1WebhookClientConfig; /** * WebhookThrottleConfig holds the configuration for throttling events */ class V1alpha1WebhookThrottleConfig { static getAttributeTypeMap() { return V1alpha1WebhookThrottleConfig.attributeTypeMap; } } V1alpha1WebhookThrottleConfig.discriminator = undefined; V1alpha1WebhookThrottleConfig.attributeTypeMap = [ { "name": "burst", "baseName": "burst", "type": "number" }, { "name": "qps", "baseName": "qps", "type": "number" } ]; exports.V1alpha1WebhookThrottleConfig = V1alpha1WebhookThrottleConfig; /** * APIService represents a server for a particular GroupVersion. Name must be \"version.group\". */ class V1beta1APIService { static getAttributeTypeMap() { return V1beta1APIService.attributeTypeMap; } } V1beta1APIService.discriminator = undefined; V1beta1APIService.attributeTypeMap = [ { "name": "apiVersion", "baseName": "apiVersion", "type": "string" }, { "name": "kind", "baseName": "kind", "type": "string" }, { "name": "metadata", "baseName": "metadata", "type": "V1ObjectMeta" }, { "name": "spec", "baseName": "spec", "type": "V1beta1APIServiceSpec" }, { "name": "status", "baseName": "status", "type": "V1beta1APIServiceStatus" } ]; exports.V1beta1APIService = V1beta1APIService; class V1beta1APIServiceCondition { static getAttributeTypeMap() { return V1beta1APIServiceCondition.attributeTypeMap; } } V1beta1APIServiceCondition.discriminator = undefined; V1beta1APIServiceCondition.attributeTypeMap = [ { "name": "lastTransitionTime", "baseName": "lastTransitionTime", "type": "Date" }, { "name": "message", "baseName": "message", "type": "string" }, { "name": "reason", "baseName": "reason", "type": "string" }, { "name": "status", "baseName": "status", "type": "string" }, { "name": "type", "baseName": "type", "type": "string" } ]; exports.V1beta1APIServiceCondition = V1beta1APIServiceCondition; /** * APIServiceList is a list of APIService objects. */ class V1beta1APIServiceList { static getAttributeTypeMap() { return V1beta1APIServiceList.attributeTypeMap; } } V1beta1APIServiceList.discriminator = undefined; V1beta1APIServiceList.attributeTypeMap = [ { "name": "apiVersion", "baseName": "apiVersion", "type": "string" }, { "name": "items", "baseName": "items", "type": "Array" }, { "name": "kind", "baseName": "kind", "type": "string" }, { "name": "metadata", "baseName": "metadata", "type": "V1ListMeta" } ]; exports.V1beta1APIServiceList = V1beta1APIServiceList; /** * APIServiceSpec contains information for locating and communicating with a server. Only https is supported, though you are able to disable certificate verification. */ class V1beta1APIServiceSpec { static getAttributeTypeMap() { return V1beta1APIServiceSpec.attributeTypeMap; } } V1beta1APIServiceSpec.discriminator = undefined; V1beta1APIServiceSpec.attributeTypeMap = [ { "name": "caBundle", "baseName": "caBundle", "type": "string" }, { "name": "group", "baseName": "group", "type": "string" }, { "name": "groupPriorityMinimum", "baseName": "groupPriorityMinimum", "type": "number" }, { "name": "insecureSkipTLSVerify", "baseName": "insecureSkipTLSVerify", "type": "boolean" }, { "name": "service", "baseName": "service", "type": "ApiregistrationV1beta1ServiceReference" }, { "name": "version", "baseName": "version", "type": "string" }, { "name": "versionPriority", "baseName": "versionPriority", "type": "number" } ]; exports.V1beta1APIServiceSpec = V1beta1APIServiceSpec; /** * APIServiceStatus contains derived information about an API server */ class V1beta1APIServiceStatus { static getAttributeTypeMap() { return V1beta1APIServiceStatus.attributeTypeMap; } } V1beta1APIServiceStatus.discriminator = undefined; V1beta1APIServiceStatus.attributeTypeMap = [ { "name": "conditions", "baseName": "conditions", "type": "Array" } ]; exports.V1beta1APIServiceStatus = V1beta1APIServiceStatus; /** * AggregationRule describes how to locate ClusterRoles to aggregate into the ClusterRole */ class V1beta1AggregationRule { static getAttributeTypeMap() { return V1beta1AggregationRule.attributeTypeMap; } } V1beta1AggregationRule.discriminator = undefined; V1beta1AggregationRule.attributeTypeMap = [ { "name": "clusterRoleSelectors", "baseName": "clusterRoleSelectors", "type": "Array" } ]; exports.V1beta1AggregationRule = V1beta1AggregationRule; /** * Describes a certificate signing request */ class V1beta1CertificateSigningRequest { static getAttributeTypeMap() { return V1beta1CertificateSigningRequest.attributeTypeMap; } } V1beta1CertificateSigningRequest.discriminator = undefined; V1beta1CertificateSigningRequest.attributeTypeMap = [ { "name": "apiVersion", "baseName": "apiVersion", "type": "string" }, { "name": "kind", "baseName": "kind", "type": "string" }, { "name": "metadata", "baseName": "metadata", "type": "V1ObjectMeta" }, { "name": "spec", "baseName": "spec", "type": "V1beta1CertificateSigningRequestSpec" }, { "name": "status", "baseName": "status", "type": "V1beta1CertificateSigningRequestStatus" } ]; exports.V1beta1CertificateSigningRequest = V1beta1CertificateSigningRequest; class V1beta1CertificateSigningRequestCondition { static getAttributeTypeMap() { return V1beta1CertificateSigningRequestCondition.attributeTypeMap; } } V1beta1CertificateSigningRequestCondition.discriminator = undefined; V1beta1CertificateSigningRequestCondition.attributeTypeMap = [ { "name": "lastUpdateTime", "baseName": "lastUpdateTime", "type": "Date" }, { "name": "message", "baseName": "message", "type": "string" }, { "name": "reason", "baseName": "reason", "type": "string" }, { "name": "type", "baseName": "type", "type": "string" } ]; exports.V1beta1CertificateSigningRequestCondition = V1beta1CertificateSigningRequestCondition; class V1beta1CertificateSigningRequestList { static getAttributeTypeMap() { return V1beta1CertificateSigningRequestList.attributeTypeMap; } } V1beta1CertificateSigningRequestList.discriminator = undefined; V1beta1CertificateSigningRequestList.attributeTypeMap = [ { "name": "apiVersion", "baseName": "apiVersion", "type": "string" }, { "name": "items", "baseName": "items", "type": "Array" }, { "name": "kind", "baseName": "kind", "type": "string" }, { "name": "metadata", "baseName": "metadata", "type": "V1ListMeta" } ]; exports.V1beta1CertificateSigningRequestList = V1beta1CertificateSigningRequestList; /** * This information is immutable after the request is created. Only the Request and Usages fields can be set on creation, other fields are derived by Kubernetes and cannot be modified by users. */ class V1beta1CertificateSigningRequestSpec { static getAttributeTypeMap() { return V1beta1CertificateSigningRequestSpec.attributeTypeMap; } } V1beta1CertificateSigningRequestSpec.discriminator = undefined; V1beta1CertificateSigningRequestSpec.attributeTypeMap = [ { "name": "extra", "baseName": "extra", "type": "{ [key: string]: Array; }" }, { "name": "groups", "baseName": "groups", "type": "Array" }, { "name": "request", "baseName": "request", "type": "string" }, { "name": "uid", "baseName": "uid", "type": "string" }, { "name": "usages", "baseName": "usages", "type": "Array" }, { "name": "username", "baseName": "username", "type": "string" } ]; exports.V1beta1CertificateSigningRequestSpec = V1beta1CertificateSigningRequestSpec; class V1beta1CertificateSigningRequestStatus { static getAttributeTypeMap() { return V1beta1CertificateSigningRequestStatus.attributeTypeMap; } } V1beta1CertificateSigningRequestStatus.discriminator = undefined; V1beta1CertificateSigningRequestStatus.attributeTypeMap = [ { "name": "certificate", "baseName": "certificate", "type": "string" }, { "name": "conditions", "baseName": "conditions", "type": "Array" } ]; exports.V1beta1CertificateSigningRequestStatus = V1beta1CertificateSigningRequestStatus; /** * ClusterRole is a cluster level, logical grouping of PolicyRules that can be referenced as a unit by a RoleBinding or ClusterRoleBinding. */ class V1beta1ClusterRole { static getAttributeTypeMap() { return V1beta1ClusterRole.attributeTypeMap; } } V1beta1ClusterRole.discriminator = undefined; V1beta1ClusterRole.attributeTypeMap = [ { "name": "aggregationRule", "baseName": "aggregationRule", "type": "V1beta1AggregationRule" }, { "name": "apiVersion", "baseName": "apiVersion", "type": "string" }, { "name": "kind", "baseName": "kind", "type": "string" }, { "name": "metadata", "baseName": "metadata", "type": "V1ObjectMeta" }, { "name": "rules", "baseName": "rules", "type": "Array" } ]; exports.V1beta1ClusterRole = V1beta1ClusterRole; /** * ClusterRoleBinding references a ClusterRole, but not contain it. It can reference a ClusterRole in the global namespace, and adds who information via Subject. */ class V1beta1ClusterRoleBinding { static getAttributeTypeMap() { return V1beta1ClusterRoleBinding.attributeTypeMap; } } V1beta1ClusterRoleBinding.discriminator = undefined; V1beta1ClusterRoleBinding.attributeTypeMap = [ { "name": "apiVersion", "baseName": "apiVersion", "type": "string" }, { "name": "kind", "baseName": "kind", "type": "string" }, { "name": "metadata", "baseName": "metadata", "type": "V1ObjectMeta" }, { "name": "roleRef", "baseName": "roleRef", "type": "V1beta1RoleRef" }, { "name": "subjects", "baseName": "subjects", "type": "Array" } ]; exports.V1beta1ClusterRoleBinding = V1beta1ClusterRoleBinding; /** * ClusterRoleBindingList is a collection of ClusterRoleBindings */ class V1beta1ClusterRoleBindingList { static getAttributeTypeMap() { return V1beta1ClusterRoleBindingList.attributeTypeMap; } } V1beta1ClusterRoleBindingList.discriminator = undefined; V1beta1ClusterRoleBindingList.attributeTypeMap = [ { "name": "apiVersion", "baseName": "apiVersion", "type": "string" }, { "name": "items", "baseName": "items", "type": "Array" }, { "name": "kind", "baseName": "kind", "type": "string" }, { "name": "metadata", "baseName": "metadata", "type": "V1ListMeta" } ]; exports.V1beta1ClusterRoleBindingList = V1beta1ClusterRoleBindingList; /** * ClusterRoleList is a collection of ClusterRoles */ class V1beta1ClusterRoleList { static getAttributeTypeMap() { return V1beta1ClusterRoleList.attributeTypeMap; } } V1beta1ClusterRoleList.discriminator = undefined; V1beta1ClusterRoleList.attributeTypeMap = [ { "name": "apiVersion", "baseName": "apiVersion", "type": "string" }, { "name": "items", "baseName": "items", "type": "Array" }, { "name": "kind", "baseName": "kind", "type": "string" }, { "name": "metadata", "baseName": "metadata", "type": "V1ListMeta" } ]; exports.V1beta1ClusterRoleList = V1beta1ClusterRoleList; /** * DEPRECATED - This group version of ControllerRevision is deprecated by apps/v1beta2/ControllerRevision. See the release notes for more information. 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. */ class V1beta1ControllerRevision { static getAttributeTypeMap() { return V1beta1ControllerRevision.attributeTypeMap; } } V1beta1ControllerRevision.discriminator = undefined; V1beta1ControllerRevision.attributeTypeMap = [ { "name": "apiVersion", "baseName": "apiVersion", "type": "string" }, { "name": "data", "baseName": "data", "type": "RuntimeRawExtension" }, { "name": "kind", "baseName": "kind", "type": "string" }, { "name": "metadata", "baseName": "metadata", "type": "V1ObjectMeta" }, { "name": "revision", "baseName": "revision", "type": "number" } ]; exports.V1beta1ControllerRevision = V1beta1ControllerRevision; /** * ControllerRevisionList is a resource containing a list of ControllerRevision objects. */ class V1beta1ControllerRevisionList { static getAttributeTypeMap() { return V1beta1ControllerRevisionList.attributeTypeMap; } } V1beta1ControllerRevisionList.discriminator = undefined; V1beta1ControllerRevisionList.attributeTypeMap = [ { "name": "apiVersion", "baseName": "apiVersion", "type": "string" }, { "name": "items", "baseName": "items", "type": "Array" }, { "name": "kind", "baseName": "kind", "type": "string" }, { "name": "metadata", "baseName": "metadata", "type": "V1ListMeta" } ]; exports.V1beta1ControllerRevisionList = V1beta1ControllerRevisionList; /** * CronJob represents the configuration of a single cron job. */ class V1beta1CronJob { static getAttributeTypeMap() { return V1beta1CronJob.attributeTypeMap; } } V1beta1CronJob.discriminator = undefined; V1beta1CronJob.attributeTypeMap = [ { "name": "apiVersion", "baseName": "apiVersion", "type": "string" }, { "name": "kind", "baseName": "kind", "type": "string" }, { "name": "metadata", "baseName": "metadata", "type": "V1ObjectMeta" }, { "name": "spec", "baseName": "spec", "type": "V1beta1CronJobSpec" }, { "name": "status", "baseName": "status", "type": "V1beta1CronJobStatus" } ]; exports.V1beta1CronJob = V1beta1CronJob; /** * CronJobList is a collection of cron jobs. */ class V1beta1CronJobList { static getAttributeTypeMap() { return V1beta1CronJobList.attributeTypeMap; } } V1beta1CronJobList.discriminator = undefined; V1beta1CronJobList.attributeTypeMap = [ { "name": "apiVersion", "baseName": "apiVersion", "type": "string" }, { "name": "items", "baseName": "items", "type": "Array" }, { "name": "kind", "baseName": "kind", "type": "string" }, { "name": "metadata", "baseName": "metadata", "type": "V1ListMeta" } ]; exports.V1beta1CronJobList = V1beta1CronJobList; /** * CronJobSpec describes how the job execution will look like and when it will actually run. */ class V1beta1CronJobSpec { static getAttributeTypeMap() { return V1beta1CronJobSpec.attributeTypeMap; } } V1beta1CronJobSpec.discriminator = undefined; V1beta1CronJobSpec.attributeTypeMap = [ { "name": "concurrencyPolicy", "baseName": "concurrencyPolicy", "type": "string" }, { "name": "failedJobsHistoryLimit", "baseName": "failedJobsHistoryLimit", "type": "number" }, { "name": "jobTemplate", "baseName": "jobTemplate", "type": "V1beta1JobTemplateSpec" }, { "name": "schedule", "baseName": "schedule", "type": "string" }, { "name": "startingDeadlineSeconds", "baseName": "startingDeadlineSeconds", "type": "number" }, { "name": "successfulJobsHistoryLimit", "baseName": "successfulJobsHistoryLimit", "type": "number" }, { "name": "suspend", "baseName": "suspend", "type": "boolean" } ]; exports.V1beta1CronJobSpec = V1beta1CronJobSpec; /** * CronJobStatus represents the current state of a cron job. */ class V1beta1CronJobStatus { static getAttributeTypeMap() { return V1beta1CronJobStatus.attributeTypeMap; } } V1beta1CronJobStatus.discriminator = undefined; V1beta1CronJobStatus.attributeTypeMap = [ { "name": "active", "baseName": "active", "type": "Array" }, { "name": "lastScheduleTime", "baseName": "lastScheduleTime", "type": "Date" } ]; exports.V1beta1CronJobStatus = V1beta1CronJobStatus; /** * CustomResourceColumnDefinition specifies a column for server side printing. */ class V1beta1CustomResourceColumnDefinition { static getAttributeTypeMap() { return V1beta1CustomResourceColumnDefinition.attributeTypeMap; } } V1beta1CustomResourceColumnDefinition.discriminator = undefined; V1beta1CustomResourceColumnDefinition.attributeTypeMap = [ { "name": "jSONPath", "baseName": "JSONPath", "type": "string" }, { "name": "description", "baseName": "description", "type": "string" }, { "name": "format", "baseName": "format", "type": "string" }, { "name": "name", "baseName": "name", "type": "string" }, { "name": "priority", "baseName": "priority", "type": "number" }, { "name": "type", "baseName": "type", "type": "string" } ]; exports.V1beta1CustomResourceColumnDefinition = V1beta1CustomResourceColumnDefinition; /** * CustomResourceConversion describes how to convert different versions of a CR. */ class V1beta1CustomResourceConversion { static getAttributeTypeMap() { return V1beta1CustomResourceConversion.attributeTypeMap; } } V1beta1CustomResourceConversion.discriminator = undefined; V1beta1CustomResourceConversion.attributeTypeMap = [ { "name": "strategy", "baseName": "strategy", "type": "string" }, { "name": "webhookClientConfig", "baseName": "webhookClientConfig", "type": "ApiextensionsV1beta1WebhookClientConfig" } ]; exports.V1beta1CustomResourceConversion = V1beta1CustomResourceConversion; /** * CustomResourceDefinition represents a resource that should be exposed on the API server. Its name MUST be in the format <.spec.name>.<.spec.group>. */ class V1beta1CustomResourceDefinition { static getAttributeTypeMap() { return V1beta1CustomResourceDefinition.attributeTypeMap; } } V1beta1CustomResourceDefinition.discriminator = undefined; V1beta1CustomResourceDefinition.attributeTypeMap = [ { "name": "apiVersion", "baseName": "apiVersion", "type": "string" }, { "name": "kind", "baseName": "kind", "type": "string" }, { "name": "metadata", "baseName": "metadata", "type": "V1ObjectMeta" }, { "name": "spec", "baseName": "spec", "type": "V1beta1CustomResourceDefinitionSpec" }, { "name": "status", "baseName": "status", "type": "V1beta1CustomResourceDefinitionStatus" } ]; exports.V1beta1CustomResourceDefinition = V1beta1CustomResourceDefinition; /** * CustomResourceDefinitionCondition contains details for the current condition of this pod. */ class V1beta1CustomResourceDefinitionCondition { static getAttributeTypeMap() { return V1beta1CustomResourceDefinitionCondition.attributeTypeMap; } } V1beta1CustomResourceDefinitionCondition.discriminator = undefined; V1beta1CustomResourceDefinitionCondition.attributeTypeMap = [ { "name": "lastTransitionTime", "baseName": "lastTransitionTime", "type": "Date" }, { "name": "message", "baseName": "message", "type": "string" }, { "name": "reason", "baseName": "reason", "type": "string" }, { "name": "status", "baseName": "status", "type": "string" }, { "name": "type", "baseName": "type", "type": "string" } ]; exports.V1beta1CustomResourceDefinitionCondition = V1beta1CustomResourceDefinitionCondition; /** * CustomResourceDefinitionList is a list of CustomResourceDefinition objects. */ class V1beta1CustomResourceDefinitionList { static getAttributeTypeMap() { return V1beta1CustomResourceDefinitionList.attributeTypeMap; } } V1beta1CustomResourceDefinitionList.discriminator = undefined; V1beta1CustomResourceDefinitionList.attributeTypeMap = [ { "name": "apiVersion", "baseName": "apiVersion", "type": "string" }, { "name": "items", "baseName": "items", "type": "Array" }, { "name": "kind", "baseName": "kind", "type": "string" }, { "name": "metadata", "baseName": "metadata", "type": "V1ListMeta" } ]; exports.V1beta1CustomResourceDefinitionList = V1beta1CustomResourceDefinitionList; /** * CustomResourceDefinitionNames indicates the names to serve this CustomResourceDefinition */ class V1beta1CustomResourceDefinitionNames { static getAttributeTypeMap() { return V1beta1CustomResourceDefinitionNames.attributeTypeMap; } } V1beta1CustomResourceDefinitionNames.discriminator = undefined; V1beta1CustomResourceDefinitionNames.attributeTypeMap = [ { "name": "categories", "baseName": "categories", "type": "Array" }, { "name": "kind", "baseName": "kind", "type": "string" }, { "name": "listKind", "baseName": "listKind", "type": "string" }, { "name": "plural", "baseName": "plural", "type": "string" }, { "name": "shortNames", "baseName": "shortNames", "type": "Array" }, { "name": "singular", "baseName": "singular", "type": "string" } ]; exports.V1beta1CustomResourceDefinitionNames = V1beta1CustomResourceDefinitionNames; /** * CustomResourceDefinitionSpec describes how a user wants their resource to appear */ class V1beta1CustomResourceDefinitionSpec { static getAttributeTypeMap() { return V1beta1CustomResourceDefinitionSpec.attributeTypeMap; } } V1beta1CustomResourceDefinitionSpec.discriminator = undefined; V1beta1CustomResourceDefinitionSpec.attributeTypeMap = [ { "name": "additionalPrinterColumns", "baseName": "additionalPrinterColumns", "type": "Array" }, { "name": "conversion", "baseName": "conversion", "type": "V1beta1CustomResourceConversion" }, { "name": "group", "baseName": "group", "type": "string" }, { "name": "names", "baseName": "names", "type": "V1beta1CustomResourceDefinitionNames" }, { "name": "scope", "baseName": "scope", "type": "string" }, { "name": "subresources", "baseName": "subresources", "type": "V1beta1CustomResourceSubresources" }, { "name": "validation", "baseName": "validation", "type": "V1beta1CustomResourceValidation" }, { "name": "version", "baseName": "version", "type": "string" }, { "name": "versions", "baseName": "versions", "type": "Array" } ]; exports.V1beta1CustomResourceDefinitionSpec = V1beta1CustomResourceDefinitionSpec; /** * CustomResourceDefinitionStatus indicates the state of the CustomResourceDefinition */ class V1beta1CustomResourceDefinitionStatus { static getAttributeTypeMap() { return V1beta1CustomResourceDefinitionStatus.attributeTypeMap; } } V1beta1CustomResourceDefinitionStatus.discriminator = undefined; V1beta1CustomResourceDefinitionStatus.attributeTypeMap = [ { "name": "acceptedNames", "baseName": "acceptedNames", "type": "V1beta1CustomResourceDefinitionNames" }, { "name": "conditions", "baseName": "conditions", "type": "Array" }, { "name": "storedVersions", "baseName": "storedVersions", "type": "Array" } ]; exports.V1beta1CustomResourceDefinitionStatus = V1beta1CustomResourceDefinitionStatus; /** * CustomResourceDefinitionVersion describes a version for CRD. */ class V1beta1CustomResourceDefinitionVersion { static getAttributeTypeMap() { return V1beta1CustomResourceDefinitionVersion.attributeTypeMap; } } V1beta1CustomResourceDefinitionVersion.discriminator = undefined; V1beta1CustomResourceDefinitionVersion.attributeTypeMap = [ { "name": "additionalPrinterColumns", "baseName": "additionalPrinterColumns", "type": "Array" }, { "name": "name", "baseName": "name", "type": "string" }, { "name": "schema", "baseName": "schema", "type": "V1beta1CustomResourceValidation" }, { "name": "served", "baseName": "served", "type": "boolean" }, { "name": "storage", "baseName": "storage", "type": "boolean" }, { "name": "subresources", "baseName": "subresources", "type": "V1beta1CustomResourceSubresources" } ]; exports.V1beta1CustomResourceDefinitionVersion = V1beta1CustomResourceDefinitionVersion; /** * CustomResourceSubresourceScale defines how to serve the scale subresource for CustomResources. */ class V1beta1CustomResourceSubresourceScale { static getAttributeTypeMap() { return V1beta1CustomResourceSubresourceScale.attributeTypeMap; } } V1beta1CustomResourceSubresourceScale.discriminator = undefined; V1beta1CustomResourceSubresourceScale.attributeTypeMap = [ { "name": "labelSelectorPath", "baseName": "labelSelectorPath", "type": "string" }, { "name": "specReplicasPath", "baseName": "specReplicasPath", "type": "string" }, { "name": "statusReplicasPath", "baseName": "statusReplicasPath", "type": "string" } ]; exports.V1beta1CustomResourceSubresourceScale = V1beta1CustomResourceSubresourceScale; /** * CustomResourceSubresources defines the status and scale subresources for CustomResources. */ class V1beta1CustomResourceSubresources { static getAttributeTypeMap() { return V1beta1CustomResourceSubresources.attributeTypeMap; } } V1beta1CustomResourceSubresources.discriminator = undefined; V1beta1CustomResourceSubresources.attributeTypeMap = [ { "name": "scale", "baseName": "scale", "type": "V1beta1CustomResourceSubresourceScale" }, { "name": "status", "baseName": "status", "type": "any" } ]; exports.V1beta1CustomResourceSubresources = V1beta1CustomResourceSubresources; /** * CustomResourceValidation is a list of validation methods for CustomResources. */ class V1beta1CustomResourceValidation { static getAttributeTypeMap() { return V1beta1CustomResourceValidation.attributeTypeMap; } } V1beta1CustomResourceValidation.discriminator = undefined; V1beta1CustomResourceValidation.attributeTypeMap = [ { "name": "openAPIV3Schema", "baseName": "openAPIV3Schema", "type": "V1beta1JSONSchemaProps" } ]; exports.V1beta1CustomResourceValidation = V1beta1CustomResourceValidation; /** * DEPRECATED - This group version of DaemonSet is deprecated by apps/v1beta2/DaemonSet. See the release notes for more information. DaemonSet represents the configuration of a daemon set. */ class V1beta1DaemonSet { static getAttributeTypeMap() { return V1beta1DaemonSet.attributeTypeMap; } } V1beta1DaemonSet.discriminator = undefined; V1beta1DaemonSet.attributeTypeMap = [ { "name": "apiVersion", "baseName": "apiVersion", "type": "string" }, { "name": "kind", "baseName": "kind", "type": "string" }, { "name": "metadata", "baseName": "metadata", "type": "V1ObjectMeta" }, { "name": "spec", "baseName": "spec", "type": "V1beta1DaemonSetSpec" }, { "name": "status", "baseName": "status", "type": "V1beta1DaemonSetStatus" } ]; exports.V1beta1DaemonSet = V1beta1DaemonSet; /** * DaemonSetCondition describes the state of a DaemonSet at a certain point. */ class V1beta1DaemonSetCondition { static getAttributeTypeMap() { return V1beta1DaemonSetCondition.attributeTypeMap; } } V1beta1DaemonSetCondition.discriminator = undefined; V1beta1DaemonSetCondition.attributeTypeMap = [ { "name": "lastTransitionTime", "baseName": "lastTransitionTime", "type": "Date" }, { "name": "message", "baseName": "message", "type": "string" }, { "name": "reason", "baseName": "reason", "type": "string" }, { "name": "status", "baseName": "status", "type": "string" }, { "name": "type", "baseName": "type", "type": "string" } ]; exports.V1beta1DaemonSetCondition = V1beta1DaemonSetCondition; /** * DaemonSetList is a collection of daemon sets. */ class V1beta1DaemonSetList { static getAttributeTypeMap() { return V1beta1DaemonSetList.attributeTypeMap; } } V1beta1DaemonSetList.discriminator = undefined; V1beta1DaemonSetList.attributeTypeMap = [ { "name": "apiVersion", "baseName": "apiVersion", "type": "string" }, { "name": "items", "baseName": "items", "type": "Array" }, { "name": "kind", "baseName": "kind", "type": "string" }, { "name": "metadata", "baseName": "metadata", "type": "V1ListMeta" } ]; exports.V1beta1DaemonSetList = V1beta1DaemonSetList; /** * DaemonSetSpec is the specification of a daemon set. */ class V1beta1DaemonSetSpec { static getAttributeTypeMap() { return V1beta1DaemonSetSpec.attributeTypeMap; } } V1beta1DaemonSetSpec.discriminator = undefined; V1beta1DaemonSetSpec.attributeTypeMap = [ { "name": "minReadySeconds", "baseName": "minReadySeconds", "type": "number" }, { "name": "revisionHistoryLimit", "baseName": "revisionHistoryLimit", "type": "number" }, { "name": "selector", "baseName": "selector", "type": "V1LabelSelector" }, { "name": "template", "baseName": "template", "type": "V1PodTemplateSpec" }, { "name": "templateGeneration", "baseName": "templateGeneration", "type": "number" }, { "name": "updateStrategy", "baseName": "updateStrategy", "type": "V1beta1DaemonSetUpdateStrategy" } ]; exports.V1beta1DaemonSetSpec = V1beta1DaemonSetSpec; /** * DaemonSetStatus represents the current status of a daemon set. */ class V1beta1DaemonSetStatus { static getAttributeTypeMap() { return V1beta1DaemonSetStatus.attributeTypeMap; } } V1beta1DaemonSetStatus.discriminator = undefined; V1beta1DaemonSetStatus.attributeTypeMap = [ { "name": "collisionCount", "baseName": "collisionCount", "type": "number" }, { "name": "conditions", "baseName": "conditions", "type": "Array" }, { "name": "currentNumberScheduled", "baseName": "currentNumberScheduled", "type": "number" }, { "name": "desiredNumberScheduled", "baseName": "desiredNumberScheduled", "type": "number" }, { "name": "numberAvailable", "baseName": "numberAvailable", "type": "number" }, { "name": "numberMisscheduled", "baseName": "numberMisscheduled", "type": "number" }, { "name": "numberReady", "baseName": "numberReady", "type": "number" }, { "name": "numberUnavailable", "baseName": "numberUnavailable", "type": "number" }, { "name": "observedGeneration", "baseName": "observedGeneration", "type": "number" }, { "name": "updatedNumberScheduled", "baseName": "updatedNumberScheduled", "type": "number" } ]; exports.V1beta1DaemonSetStatus = V1beta1DaemonSetStatus; class V1beta1DaemonSetUpdateStrategy { static getAttributeTypeMap() { return V1beta1DaemonSetUpdateStrategy.attributeTypeMap; } } V1beta1DaemonSetUpdateStrategy.discriminator = undefined; V1beta1DaemonSetUpdateStrategy.attributeTypeMap = [ { "name": "rollingUpdate", "baseName": "rollingUpdate", "type": "V1beta1RollingUpdateDaemonSet" }, { "name": "type", "baseName": "type", "type": "string" } ]; exports.V1beta1DaemonSetUpdateStrategy = V1beta1DaemonSetUpdateStrategy; /** * Event is a report of an event somewhere in the cluster. It generally denotes some state change in the system. */ class V1beta1Event { static getAttributeTypeMap() { return V1beta1Event.attributeTypeMap; } } V1beta1Event.discriminator = undefined; V1beta1Event.attributeTypeMap = [ { "name": "action", "baseName": "action", "type": "string" }, { "name": "apiVersion", "baseName": "apiVersion", "type": "string" }, { "name": "deprecatedCount", "baseName": "deprecatedCount", "type": "number" }, { "name": "deprecatedFirstTimestamp", "baseName": "deprecatedFirstTimestamp", "type": "Date" }, { "name": "deprecatedLastTimestamp", "baseName": "deprecatedLastTimestamp", "type": "Date" }, { "name": "deprecatedSource", "baseName": "deprecatedSource", "type": "V1EventSource" }, { "name": "eventTime", "baseName": "eventTime", "type": "Date" }, { "name": "kind", "baseName": "kind", "type": "string" }, { "name": "metadata", "baseName": "metadata", "type": "V1ObjectMeta" }, { "name": "note", "baseName": "note", "type": "string" }, { "name": "reason", "baseName": "reason", "type": "string" }, { "name": "regarding", "baseName": "regarding", "type": "V1ObjectReference" }, { "name": "related", "baseName": "related", "type": "V1ObjectReference" }, { "name": "reportingController", "baseName": "reportingController", "type": "string" }, { "name": "reportingInstance", "baseName": "reportingInstance", "type": "string" }, { "name": "series", "baseName": "series", "type": "V1beta1EventSeries" }, { "name": "type", "baseName": "type", "type": "string" } ]; exports.V1beta1Event = V1beta1Event; /** * EventList is a list of Event objects. */ class V1beta1EventList { static getAttributeTypeMap() { return V1beta1EventList.attributeTypeMap; } } V1beta1EventList.discriminator = undefined; V1beta1EventList.attributeTypeMap = [ { "name": "apiVersion", "baseName": "apiVersion", "type": "string" }, { "name": "items", "baseName": "items", "type": "Array" }, { "name": "kind", "baseName": "kind", "type": "string" }, { "name": "metadata", "baseName": "metadata", "type": "V1ListMeta" } ]; exports.V1beta1EventList = V1beta1EventList; /** * EventSeries contain information on series of events, i.e. thing that was/is happening continuously for some time. */ class V1beta1EventSeries { static getAttributeTypeMap() { return V1beta1EventSeries.attributeTypeMap; } } V1beta1EventSeries.discriminator = undefined; V1beta1EventSeries.attributeTypeMap = [ { "name": "count", "baseName": "count", "type": "number" }, { "name": "lastObservedTime", "baseName": "lastObservedTime", "type": "Date" }, { "name": "state", "baseName": "state", "type": "string" } ]; exports.V1beta1EventSeries = V1beta1EventSeries; /** * 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. */ class V1beta1Eviction { static getAttributeTypeMap() { return V1beta1Eviction.attributeTypeMap; } } V1beta1Eviction.discriminator = undefined; V1beta1Eviction.attributeTypeMap = [ { "name": "apiVersion", "baseName": "apiVersion", "type": "string" }, { "name": "deleteOptions", "baseName": "deleteOptions", "type": "V1DeleteOptions" }, { "name": "kind", "baseName": "kind", "type": "string" }, { "name": "metadata", "baseName": "metadata", "type": "V1ObjectMeta" } ]; exports.V1beta1Eviction = V1beta1Eviction; /** * ExternalDocumentation allows referencing an external resource for extended documentation. */ class V1beta1ExternalDocumentation { static getAttributeTypeMap() { return V1beta1ExternalDocumentation.attributeTypeMap; } } V1beta1ExternalDocumentation.discriminator = undefined; V1beta1ExternalDocumentation.attributeTypeMap = [ { "name": "description", "baseName": "description", "type": "string" }, { "name": "url", "baseName": "url", "type": "string" } ]; exports.V1beta1ExternalDocumentation = V1beta1ExternalDocumentation; /** * HTTPIngressPath associates a path regex with a backend. Incoming urls matching the path are forwarded to the backend. */ class V1beta1HTTPIngressPath { static getAttributeTypeMap() { return V1beta1HTTPIngressPath.attributeTypeMap; } } V1beta1HTTPIngressPath.discriminator = undefined; V1beta1HTTPIngressPath.attributeTypeMap = [ { "name": "backend", "baseName": "backend", "type": "V1beta1IngressBackend" }, { "name": "path", "baseName": "path", "type": "string" } ]; exports.V1beta1HTTPIngressPath = V1beta1HTTPIngressPath; /** * 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 '#'. */ class V1beta1HTTPIngressRuleValue { static getAttributeTypeMap() { return V1beta1HTTPIngressRuleValue.attributeTypeMap; } } V1beta1HTTPIngressRuleValue.discriminator = undefined; V1beta1HTTPIngressRuleValue.attributeTypeMap = [ { "name": "paths", "baseName": "paths", "type": "Array" } ]; exports.V1beta1HTTPIngressRuleValue = V1beta1HTTPIngressRuleValue; /** * DEPRECATED 1.9 - This group version of IPBlock is deprecated by networking/v1/IPBlock. IPBlock describes a particular CIDR (Ex. \"192.168.1.1/24\") 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. */ class V1beta1IPBlock { static getAttributeTypeMap() { return V1beta1IPBlock.attributeTypeMap; } } V1beta1IPBlock.discriminator = undefined; V1beta1IPBlock.attributeTypeMap = [ { "name": "cidr", "baseName": "cidr", "type": "string" }, { "name": "except", "baseName": "except", "type": "Array" } ]; exports.V1beta1IPBlock = V1beta1IPBlock; /** * 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. */ class V1beta1Ingress { static getAttributeTypeMap() { return V1beta1Ingress.attributeTypeMap; } } V1beta1Ingress.discriminator = undefined; V1beta1Ingress.attributeTypeMap = [ { "name": "apiVersion", "baseName": "apiVersion", "type": "string" }, { "name": "kind", "baseName": "kind", "type": "string" }, { "name": "metadata", "baseName": "metadata", "type": "V1ObjectMeta" }, { "name": "spec", "baseName": "spec", "type": "V1beta1IngressSpec" }, { "name": "status", "baseName": "status", "type": "V1beta1IngressStatus" } ]; exports.V1beta1Ingress = V1beta1Ingress; /** * IngressBackend describes all endpoints for a given service and port. */ class V1beta1IngressBackend { static getAttributeTypeMap() { return V1beta1IngressBackend.attributeTypeMap; } } V1beta1IngressBackend.discriminator = undefined; V1beta1IngressBackend.attributeTypeMap = [ { "name": "serviceName", "baseName": "serviceName", "type": "string" }, { "name": "servicePort", "baseName": "servicePort", "type": "any" } ]; exports.V1beta1IngressBackend = V1beta1IngressBackend; /** * IngressList is a collection of Ingress. */ class V1beta1IngressList { static getAttributeTypeMap() { return V1beta1IngressList.attributeTypeMap; } } V1beta1IngressList.discriminator = undefined; V1beta1IngressList.attributeTypeMap = [ { "name": "apiVersion", "baseName": "apiVersion", "type": "string" }, { "name": "items", "baseName": "items", "type": "Array" }, { "name": "kind", "baseName": "kind", "type": "string" }, { "name": "metadata", "baseName": "metadata", "type": "V1ListMeta" } ]; exports.V1beta1IngressList = V1beta1IngressList; /** * 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. */ class V1beta1IngressRule { static getAttributeTypeMap() { return V1beta1IngressRule.attributeTypeMap; } } V1beta1IngressRule.discriminator = undefined; V1beta1IngressRule.attributeTypeMap = [ { "name": "host", "baseName": "host", "type": "string" }, { "name": "http", "baseName": "http", "type": "V1beta1HTTPIngressRuleValue" } ]; exports.V1beta1IngressRule = V1beta1IngressRule; /** * IngressSpec describes the Ingress the user wishes to exist. */ class V1beta1IngressSpec { static getAttributeTypeMap() { return V1beta1IngressSpec.attributeTypeMap; } } V1beta1IngressSpec.discriminator = undefined; V1beta1IngressSpec.attributeTypeMap = [ { "name": "backend", "baseName": "backend", "type": "V1beta1IngressBackend" }, { "name": "rules", "baseName": "rules", "type": "Array" }, { "name": "tls", "baseName": "tls", "type": "Array" } ]; exports.V1beta1IngressSpec = V1beta1IngressSpec; /** * IngressStatus describe the current state of the Ingress. */ class V1beta1IngressStatus { static getAttributeTypeMap() { return V1beta1IngressStatus.attributeTypeMap; } } V1beta1IngressStatus.discriminator = undefined; V1beta1IngressStatus.attributeTypeMap = [ { "name": "loadBalancer", "baseName": "loadBalancer", "type": "V1LoadBalancerStatus" } ]; exports.V1beta1IngressStatus = V1beta1IngressStatus; /** * IngressTLS describes the transport layer security associated with an Ingress. */ class V1beta1IngressTLS { static getAttributeTypeMap() { return V1beta1IngressTLS.attributeTypeMap; } } V1beta1IngressTLS.discriminator = undefined; V1beta1IngressTLS.attributeTypeMap = [ { "name": "hosts", "baseName": "hosts", "type": "Array" }, { "name": "secretName", "baseName": "secretName", "type": "string" } ]; exports.V1beta1IngressTLS = V1beta1IngressTLS; /** * JSONSchemaProps is a JSON-Schema following Specification Draft 4 (http://json-schema.org/). */ class V1beta1JSONSchemaProps { static getAttributeTypeMap() { return V1beta1JSONSchemaProps.attributeTypeMap; } } V1beta1JSONSchemaProps.discriminator = undefined; V1beta1JSONSchemaProps.attributeTypeMap = [ { "name": "ref", "baseName": "$ref", "type": "string" }, { "name": "schema", "baseName": "$schema", "type": "string" }, { "name": "additionalItems", "baseName": "additionalItems", "type": "any" }, { "name": "additionalProperties", "baseName": "additionalProperties", "type": "any" }, { "name": "allOf", "baseName": "allOf", "type": "Array" }, { "name": "anyOf", "baseName": "anyOf", "type": "Array" }, { "name": "_default", "baseName": "default", "type": "any" }, { "name": "definitions", "baseName": "definitions", "type": "{ [key: string]: V1beta1JSONSchemaProps; }" }, { "name": "dependencies", "baseName": "dependencies", "type": "{ [key: string]: any; }" }, { "name": "description", "baseName": "description", "type": "string" }, { "name": "_enum", "baseName": "enum", "type": "Array" }, { "name": "example", "baseName": "example", "type": "any" }, { "name": "exclusiveMaximum", "baseName": "exclusiveMaximum", "type": "boolean" }, { "name": "exclusiveMinimum", "baseName": "exclusiveMinimum", "type": "boolean" }, { "name": "externalDocs", "baseName": "externalDocs", "type": "V1beta1ExternalDocumentation" }, { "name": "format", "baseName": "format", "type": "string" }, { "name": "id", "baseName": "id", "type": "string" }, { "name": "items", "baseName": "items", "type": "any" }, { "name": "maxItems", "baseName": "maxItems", "type": "number" }, { "name": "maxLength", "baseName": "maxLength", "type": "number" }, { "name": "maxProperties", "baseName": "maxProperties", "type": "number" }, { "name": "maximum", "baseName": "maximum", "type": "number" }, { "name": "minItems", "baseName": "minItems", "type": "number" }, { "name": "minLength", "baseName": "minLength", "type": "number" }, { "name": "minProperties", "baseName": "minProperties", "type": "number" }, { "name": "minimum", "baseName": "minimum", "type": "number" }, { "name": "multipleOf", "baseName": "multipleOf", "type": "number" }, { "name": "not", "baseName": "not", "type": "V1beta1JSONSchemaProps" }, { "name": "oneOf", "baseName": "oneOf", "type": "Array" }, { "name": "pattern", "baseName": "pattern", "type": "string" }, { "name": "patternProperties", "baseName": "patternProperties", "type": "{ [key: string]: V1beta1JSONSchemaProps; }" }, { "name": "properties", "baseName": "properties", "type": "{ [key: string]: V1beta1JSONSchemaProps; }" }, { "name": "required", "baseName": "required", "type": "Array" }, { "name": "title", "baseName": "title", "type": "string" }, { "name": "type", "baseName": "type", "type": "string" }, { "name": "uniqueItems", "baseName": "uniqueItems", "type": "boolean" } ]; exports.V1beta1JSONSchemaProps = V1beta1JSONSchemaProps; /** * JobTemplateSpec describes the data a Job should have when created from a template */ class V1beta1JobTemplateSpec { static getAttributeTypeMap() { return V1beta1JobTemplateSpec.attributeTypeMap; } } V1beta1JobTemplateSpec.discriminator = undefined; V1beta1JobTemplateSpec.attributeTypeMap = [ { "name": "metadata", "baseName": "metadata", "type": "V1ObjectMeta" }, { "name": "spec", "baseName": "spec", "type": "V1JobSpec" } ]; exports.V1beta1JobTemplateSpec = V1beta1JobTemplateSpec; /** * Lease defines a lease concept. */ class V1beta1Lease { static getAttributeTypeMap() { return V1beta1Lease.attributeTypeMap; } } V1beta1Lease.discriminator = undefined; V1beta1Lease.attributeTypeMap = [ { "name": "apiVersion", "baseName": "apiVersion", "type": "string" }, { "name": "kind", "baseName": "kind", "type": "string" }, { "name": "metadata", "baseName": "metadata", "type": "V1ObjectMeta" }, { "name": "spec", "baseName": "spec", "type": "V1beta1LeaseSpec" } ]; exports.V1beta1Lease = V1beta1Lease; /** * LeaseList is a list of Lease objects. */ class V1beta1LeaseList { static getAttributeTypeMap() { return V1beta1LeaseList.attributeTypeMap; } } V1beta1LeaseList.discriminator = undefined; V1beta1LeaseList.attributeTypeMap = [ { "name": "apiVersion", "baseName": "apiVersion", "type": "string" }, { "name": "items", "baseName": "items", "type": "Array" }, { "name": "kind", "baseName": "kind", "type": "string" }, { "name": "metadata", "baseName": "metadata", "type": "V1ListMeta" } ]; exports.V1beta1LeaseList = V1beta1LeaseList; /** * LeaseSpec is a specification of a Lease. */ class V1beta1LeaseSpec { static getAttributeTypeMap() { return V1beta1LeaseSpec.attributeTypeMap; } } V1beta1LeaseSpec.discriminator = undefined; V1beta1LeaseSpec.attributeTypeMap = [ { "name": "acquireTime", "baseName": "acquireTime", "type": "Date" }, { "name": "holderIdentity", "baseName": "holderIdentity", "type": "string" }, { "name": "leaseDurationSeconds", "baseName": "leaseDurationSeconds", "type": "number" }, { "name": "leaseTransitions", "baseName": "leaseTransitions", "type": "number" }, { "name": "renewTime", "baseName": "renewTime", "type": "Date" } ]; exports.V1beta1LeaseSpec = V1beta1LeaseSpec; /** * 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. */ class V1beta1LocalSubjectAccessReview { static getAttributeTypeMap() { return V1beta1LocalSubjectAccessReview.attributeTypeMap; } } V1beta1LocalSubjectAccessReview.discriminator = undefined; V1beta1LocalSubjectAccessReview.attributeTypeMap = [ { "name": "apiVersion", "baseName": "apiVersion", "type": "string" }, { "name": "kind", "baseName": "kind", "type": "string" }, { "name": "metadata", "baseName": "metadata", "type": "V1ObjectMeta" }, { "name": "spec", "baseName": "spec", "type": "V1beta1SubjectAccessReviewSpec" }, { "name": "status", "baseName": "status", "type": "V1beta1SubjectAccessReviewStatus" } ]; exports.V1beta1LocalSubjectAccessReview = V1beta1LocalSubjectAccessReview; /** * MutatingWebhookConfiguration describes the configuration of and admission webhook that accept or reject and may change the object. */ class V1beta1MutatingWebhookConfiguration { static getAttributeTypeMap() { return V1beta1MutatingWebhookConfiguration.attributeTypeMap; } } V1beta1MutatingWebhookConfiguration.discriminator = undefined; V1beta1MutatingWebhookConfiguration.attributeTypeMap = [ { "name": "apiVersion", "baseName": "apiVersion", "type": "string" }, { "name": "kind", "baseName": "kind", "type": "string" }, { "name": "metadata", "baseName": "metadata", "type": "V1ObjectMeta" }, { "name": "webhooks", "baseName": "webhooks", "type": "Array" } ]; exports.V1beta1MutatingWebhookConfiguration = V1beta1MutatingWebhookConfiguration; /** * MutatingWebhookConfigurationList is a list of MutatingWebhookConfiguration. */ class V1beta1MutatingWebhookConfigurationList { static getAttributeTypeMap() { return V1beta1MutatingWebhookConfigurationList.attributeTypeMap; } } V1beta1MutatingWebhookConfigurationList.discriminator = undefined; V1beta1MutatingWebhookConfigurationList.attributeTypeMap = [ { "name": "apiVersion", "baseName": "apiVersion", "type": "string" }, { "name": "items", "baseName": "items", "type": "Array" }, { "name": "kind", "baseName": "kind", "type": "string" }, { "name": "metadata", "baseName": "metadata", "type": "V1ListMeta" } ]; exports.V1beta1MutatingWebhookConfigurationList = V1beta1MutatingWebhookConfigurationList; /** * DEPRECATED 1.9 - This group version of NetworkPolicy is deprecated by networking/v1/NetworkPolicy. NetworkPolicy describes what network traffic is allowed for a set of Pods */ class V1beta1NetworkPolicy { static getAttributeTypeMap() { return V1beta1NetworkPolicy.attributeTypeMap; } } V1beta1NetworkPolicy.discriminator = undefined; V1beta1NetworkPolicy.attributeTypeMap = [ { "name": "apiVersion", "baseName": "apiVersion", "type": "string" }, { "name": "kind", "baseName": "kind", "type": "string" }, { "name": "metadata", "baseName": "metadata", "type": "V1ObjectMeta" }, { "name": "spec", "baseName": "spec", "type": "V1beta1NetworkPolicySpec" } ]; exports.V1beta1NetworkPolicy = V1beta1NetworkPolicy; /** * DEPRECATED 1.9 - This group version of NetworkPolicyEgressRule is deprecated by networking/v1/NetworkPolicyEgressRule. 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 */ class V1beta1NetworkPolicyEgressRule { static getAttributeTypeMap() { return V1beta1NetworkPolicyEgressRule.attributeTypeMap; } } V1beta1NetworkPolicyEgressRule.discriminator = undefined; V1beta1NetworkPolicyEgressRule.attributeTypeMap = [ { "name": "ports", "baseName": "ports", "type": "Array" }, { "name": "to", "baseName": "to", "type": "Array" } ]; exports.V1beta1NetworkPolicyEgressRule = V1beta1NetworkPolicyEgressRule; /** * DEPRECATED 1.9 - This group version of NetworkPolicyIngressRule is deprecated by networking/v1/NetworkPolicyIngressRule. This NetworkPolicyIngressRule matches traffic if and only if the traffic matches both ports AND from. */ class V1beta1NetworkPolicyIngressRule { static getAttributeTypeMap() { return V1beta1NetworkPolicyIngressRule.attributeTypeMap; } } V1beta1NetworkPolicyIngressRule.discriminator = undefined; V1beta1NetworkPolicyIngressRule.attributeTypeMap = [ { "name": "from", "baseName": "from", "type": "Array" }, { "name": "ports", "baseName": "ports", "type": "Array" } ]; exports.V1beta1NetworkPolicyIngressRule = V1beta1NetworkPolicyIngressRule; /** * DEPRECATED 1.9 - This group version of NetworkPolicyList is deprecated by networking/v1/NetworkPolicyList. Network Policy List is a list of NetworkPolicy objects. */ class V1beta1NetworkPolicyList { static getAttributeTypeMap() { return V1beta1NetworkPolicyList.attributeTypeMap; } } V1beta1NetworkPolicyList.discriminator = undefined; V1beta1NetworkPolicyList.attributeTypeMap = [ { "name": "apiVersion", "baseName": "apiVersion", "type": "string" }, { "name": "items", "baseName": "items", "type": "Array" }, { "name": "kind", "baseName": "kind", "type": "string" }, { "name": "metadata", "baseName": "metadata", "type": "V1ListMeta" } ]; exports.V1beta1NetworkPolicyList = V1beta1NetworkPolicyList; /** * DEPRECATED 1.9 - This group version of NetworkPolicyPeer is deprecated by networking/v1/NetworkPolicyPeer. */ class V1beta1NetworkPolicyPeer { static getAttributeTypeMap() { return V1beta1NetworkPolicyPeer.attributeTypeMap; } } V1beta1NetworkPolicyPeer.discriminator = undefined; V1beta1NetworkPolicyPeer.attributeTypeMap = [ { "name": "ipBlock", "baseName": "ipBlock", "type": "V1beta1IPBlock" }, { "name": "namespaceSelector", "baseName": "namespaceSelector", "type": "V1LabelSelector" }, { "name": "podSelector", "baseName": "podSelector", "type": "V1LabelSelector" } ]; exports.V1beta1NetworkPolicyPeer = V1beta1NetworkPolicyPeer; /** * DEPRECATED 1.9 - This group version of NetworkPolicyPort is deprecated by networking/v1/NetworkPolicyPort. */ class V1beta1NetworkPolicyPort { static getAttributeTypeMap() { return V1beta1NetworkPolicyPort.attributeTypeMap; } } V1beta1NetworkPolicyPort.discriminator = undefined; V1beta1NetworkPolicyPort.attributeTypeMap = [ { "name": "port", "baseName": "port", "type": "any" }, { "name": "protocol", "baseName": "protocol", "type": "string" } ]; exports.V1beta1NetworkPolicyPort = V1beta1NetworkPolicyPort; /** * DEPRECATED 1.9 - This group version of NetworkPolicySpec is deprecated by networking/v1/NetworkPolicySpec. */ class V1beta1NetworkPolicySpec { static getAttributeTypeMap() { return V1beta1NetworkPolicySpec.attributeTypeMap; } } V1beta1NetworkPolicySpec.discriminator = undefined; V1beta1NetworkPolicySpec.attributeTypeMap = [ { "name": "egress", "baseName": "egress", "type": "Array" }, { "name": "ingress", "baseName": "ingress", "type": "Array" }, { "name": "podSelector", "baseName": "podSelector", "type": "V1LabelSelector" }, { "name": "policyTypes", "baseName": "policyTypes", "type": "Array" } ]; exports.V1beta1NetworkPolicySpec = V1beta1NetworkPolicySpec; /** * NonResourceAttributes includes the authorization attributes available for non-resource requests to the Authorizer interface */ class V1beta1NonResourceAttributes { static getAttributeTypeMap() { return V1beta1NonResourceAttributes.attributeTypeMap; } } V1beta1NonResourceAttributes.discriminator = undefined; V1beta1NonResourceAttributes.attributeTypeMap = [ { "name": "path", "baseName": "path", "type": "string" }, { "name": "verb", "baseName": "verb", "type": "string" } ]; exports.V1beta1NonResourceAttributes = V1beta1NonResourceAttributes; /** * NonResourceRule holds information that describes a rule for the non-resource */ class V1beta1NonResourceRule { static getAttributeTypeMap() { return V1beta1NonResourceRule.attributeTypeMap; } } V1beta1NonResourceRule.discriminator = undefined; V1beta1NonResourceRule.attributeTypeMap = [ { "name": "nonResourceURLs", "baseName": "nonResourceURLs", "type": "Array" }, { "name": "verbs", "baseName": "verbs", "type": "Array" } ]; exports.V1beta1NonResourceRule = V1beta1NonResourceRule; /** * PodDisruptionBudget is an object to define the max disruption that can be caused to a collection of pods */ class V1beta1PodDisruptionBudget { static getAttributeTypeMap() { return V1beta1PodDisruptionBudget.attributeTypeMap; } } V1beta1PodDisruptionBudget.discriminator = undefined; V1beta1PodDisruptionBudget.attributeTypeMap = [ { "name": "apiVersion", "baseName": "apiVersion", "type": "string" }, { "name": "kind", "baseName": "kind", "type": "string" }, { "name": "metadata", "baseName": "metadata", "type": "V1ObjectMeta" }, { "name": "spec", "baseName": "spec", "type": "V1beta1PodDisruptionBudgetSpec" }, { "name": "status", "baseName": "status", "type": "V1beta1PodDisruptionBudgetStatus" } ]; exports.V1beta1PodDisruptionBudget = V1beta1PodDisruptionBudget; /** * PodDisruptionBudgetList is a collection of PodDisruptionBudgets. */ class V1beta1PodDisruptionBudgetList { static getAttributeTypeMap() { return V1beta1PodDisruptionBudgetList.attributeTypeMap; } } V1beta1PodDisruptionBudgetList.discriminator = undefined; V1beta1PodDisruptionBudgetList.attributeTypeMap = [ { "name": "apiVersion", "baseName": "apiVersion", "type": "string" }, { "name": "items", "baseName": "items", "type": "Array" }, { "name": "kind", "baseName": "kind", "type": "string" }, { "name": "metadata", "baseName": "metadata", "type": "V1ListMeta" } ]; exports.V1beta1PodDisruptionBudgetList = V1beta1PodDisruptionBudgetList; /** * PodDisruptionBudgetSpec is a description of a PodDisruptionBudget. */ class V1beta1PodDisruptionBudgetSpec { static getAttributeTypeMap() { return V1beta1PodDisruptionBudgetSpec.attributeTypeMap; } } V1beta1PodDisruptionBudgetSpec.discriminator = undefined; V1beta1PodDisruptionBudgetSpec.attributeTypeMap = [ { "name": "maxUnavailable", "baseName": "maxUnavailable", "type": "any" }, { "name": "minAvailable", "baseName": "minAvailable", "type": "any" }, { "name": "selector", "baseName": "selector", "type": "V1LabelSelector" } ]; exports.V1beta1PodDisruptionBudgetSpec = V1beta1PodDisruptionBudgetSpec; /** * PodDisruptionBudgetStatus represents information about the status of a PodDisruptionBudget. Status may trail the actual state of a system. */ class V1beta1PodDisruptionBudgetStatus { static getAttributeTypeMap() { return V1beta1PodDisruptionBudgetStatus.attributeTypeMap; } } V1beta1PodDisruptionBudgetStatus.discriminator = undefined; V1beta1PodDisruptionBudgetStatus.attributeTypeMap = [ { "name": "currentHealthy", "baseName": "currentHealthy", "type": "number" }, { "name": "desiredHealthy", "baseName": "desiredHealthy", "type": "number" }, { "name": "disruptedPods", "baseName": "disruptedPods", "type": "{ [key: string]: Date; }" }, { "name": "disruptionsAllowed", "baseName": "disruptionsAllowed", "type": "number" }, { "name": "expectedPods", "baseName": "expectedPods", "type": "number" }, { "name": "observedGeneration", "baseName": "observedGeneration", "type": "number" } ]; exports.V1beta1PodDisruptionBudgetStatus = V1beta1PodDisruptionBudgetStatus; /** * 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. */ class V1beta1PolicyRule { static getAttributeTypeMap() { return V1beta1PolicyRule.attributeTypeMap; } } V1beta1PolicyRule.discriminator = undefined; V1beta1PolicyRule.attributeTypeMap = [ { "name": "apiGroups", "baseName": "apiGroups", "type": "Array" }, { "name": "nonResourceURLs", "baseName": "nonResourceURLs", "type": "Array" }, { "name": "resourceNames", "baseName": "resourceNames", "type": "Array" }, { "name": "resources", "baseName": "resources", "type": "Array" }, { "name": "verbs", "baseName": "verbs", "type": "Array" } ]; exports.V1beta1PolicyRule = V1beta1PolicyRule; /** * PriorityClass defines mapping from a priority class name to the priority integer value. The value can be any valid integer. */ class V1beta1PriorityClass { static getAttributeTypeMap() { return V1beta1PriorityClass.attributeTypeMap; } } V1beta1PriorityClass.discriminator = undefined; V1beta1PriorityClass.attributeTypeMap = [ { "name": "apiVersion", "baseName": "apiVersion", "type": "string" }, { "name": "description", "baseName": "description", "type": "string" }, { "name": "globalDefault", "baseName": "globalDefault", "type": "boolean" }, { "name": "kind", "baseName": "kind", "type": "string" }, { "name": "metadata", "baseName": "metadata", "type": "V1ObjectMeta" }, { "name": "value", "baseName": "value", "type": "number" } ]; exports.V1beta1PriorityClass = V1beta1PriorityClass; /** * PriorityClassList is a collection of priority classes. */ class V1beta1PriorityClassList { static getAttributeTypeMap() { return V1beta1PriorityClassList.attributeTypeMap; } } V1beta1PriorityClassList.discriminator = undefined; V1beta1PriorityClassList.attributeTypeMap = [ { "name": "apiVersion", "baseName": "apiVersion", "type": "string" }, { "name": "items", "baseName": "items", "type": "Array" }, { "name": "kind", "baseName": "kind", "type": "string" }, { "name": "metadata", "baseName": "metadata", "type": "V1ListMeta" } ]; exports.V1beta1PriorityClassList = V1beta1PriorityClassList; /** * DEPRECATED - This group version of ReplicaSet is deprecated by apps/v1beta2/ReplicaSet. See the release notes for more information. ReplicaSet ensures that a specified number of pod replicas are running at any given time. */ class V1beta1ReplicaSet { static getAttributeTypeMap() { return V1beta1ReplicaSet.attributeTypeMap; } } V1beta1ReplicaSet.discriminator = undefined; V1beta1ReplicaSet.attributeTypeMap = [ { "name": "apiVersion", "baseName": "apiVersion", "type": "string" }, { "name": "kind", "baseName": "kind", "type": "string" }, { "name": "metadata", "baseName": "metadata", "type": "V1ObjectMeta" }, { "name": "spec", "baseName": "spec", "type": "V1beta1ReplicaSetSpec" }, { "name": "status", "baseName": "status", "type": "V1beta1ReplicaSetStatus" } ]; exports.V1beta1ReplicaSet = V1beta1ReplicaSet; /** * ReplicaSetCondition describes the state of a replica set at a certain point. */ class V1beta1ReplicaSetCondition { static getAttributeTypeMap() { return V1beta1ReplicaSetCondition.attributeTypeMap; } } V1beta1ReplicaSetCondition.discriminator = undefined; V1beta1ReplicaSetCondition.attributeTypeMap = [ { "name": "lastTransitionTime", "baseName": "lastTransitionTime", "type": "Date" }, { "name": "message", "baseName": "message", "type": "string" }, { "name": "reason", "baseName": "reason", "type": "string" }, { "name": "status", "baseName": "status", "type": "string" }, { "name": "type", "baseName": "type", "type": "string" } ]; exports.V1beta1ReplicaSetCondition = V1beta1ReplicaSetCondition; /** * ReplicaSetList is a collection of ReplicaSets. */ class V1beta1ReplicaSetList { static getAttributeTypeMap() { return V1beta1ReplicaSetList.attributeTypeMap; } } V1beta1ReplicaSetList.discriminator = undefined; V1beta1ReplicaSetList.attributeTypeMap = [ { "name": "apiVersion", "baseName": "apiVersion", "type": "string" }, { "name": "items", "baseName": "items", "type": "Array" }, { "name": "kind", "baseName": "kind", "type": "string" }, { "name": "metadata", "baseName": "metadata", "type": "V1ListMeta" } ]; exports.V1beta1ReplicaSetList = V1beta1ReplicaSetList; /** * ReplicaSetSpec is the specification of a ReplicaSet. */ class V1beta1ReplicaSetSpec { static getAttributeTypeMap() { return V1beta1ReplicaSetSpec.attributeTypeMap; } } V1beta1ReplicaSetSpec.discriminator = undefined; V1beta1ReplicaSetSpec.attributeTypeMap = [ { "name": "minReadySeconds", "baseName": "minReadySeconds", "type": "number" }, { "name": "replicas", "baseName": "replicas", "type": "number" }, { "name": "selector", "baseName": "selector", "type": "V1LabelSelector" }, { "name": "template", "baseName": "template", "type": "V1PodTemplateSpec" } ]; exports.V1beta1ReplicaSetSpec = V1beta1ReplicaSetSpec; /** * ReplicaSetStatus represents the current status of a ReplicaSet. */ class V1beta1ReplicaSetStatus { static getAttributeTypeMap() { return V1beta1ReplicaSetStatus.attributeTypeMap; } } V1beta1ReplicaSetStatus.discriminator = undefined; V1beta1ReplicaSetStatus.attributeTypeMap = [ { "name": "availableReplicas", "baseName": "availableReplicas", "type": "number" }, { "name": "conditions", "baseName": "conditions", "type": "Array" }, { "name": "fullyLabeledReplicas", "baseName": "fullyLabeledReplicas", "type": "number" }, { "name": "observedGeneration", "baseName": "observedGeneration", "type": "number" }, { "name": "readyReplicas", "baseName": "readyReplicas", "type": "number" }, { "name": "replicas", "baseName": "replicas", "type": "number" } ]; exports.V1beta1ReplicaSetStatus = V1beta1ReplicaSetStatus; /** * ResourceAttributes includes the authorization attributes available for resource requests to the Authorizer interface */ class V1beta1ResourceAttributes { static getAttributeTypeMap() { return V1beta1ResourceAttributes.attributeTypeMap; } } V1beta1ResourceAttributes.discriminator = undefined; V1beta1ResourceAttributes.attributeTypeMap = [ { "name": "group", "baseName": "group", "type": "string" }, { "name": "name", "baseName": "name", "type": "string" }, { "name": "namespace", "baseName": "namespace", "type": "string" }, { "name": "resource", "baseName": "resource", "type": "string" }, { "name": "subresource", "baseName": "subresource", "type": "string" }, { "name": "verb", "baseName": "verb", "type": "string" }, { "name": "version", "baseName": "version", "type": "string" } ]; exports.V1beta1ResourceAttributes = V1beta1ResourceAttributes; /** * 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. */ class V1beta1ResourceRule { static getAttributeTypeMap() { return V1beta1ResourceRule.attributeTypeMap; } } V1beta1ResourceRule.discriminator = undefined; V1beta1ResourceRule.attributeTypeMap = [ { "name": "apiGroups", "baseName": "apiGroups", "type": "Array" }, { "name": "resourceNames", "baseName": "resourceNames", "type": "Array" }, { "name": "resources", "baseName": "resources", "type": "Array" }, { "name": "verbs", "baseName": "verbs", "type": "Array" } ]; exports.V1beta1ResourceRule = V1beta1ResourceRule; /** * Role is a namespaced, logical grouping of PolicyRules that can be referenced as a unit by a RoleBinding. */ class V1beta1Role { static getAttributeTypeMap() { return V1beta1Role.attributeTypeMap; } } V1beta1Role.discriminator = undefined; V1beta1Role.attributeTypeMap = [ { "name": "apiVersion", "baseName": "apiVersion", "type": "string" }, { "name": "kind", "baseName": "kind", "type": "string" }, { "name": "metadata", "baseName": "metadata", "type": "V1ObjectMeta" }, { "name": "rules", "baseName": "rules", "type": "Array" } ]; exports.V1beta1Role = V1beta1Role; /** * 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. */ class V1beta1RoleBinding { static getAttributeTypeMap() { return V1beta1RoleBinding.attributeTypeMap; } } V1beta1RoleBinding.discriminator = undefined; V1beta1RoleBinding.attributeTypeMap = [ { "name": "apiVersion", "baseName": "apiVersion", "type": "string" }, { "name": "kind", "baseName": "kind", "type": "string" }, { "name": "metadata", "baseName": "metadata", "type": "V1ObjectMeta" }, { "name": "roleRef", "baseName": "roleRef", "type": "V1beta1RoleRef" }, { "name": "subjects", "baseName": "subjects", "type": "Array" } ]; exports.V1beta1RoleBinding = V1beta1RoleBinding; /** * RoleBindingList is a collection of RoleBindings */ class V1beta1RoleBindingList { static getAttributeTypeMap() { return V1beta1RoleBindingList.attributeTypeMap; } } V1beta1RoleBindingList.discriminator = undefined; V1beta1RoleBindingList.attributeTypeMap = [ { "name": "apiVersion", "baseName": "apiVersion", "type": "string" }, { "name": "items", "baseName": "items", "type": "Array" }, { "name": "kind", "baseName": "kind", "type": "string" }, { "name": "metadata", "baseName": "metadata", "type": "V1ListMeta" } ]; exports.V1beta1RoleBindingList = V1beta1RoleBindingList; /** * RoleList is a collection of Roles */ class V1beta1RoleList { static getAttributeTypeMap() { return V1beta1RoleList.attributeTypeMap; } } V1beta1RoleList.discriminator = undefined; V1beta1RoleList.attributeTypeMap = [ { "name": "apiVersion", "baseName": "apiVersion", "type": "string" }, { "name": "items", "baseName": "items", "type": "Array" }, { "name": "kind", "baseName": "kind", "type": "string" }, { "name": "metadata", "baseName": "metadata", "type": "V1ListMeta" } ]; exports.V1beta1RoleList = V1beta1RoleList; /** * RoleRef contains information that points to the role being used */ class V1beta1RoleRef { static getAttributeTypeMap() { return V1beta1RoleRef.attributeTypeMap; } } V1beta1RoleRef.discriminator = undefined; V1beta1RoleRef.attributeTypeMap = [ { "name": "apiGroup", "baseName": "apiGroup", "type": "string" }, { "name": "kind", "baseName": "kind", "type": "string" }, { "name": "name", "baseName": "name", "type": "string" } ]; exports.V1beta1RoleRef = V1beta1RoleRef; /** * Spec to control the desired behavior of daemon set rolling update. */ class V1beta1RollingUpdateDaemonSet { static getAttributeTypeMap() { return V1beta1RollingUpdateDaemonSet.attributeTypeMap; } } V1beta1RollingUpdateDaemonSet.discriminator = undefined; V1beta1RollingUpdateDaemonSet.attributeTypeMap = [ { "name": "maxUnavailable", "baseName": "maxUnavailable", "type": "any" } ]; exports.V1beta1RollingUpdateDaemonSet = V1beta1RollingUpdateDaemonSet; /** * RollingUpdateStatefulSetStrategy is used to communicate parameter for RollingUpdateStatefulSetStrategyType. */ class V1beta1RollingUpdateStatefulSetStrategy { static getAttributeTypeMap() { return V1beta1RollingUpdateStatefulSetStrategy.attributeTypeMap; } } V1beta1RollingUpdateStatefulSetStrategy.discriminator = undefined; V1beta1RollingUpdateStatefulSetStrategy.attributeTypeMap = [ { "name": "partition", "baseName": "partition", "type": "number" } ]; exports.V1beta1RollingUpdateStatefulSetStrategy = V1beta1RollingUpdateStatefulSetStrategy; /** * RuleWithOperations is a tuple of Operations and Resources. It is recommended to make sure that all the tuple expansions are valid. */ class V1beta1RuleWithOperations { static getAttributeTypeMap() { return V1beta1RuleWithOperations.attributeTypeMap; } } V1beta1RuleWithOperations.discriminator = undefined; V1beta1RuleWithOperations.attributeTypeMap = [ { "name": "apiGroups", "baseName": "apiGroups", "type": "Array" }, { "name": "apiVersions", "baseName": "apiVersions", "type": "Array" }, { "name": "operations", "baseName": "operations", "type": "Array" }, { "name": "resources", "baseName": "resources", "type": "Array" } ]; exports.V1beta1RuleWithOperations = V1beta1RuleWithOperations; /** * 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 */ class V1beta1SelfSubjectAccessReview { static getAttributeTypeMap() { return V1beta1SelfSubjectAccessReview.attributeTypeMap; } } V1beta1SelfSubjectAccessReview.discriminator = undefined; V1beta1SelfSubjectAccessReview.attributeTypeMap = [ { "name": "apiVersion", "baseName": "apiVersion", "type": "string" }, { "name": "kind", "baseName": "kind", "type": "string" }, { "name": "metadata", "baseName": "metadata", "type": "V1ObjectMeta" }, { "name": "spec", "baseName": "spec", "type": "V1beta1SelfSubjectAccessReviewSpec" }, { "name": "status", "baseName": "status", "type": "V1beta1SubjectAccessReviewStatus" } ]; exports.V1beta1SelfSubjectAccessReview = V1beta1SelfSubjectAccessReview; /** * SelfSubjectAccessReviewSpec is a description of the access request. Exactly one of ResourceAuthorizationAttributes and NonResourceAuthorizationAttributes must be set */ class V1beta1SelfSubjectAccessReviewSpec { static getAttributeTypeMap() { return V1beta1SelfSubjectAccessReviewSpec.attributeTypeMap; } } V1beta1SelfSubjectAccessReviewSpec.discriminator = undefined; V1beta1SelfSubjectAccessReviewSpec.attributeTypeMap = [ { "name": "nonResourceAttributes", "baseName": "nonResourceAttributes", "type": "V1beta1NonResourceAttributes" }, { "name": "resourceAttributes", "baseName": "resourceAttributes", "type": "V1beta1ResourceAttributes" } ]; exports.V1beta1SelfSubjectAccessReviewSpec = V1beta1SelfSubjectAccessReviewSpec; /** * 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. */ class V1beta1SelfSubjectRulesReview { static getAttributeTypeMap() { return V1beta1SelfSubjectRulesReview.attributeTypeMap; } } V1beta1SelfSubjectRulesReview.discriminator = undefined; V1beta1SelfSubjectRulesReview.attributeTypeMap = [ { "name": "apiVersion", "baseName": "apiVersion", "type": "string" }, { "name": "kind", "baseName": "kind", "type": "string" }, { "name": "metadata", "baseName": "metadata", "type": "V1ObjectMeta" }, { "name": "spec", "baseName": "spec", "type": "V1beta1SelfSubjectRulesReviewSpec" }, { "name": "status", "baseName": "status", "type": "V1beta1SubjectRulesReviewStatus" } ]; exports.V1beta1SelfSubjectRulesReview = V1beta1SelfSubjectRulesReview; class V1beta1SelfSubjectRulesReviewSpec { static getAttributeTypeMap() { return V1beta1SelfSubjectRulesReviewSpec.attributeTypeMap; } } V1beta1SelfSubjectRulesReviewSpec.discriminator = undefined; V1beta1SelfSubjectRulesReviewSpec.attributeTypeMap = [ { "name": "namespace", "baseName": "namespace", "type": "string" } ]; exports.V1beta1SelfSubjectRulesReviewSpec = V1beta1SelfSubjectRulesReviewSpec; /** * DEPRECATED - This group version of StatefulSet is deprecated by apps/v1beta2/StatefulSet. See the release notes for more information. 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. */ class V1beta1StatefulSet { static getAttributeTypeMap() { return V1beta1StatefulSet.attributeTypeMap; } } V1beta1StatefulSet.discriminator = undefined; V1beta1StatefulSet.attributeTypeMap = [ { "name": "apiVersion", "baseName": "apiVersion", "type": "string" }, { "name": "kind", "baseName": "kind", "type": "string" }, { "name": "metadata", "baseName": "metadata", "type": "V1ObjectMeta" }, { "name": "spec", "baseName": "spec", "type": "V1beta1StatefulSetSpec" }, { "name": "status", "baseName": "status", "type": "V1beta1StatefulSetStatus" } ]; exports.V1beta1StatefulSet = V1beta1StatefulSet; /** * StatefulSetCondition describes the state of a statefulset at a certain point. */ class V1beta1StatefulSetCondition { static getAttributeTypeMap() { return V1beta1StatefulSetCondition.attributeTypeMap; } } V1beta1StatefulSetCondition.discriminator = undefined; V1beta1StatefulSetCondition.attributeTypeMap = [ { "name": "lastTransitionTime", "baseName": "lastTransitionTime", "type": "Date" }, { "name": "message", "baseName": "message", "type": "string" }, { "name": "reason", "baseName": "reason", "type": "string" }, { "name": "status", "baseName": "status", "type": "string" }, { "name": "type", "baseName": "type", "type": "string" } ]; exports.V1beta1StatefulSetCondition = V1beta1StatefulSetCondition; /** * StatefulSetList is a collection of StatefulSets. */ class V1beta1StatefulSetList { static getAttributeTypeMap() { return V1beta1StatefulSetList.attributeTypeMap; } } V1beta1StatefulSetList.discriminator = undefined; V1beta1StatefulSetList.attributeTypeMap = [ { "name": "apiVersion", "baseName": "apiVersion", "type": "string" }, { "name": "items", "baseName": "items", "type": "Array" }, { "name": "kind", "baseName": "kind", "type": "string" }, { "name": "metadata", "baseName": "metadata", "type": "V1ListMeta" } ]; exports.V1beta1StatefulSetList = V1beta1StatefulSetList; /** * A StatefulSetSpec is the specification of a StatefulSet. */ class V1beta1StatefulSetSpec { static getAttributeTypeMap() { return V1beta1StatefulSetSpec.attributeTypeMap; } } V1beta1StatefulSetSpec.discriminator = undefined; V1beta1StatefulSetSpec.attributeTypeMap = [ { "name": "podManagementPolicy", "baseName": "podManagementPolicy", "type": "string" }, { "name": "replicas", "baseName": "replicas", "type": "number" }, { "name": "revisionHistoryLimit", "baseName": "revisionHistoryLimit", "type": "number" }, { "name": "selector", "baseName": "selector", "type": "V1LabelSelector" }, { "name": "serviceName", "baseName": "serviceName", "type": "string" }, { "name": "template", "baseName": "template", "type": "V1PodTemplateSpec" }, { "name": "updateStrategy", "baseName": "updateStrategy", "type": "V1beta1StatefulSetUpdateStrategy" }, { "name": "volumeClaimTemplates", "baseName": "volumeClaimTemplates", "type": "Array" } ]; exports.V1beta1StatefulSetSpec = V1beta1StatefulSetSpec; /** * StatefulSetStatus represents the current state of a StatefulSet. */ class V1beta1StatefulSetStatus { static getAttributeTypeMap() { return V1beta1StatefulSetStatus.attributeTypeMap; } } V1beta1StatefulSetStatus.discriminator = undefined; V1beta1StatefulSetStatus.attributeTypeMap = [ { "name": "collisionCount", "baseName": "collisionCount", "type": "number" }, { "name": "conditions", "baseName": "conditions", "type": "Array" }, { "name": "currentReplicas", "baseName": "currentReplicas", "type": "number" }, { "name": "currentRevision", "baseName": "currentRevision", "type": "string" }, { "name": "observedGeneration", "baseName": "observedGeneration", "type": "number" }, { "name": "readyReplicas", "baseName": "readyReplicas", "type": "number" }, { "name": "replicas", "baseName": "replicas", "type": "number" }, { "name": "updateRevision", "baseName": "updateRevision", "type": "string" }, { "name": "updatedReplicas", "baseName": "updatedReplicas", "type": "number" } ]; exports.V1beta1StatefulSetStatus = V1beta1StatefulSetStatus; /** * 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. */ class V1beta1StatefulSetUpdateStrategy { static getAttributeTypeMap() { return V1beta1StatefulSetUpdateStrategy.attributeTypeMap; } } V1beta1StatefulSetUpdateStrategy.discriminator = undefined; V1beta1StatefulSetUpdateStrategy.attributeTypeMap = [ { "name": "rollingUpdate", "baseName": "rollingUpdate", "type": "V1beta1RollingUpdateStatefulSetStrategy" }, { "name": "type", "baseName": "type", "type": "string" } ]; exports.V1beta1StatefulSetUpdateStrategy = V1beta1StatefulSetUpdateStrategy; /** * 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. */ class V1beta1StorageClass { static getAttributeTypeMap() { return V1beta1StorageClass.attributeTypeMap; } } V1beta1StorageClass.discriminator = undefined; V1beta1StorageClass.attributeTypeMap = [ { "name": "allowVolumeExpansion", "baseName": "allowVolumeExpansion", "type": "boolean" }, { "name": "allowedTopologies", "baseName": "allowedTopologies", "type": "Array" }, { "name": "apiVersion", "baseName": "apiVersion", "type": "string" }, { "name": "kind", "baseName": "kind", "type": "string" }, { "name": "metadata", "baseName": "metadata", "type": "V1ObjectMeta" }, { "name": "mountOptions", "baseName": "mountOptions", "type": "Array" }, { "name": "parameters", "baseName": "parameters", "type": "{ [key: string]: string; }" }, { "name": "provisioner", "baseName": "provisioner", "type": "string" }, { "name": "reclaimPolicy", "baseName": "reclaimPolicy", "type": "string" }, { "name": "volumeBindingMode", "baseName": "volumeBindingMode", "type": "string" } ]; exports.V1beta1StorageClass = V1beta1StorageClass; /** * StorageClassList is a collection of storage classes. */ class V1beta1StorageClassList { static getAttributeTypeMap() { return V1beta1StorageClassList.attributeTypeMap; } } V1beta1StorageClassList.discriminator = undefined; V1beta1StorageClassList.attributeTypeMap = [ { "name": "apiVersion", "baseName": "apiVersion", "type": "string" }, { "name": "items", "baseName": "items", "type": "Array" }, { "name": "kind", "baseName": "kind", "type": "string" }, { "name": "metadata", "baseName": "metadata", "type": "V1ListMeta" } ]; exports.V1beta1StorageClassList = V1beta1StorageClassList; /** * 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. */ class V1beta1Subject { static getAttributeTypeMap() { return V1beta1Subject.attributeTypeMap; } } V1beta1Subject.discriminator = undefined; V1beta1Subject.attributeTypeMap = [ { "name": "apiGroup", "baseName": "apiGroup", "type": "string" }, { "name": "kind", "baseName": "kind", "type": "string" }, { "name": "name", "baseName": "name", "type": "string" }, { "name": "namespace", "baseName": "namespace", "type": "string" } ]; exports.V1beta1Subject = V1beta1Subject; /** * SubjectAccessReview checks whether or not a user or group can perform an action. */ class V1beta1SubjectAccessReview { static getAttributeTypeMap() { return V1beta1SubjectAccessReview.attributeTypeMap; } } V1beta1SubjectAccessReview.discriminator = undefined; V1beta1SubjectAccessReview.attributeTypeMap = [ { "name": "apiVersion", "baseName": "apiVersion", "type": "string" }, { "name": "kind", "baseName": "kind", "type": "string" }, { "name": "metadata", "baseName": "metadata", "type": "V1ObjectMeta" }, { "name": "spec", "baseName": "spec", "type": "V1beta1SubjectAccessReviewSpec" }, { "name": "status", "baseName": "status", "type": "V1beta1SubjectAccessReviewStatus" } ]; exports.V1beta1SubjectAccessReview = V1beta1SubjectAccessReview; /** * SubjectAccessReviewSpec is a description of the access request. Exactly one of ResourceAuthorizationAttributes and NonResourceAuthorizationAttributes must be set */ class V1beta1SubjectAccessReviewSpec { static getAttributeTypeMap() { return V1beta1SubjectAccessReviewSpec.attributeTypeMap; } } V1beta1SubjectAccessReviewSpec.discriminator = undefined; V1beta1SubjectAccessReviewSpec.attributeTypeMap = [ { "name": "extra", "baseName": "extra", "type": "{ [key: string]: Array; }" }, { "name": "group", "baseName": "group", "type": "Array" }, { "name": "nonResourceAttributes", "baseName": "nonResourceAttributes", "type": "V1beta1NonResourceAttributes" }, { "name": "resourceAttributes", "baseName": "resourceAttributes", "type": "V1beta1ResourceAttributes" }, { "name": "uid", "baseName": "uid", "type": "string" }, { "name": "user", "baseName": "user", "type": "string" } ]; exports.V1beta1SubjectAccessReviewSpec = V1beta1SubjectAccessReviewSpec; /** * SubjectAccessReviewStatus */ class V1beta1SubjectAccessReviewStatus { static getAttributeTypeMap() { return V1beta1SubjectAccessReviewStatus.attributeTypeMap; } } V1beta1SubjectAccessReviewStatus.discriminator = undefined; V1beta1SubjectAccessReviewStatus.attributeTypeMap = [ { "name": "allowed", "baseName": "allowed", "type": "boolean" }, { "name": "denied", "baseName": "denied", "type": "boolean" }, { "name": "evaluationError", "baseName": "evaluationError", "type": "string" }, { "name": "reason", "baseName": "reason", "type": "string" } ]; exports.V1beta1SubjectAccessReviewStatus = V1beta1SubjectAccessReviewStatus; /** * 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. */ class V1beta1SubjectRulesReviewStatus { static getAttributeTypeMap() { return V1beta1SubjectRulesReviewStatus.attributeTypeMap; } } V1beta1SubjectRulesReviewStatus.discriminator = undefined; V1beta1SubjectRulesReviewStatus.attributeTypeMap = [ { "name": "evaluationError", "baseName": "evaluationError", "type": "string" }, { "name": "incomplete", "baseName": "incomplete", "type": "boolean" }, { "name": "nonResourceRules", "baseName": "nonResourceRules", "type": "Array" }, { "name": "resourceRules", "baseName": "resourceRules", "type": "Array" } ]; exports.V1beta1SubjectRulesReviewStatus = V1beta1SubjectRulesReviewStatus; /** * 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. */ class V1beta1TokenReview { static getAttributeTypeMap() { return V1beta1TokenReview.attributeTypeMap; } } V1beta1TokenReview.discriminator = undefined; V1beta1TokenReview.attributeTypeMap = [ { "name": "apiVersion", "baseName": "apiVersion", "type": "string" }, { "name": "kind", "baseName": "kind", "type": "string" }, { "name": "metadata", "baseName": "metadata", "type": "V1ObjectMeta" }, { "name": "spec", "baseName": "spec", "type": "V1beta1TokenReviewSpec" }, { "name": "status", "baseName": "status", "type": "V1beta1TokenReviewStatus" } ]; exports.V1beta1TokenReview = V1beta1TokenReview; /** * TokenReviewSpec is a description of the token authentication request. */ class V1beta1TokenReviewSpec { static getAttributeTypeMap() { return V1beta1TokenReviewSpec.attributeTypeMap; } } V1beta1TokenReviewSpec.discriminator = undefined; V1beta1TokenReviewSpec.attributeTypeMap = [ { "name": "audiences", "baseName": "audiences", "type": "Array" }, { "name": "token", "baseName": "token", "type": "string" } ]; exports.V1beta1TokenReviewSpec = V1beta1TokenReviewSpec; /** * TokenReviewStatus is the result of the token authentication request. */ class V1beta1TokenReviewStatus { static getAttributeTypeMap() { return V1beta1TokenReviewStatus.attributeTypeMap; } } V1beta1TokenReviewStatus.discriminator = undefined; V1beta1TokenReviewStatus.attributeTypeMap = [ { "name": "audiences", "baseName": "audiences", "type": "Array" }, { "name": "authenticated", "baseName": "authenticated", "type": "boolean" }, { "name": "error", "baseName": "error", "type": "string" }, { "name": "user", "baseName": "user", "type": "V1beta1UserInfo" } ]; exports.V1beta1TokenReviewStatus = V1beta1TokenReviewStatus; /** * UserInfo holds the information about the user needed to implement the user.Info interface. */ class V1beta1UserInfo { static getAttributeTypeMap() { return V1beta1UserInfo.attributeTypeMap; } } V1beta1UserInfo.discriminator = undefined; V1beta1UserInfo.attributeTypeMap = [ { "name": "extra", "baseName": "extra", "type": "{ [key: string]: Array; }" }, { "name": "groups", "baseName": "groups", "type": "Array" }, { "name": "uid", "baseName": "uid", "type": "string" }, { "name": "username", "baseName": "username", "type": "string" } ]; exports.V1beta1UserInfo = V1beta1UserInfo; /** * ValidatingWebhookConfiguration describes the configuration of and admission webhook that accept or reject and object without changing it. */ class V1beta1ValidatingWebhookConfiguration { static getAttributeTypeMap() { return V1beta1ValidatingWebhookConfiguration.attributeTypeMap; } } V1beta1ValidatingWebhookConfiguration.discriminator = undefined; V1beta1ValidatingWebhookConfiguration.attributeTypeMap = [ { "name": "apiVersion", "baseName": "apiVersion", "type": "string" }, { "name": "kind", "baseName": "kind", "type": "string" }, { "name": "metadata", "baseName": "metadata", "type": "V1ObjectMeta" }, { "name": "webhooks", "baseName": "webhooks", "type": "Array" } ]; exports.V1beta1ValidatingWebhookConfiguration = V1beta1ValidatingWebhookConfiguration; /** * ValidatingWebhookConfigurationList is a list of ValidatingWebhookConfiguration. */ class V1beta1ValidatingWebhookConfigurationList { static getAttributeTypeMap() { return V1beta1ValidatingWebhookConfigurationList.attributeTypeMap; } } V1beta1ValidatingWebhookConfigurationList.discriminator = undefined; V1beta1ValidatingWebhookConfigurationList.attributeTypeMap = [ { "name": "apiVersion", "baseName": "apiVersion", "type": "string" }, { "name": "items", "baseName": "items", "type": "Array" }, { "name": "kind", "baseName": "kind", "type": "string" }, { "name": "metadata", "baseName": "metadata", "type": "V1ListMeta" } ]; exports.V1beta1ValidatingWebhookConfigurationList = V1beta1ValidatingWebhookConfigurationList; /** * VolumeAttachment captures the intent to attach or detach the specified volume to/from the specified node. VolumeAttachment objects are non-namespaced. */ class V1beta1VolumeAttachment { static getAttributeTypeMap() { return V1beta1VolumeAttachment.attributeTypeMap; } } V1beta1VolumeAttachment.discriminator = undefined; V1beta1VolumeAttachment.attributeTypeMap = [ { "name": "apiVersion", "baseName": "apiVersion", "type": "string" }, { "name": "kind", "baseName": "kind", "type": "string" }, { "name": "metadata", "baseName": "metadata", "type": "V1ObjectMeta" }, { "name": "spec", "baseName": "spec", "type": "V1beta1VolumeAttachmentSpec" }, { "name": "status", "baseName": "status", "type": "V1beta1VolumeAttachmentStatus" } ]; exports.V1beta1VolumeAttachment = V1beta1VolumeAttachment; /** * VolumeAttachmentList is a collection of VolumeAttachment objects. */ class V1beta1VolumeAttachmentList { static getAttributeTypeMap() { return V1beta1VolumeAttachmentList.attributeTypeMap; } } V1beta1VolumeAttachmentList.discriminator = undefined; V1beta1VolumeAttachmentList.attributeTypeMap = [ { "name": "apiVersion", "baseName": "apiVersion", "type": "string" }, { "name": "items", "baseName": "items", "type": "Array" }, { "name": "kind", "baseName": "kind", "type": "string" }, { "name": "metadata", "baseName": "metadata", "type": "V1ListMeta" } ]; exports.V1beta1VolumeAttachmentList = V1beta1VolumeAttachmentList; /** * 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. */ class V1beta1VolumeAttachmentSource { static getAttributeTypeMap() { return V1beta1VolumeAttachmentSource.attributeTypeMap; } } V1beta1VolumeAttachmentSource.discriminator = undefined; V1beta1VolumeAttachmentSource.attributeTypeMap = [ { "name": "persistentVolumeName", "baseName": "persistentVolumeName", "type": "string" } ]; exports.V1beta1VolumeAttachmentSource = V1beta1VolumeAttachmentSource; /** * VolumeAttachmentSpec is the specification of a VolumeAttachment request. */ class V1beta1VolumeAttachmentSpec { static getAttributeTypeMap() { return V1beta1VolumeAttachmentSpec.attributeTypeMap; } } V1beta1VolumeAttachmentSpec.discriminator = undefined; V1beta1VolumeAttachmentSpec.attributeTypeMap = [ { "name": "attacher", "baseName": "attacher", "type": "string" }, { "name": "nodeName", "baseName": "nodeName", "type": "string" }, { "name": "source", "baseName": "source", "type": "V1beta1VolumeAttachmentSource" } ]; exports.V1beta1VolumeAttachmentSpec = V1beta1VolumeAttachmentSpec; /** * VolumeAttachmentStatus is the status of a VolumeAttachment request. */ class V1beta1VolumeAttachmentStatus { static getAttributeTypeMap() { return V1beta1VolumeAttachmentStatus.attributeTypeMap; } } V1beta1VolumeAttachmentStatus.discriminator = undefined; V1beta1VolumeAttachmentStatus.attributeTypeMap = [ { "name": "attachError", "baseName": "attachError", "type": "V1beta1VolumeError" }, { "name": "attached", "baseName": "attached", "type": "boolean" }, { "name": "attachmentMetadata", "baseName": "attachmentMetadata", "type": "{ [key: string]: string; }" }, { "name": "detachError", "baseName": "detachError", "type": "V1beta1VolumeError" } ]; exports.V1beta1VolumeAttachmentStatus = V1beta1VolumeAttachmentStatus; /** * VolumeError captures an error encountered during a volume operation. */ class V1beta1VolumeError { static getAttributeTypeMap() { return V1beta1VolumeError.attributeTypeMap; } } V1beta1VolumeError.discriminator = undefined; V1beta1VolumeError.attributeTypeMap = [ { "name": "message", "baseName": "message", "type": "string" }, { "name": "time", "baseName": "time", "type": "Date" } ]; exports.V1beta1VolumeError = V1beta1VolumeError; /** * Webhook describes an admission webhook and the resources and operations it applies to. */ class V1beta1Webhook { static getAttributeTypeMap() { return V1beta1Webhook.attributeTypeMap; } } V1beta1Webhook.discriminator = undefined; V1beta1Webhook.attributeTypeMap = [ { "name": "clientConfig", "baseName": "clientConfig", "type": "AdmissionregistrationV1beta1WebhookClientConfig" }, { "name": "failurePolicy", "baseName": "failurePolicy", "type": "string" }, { "name": "name", "baseName": "name", "type": "string" }, { "name": "namespaceSelector", "baseName": "namespaceSelector", "type": "V1LabelSelector" }, { "name": "rules", "baseName": "rules", "type": "Array" }, { "name": "sideEffects", "baseName": "sideEffects", "type": "string" } ]; exports.V1beta1Webhook = V1beta1Webhook; /** * DEPRECATED - This group version of ControllerRevision is deprecated by apps/v1/ControllerRevision. See the release notes for more information. 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. */ class V1beta2ControllerRevision { static getAttributeTypeMap() { return V1beta2ControllerRevision.attributeTypeMap; } } V1beta2ControllerRevision.discriminator = undefined; V1beta2ControllerRevision.attributeTypeMap = [ { "name": "apiVersion", "baseName": "apiVersion", "type": "string" }, { "name": "data", "baseName": "data", "type": "RuntimeRawExtension" }, { "name": "kind", "baseName": "kind", "type": "string" }, { "name": "metadata", "baseName": "metadata", "type": "V1ObjectMeta" }, { "name": "revision", "baseName": "revision", "type": "number" } ]; exports.V1beta2ControllerRevision = V1beta2ControllerRevision; /** * ControllerRevisionList is a resource containing a list of ControllerRevision objects. */ class V1beta2ControllerRevisionList { static getAttributeTypeMap() { return V1beta2ControllerRevisionList.attributeTypeMap; } } V1beta2ControllerRevisionList.discriminator = undefined; V1beta2ControllerRevisionList.attributeTypeMap = [ { "name": "apiVersion", "baseName": "apiVersion", "type": "string" }, { "name": "items", "baseName": "items", "type": "Array" }, { "name": "kind", "baseName": "kind", "type": "string" }, { "name": "metadata", "baseName": "metadata", "type": "V1ListMeta" } ]; exports.V1beta2ControllerRevisionList = V1beta2ControllerRevisionList; /** * DEPRECATED - This group version of DaemonSet is deprecated by apps/v1/DaemonSet. See the release notes for more information. DaemonSet represents the configuration of a daemon set. */ class V1beta2DaemonSet { static getAttributeTypeMap() { return V1beta2DaemonSet.attributeTypeMap; } } V1beta2DaemonSet.discriminator = undefined; V1beta2DaemonSet.attributeTypeMap = [ { "name": "apiVersion", "baseName": "apiVersion", "type": "string" }, { "name": "kind", "baseName": "kind", "type": "string" }, { "name": "metadata", "baseName": "metadata", "type": "V1ObjectMeta" }, { "name": "spec", "baseName": "spec", "type": "V1beta2DaemonSetSpec" }, { "name": "status", "baseName": "status", "type": "V1beta2DaemonSetStatus" } ]; exports.V1beta2DaemonSet = V1beta2DaemonSet; /** * DaemonSetCondition describes the state of a DaemonSet at a certain point. */ class V1beta2DaemonSetCondition { static getAttributeTypeMap() { return V1beta2DaemonSetCondition.attributeTypeMap; } } V1beta2DaemonSetCondition.discriminator = undefined; V1beta2DaemonSetCondition.attributeTypeMap = [ { "name": "lastTransitionTime", "baseName": "lastTransitionTime", "type": "Date" }, { "name": "message", "baseName": "message", "type": "string" }, { "name": "reason", "baseName": "reason", "type": "string" }, { "name": "status", "baseName": "status", "type": "string" }, { "name": "type", "baseName": "type", "type": "string" } ]; exports.V1beta2DaemonSetCondition = V1beta2DaemonSetCondition; /** * DaemonSetList is a collection of daemon sets. */ class V1beta2DaemonSetList { static getAttributeTypeMap() { return V1beta2DaemonSetList.attributeTypeMap; } } V1beta2DaemonSetList.discriminator = undefined; V1beta2DaemonSetList.attributeTypeMap = [ { "name": "apiVersion", "baseName": "apiVersion", "type": "string" }, { "name": "items", "baseName": "items", "type": "Array" }, { "name": "kind", "baseName": "kind", "type": "string" }, { "name": "metadata", "baseName": "metadata", "type": "V1ListMeta" } ]; exports.V1beta2DaemonSetList = V1beta2DaemonSetList; /** * DaemonSetSpec is the specification of a daemon set. */ class V1beta2DaemonSetSpec { static getAttributeTypeMap() { return V1beta2DaemonSetSpec.attributeTypeMap; } } V1beta2DaemonSetSpec.discriminator = undefined; V1beta2DaemonSetSpec.attributeTypeMap = [ { "name": "minReadySeconds", "baseName": "minReadySeconds", "type": "number" }, { "name": "revisionHistoryLimit", "baseName": "revisionHistoryLimit", "type": "number" }, { "name": "selector", "baseName": "selector", "type": "V1LabelSelector" }, { "name": "template", "baseName": "template", "type": "V1PodTemplateSpec" }, { "name": "updateStrategy", "baseName": "updateStrategy", "type": "V1beta2DaemonSetUpdateStrategy" } ]; exports.V1beta2DaemonSetSpec = V1beta2DaemonSetSpec; /** * DaemonSetStatus represents the current status of a daemon set. */ class V1beta2DaemonSetStatus { static getAttributeTypeMap() { return V1beta2DaemonSetStatus.attributeTypeMap; } } V1beta2DaemonSetStatus.discriminator = undefined; V1beta2DaemonSetStatus.attributeTypeMap = [ { "name": "collisionCount", "baseName": "collisionCount", "type": "number" }, { "name": "conditions", "baseName": "conditions", "type": "Array" }, { "name": "currentNumberScheduled", "baseName": "currentNumberScheduled", "type": "number" }, { "name": "desiredNumberScheduled", "baseName": "desiredNumberScheduled", "type": "number" }, { "name": "numberAvailable", "baseName": "numberAvailable", "type": "number" }, { "name": "numberMisscheduled", "baseName": "numberMisscheduled", "type": "number" }, { "name": "numberReady", "baseName": "numberReady", "type": "number" }, { "name": "numberUnavailable", "baseName": "numberUnavailable", "type": "number" }, { "name": "observedGeneration", "baseName": "observedGeneration", "type": "number" }, { "name": "updatedNumberScheduled", "baseName": "updatedNumberScheduled", "type": "number" } ]; exports.V1beta2DaemonSetStatus = V1beta2DaemonSetStatus; /** * DaemonSetUpdateStrategy is a struct used to control the update strategy for a DaemonSet. */ class V1beta2DaemonSetUpdateStrategy { static getAttributeTypeMap() { return V1beta2DaemonSetUpdateStrategy.attributeTypeMap; } } V1beta2DaemonSetUpdateStrategy.discriminator = undefined; V1beta2DaemonSetUpdateStrategy.attributeTypeMap = [ { "name": "rollingUpdate", "baseName": "rollingUpdate", "type": "V1beta2RollingUpdateDaemonSet" }, { "name": "type", "baseName": "type", "type": "string" } ]; exports.V1beta2DaemonSetUpdateStrategy = V1beta2DaemonSetUpdateStrategy; /** * DEPRECATED - This group version of Deployment is deprecated by apps/v1/Deployment. See the release notes for more information. Deployment enables declarative updates for Pods and ReplicaSets. */ class V1beta2Deployment { static getAttributeTypeMap() { return V1beta2Deployment.attributeTypeMap; } } V1beta2Deployment.discriminator = undefined; V1beta2Deployment.attributeTypeMap = [ { "name": "apiVersion", "baseName": "apiVersion", "type": "string" }, { "name": "kind", "baseName": "kind", "type": "string" }, { "name": "metadata", "baseName": "metadata", "type": "V1ObjectMeta" }, { "name": "spec", "baseName": "spec", "type": "V1beta2DeploymentSpec" }, { "name": "status", "baseName": "status", "type": "V1beta2DeploymentStatus" } ]; exports.V1beta2Deployment = V1beta2Deployment; /** * DeploymentCondition describes the state of a deployment at a certain point. */ class V1beta2DeploymentCondition { static getAttributeTypeMap() { return V1beta2DeploymentCondition.attributeTypeMap; } } V1beta2DeploymentCondition.discriminator = undefined; V1beta2DeploymentCondition.attributeTypeMap = [ { "name": "lastTransitionTime", "baseName": "lastTransitionTime", "type": "Date" }, { "name": "lastUpdateTime", "baseName": "lastUpdateTime", "type": "Date" }, { "name": "message", "baseName": "message", "type": "string" }, { "name": "reason", "baseName": "reason", "type": "string" }, { "name": "status", "baseName": "status", "type": "string" }, { "name": "type", "baseName": "type", "type": "string" } ]; exports.V1beta2DeploymentCondition = V1beta2DeploymentCondition; /** * DeploymentList is a list of Deployments. */ class V1beta2DeploymentList { static getAttributeTypeMap() { return V1beta2DeploymentList.attributeTypeMap; } } V1beta2DeploymentList.discriminator = undefined; V1beta2DeploymentList.attributeTypeMap = [ { "name": "apiVersion", "baseName": "apiVersion", "type": "string" }, { "name": "items", "baseName": "items", "type": "Array" }, { "name": "kind", "baseName": "kind", "type": "string" }, { "name": "metadata", "baseName": "metadata", "type": "V1ListMeta" } ]; exports.V1beta2DeploymentList = V1beta2DeploymentList; /** * DeploymentSpec is the specification of the desired behavior of the Deployment. */ class V1beta2DeploymentSpec { static getAttributeTypeMap() { return V1beta2DeploymentSpec.attributeTypeMap; } } V1beta2DeploymentSpec.discriminator = undefined; V1beta2DeploymentSpec.attributeTypeMap = [ { "name": "minReadySeconds", "baseName": "minReadySeconds", "type": "number" }, { "name": "paused", "baseName": "paused", "type": "boolean" }, { "name": "progressDeadlineSeconds", "baseName": "progressDeadlineSeconds", "type": "number" }, { "name": "replicas", "baseName": "replicas", "type": "number" }, { "name": "revisionHistoryLimit", "baseName": "revisionHistoryLimit", "type": "number" }, { "name": "selector", "baseName": "selector", "type": "V1LabelSelector" }, { "name": "strategy", "baseName": "strategy", "type": "V1beta2DeploymentStrategy" }, { "name": "template", "baseName": "template", "type": "V1PodTemplateSpec" } ]; exports.V1beta2DeploymentSpec = V1beta2DeploymentSpec; /** * DeploymentStatus is the most recently observed status of the Deployment. */ class V1beta2DeploymentStatus { static getAttributeTypeMap() { return V1beta2DeploymentStatus.attributeTypeMap; } } V1beta2DeploymentStatus.discriminator = undefined; V1beta2DeploymentStatus.attributeTypeMap = [ { "name": "availableReplicas", "baseName": "availableReplicas", "type": "number" }, { "name": "collisionCount", "baseName": "collisionCount", "type": "number" }, { "name": "conditions", "baseName": "conditions", "type": "Array" }, { "name": "observedGeneration", "baseName": "observedGeneration", "type": "number" }, { "name": "readyReplicas", "baseName": "readyReplicas", "type": "number" }, { "name": "replicas", "baseName": "replicas", "type": "number" }, { "name": "unavailableReplicas", "baseName": "unavailableReplicas", "type": "number" }, { "name": "updatedReplicas", "baseName": "updatedReplicas", "type": "number" } ]; exports.V1beta2DeploymentStatus = V1beta2DeploymentStatus; /** * DeploymentStrategy describes how to replace existing pods with new ones. */ class V1beta2DeploymentStrategy { static getAttributeTypeMap() { return V1beta2DeploymentStrategy.attributeTypeMap; } } V1beta2DeploymentStrategy.discriminator = undefined; V1beta2DeploymentStrategy.attributeTypeMap = [ { "name": "rollingUpdate", "baseName": "rollingUpdate", "type": "V1beta2RollingUpdateDeployment" }, { "name": "type", "baseName": "type", "type": "string" } ]; exports.V1beta2DeploymentStrategy = V1beta2DeploymentStrategy; /** * DEPRECATED - This group version of ReplicaSet is deprecated by apps/v1/ReplicaSet. See the release notes for more information. ReplicaSet ensures that a specified number of pod replicas are running at any given time. */ class V1beta2ReplicaSet { static getAttributeTypeMap() { return V1beta2ReplicaSet.attributeTypeMap; } } V1beta2ReplicaSet.discriminator = undefined; V1beta2ReplicaSet.attributeTypeMap = [ { "name": "apiVersion", "baseName": "apiVersion", "type": "string" }, { "name": "kind", "baseName": "kind", "type": "string" }, { "name": "metadata", "baseName": "metadata", "type": "V1ObjectMeta" }, { "name": "spec", "baseName": "spec", "type": "V1beta2ReplicaSetSpec" }, { "name": "status", "baseName": "status", "type": "V1beta2ReplicaSetStatus" } ]; exports.V1beta2ReplicaSet = V1beta2ReplicaSet; /** * ReplicaSetCondition describes the state of a replica set at a certain point. */ class V1beta2ReplicaSetCondition { static getAttributeTypeMap() { return V1beta2ReplicaSetCondition.attributeTypeMap; } } V1beta2ReplicaSetCondition.discriminator = undefined; V1beta2ReplicaSetCondition.attributeTypeMap = [ { "name": "lastTransitionTime", "baseName": "lastTransitionTime", "type": "Date" }, { "name": "message", "baseName": "message", "type": "string" }, { "name": "reason", "baseName": "reason", "type": "string" }, { "name": "status", "baseName": "status", "type": "string" }, { "name": "type", "baseName": "type", "type": "string" } ]; exports.V1beta2ReplicaSetCondition = V1beta2ReplicaSetCondition; /** * ReplicaSetList is a collection of ReplicaSets. */ class V1beta2ReplicaSetList { static getAttributeTypeMap() { return V1beta2ReplicaSetList.attributeTypeMap; } } V1beta2ReplicaSetList.discriminator = undefined; V1beta2ReplicaSetList.attributeTypeMap = [ { "name": "apiVersion", "baseName": "apiVersion", "type": "string" }, { "name": "items", "baseName": "items", "type": "Array" }, { "name": "kind", "baseName": "kind", "type": "string" }, { "name": "metadata", "baseName": "metadata", "type": "V1ListMeta" } ]; exports.V1beta2ReplicaSetList = V1beta2ReplicaSetList; /** * ReplicaSetSpec is the specification of a ReplicaSet. */ class V1beta2ReplicaSetSpec { static getAttributeTypeMap() { return V1beta2ReplicaSetSpec.attributeTypeMap; } } V1beta2ReplicaSetSpec.discriminator = undefined; V1beta2ReplicaSetSpec.attributeTypeMap = [ { "name": "minReadySeconds", "baseName": "minReadySeconds", "type": "number" }, { "name": "replicas", "baseName": "replicas", "type": "number" }, { "name": "selector", "baseName": "selector", "type": "V1LabelSelector" }, { "name": "template", "baseName": "template", "type": "V1PodTemplateSpec" } ]; exports.V1beta2ReplicaSetSpec = V1beta2ReplicaSetSpec; /** * ReplicaSetStatus represents the current status of a ReplicaSet. */ class V1beta2ReplicaSetStatus { static getAttributeTypeMap() { return V1beta2ReplicaSetStatus.attributeTypeMap; } } V1beta2ReplicaSetStatus.discriminator = undefined; V1beta2ReplicaSetStatus.attributeTypeMap = [ { "name": "availableReplicas", "baseName": "availableReplicas", "type": "number" }, { "name": "conditions", "baseName": "conditions", "type": "Array" }, { "name": "fullyLabeledReplicas", "baseName": "fullyLabeledReplicas", "type": "number" }, { "name": "observedGeneration", "baseName": "observedGeneration", "type": "number" }, { "name": "readyReplicas", "baseName": "readyReplicas", "type": "number" }, { "name": "replicas", "baseName": "replicas", "type": "number" } ]; exports.V1beta2ReplicaSetStatus = V1beta2ReplicaSetStatus; /** * Spec to control the desired behavior of daemon set rolling update. */ class V1beta2RollingUpdateDaemonSet { static getAttributeTypeMap() { return V1beta2RollingUpdateDaemonSet.attributeTypeMap; } } V1beta2RollingUpdateDaemonSet.discriminator = undefined; V1beta2RollingUpdateDaemonSet.attributeTypeMap = [ { "name": "maxUnavailable", "baseName": "maxUnavailable", "type": "any" } ]; exports.V1beta2RollingUpdateDaemonSet = V1beta2RollingUpdateDaemonSet; /** * Spec to control the desired behavior of rolling update. */ class V1beta2RollingUpdateDeployment { static getAttributeTypeMap() { return V1beta2RollingUpdateDeployment.attributeTypeMap; } } V1beta2RollingUpdateDeployment.discriminator = undefined; V1beta2RollingUpdateDeployment.attributeTypeMap = [ { "name": "maxSurge", "baseName": "maxSurge", "type": "any" }, { "name": "maxUnavailable", "baseName": "maxUnavailable", "type": "any" } ]; exports.V1beta2RollingUpdateDeployment = V1beta2RollingUpdateDeployment; /** * RollingUpdateStatefulSetStrategy is used to communicate parameter for RollingUpdateStatefulSetStrategyType. */ class V1beta2RollingUpdateStatefulSetStrategy { static getAttributeTypeMap() { return V1beta2RollingUpdateStatefulSetStrategy.attributeTypeMap; } } V1beta2RollingUpdateStatefulSetStrategy.discriminator = undefined; V1beta2RollingUpdateStatefulSetStrategy.attributeTypeMap = [ { "name": "partition", "baseName": "partition", "type": "number" } ]; exports.V1beta2RollingUpdateStatefulSetStrategy = V1beta2RollingUpdateStatefulSetStrategy; /** * Scale represents a scaling request for a resource. */ class V1beta2Scale { static getAttributeTypeMap() { return V1beta2Scale.attributeTypeMap; } } V1beta2Scale.discriminator = undefined; V1beta2Scale.attributeTypeMap = [ { "name": "apiVersion", "baseName": "apiVersion", "type": "string" }, { "name": "kind", "baseName": "kind", "type": "string" }, { "name": "metadata", "baseName": "metadata", "type": "V1ObjectMeta" }, { "name": "spec", "baseName": "spec", "type": "V1beta2ScaleSpec" }, { "name": "status", "baseName": "status", "type": "V1beta2ScaleStatus" } ]; exports.V1beta2Scale = V1beta2Scale; /** * ScaleSpec describes the attributes of a scale subresource */ class V1beta2ScaleSpec { static getAttributeTypeMap() { return V1beta2ScaleSpec.attributeTypeMap; } } V1beta2ScaleSpec.discriminator = undefined; V1beta2ScaleSpec.attributeTypeMap = [ { "name": "replicas", "baseName": "replicas", "type": "number" } ]; exports.V1beta2ScaleSpec = V1beta2ScaleSpec; /** * ScaleStatus represents the current status of a scale subresource. */ class V1beta2ScaleStatus { static getAttributeTypeMap() { return V1beta2ScaleStatus.attributeTypeMap; } } V1beta2ScaleStatus.discriminator = undefined; V1beta2ScaleStatus.attributeTypeMap = [ { "name": "replicas", "baseName": "replicas", "type": "number" }, { "name": "selector", "baseName": "selector", "type": "{ [key: string]: string; }" }, { "name": "targetSelector", "baseName": "targetSelector", "type": "string" } ]; exports.V1beta2ScaleStatus = V1beta2ScaleStatus; /** * DEPRECATED - This group version of StatefulSet is deprecated by apps/v1/StatefulSet. See the release notes for more information. 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. */ class V1beta2StatefulSet { static getAttributeTypeMap() { return V1beta2StatefulSet.attributeTypeMap; } } V1beta2StatefulSet.discriminator = undefined; V1beta2StatefulSet.attributeTypeMap = [ { "name": "apiVersion", "baseName": "apiVersion", "type": "string" }, { "name": "kind", "baseName": "kind", "type": "string" }, { "name": "metadata", "baseName": "metadata", "type": "V1ObjectMeta" }, { "name": "spec", "baseName": "spec", "type": "V1beta2StatefulSetSpec" }, { "name": "status", "baseName": "status", "type": "V1beta2StatefulSetStatus" } ]; exports.V1beta2StatefulSet = V1beta2StatefulSet; /** * StatefulSetCondition describes the state of a statefulset at a certain point. */ class V1beta2StatefulSetCondition { static getAttributeTypeMap() { return V1beta2StatefulSetCondition.attributeTypeMap; } } V1beta2StatefulSetCondition.discriminator = undefined; V1beta2StatefulSetCondition.attributeTypeMap = [ { "name": "lastTransitionTime", "baseName": "lastTransitionTime", "type": "Date" }, { "name": "message", "baseName": "message", "type": "string" }, { "name": "reason", "baseName": "reason", "type": "string" }, { "name": "status", "baseName": "status", "type": "string" }, { "name": "type", "baseName": "type", "type": "string" } ]; exports.V1beta2StatefulSetCondition = V1beta2StatefulSetCondition; /** * StatefulSetList is a collection of StatefulSets. */ class V1beta2StatefulSetList { static getAttributeTypeMap() { return V1beta2StatefulSetList.attributeTypeMap; } } V1beta2StatefulSetList.discriminator = undefined; V1beta2StatefulSetList.attributeTypeMap = [ { "name": "apiVersion", "baseName": "apiVersion", "type": "string" }, { "name": "items", "baseName": "items", "type": "Array" }, { "name": "kind", "baseName": "kind", "type": "string" }, { "name": "metadata", "baseName": "metadata", "type": "V1ListMeta" } ]; exports.V1beta2StatefulSetList = V1beta2StatefulSetList; /** * A StatefulSetSpec is the specification of a StatefulSet. */ class V1beta2StatefulSetSpec { static getAttributeTypeMap() { return V1beta2StatefulSetSpec.attributeTypeMap; } } V1beta2StatefulSetSpec.discriminator = undefined; V1beta2StatefulSetSpec.attributeTypeMap = [ { "name": "podManagementPolicy", "baseName": "podManagementPolicy", "type": "string" }, { "name": "replicas", "baseName": "replicas", "type": "number" }, { "name": "revisionHistoryLimit", "baseName": "revisionHistoryLimit", "type": "number" }, { "name": "selector", "baseName": "selector", "type": "V1LabelSelector" }, { "name": "serviceName", "baseName": "serviceName", "type": "string" }, { "name": "template", "baseName": "template", "type": "V1PodTemplateSpec" }, { "name": "updateStrategy", "baseName": "updateStrategy", "type": "V1beta2StatefulSetUpdateStrategy" }, { "name": "volumeClaimTemplates", "baseName": "volumeClaimTemplates", "type": "Array" } ]; exports.V1beta2StatefulSetSpec = V1beta2StatefulSetSpec; /** * StatefulSetStatus represents the current state of a StatefulSet. */ class V1beta2StatefulSetStatus { static getAttributeTypeMap() { return V1beta2StatefulSetStatus.attributeTypeMap; } } V1beta2StatefulSetStatus.discriminator = undefined; V1beta2StatefulSetStatus.attributeTypeMap = [ { "name": "collisionCount", "baseName": "collisionCount", "type": "number" }, { "name": "conditions", "baseName": "conditions", "type": "Array" }, { "name": "currentReplicas", "baseName": "currentReplicas", "type": "number" }, { "name": "currentRevision", "baseName": "currentRevision", "type": "string" }, { "name": "observedGeneration", "baseName": "observedGeneration", "type": "number" }, { "name": "readyReplicas", "baseName": "readyReplicas", "type": "number" }, { "name": "replicas", "baseName": "replicas", "type": "number" }, { "name": "updateRevision", "baseName": "updateRevision", "type": "string" }, { "name": "updatedReplicas", "baseName": "updatedReplicas", "type": "number" } ]; exports.V1beta2StatefulSetStatus = V1beta2StatefulSetStatus; /** * 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. */ class V1beta2StatefulSetUpdateStrategy { static getAttributeTypeMap() { return V1beta2StatefulSetUpdateStrategy.attributeTypeMap; } } V1beta2StatefulSetUpdateStrategy.discriminator = undefined; V1beta2StatefulSetUpdateStrategy.attributeTypeMap = [ { "name": "rollingUpdate", "baseName": "rollingUpdate", "type": "V1beta2RollingUpdateStatefulSetStrategy" }, { "name": "type", "baseName": "type", "type": "string" } ]; exports.V1beta2StatefulSetUpdateStrategy = V1beta2StatefulSetUpdateStrategy; /** * CronJob represents the configuration of a single cron job. */ class V2alpha1CronJob { static getAttributeTypeMap() { return V2alpha1CronJob.attributeTypeMap; } } V2alpha1CronJob.discriminator = undefined; V2alpha1CronJob.attributeTypeMap = [ { "name": "apiVersion", "baseName": "apiVersion", "type": "string" }, { "name": "kind", "baseName": "kind", "type": "string" }, { "name": "metadata", "baseName": "metadata", "type": "V1ObjectMeta" }, { "name": "spec", "baseName": "spec", "type": "V2alpha1CronJobSpec" }, { "name": "status", "baseName": "status", "type": "V2alpha1CronJobStatus" } ]; exports.V2alpha1CronJob = V2alpha1CronJob; /** * CronJobList is a collection of cron jobs. */ class V2alpha1CronJobList { static getAttributeTypeMap() { return V2alpha1CronJobList.attributeTypeMap; } } V2alpha1CronJobList.discriminator = undefined; V2alpha1CronJobList.attributeTypeMap = [ { "name": "apiVersion", "baseName": "apiVersion", "type": "string" }, { "name": "items", "baseName": "items", "type": "Array" }, { "name": "kind", "baseName": "kind", "type": "string" }, { "name": "metadata", "baseName": "metadata", "type": "V1ListMeta" } ]; exports.V2alpha1CronJobList = V2alpha1CronJobList; /** * CronJobSpec describes how the job execution will look like and when it will actually run. */ class V2alpha1CronJobSpec { static getAttributeTypeMap() { return V2alpha1CronJobSpec.attributeTypeMap; } } V2alpha1CronJobSpec.discriminator = undefined; V2alpha1CronJobSpec.attributeTypeMap = [ { "name": "concurrencyPolicy", "baseName": "concurrencyPolicy", "type": "string" }, { "name": "failedJobsHistoryLimit", "baseName": "failedJobsHistoryLimit", "type": "number" }, { "name": "jobTemplate", "baseName": "jobTemplate", "type": "V2alpha1JobTemplateSpec" }, { "name": "schedule", "baseName": "schedule", "type": "string" }, { "name": "startingDeadlineSeconds", "baseName": "startingDeadlineSeconds", "type": "number" }, { "name": "successfulJobsHistoryLimit", "baseName": "successfulJobsHistoryLimit", "type": "number" }, { "name": "suspend", "baseName": "suspend", "type": "boolean" } ]; exports.V2alpha1CronJobSpec = V2alpha1CronJobSpec; /** * CronJobStatus represents the current state of a cron job. */ class V2alpha1CronJobStatus { static getAttributeTypeMap() { return V2alpha1CronJobStatus.attributeTypeMap; } } V2alpha1CronJobStatus.discriminator = undefined; V2alpha1CronJobStatus.attributeTypeMap = [ { "name": "active", "baseName": "active", "type": "Array" }, { "name": "lastScheduleTime", "baseName": "lastScheduleTime", "type": "Date" } ]; exports.V2alpha1CronJobStatus = V2alpha1CronJobStatus; /** * JobTemplateSpec describes the data a Job should have when created from a template */ class V2alpha1JobTemplateSpec { static getAttributeTypeMap() { return V2alpha1JobTemplateSpec.attributeTypeMap; } } V2alpha1JobTemplateSpec.discriminator = undefined; V2alpha1JobTemplateSpec.attributeTypeMap = [ { "name": "metadata", "baseName": "metadata", "type": "V1ObjectMeta" }, { "name": "spec", "baseName": "spec", "type": "V1JobSpec" } ]; exports.V2alpha1JobTemplateSpec = V2alpha1JobTemplateSpec; /** * CrossVersionObjectReference contains enough information to let you identify the referred resource. */ class V2beta1CrossVersionObjectReference { static getAttributeTypeMap() { return V2beta1CrossVersionObjectReference.attributeTypeMap; } } V2beta1CrossVersionObjectReference.discriminator = undefined; V2beta1CrossVersionObjectReference.attributeTypeMap = [ { "name": "apiVersion", "baseName": "apiVersion", "type": "string" }, { "name": "kind", "baseName": "kind", "type": "string" }, { "name": "name", "baseName": "name", "type": "string" } ]; exports.V2beta1CrossVersionObjectReference = V2beta1CrossVersionObjectReference; /** * 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. */ class V2beta1ExternalMetricSource { static getAttributeTypeMap() { return V2beta1ExternalMetricSource.attributeTypeMap; } } V2beta1ExternalMetricSource.discriminator = undefined; V2beta1ExternalMetricSource.attributeTypeMap = [ { "name": "metricName", "baseName": "metricName", "type": "string" }, { "name": "metricSelector", "baseName": "metricSelector", "type": "V1LabelSelector" }, { "name": "targetAverageValue", "baseName": "targetAverageValue", "type": "string" }, { "name": "targetValue", "baseName": "targetValue", "type": "string" } ]; exports.V2beta1ExternalMetricSource = V2beta1ExternalMetricSource; /** * ExternalMetricStatus indicates the current value of a global metric not associated with any Kubernetes object. */ class V2beta1ExternalMetricStatus { static getAttributeTypeMap() { return V2beta1ExternalMetricStatus.attributeTypeMap; } } V2beta1ExternalMetricStatus.discriminator = undefined; V2beta1ExternalMetricStatus.attributeTypeMap = [ { "name": "currentAverageValue", "baseName": "currentAverageValue", "type": "string" }, { "name": "currentValue", "baseName": "currentValue", "type": "string" }, { "name": "metricName", "baseName": "metricName", "type": "string" }, { "name": "metricSelector", "baseName": "metricSelector", "type": "V1LabelSelector" } ]; exports.V2beta1ExternalMetricStatus = V2beta1ExternalMetricStatus; /** * 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. */ class V2beta1HorizontalPodAutoscaler { static getAttributeTypeMap() { return V2beta1HorizontalPodAutoscaler.attributeTypeMap; } } V2beta1HorizontalPodAutoscaler.discriminator = undefined; V2beta1HorizontalPodAutoscaler.attributeTypeMap = [ { "name": "apiVersion", "baseName": "apiVersion", "type": "string" }, { "name": "kind", "baseName": "kind", "type": "string" }, { "name": "metadata", "baseName": "metadata", "type": "V1ObjectMeta" }, { "name": "spec", "baseName": "spec", "type": "V2beta1HorizontalPodAutoscalerSpec" }, { "name": "status", "baseName": "status", "type": "V2beta1HorizontalPodAutoscalerStatus" } ]; exports.V2beta1HorizontalPodAutoscaler = V2beta1HorizontalPodAutoscaler; /** * HorizontalPodAutoscalerCondition describes the state of a HorizontalPodAutoscaler at a certain point. */ class V2beta1HorizontalPodAutoscalerCondition { static getAttributeTypeMap() { return V2beta1HorizontalPodAutoscalerCondition.attributeTypeMap; } } V2beta1HorizontalPodAutoscalerCondition.discriminator = undefined; V2beta1HorizontalPodAutoscalerCondition.attributeTypeMap = [ { "name": "lastTransitionTime", "baseName": "lastTransitionTime", "type": "Date" }, { "name": "message", "baseName": "message", "type": "string" }, { "name": "reason", "baseName": "reason", "type": "string" }, { "name": "status", "baseName": "status", "type": "string" }, { "name": "type", "baseName": "type", "type": "string" } ]; exports.V2beta1HorizontalPodAutoscalerCondition = V2beta1HorizontalPodAutoscalerCondition; /** * HorizontalPodAutoscaler is a list of horizontal pod autoscaler objects. */ class V2beta1HorizontalPodAutoscalerList { static getAttributeTypeMap() { return V2beta1HorizontalPodAutoscalerList.attributeTypeMap; } } V2beta1HorizontalPodAutoscalerList.discriminator = undefined; V2beta1HorizontalPodAutoscalerList.attributeTypeMap = [ { "name": "apiVersion", "baseName": "apiVersion", "type": "string" }, { "name": "items", "baseName": "items", "type": "Array" }, { "name": "kind", "baseName": "kind", "type": "string" }, { "name": "metadata", "baseName": "metadata", "type": "V1ListMeta" } ]; exports.V2beta1HorizontalPodAutoscalerList = V2beta1HorizontalPodAutoscalerList; /** * HorizontalPodAutoscalerSpec describes the desired functionality of the HorizontalPodAutoscaler. */ class V2beta1HorizontalPodAutoscalerSpec { static getAttributeTypeMap() { return V2beta1HorizontalPodAutoscalerSpec.attributeTypeMap; } } V2beta1HorizontalPodAutoscalerSpec.discriminator = undefined; V2beta1HorizontalPodAutoscalerSpec.attributeTypeMap = [ { "name": "maxReplicas", "baseName": "maxReplicas", "type": "number" }, { "name": "metrics", "baseName": "metrics", "type": "Array" }, { "name": "minReplicas", "baseName": "minReplicas", "type": "number" }, { "name": "scaleTargetRef", "baseName": "scaleTargetRef", "type": "V2beta1CrossVersionObjectReference" } ]; exports.V2beta1HorizontalPodAutoscalerSpec = V2beta1HorizontalPodAutoscalerSpec; /** * HorizontalPodAutoscalerStatus describes the current status of a horizontal pod autoscaler. */ class V2beta1HorizontalPodAutoscalerStatus { static getAttributeTypeMap() { return V2beta1HorizontalPodAutoscalerStatus.attributeTypeMap; } } V2beta1HorizontalPodAutoscalerStatus.discriminator = undefined; V2beta1HorizontalPodAutoscalerStatus.attributeTypeMap = [ { "name": "conditions", "baseName": "conditions", "type": "Array" }, { "name": "currentMetrics", "baseName": "currentMetrics", "type": "Array" }, { "name": "currentReplicas", "baseName": "currentReplicas", "type": "number" }, { "name": "desiredReplicas", "baseName": "desiredReplicas", "type": "number" }, { "name": "lastScaleTime", "baseName": "lastScaleTime", "type": "Date" }, { "name": "observedGeneration", "baseName": "observedGeneration", "type": "number" } ]; exports.V2beta1HorizontalPodAutoscalerStatus = V2beta1HorizontalPodAutoscalerStatus; /** * MetricSpec specifies how to scale based on a single metric (only `type` and one other matching field should be set at once). */ class V2beta1MetricSpec { static getAttributeTypeMap() { return V2beta1MetricSpec.attributeTypeMap; } } V2beta1MetricSpec.discriminator = undefined; V2beta1MetricSpec.attributeTypeMap = [ { "name": "external", "baseName": "external", "type": "V2beta1ExternalMetricSource" }, { "name": "object", "baseName": "object", "type": "V2beta1ObjectMetricSource" }, { "name": "pods", "baseName": "pods", "type": "V2beta1PodsMetricSource" }, { "name": "resource", "baseName": "resource", "type": "V2beta1ResourceMetricSource" }, { "name": "type", "baseName": "type", "type": "string" } ]; exports.V2beta1MetricSpec = V2beta1MetricSpec; /** * MetricStatus describes the last-read state of a single metric. */ class V2beta1MetricStatus { static getAttributeTypeMap() { return V2beta1MetricStatus.attributeTypeMap; } } V2beta1MetricStatus.discriminator = undefined; V2beta1MetricStatus.attributeTypeMap = [ { "name": "external", "baseName": "external", "type": "V2beta1ExternalMetricStatus" }, { "name": "object", "baseName": "object", "type": "V2beta1ObjectMetricStatus" }, { "name": "pods", "baseName": "pods", "type": "V2beta1PodsMetricStatus" }, { "name": "resource", "baseName": "resource", "type": "V2beta1ResourceMetricStatus" }, { "name": "type", "baseName": "type", "type": "string" } ]; exports.V2beta1MetricStatus = V2beta1MetricStatus; /** * ObjectMetricSource indicates how to scale on a metric describing a kubernetes object (for example, hits-per-second on an Ingress object). */ class V2beta1ObjectMetricSource { static getAttributeTypeMap() { return V2beta1ObjectMetricSource.attributeTypeMap; } } V2beta1ObjectMetricSource.discriminator = undefined; V2beta1ObjectMetricSource.attributeTypeMap = [ { "name": "averageValue", "baseName": "averageValue", "type": "string" }, { "name": "metricName", "baseName": "metricName", "type": "string" }, { "name": "selector", "baseName": "selector", "type": "V1LabelSelector" }, { "name": "target", "baseName": "target", "type": "V2beta1CrossVersionObjectReference" }, { "name": "targetValue", "baseName": "targetValue", "type": "string" } ]; exports.V2beta1ObjectMetricSource = V2beta1ObjectMetricSource; /** * ObjectMetricStatus indicates the current value of a metric describing a kubernetes object (for example, hits-per-second on an Ingress object). */ class V2beta1ObjectMetricStatus { static getAttributeTypeMap() { return V2beta1ObjectMetricStatus.attributeTypeMap; } } V2beta1ObjectMetricStatus.discriminator = undefined; V2beta1ObjectMetricStatus.attributeTypeMap = [ { "name": "averageValue", "baseName": "averageValue", "type": "string" }, { "name": "currentValue", "baseName": "currentValue", "type": "string" }, { "name": "metricName", "baseName": "metricName", "type": "string" }, { "name": "selector", "baseName": "selector", "type": "V1LabelSelector" }, { "name": "target", "baseName": "target", "type": "V2beta1CrossVersionObjectReference" } ]; exports.V2beta1ObjectMetricStatus = V2beta1ObjectMetricStatus; /** * 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. */ class V2beta1PodsMetricSource { static getAttributeTypeMap() { return V2beta1PodsMetricSource.attributeTypeMap; } } V2beta1PodsMetricSource.discriminator = undefined; V2beta1PodsMetricSource.attributeTypeMap = [ { "name": "metricName", "baseName": "metricName", "type": "string" }, { "name": "selector", "baseName": "selector", "type": "V1LabelSelector" }, { "name": "targetAverageValue", "baseName": "targetAverageValue", "type": "string" } ]; exports.V2beta1PodsMetricSource = V2beta1PodsMetricSource; /** * PodsMetricStatus indicates the current value of a metric describing each pod in the current scale target (for example, transactions-processed-per-second). */ class V2beta1PodsMetricStatus { static getAttributeTypeMap() { return V2beta1PodsMetricStatus.attributeTypeMap; } } V2beta1PodsMetricStatus.discriminator = undefined; V2beta1PodsMetricStatus.attributeTypeMap = [ { "name": "currentAverageValue", "baseName": "currentAverageValue", "type": "string" }, { "name": "metricName", "baseName": "metricName", "type": "string" }, { "name": "selector", "baseName": "selector", "type": "V1LabelSelector" } ]; exports.V2beta1PodsMetricStatus = V2beta1PodsMetricStatus; /** * 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. */ class V2beta1ResourceMetricSource { static getAttributeTypeMap() { return V2beta1ResourceMetricSource.attributeTypeMap; } } V2beta1ResourceMetricSource.discriminator = undefined; V2beta1ResourceMetricSource.attributeTypeMap = [ { "name": "name", "baseName": "name", "type": "string" }, { "name": "targetAverageUtilization", "baseName": "targetAverageUtilization", "type": "number" }, { "name": "targetAverageValue", "baseName": "targetAverageValue", "type": "string" } ]; exports.V2beta1ResourceMetricSource = V2beta1ResourceMetricSource; /** * 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. */ class V2beta1ResourceMetricStatus { static getAttributeTypeMap() { return V2beta1ResourceMetricStatus.attributeTypeMap; } } V2beta1ResourceMetricStatus.discriminator = undefined; V2beta1ResourceMetricStatus.attributeTypeMap = [ { "name": "currentAverageUtilization", "baseName": "currentAverageUtilization", "type": "number" }, { "name": "currentAverageValue", "baseName": "currentAverageValue", "type": "string" }, { "name": "name", "baseName": "name", "type": "string" } ]; exports.V2beta1ResourceMetricStatus = V2beta1ResourceMetricStatus; /** * CrossVersionObjectReference contains enough information to let you identify the referred resource. */ class V2beta2CrossVersionObjectReference { static getAttributeTypeMap() { return V2beta2CrossVersionObjectReference.attributeTypeMap; } } V2beta2CrossVersionObjectReference.discriminator = undefined; V2beta2CrossVersionObjectReference.attributeTypeMap = [ { "name": "apiVersion", "baseName": "apiVersion", "type": "string" }, { "name": "kind", "baseName": "kind", "type": "string" }, { "name": "name", "baseName": "name", "type": "string" } ]; exports.V2beta2CrossVersionObjectReference = V2beta2CrossVersionObjectReference; /** * 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). */ class V2beta2ExternalMetricSource { static getAttributeTypeMap() { return V2beta2ExternalMetricSource.attributeTypeMap; } } V2beta2ExternalMetricSource.discriminator = undefined; V2beta2ExternalMetricSource.attributeTypeMap = [ { "name": "metric", "baseName": "metric", "type": "V2beta2MetricIdentifier" }, { "name": "target", "baseName": "target", "type": "V2beta2MetricTarget" } ]; exports.V2beta2ExternalMetricSource = V2beta2ExternalMetricSource; /** * ExternalMetricStatus indicates the current value of a global metric not associated with any Kubernetes object. */ class V2beta2ExternalMetricStatus { static getAttributeTypeMap() { return V2beta2ExternalMetricStatus.attributeTypeMap; } } V2beta2ExternalMetricStatus.discriminator = undefined; V2beta2ExternalMetricStatus.attributeTypeMap = [ { "name": "current", "baseName": "current", "type": "V2beta2MetricValueStatus" }, { "name": "metric", "baseName": "metric", "type": "V2beta2MetricIdentifier" } ]; exports.V2beta2ExternalMetricStatus = V2beta2ExternalMetricStatus; /** * 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. */ class V2beta2HorizontalPodAutoscaler { static getAttributeTypeMap() { return V2beta2HorizontalPodAutoscaler.attributeTypeMap; } } V2beta2HorizontalPodAutoscaler.discriminator = undefined; V2beta2HorizontalPodAutoscaler.attributeTypeMap = [ { "name": "apiVersion", "baseName": "apiVersion", "type": "string" }, { "name": "kind", "baseName": "kind", "type": "string" }, { "name": "metadata", "baseName": "metadata", "type": "V1ObjectMeta" }, { "name": "spec", "baseName": "spec", "type": "V2beta2HorizontalPodAutoscalerSpec" }, { "name": "status", "baseName": "status", "type": "V2beta2HorizontalPodAutoscalerStatus" } ]; exports.V2beta2HorizontalPodAutoscaler = V2beta2HorizontalPodAutoscaler; /** * HorizontalPodAutoscalerCondition describes the state of a HorizontalPodAutoscaler at a certain point. */ class V2beta2HorizontalPodAutoscalerCondition { static getAttributeTypeMap() { return V2beta2HorizontalPodAutoscalerCondition.attributeTypeMap; } } V2beta2HorizontalPodAutoscalerCondition.discriminator = undefined; V2beta2HorizontalPodAutoscalerCondition.attributeTypeMap = [ { "name": "lastTransitionTime", "baseName": "lastTransitionTime", "type": "Date" }, { "name": "message", "baseName": "message", "type": "string" }, { "name": "reason", "baseName": "reason", "type": "string" }, { "name": "status", "baseName": "status", "type": "string" }, { "name": "type", "baseName": "type", "type": "string" } ]; exports.V2beta2HorizontalPodAutoscalerCondition = V2beta2HorizontalPodAutoscalerCondition; /** * HorizontalPodAutoscalerList is a list of horizontal pod autoscaler objects. */ class V2beta2HorizontalPodAutoscalerList { static getAttributeTypeMap() { return V2beta2HorizontalPodAutoscalerList.attributeTypeMap; } } V2beta2HorizontalPodAutoscalerList.discriminator = undefined; V2beta2HorizontalPodAutoscalerList.attributeTypeMap = [ { "name": "apiVersion", "baseName": "apiVersion", "type": "string" }, { "name": "items", "baseName": "items", "type": "Array" }, { "name": "kind", "baseName": "kind", "type": "string" }, { "name": "metadata", "baseName": "metadata", "type": "V1ListMeta" } ]; exports.V2beta2HorizontalPodAutoscalerList = V2beta2HorizontalPodAutoscalerList; /** * HorizontalPodAutoscalerSpec describes the desired functionality of the HorizontalPodAutoscaler. */ class V2beta2HorizontalPodAutoscalerSpec { static getAttributeTypeMap() { return V2beta2HorizontalPodAutoscalerSpec.attributeTypeMap; } } V2beta2HorizontalPodAutoscalerSpec.discriminator = undefined; V2beta2HorizontalPodAutoscalerSpec.attributeTypeMap = [ { "name": "maxReplicas", "baseName": "maxReplicas", "type": "number" }, { "name": "metrics", "baseName": "metrics", "type": "Array" }, { "name": "minReplicas", "baseName": "minReplicas", "type": "number" }, { "name": "scaleTargetRef", "baseName": "scaleTargetRef", "type": "V2beta2CrossVersionObjectReference" } ]; exports.V2beta2HorizontalPodAutoscalerSpec = V2beta2HorizontalPodAutoscalerSpec; /** * HorizontalPodAutoscalerStatus describes the current status of a horizontal pod autoscaler. */ class V2beta2HorizontalPodAutoscalerStatus { static getAttributeTypeMap() { return V2beta2HorizontalPodAutoscalerStatus.attributeTypeMap; } } V2beta2HorizontalPodAutoscalerStatus.discriminator = undefined; V2beta2HorizontalPodAutoscalerStatus.attributeTypeMap = [ { "name": "conditions", "baseName": "conditions", "type": "Array" }, { "name": "currentMetrics", "baseName": "currentMetrics", "type": "Array" }, { "name": "currentReplicas", "baseName": "currentReplicas", "type": "number" }, { "name": "desiredReplicas", "baseName": "desiredReplicas", "type": "number" }, { "name": "lastScaleTime", "baseName": "lastScaleTime", "type": "Date" }, { "name": "observedGeneration", "baseName": "observedGeneration", "type": "number" } ]; exports.V2beta2HorizontalPodAutoscalerStatus = V2beta2HorizontalPodAutoscalerStatus; /** * MetricIdentifier defines the name and optionally selector for a metric */ class V2beta2MetricIdentifier { static getAttributeTypeMap() { return V2beta2MetricIdentifier.attributeTypeMap; } } V2beta2MetricIdentifier.discriminator = undefined; V2beta2MetricIdentifier.attributeTypeMap = [ { "name": "name", "baseName": "name", "type": "string" }, { "name": "selector", "baseName": "selector", "type": "V1LabelSelector" } ]; exports.V2beta2MetricIdentifier = V2beta2MetricIdentifier; /** * MetricSpec specifies how to scale based on a single metric (only `type` and one other matching field should be set at once). */ class V2beta2MetricSpec { static getAttributeTypeMap() { return V2beta2MetricSpec.attributeTypeMap; } } V2beta2MetricSpec.discriminator = undefined; V2beta2MetricSpec.attributeTypeMap = [ { "name": "external", "baseName": "external", "type": "V2beta2ExternalMetricSource" }, { "name": "object", "baseName": "object", "type": "V2beta2ObjectMetricSource" }, { "name": "pods", "baseName": "pods", "type": "V2beta2PodsMetricSource" }, { "name": "resource", "baseName": "resource", "type": "V2beta2ResourceMetricSource" }, { "name": "type", "baseName": "type", "type": "string" } ]; exports.V2beta2MetricSpec = V2beta2MetricSpec; /** * MetricStatus describes the last-read state of a single metric. */ class V2beta2MetricStatus { static getAttributeTypeMap() { return V2beta2MetricStatus.attributeTypeMap; } } V2beta2MetricStatus.discriminator = undefined; V2beta2MetricStatus.attributeTypeMap = [ { "name": "external", "baseName": "external", "type": "V2beta2ExternalMetricStatus" }, { "name": "object", "baseName": "object", "type": "V2beta2ObjectMetricStatus" }, { "name": "pods", "baseName": "pods", "type": "V2beta2PodsMetricStatus" }, { "name": "resource", "baseName": "resource", "type": "V2beta2ResourceMetricStatus" }, { "name": "type", "baseName": "type", "type": "string" } ]; exports.V2beta2MetricStatus = V2beta2MetricStatus; /** * MetricTarget defines the target value, average value, or average utilization of a specific metric */ class V2beta2MetricTarget { static getAttributeTypeMap() { return V2beta2MetricTarget.attributeTypeMap; } } V2beta2MetricTarget.discriminator = undefined; V2beta2MetricTarget.attributeTypeMap = [ { "name": "averageUtilization", "baseName": "averageUtilization", "type": "number" }, { "name": "averageValue", "baseName": "averageValue", "type": "string" }, { "name": "type", "baseName": "type", "type": "string" }, { "name": "value", "baseName": "value", "type": "string" } ]; exports.V2beta2MetricTarget = V2beta2MetricTarget; /** * MetricValueStatus holds the current value for a metric */ class V2beta2MetricValueStatus { static getAttributeTypeMap() { return V2beta2MetricValueStatus.attributeTypeMap; } } V2beta2MetricValueStatus.discriminator = undefined; V2beta2MetricValueStatus.attributeTypeMap = [ { "name": "averageUtilization", "baseName": "averageUtilization", "type": "number" }, { "name": "averageValue", "baseName": "averageValue", "type": "string" }, { "name": "value", "baseName": "value", "type": "string" } ]; exports.V2beta2MetricValueStatus = V2beta2MetricValueStatus; /** * ObjectMetricSource indicates how to scale on a metric describing a kubernetes object (for example, hits-per-second on an Ingress object). */ class V2beta2ObjectMetricSource { static getAttributeTypeMap() { return V2beta2ObjectMetricSource.attributeTypeMap; } } V2beta2ObjectMetricSource.discriminator = undefined; V2beta2ObjectMetricSource.attributeTypeMap = [ { "name": "describedObject", "baseName": "describedObject", "type": "V2beta2CrossVersionObjectReference" }, { "name": "metric", "baseName": "metric", "type": "V2beta2MetricIdentifier" }, { "name": "target", "baseName": "target", "type": "V2beta2MetricTarget" } ]; exports.V2beta2ObjectMetricSource = V2beta2ObjectMetricSource; /** * ObjectMetricStatus indicates the current value of a metric describing a kubernetes object (for example, hits-per-second on an Ingress object). */ class V2beta2ObjectMetricStatus { static getAttributeTypeMap() { return V2beta2ObjectMetricStatus.attributeTypeMap; } } V2beta2ObjectMetricStatus.discriminator = undefined; V2beta2ObjectMetricStatus.attributeTypeMap = [ { "name": "current", "baseName": "current", "type": "V2beta2MetricValueStatus" }, { "name": "describedObject", "baseName": "describedObject", "type": "V2beta2CrossVersionObjectReference" }, { "name": "metric", "baseName": "metric", "type": "V2beta2MetricIdentifier" } ]; exports.V2beta2ObjectMetricStatus = V2beta2ObjectMetricStatus; /** * 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. */ class V2beta2PodsMetricSource { static getAttributeTypeMap() { return V2beta2PodsMetricSource.attributeTypeMap; } } V2beta2PodsMetricSource.discriminator = undefined; V2beta2PodsMetricSource.attributeTypeMap = [ { "name": "metric", "baseName": "metric", "type": "V2beta2MetricIdentifier" }, { "name": "target", "baseName": "target", "type": "V2beta2MetricTarget" } ]; exports.V2beta2PodsMetricSource = V2beta2PodsMetricSource; /** * PodsMetricStatus indicates the current value of a metric describing each pod in the current scale target (for example, transactions-processed-per-second). */ class V2beta2PodsMetricStatus { static getAttributeTypeMap() { return V2beta2PodsMetricStatus.attributeTypeMap; } } V2beta2PodsMetricStatus.discriminator = undefined; V2beta2PodsMetricStatus.attributeTypeMap = [ { "name": "current", "baseName": "current", "type": "V2beta2MetricValueStatus" }, { "name": "metric", "baseName": "metric", "type": "V2beta2MetricIdentifier" } ]; exports.V2beta2PodsMetricStatus = V2beta2PodsMetricStatus; /** * 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. */ class V2beta2ResourceMetricSource { static getAttributeTypeMap() { return V2beta2ResourceMetricSource.attributeTypeMap; } } V2beta2ResourceMetricSource.discriminator = undefined; V2beta2ResourceMetricSource.attributeTypeMap = [ { "name": "name", "baseName": "name", "type": "string" }, { "name": "target", "baseName": "target", "type": "V2beta2MetricTarget" } ]; exports.V2beta2ResourceMetricSource = V2beta2ResourceMetricSource; /** * 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. */ class V2beta2ResourceMetricStatus { static getAttributeTypeMap() { return V2beta2ResourceMetricStatus.attributeTypeMap; } } V2beta2ResourceMetricStatus.discriminator = undefined; V2beta2ResourceMetricStatus.attributeTypeMap = [ { "name": "current", "baseName": "current", "type": "V2beta2MetricValueStatus" }, { "name": "name", "baseName": "name", "type": "string" } ]; exports.V2beta2ResourceMetricStatus = V2beta2ResourceMetricStatus; /** * Info contains versioning information. how we'll want to distribute that information. */ class VersionInfo { static getAttributeTypeMap() { return VersionInfo.attributeTypeMap; } } VersionInfo.discriminator = undefined; VersionInfo.attributeTypeMap = [ { "name": "buildDate", "baseName": "buildDate", "type": "string" }, { "name": "compiler", "baseName": "compiler", "type": "string" }, { "name": "gitCommit", "baseName": "gitCommit", "type": "string" }, { "name": "gitTreeState", "baseName": "gitTreeState", "type": "string" }, { "name": "gitVersion", "baseName": "gitVersion", "type": "string" }, { "name": "goVersion", "baseName": "goVersion", "type": "string" }, { "name": "major", "baseName": "major", "type": "string" }, { "name": "minor", "baseName": "minor", "type": "string" }, { "name": "platform", "baseName": "platform", "type": "string" } ]; exports.VersionInfo = VersionInfo; let enumsMap = {}; let typeMap = { "AdmissionregistrationV1beta1ServiceReference": AdmissionregistrationV1beta1ServiceReference, "AdmissionregistrationV1beta1WebhookClientConfig": AdmissionregistrationV1beta1WebhookClientConfig, "ApiextensionsV1beta1ServiceReference": ApiextensionsV1beta1ServiceReference, "ApiextensionsV1beta1WebhookClientConfig": ApiextensionsV1beta1WebhookClientConfig, "ApiregistrationV1beta1ServiceReference": ApiregistrationV1beta1ServiceReference, "AppsV1beta1Deployment": AppsV1beta1Deployment, "AppsV1beta1DeploymentCondition": AppsV1beta1DeploymentCondition, "AppsV1beta1DeploymentList": AppsV1beta1DeploymentList, "AppsV1beta1DeploymentRollback": AppsV1beta1DeploymentRollback, "AppsV1beta1DeploymentSpec": AppsV1beta1DeploymentSpec, "AppsV1beta1DeploymentStatus": AppsV1beta1DeploymentStatus, "AppsV1beta1DeploymentStrategy": AppsV1beta1DeploymentStrategy, "AppsV1beta1RollbackConfig": AppsV1beta1RollbackConfig, "AppsV1beta1RollingUpdateDeployment": AppsV1beta1RollingUpdateDeployment, "AppsV1beta1Scale": AppsV1beta1Scale, "AppsV1beta1ScaleSpec": AppsV1beta1ScaleSpec, "AppsV1beta1ScaleStatus": AppsV1beta1ScaleStatus, "ExtensionsV1beta1AllowedFlexVolume": ExtensionsV1beta1AllowedFlexVolume, "ExtensionsV1beta1AllowedHostPath": ExtensionsV1beta1AllowedHostPath, "ExtensionsV1beta1Deployment": ExtensionsV1beta1Deployment, "ExtensionsV1beta1DeploymentCondition": ExtensionsV1beta1DeploymentCondition, "ExtensionsV1beta1DeploymentList": ExtensionsV1beta1DeploymentList, "ExtensionsV1beta1DeploymentRollback": ExtensionsV1beta1DeploymentRollback, "ExtensionsV1beta1DeploymentSpec": ExtensionsV1beta1DeploymentSpec, "ExtensionsV1beta1DeploymentStatus": ExtensionsV1beta1DeploymentStatus, "ExtensionsV1beta1DeploymentStrategy": ExtensionsV1beta1DeploymentStrategy, "ExtensionsV1beta1FSGroupStrategyOptions": ExtensionsV1beta1FSGroupStrategyOptions, "ExtensionsV1beta1HostPortRange": ExtensionsV1beta1HostPortRange, "ExtensionsV1beta1IDRange": ExtensionsV1beta1IDRange, "ExtensionsV1beta1PodSecurityPolicy": ExtensionsV1beta1PodSecurityPolicy, "ExtensionsV1beta1PodSecurityPolicyList": ExtensionsV1beta1PodSecurityPolicyList, "ExtensionsV1beta1PodSecurityPolicySpec": ExtensionsV1beta1PodSecurityPolicySpec, "ExtensionsV1beta1RollbackConfig": ExtensionsV1beta1RollbackConfig, "ExtensionsV1beta1RollingUpdateDeployment": ExtensionsV1beta1RollingUpdateDeployment, "ExtensionsV1beta1RunAsGroupStrategyOptions": ExtensionsV1beta1RunAsGroupStrategyOptions, "ExtensionsV1beta1RunAsUserStrategyOptions": ExtensionsV1beta1RunAsUserStrategyOptions, "ExtensionsV1beta1SELinuxStrategyOptions": ExtensionsV1beta1SELinuxStrategyOptions, "ExtensionsV1beta1Scale": ExtensionsV1beta1Scale, "ExtensionsV1beta1ScaleSpec": ExtensionsV1beta1ScaleSpec, "ExtensionsV1beta1ScaleStatus": ExtensionsV1beta1ScaleStatus, "ExtensionsV1beta1SupplementalGroupsStrategyOptions": ExtensionsV1beta1SupplementalGroupsStrategyOptions, "PolicyV1beta1AllowedFlexVolume": PolicyV1beta1AllowedFlexVolume, "PolicyV1beta1AllowedHostPath": PolicyV1beta1AllowedHostPath, "PolicyV1beta1FSGroupStrategyOptions": PolicyV1beta1FSGroupStrategyOptions, "PolicyV1beta1HostPortRange": PolicyV1beta1HostPortRange, "PolicyV1beta1IDRange": PolicyV1beta1IDRange, "PolicyV1beta1PodSecurityPolicy": PolicyV1beta1PodSecurityPolicy, "PolicyV1beta1PodSecurityPolicyList": PolicyV1beta1PodSecurityPolicyList, "PolicyV1beta1PodSecurityPolicySpec": PolicyV1beta1PodSecurityPolicySpec, "PolicyV1beta1RunAsGroupStrategyOptions": PolicyV1beta1RunAsGroupStrategyOptions, "PolicyV1beta1RunAsUserStrategyOptions": PolicyV1beta1RunAsUserStrategyOptions, "PolicyV1beta1SELinuxStrategyOptions": PolicyV1beta1SELinuxStrategyOptions, "PolicyV1beta1SupplementalGroupsStrategyOptions": PolicyV1beta1SupplementalGroupsStrategyOptions, "RuntimeRawExtension": RuntimeRawExtension, "V1APIGroup": V1APIGroup, "V1APIGroupList": V1APIGroupList, "V1APIResource": V1APIResource, "V1APIResourceList": V1APIResourceList, "V1APIService": V1APIService, "V1APIServiceCondition": V1APIServiceCondition, "V1APIServiceList": V1APIServiceList, "V1APIServiceSpec": V1APIServiceSpec, "V1APIServiceStatus": V1APIServiceStatus, "V1APIVersions": V1APIVersions, "V1AWSElasticBlockStoreVolumeSource": V1AWSElasticBlockStoreVolumeSource, "V1Affinity": V1Affinity, "V1AggregationRule": V1AggregationRule, "V1AttachedVolume": V1AttachedVolume, "V1AzureDiskVolumeSource": V1AzureDiskVolumeSource, "V1AzureFilePersistentVolumeSource": V1AzureFilePersistentVolumeSource, "V1AzureFileVolumeSource": V1AzureFileVolumeSource, "V1Binding": V1Binding, "V1CSIPersistentVolumeSource": V1CSIPersistentVolumeSource, "V1Capabilities": V1Capabilities, "V1CephFSPersistentVolumeSource": V1CephFSPersistentVolumeSource, "V1CephFSVolumeSource": V1CephFSVolumeSource, "V1CinderPersistentVolumeSource": V1CinderPersistentVolumeSource, "V1CinderVolumeSource": V1CinderVolumeSource, "V1ClientIPConfig": V1ClientIPConfig, "V1ClusterRole": V1ClusterRole, "V1ClusterRoleBinding": V1ClusterRoleBinding, "V1ClusterRoleBindingList": V1ClusterRoleBindingList, "V1ClusterRoleList": V1ClusterRoleList, "V1ComponentCondition": V1ComponentCondition, "V1ComponentStatus": V1ComponentStatus, "V1ComponentStatusList": V1ComponentStatusList, "V1ConfigMap": V1ConfigMap, "V1ConfigMapEnvSource": V1ConfigMapEnvSource, "V1ConfigMapKeySelector": V1ConfigMapKeySelector, "V1ConfigMapList": V1ConfigMapList, "V1ConfigMapNodeConfigSource": V1ConfigMapNodeConfigSource, "V1ConfigMapProjection": V1ConfigMapProjection, "V1ConfigMapVolumeSource": V1ConfigMapVolumeSource, "V1Container": V1Container, "V1ContainerImage": V1ContainerImage, "V1ContainerPort": V1ContainerPort, "V1ContainerState": V1ContainerState, "V1ContainerStateRunning": V1ContainerStateRunning, "V1ContainerStateTerminated": V1ContainerStateTerminated, "V1ContainerStateWaiting": V1ContainerStateWaiting, "V1ContainerStatus": V1ContainerStatus, "V1ControllerRevision": V1ControllerRevision, "V1ControllerRevisionList": V1ControllerRevisionList, "V1CrossVersionObjectReference": V1CrossVersionObjectReference, "V1DaemonEndpoint": V1DaemonEndpoint, "V1DaemonSet": V1DaemonSet, "V1DaemonSetCondition": V1DaemonSetCondition, "V1DaemonSetList": V1DaemonSetList, "V1DaemonSetSpec": V1DaemonSetSpec, "V1DaemonSetStatus": V1DaemonSetStatus, "V1DaemonSetUpdateStrategy": V1DaemonSetUpdateStrategy, "V1DeleteOptions": V1DeleteOptions, "V1Deployment": V1Deployment, "V1DeploymentCondition": V1DeploymentCondition, "V1DeploymentList": V1DeploymentList, "V1DeploymentSpec": V1DeploymentSpec, "V1DeploymentStatus": V1DeploymentStatus, "V1DeploymentStrategy": V1DeploymentStrategy, "V1DownwardAPIProjection": V1DownwardAPIProjection, "V1DownwardAPIVolumeFile": V1DownwardAPIVolumeFile, "V1DownwardAPIVolumeSource": V1DownwardAPIVolumeSource, "V1EmptyDirVolumeSource": V1EmptyDirVolumeSource, "V1EndpointAddress": V1EndpointAddress, "V1EndpointPort": V1EndpointPort, "V1EndpointSubset": V1EndpointSubset, "V1Endpoints": V1Endpoints, "V1EndpointsList": V1EndpointsList, "V1EnvFromSource": V1EnvFromSource, "V1EnvVar": V1EnvVar, "V1EnvVarSource": V1EnvVarSource, "V1Event": V1Event, "V1EventList": V1EventList, "V1EventSeries": V1EventSeries, "V1EventSource": V1EventSource, "V1ExecAction": V1ExecAction, "V1FCVolumeSource": V1FCVolumeSource, "V1FlexPersistentVolumeSource": V1FlexPersistentVolumeSource, "V1FlexVolumeSource": V1FlexVolumeSource, "V1FlockerVolumeSource": V1FlockerVolumeSource, "V1GCEPersistentDiskVolumeSource": V1GCEPersistentDiskVolumeSource, "V1GitRepoVolumeSource": V1GitRepoVolumeSource, "V1GlusterfsPersistentVolumeSource": V1GlusterfsPersistentVolumeSource, "V1GlusterfsVolumeSource": V1GlusterfsVolumeSource, "V1GroupVersionForDiscovery": V1GroupVersionForDiscovery, "V1HTTPGetAction": V1HTTPGetAction, "V1HTTPHeader": V1HTTPHeader, "V1Handler": V1Handler, "V1HorizontalPodAutoscaler": V1HorizontalPodAutoscaler, "V1HorizontalPodAutoscalerList": V1HorizontalPodAutoscalerList, "V1HorizontalPodAutoscalerSpec": V1HorizontalPodAutoscalerSpec, "V1HorizontalPodAutoscalerStatus": V1HorizontalPodAutoscalerStatus, "V1HostAlias": V1HostAlias, "V1HostPathVolumeSource": V1HostPathVolumeSource, "V1IPBlock": V1IPBlock, "V1ISCSIPersistentVolumeSource": V1ISCSIPersistentVolumeSource, "V1ISCSIVolumeSource": V1ISCSIVolumeSource, "V1Initializer": V1Initializer, "V1Initializers": V1Initializers, "V1Job": V1Job, "V1JobCondition": V1JobCondition, "V1JobList": V1JobList, "V1JobSpec": V1JobSpec, "V1JobStatus": V1JobStatus, "V1KeyToPath": V1KeyToPath, "V1LabelSelector": V1LabelSelector, "V1LabelSelectorRequirement": V1LabelSelectorRequirement, "V1Lifecycle": V1Lifecycle, "V1LimitRange": V1LimitRange, "V1LimitRangeItem": V1LimitRangeItem, "V1LimitRangeList": V1LimitRangeList, "V1LimitRangeSpec": V1LimitRangeSpec, "V1ListMeta": V1ListMeta, "V1LoadBalancerIngress": V1LoadBalancerIngress, "V1LoadBalancerStatus": V1LoadBalancerStatus, "V1LocalObjectReference": V1LocalObjectReference, "V1LocalSubjectAccessReview": V1LocalSubjectAccessReview, "V1LocalVolumeSource": V1LocalVolumeSource, "V1NFSVolumeSource": V1NFSVolumeSource, "V1Namespace": V1Namespace, "V1NamespaceList": V1NamespaceList, "V1NamespaceSpec": V1NamespaceSpec, "V1NamespaceStatus": V1NamespaceStatus, "V1NetworkPolicy": V1NetworkPolicy, "V1NetworkPolicyEgressRule": V1NetworkPolicyEgressRule, "V1NetworkPolicyIngressRule": V1NetworkPolicyIngressRule, "V1NetworkPolicyList": V1NetworkPolicyList, "V1NetworkPolicyPeer": V1NetworkPolicyPeer, "V1NetworkPolicyPort": V1NetworkPolicyPort, "V1NetworkPolicySpec": V1NetworkPolicySpec, "V1Node": V1Node, "V1NodeAddress": V1NodeAddress, "V1NodeAffinity": V1NodeAffinity, "V1NodeCondition": V1NodeCondition, "V1NodeConfigSource": V1NodeConfigSource, "V1NodeConfigStatus": V1NodeConfigStatus, "V1NodeDaemonEndpoints": V1NodeDaemonEndpoints, "V1NodeList": V1NodeList, "V1NodeSelector": V1NodeSelector, "V1NodeSelectorRequirement": V1NodeSelectorRequirement, "V1NodeSelectorTerm": V1NodeSelectorTerm, "V1NodeSpec": V1NodeSpec, "V1NodeStatus": V1NodeStatus, "V1NodeSystemInfo": V1NodeSystemInfo, "V1NonResourceAttributes": V1NonResourceAttributes, "V1NonResourceRule": V1NonResourceRule, "V1ObjectFieldSelector": V1ObjectFieldSelector, "V1ObjectMeta": V1ObjectMeta, "V1ObjectReference": V1ObjectReference, "V1OwnerReference": V1OwnerReference, "V1PersistentVolume": V1PersistentVolume, "V1PersistentVolumeClaim": V1PersistentVolumeClaim, "V1PersistentVolumeClaimCondition": V1PersistentVolumeClaimCondition, "V1PersistentVolumeClaimList": V1PersistentVolumeClaimList, "V1PersistentVolumeClaimSpec": V1PersistentVolumeClaimSpec, "V1PersistentVolumeClaimStatus": V1PersistentVolumeClaimStatus, "V1PersistentVolumeClaimVolumeSource": V1PersistentVolumeClaimVolumeSource, "V1PersistentVolumeList": V1PersistentVolumeList, "V1PersistentVolumeSpec": V1PersistentVolumeSpec, "V1PersistentVolumeStatus": V1PersistentVolumeStatus, "V1PhotonPersistentDiskVolumeSource": V1PhotonPersistentDiskVolumeSource, "V1Pod": V1Pod, "V1PodAffinity": V1PodAffinity, "V1PodAffinityTerm": V1PodAffinityTerm, "V1PodAntiAffinity": V1PodAntiAffinity, "V1PodCondition": V1PodCondition, "V1PodDNSConfig": V1PodDNSConfig, "V1PodDNSConfigOption": V1PodDNSConfigOption, "V1PodList": V1PodList, "V1PodReadinessGate": V1PodReadinessGate, "V1PodSecurityContext": V1PodSecurityContext, "V1PodSpec": V1PodSpec, "V1PodStatus": V1PodStatus, "V1PodTemplate": V1PodTemplate, "V1PodTemplateList": V1PodTemplateList, "V1PodTemplateSpec": V1PodTemplateSpec, "V1PolicyRule": V1PolicyRule, "V1PortworxVolumeSource": V1PortworxVolumeSource, "V1Preconditions": V1Preconditions, "V1PreferredSchedulingTerm": V1PreferredSchedulingTerm, "V1Probe": V1Probe, "V1ProjectedVolumeSource": V1ProjectedVolumeSource, "V1QuobyteVolumeSource": V1QuobyteVolumeSource, "V1RBDPersistentVolumeSource": V1RBDPersistentVolumeSource, "V1RBDVolumeSource": V1RBDVolumeSource, "V1ReplicaSet": V1ReplicaSet, "V1ReplicaSetCondition": V1ReplicaSetCondition, "V1ReplicaSetList": V1ReplicaSetList, "V1ReplicaSetSpec": V1ReplicaSetSpec, "V1ReplicaSetStatus": V1ReplicaSetStatus, "V1ReplicationController": V1ReplicationController, "V1ReplicationControllerCondition": V1ReplicationControllerCondition, "V1ReplicationControllerList": V1ReplicationControllerList, "V1ReplicationControllerSpec": V1ReplicationControllerSpec, "V1ReplicationControllerStatus": V1ReplicationControllerStatus, "V1ResourceAttributes": V1ResourceAttributes, "V1ResourceFieldSelector": V1ResourceFieldSelector, "V1ResourceQuota": V1ResourceQuota, "V1ResourceQuotaList": V1ResourceQuotaList, "V1ResourceQuotaSpec": V1ResourceQuotaSpec, "V1ResourceQuotaStatus": V1ResourceQuotaStatus, "V1ResourceRequirements": V1ResourceRequirements, "V1ResourceRule": V1ResourceRule, "V1Role": V1Role, "V1RoleBinding": V1RoleBinding, "V1RoleBindingList": V1RoleBindingList, "V1RoleList": V1RoleList, "V1RoleRef": V1RoleRef, "V1RollingUpdateDaemonSet": V1RollingUpdateDaemonSet, "V1RollingUpdateDeployment": V1RollingUpdateDeployment, "V1RollingUpdateStatefulSetStrategy": V1RollingUpdateStatefulSetStrategy, "V1SELinuxOptions": V1SELinuxOptions, "V1Scale": V1Scale, "V1ScaleIOPersistentVolumeSource": V1ScaleIOPersistentVolumeSource, "V1ScaleIOVolumeSource": V1ScaleIOVolumeSource, "V1ScaleSpec": V1ScaleSpec, "V1ScaleStatus": V1ScaleStatus, "V1ScopeSelector": V1ScopeSelector, "V1ScopedResourceSelectorRequirement": V1ScopedResourceSelectorRequirement, "V1Secret": V1Secret, "V1SecretEnvSource": V1SecretEnvSource, "V1SecretKeySelector": V1SecretKeySelector, "V1SecretList": V1SecretList, "V1SecretProjection": V1SecretProjection, "V1SecretReference": V1SecretReference, "V1SecretVolumeSource": V1SecretVolumeSource, "V1SecurityContext": V1SecurityContext, "V1SelfSubjectAccessReview": V1SelfSubjectAccessReview, "V1SelfSubjectAccessReviewSpec": V1SelfSubjectAccessReviewSpec, "V1SelfSubjectRulesReview": V1SelfSubjectRulesReview, "V1SelfSubjectRulesReviewSpec": V1SelfSubjectRulesReviewSpec, "V1ServerAddressByClientCIDR": V1ServerAddressByClientCIDR, "V1Service": V1Service, "V1ServiceAccount": V1ServiceAccount, "V1ServiceAccountList": V1ServiceAccountList, "V1ServiceAccountTokenProjection": V1ServiceAccountTokenProjection, "V1ServiceList": V1ServiceList, "V1ServicePort": V1ServicePort, "V1ServiceReference": V1ServiceReference, "V1ServiceSpec": V1ServiceSpec, "V1ServiceStatus": V1ServiceStatus, "V1SessionAffinityConfig": V1SessionAffinityConfig, "V1StatefulSet": V1StatefulSet, "V1StatefulSetCondition": V1StatefulSetCondition, "V1StatefulSetList": V1StatefulSetList, "V1StatefulSetSpec": V1StatefulSetSpec, "V1StatefulSetStatus": V1StatefulSetStatus, "V1StatefulSetUpdateStrategy": V1StatefulSetUpdateStrategy, "V1Status": V1Status, "V1StatusCause": V1StatusCause, "V1StatusDetails": V1StatusDetails, "V1StorageClass": V1StorageClass, "V1StorageClassList": V1StorageClassList, "V1StorageOSPersistentVolumeSource": V1StorageOSPersistentVolumeSource, "V1StorageOSVolumeSource": V1StorageOSVolumeSource, "V1Subject": V1Subject, "V1SubjectAccessReview": V1SubjectAccessReview, "V1SubjectAccessReviewSpec": V1SubjectAccessReviewSpec, "V1SubjectAccessReviewStatus": V1SubjectAccessReviewStatus, "V1SubjectRulesReviewStatus": V1SubjectRulesReviewStatus, "V1Sysctl": V1Sysctl, "V1TCPSocketAction": V1TCPSocketAction, "V1Taint": V1Taint, "V1TokenReview": V1TokenReview, "V1TokenReviewSpec": V1TokenReviewSpec, "V1TokenReviewStatus": V1TokenReviewStatus, "V1Toleration": V1Toleration, "V1TopologySelectorLabelRequirement": V1TopologySelectorLabelRequirement, "V1TopologySelectorTerm": V1TopologySelectorTerm, "V1TypedLocalObjectReference": V1TypedLocalObjectReference, "V1UserInfo": V1UserInfo, "V1Volume": V1Volume, "V1VolumeAttachment": V1VolumeAttachment, "V1VolumeAttachmentList": V1VolumeAttachmentList, "V1VolumeAttachmentSource": V1VolumeAttachmentSource, "V1VolumeAttachmentSpec": V1VolumeAttachmentSpec, "V1VolumeAttachmentStatus": V1VolumeAttachmentStatus, "V1VolumeDevice": V1VolumeDevice, "V1VolumeError": V1VolumeError, "V1VolumeMount": V1VolumeMount, "V1VolumeNodeAffinity": V1VolumeNodeAffinity, "V1VolumeProjection": V1VolumeProjection, "V1VsphereVirtualDiskVolumeSource": V1VsphereVirtualDiskVolumeSource, "V1WatchEvent": V1WatchEvent, "V1WeightedPodAffinityTerm": V1WeightedPodAffinityTerm, "V1alpha1AggregationRule": V1alpha1AggregationRule, "V1alpha1AuditSink": V1alpha1AuditSink, "V1alpha1AuditSinkList": V1alpha1AuditSinkList, "V1alpha1AuditSinkSpec": V1alpha1AuditSinkSpec, "V1alpha1ClusterRole": V1alpha1ClusterRole, "V1alpha1ClusterRoleBinding": V1alpha1ClusterRoleBinding, "V1alpha1ClusterRoleBindingList": V1alpha1ClusterRoleBindingList, "V1alpha1ClusterRoleList": V1alpha1ClusterRoleList, "V1alpha1Initializer": V1alpha1Initializer, "V1alpha1InitializerConfiguration": V1alpha1InitializerConfiguration, "V1alpha1InitializerConfigurationList": V1alpha1InitializerConfigurationList, "V1alpha1PodPreset": V1alpha1PodPreset, "V1alpha1PodPresetList": V1alpha1PodPresetList, "V1alpha1PodPresetSpec": V1alpha1PodPresetSpec, "V1alpha1Policy": V1alpha1Policy, "V1alpha1PolicyRule": V1alpha1PolicyRule, "V1alpha1PriorityClass": V1alpha1PriorityClass, "V1alpha1PriorityClassList": V1alpha1PriorityClassList, "V1alpha1Role": V1alpha1Role, "V1alpha1RoleBinding": V1alpha1RoleBinding, "V1alpha1RoleBindingList": V1alpha1RoleBindingList, "V1alpha1RoleList": V1alpha1RoleList, "V1alpha1RoleRef": V1alpha1RoleRef, "V1alpha1Rule": V1alpha1Rule, "V1alpha1ServiceReference": V1alpha1ServiceReference, "V1alpha1Subject": V1alpha1Subject, "V1alpha1VolumeAttachment": V1alpha1VolumeAttachment, "V1alpha1VolumeAttachmentList": V1alpha1VolumeAttachmentList, "V1alpha1VolumeAttachmentSource": V1alpha1VolumeAttachmentSource, "V1alpha1VolumeAttachmentSpec": V1alpha1VolumeAttachmentSpec, "V1alpha1VolumeAttachmentStatus": V1alpha1VolumeAttachmentStatus, "V1alpha1VolumeError": V1alpha1VolumeError, "V1alpha1Webhook": V1alpha1Webhook, "V1alpha1WebhookClientConfig": V1alpha1WebhookClientConfig, "V1alpha1WebhookThrottleConfig": V1alpha1WebhookThrottleConfig, "V1beta1APIService": V1beta1APIService, "V1beta1APIServiceCondition": V1beta1APIServiceCondition, "V1beta1APIServiceList": V1beta1APIServiceList, "V1beta1APIServiceSpec": V1beta1APIServiceSpec, "V1beta1APIServiceStatus": V1beta1APIServiceStatus, "V1beta1AggregationRule": V1beta1AggregationRule, "V1beta1CertificateSigningRequest": V1beta1CertificateSigningRequest, "V1beta1CertificateSigningRequestCondition": V1beta1CertificateSigningRequestCondition, "V1beta1CertificateSigningRequestList": V1beta1CertificateSigningRequestList, "V1beta1CertificateSigningRequestSpec": V1beta1CertificateSigningRequestSpec, "V1beta1CertificateSigningRequestStatus": V1beta1CertificateSigningRequestStatus, "V1beta1ClusterRole": V1beta1ClusterRole, "V1beta1ClusterRoleBinding": V1beta1ClusterRoleBinding, "V1beta1ClusterRoleBindingList": V1beta1ClusterRoleBindingList, "V1beta1ClusterRoleList": V1beta1ClusterRoleList, "V1beta1ControllerRevision": V1beta1ControllerRevision, "V1beta1ControllerRevisionList": V1beta1ControllerRevisionList, "V1beta1CronJob": V1beta1CronJob, "V1beta1CronJobList": V1beta1CronJobList, "V1beta1CronJobSpec": V1beta1CronJobSpec, "V1beta1CronJobStatus": V1beta1CronJobStatus, "V1beta1CustomResourceColumnDefinition": V1beta1CustomResourceColumnDefinition, "V1beta1CustomResourceConversion": V1beta1CustomResourceConversion, "V1beta1CustomResourceDefinition": V1beta1CustomResourceDefinition, "V1beta1CustomResourceDefinitionCondition": V1beta1CustomResourceDefinitionCondition, "V1beta1CustomResourceDefinitionList": V1beta1CustomResourceDefinitionList, "V1beta1CustomResourceDefinitionNames": V1beta1CustomResourceDefinitionNames, "V1beta1CustomResourceDefinitionSpec": V1beta1CustomResourceDefinitionSpec, "V1beta1CustomResourceDefinitionStatus": V1beta1CustomResourceDefinitionStatus, "V1beta1CustomResourceDefinitionVersion": V1beta1CustomResourceDefinitionVersion, "V1beta1CustomResourceSubresourceScale": V1beta1CustomResourceSubresourceScale, "V1beta1CustomResourceSubresources": V1beta1CustomResourceSubresources, "V1beta1CustomResourceValidation": V1beta1CustomResourceValidation, "V1beta1DaemonSet": V1beta1DaemonSet, "V1beta1DaemonSetCondition": V1beta1DaemonSetCondition, "V1beta1DaemonSetList": V1beta1DaemonSetList, "V1beta1DaemonSetSpec": V1beta1DaemonSetSpec, "V1beta1DaemonSetStatus": V1beta1DaemonSetStatus, "V1beta1DaemonSetUpdateStrategy": V1beta1DaemonSetUpdateStrategy, "V1beta1Event": V1beta1Event, "V1beta1EventList": V1beta1EventList, "V1beta1EventSeries": V1beta1EventSeries, "V1beta1Eviction": V1beta1Eviction, "V1beta1ExternalDocumentation": V1beta1ExternalDocumentation, "V1beta1HTTPIngressPath": V1beta1HTTPIngressPath, "V1beta1HTTPIngressRuleValue": V1beta1HTTPIngressRuleValue, "V1beta1IPBlock": V1beta1IPBlock, "V1beta1Ingress": V1beta1Ingress, "V1beta1IngressBackend": V1beta1IngressBackend, "V1beta1IngressList": V1beta1IngressList, "V1beta1IngressRule": V1beta1IngressRule, "V1beta1IngressSpec": V1beta1IngressSpec, "V1beta1IngressStatus": V1beta1IngressStatus, "V1beta1IngressTLS": V1beta1IngressTLS, "V1beta1JSONSchemaProps": V1beta1JSONSchemaProps, "V1beta1JobTemplateSpec": V1beta1JobTemplateSpec, "V1beta1Lease": V1beta1Lease, "V1beta1LeaseList": V1beta1LeaseList, "V1beta1LeaseSpec": V1beta1LeaseSpec, "V1beta1LocalSubjectAccessReview": V1beta1LocalSubjectAccessReview, "V1beta1MutatingWebhookConfiguration": V1beta1MutatingWebhookConfiguration, "V1beta1MutatingWebhookConfigurationList": V1beta1MutatingWebhookConfigurationList, "V1beta1NetworkPolicy": V1beta1NetworkPolicy, "V1beta1NetworkPolicyEgressRule": V1beta1NetworkPolicyEgressRule, "V1beta1NetworkPolicyIngressRule": V1beta1NetworkPolicyIngressRule, "V1beta1NetworkPolicyList": V1beta1NetworkPolicyList, "V1beta1NetworkPolicyPeer": V1beta1NetworkPolicyPeer, "V1beta1NetworkPolicyPort": V1beta1NetworkPolicyPort, "V1beta1NetworkPolicySpec": V1beta1NetworkPolicySpec, "V1beta1NonResourceAttributes": V1beta1NonResourceAttributes, "V1beta1NonResourceRule": V1beta1NonResourceRule, "V1beta1PodDisruptionBudget": V1beta1PodDisruptionBudget, "V1beta1PodDisruptionBudgetList": V1beta1PodDisruptionBudgetList, "V1beta1PodDisruptionBudgetSpec": V1beta1PodDisruptionBudgetSpec, "V1beta1PodDisruptionBudgetStatus": V1beta1PodDisruptionBudgetStatus, "V1beta1PolicyRule": V1beta1PolicyRule, "V1beta1PriorityClass": V1beta1PriorityClass, "V1beta1PriorityClassList": V1beta1PriorityClassList, "V1beta1ReplicaSet": V1beta1ReplicaSet, "V1beta1ReplicaSetCondition": V1beta1ReplicaSetCondition, "V1beta1ReplicaSetList": V1beta1ReplicaSetList, "V1beta1ReplicaSetSpec": V1beta1ReplicaSetSpec, "V1beta1ReplicaSetStatus": V1beta1ReplicaSetStatus, "V1beta1ResourceAttributes": V1beta1ResourceAttributes, "V1beta1ResourceRule": V1beta1ResourceRule, "V1beta1Role": V1beta1Role, "V1beta1RoleBinding": V1beta1RoleBinding, "V1beta1RoleBindingList": V1beta1RoleBindingList, "V1beta1RoleList": V1beta1RoleList, "V1beta1RoleRef": V1beta1RoleRef, "V1beta1RollingUpdateDaemonSet": V1beta1RollingUpdateDaemonSet, "V1beta1RollingUpdateStatefulSetStrategy": V1beta1RollingUpdateStatefulSetStrategy, "V1beta1RuleWithOperations": V1beta1RuleWithOperations, "V1beta1SelfSubjectAccessReview": V1beta1SelfSubjectAccessReview, "V1beta1SelfSubjectAccessReviewSpec": V1beta1SelfSubjectAccessReviewSpec, "V1beta1SelfSubjectRulesReview": V1beta1SelfSubjectRulesReview, "V1beta1SelfSubjectRulesReviewSpec": V1beta1SelfSubjectRulesReviewSpec, "V1beta1StatefulSet": V1beta1StatefulSet, "V1beta1StatefulSetCondition": V1beta1StatefulSetCondition, "V1beta1StatefulSetList": V1beta1StatefulSetList, "V1beta1StatefulSetSpec": V1beta1StatefulSetSpec, "V1beta1StatefulSetStatus": V1beta1StatefulSetStatus, "V1beta1StatefulSetUpdateStrategy": V1beta1StatefulSetUpdateStrategy, "V1beta1StorageClass": V1beta1StorageClass, "V1beta1StorageClassList": V1beta1StorageClassList, "V1beta1Subject": V1beta1Subject, "V1beta1SubjectAccessReview": V1beta1SubjectAccessReview, "V1beta1SubjectAccessReviewSpec": V1beta1SubjectAccessReviewSpec, "V1beta1SubjectAccessReviewStatus": V1beta1SubjectAccessReviewStatus, "V1beta1SubjectRulesReviewStatus": V1beta1SubjectRulesReviewStatus, "V1beta1TokenReview": V1beta1TokenReview, "V1beta1TokenReviewSpec": V1beta1TokenReviewSpec, "V1beta1TokenReviewStatus": V1beta1TokenReviewStatus, "V1beta1UserInfo": V1beta1UserInfo, "V1beta1ValidatingWebhookConfiguration": V1beta1ValidatingWebhookConfiguration, "V1beta1ValidatingWebhookConfigurationList": V1beta1ValidatingWebhookConfigurationList, "V1beta1VolumeAttachment": V1beta1VolumeAttachment, "V1beta1VolumeAttachmentList": V1beta1VolumeAttachmentList, "V1beta1VolumeAttachmentSource": V1beta1VolumeAttachmentSource, "V1beta1VolumeAttachmentSpec": V1beta1VolumeAttachmentSpec, "V1beta1VolumeAttachmentStatus": V1beta1VolumeAttachmentStatus, "V1beta1VolumeError": V1beta1VolumeError, "V1beta1Webhook": V1beta1Webhook, "V1beta2ControllerRevision": V1beta2ControllerRevision, "V1beta2ControllerRevisionList": V1beta2ControllerRevisionList, "V1beta2DaemonSet": V1beta2DaemonSet, "V1beta2DaemonSetCondition": V1beta2DaemonSetCondition, "V1beta2DaemonSetList": V1beta2DaemonSetList, "V1beta2DaemonSetSpec": V1beta2DaemonSetSpec, "V1beta2DaemonSetStatus": V1beta2DaemonSetStatus, "V1beta2DaemonSetUpdateStrategy": V1beta2DaemonSetUpdateStrategy, "V1beta2Deployment": V1beta2Deployment, "V1beta2DeploymentCondition": V1beta2DeploymentCondition, "V1beta2DeploymentList": V1beta2DeploymentList, "V1beta2DeploymentSpec": V1beta2DeploymentSpec, "V1beta2DeploymentStatus": V1beta2DeploymentStatus, "V1beta2DeploymentStrategy": V1beta2DeploymentStrategy, "V1beta2ReplicaSet": V1beta2ReplicaSet, "V1beta2ReplicaSetCondition": V1beta2ReplicaSetCondition, "V1beta2ReplicaSetList": V1beta2ReplicaSetList, "V1beta2ReplicaSetSpec": V1beta2ReplicaSetSpec, "V1beta2ReplicaSetStatus": V1beta2ReplicaSetStatus, "V1beta2RollingUpdateDaemonSet": V1beta2RollingUpdateDaemonSet, "V1beta2RollingUpdateDeployment": V1beta2RollingUpdateDeployment, "V1beta2RollingUpdateStatefulSetStrategy": V1beta2RollingUpdateStatefulSetStrategy, "V1beta2Scale": V1beta2Scale, "V1beta2ScaleSpec": V1beta2ScaleSpec, "V1beta2ScaleStatus": V1beta2ScaleStatus, "V1beta2StatefulSet": V1beta2StatefulSet, "V1beta2StatefulSetCondition": V1beta2StatefulSetCondition, "V1beta2StatefulSetList": V1beta2StatefulSetList, "V1beta2StatefulSetSpec": V1beta2StatefulSetSpec, "V1beta2StatefulSetStatus": V1beta2StatefulSetStatus, "V1beta2StatefulSetUpdateStrategy": V1beta2StatefulSetUpdateStrategy, "V2alpha1CronJob": V2alpha1CronJob, "V2alpha1CronJobList": V2alpha1CronJobList, "V2alpha1CronJobSpec": V2alpha1CronJobSpec, "V2alpha1CronJobStatus": V2alpha1CronJobStatus, "V2alpha1JobTemplateSpec": V2alpha1JobTemplateSpec, "V2beta1CrossVersionObjectReference": V2beta1CrossVersionObjectReference, "V2beta1ExternalMetricSource": V2beta1ExternalMetricSource, "V2beta1ExternalMetricStatus": V2beta1ExternalMetricStatus, "V2beta1HorizontalPodAutoscaler": V2beta1HorizontalPodAutoscaler, "V2beta1HorizontalPodAutoscalerCondition": V2beta1HorizontalPodAutoscalerCondition, "V2beta1HorizontalPodAutoscalerList": V2beta1HorizontalPodAutoscalerList, "V2beta1HorizontalPodAutoscalerSpec": V2beta1HorizontalPodAutoscalerSpec, "V2beta1HorizontalPodAutoscalerStatus": V2beta1HorizontalPodAutoscalerStatus, "V2beta1MetricSpec": V2beta1MetricSpec, "V2beta1MetricStatus": V2beta1MetricStatus, "V2beta1ObjectMetricSource": V2beta1ObjectMetricSource, "V2beta1ObjectMetricStatus": V2beta1ObjectMetricStatus, "V2beta1PodsMetricSource": V2beta1PodsMetricSource, "V2beta1PodsMetricStatus": V2beta1PodsMetricStatus, "V2beta1ResourceMetricSource": V2beta1ResourceMetricSource, "V2beta1ResourceMetricStatus": V2beta1ResourceMetricStatus, "V2beta2CrossVersionObjectReference": V2beta2CrossVersionObjectReference, "V2beta2ExternalMetricSource": V2beta2ExternalMetricSource, "V2beta2ExternalMetricStatus": V2beta2ExternalMetricStatus, "V2beta2HorizontalPodAutoscaler": V2beta2HorizontalPodAutoscaler, "V2beta2HorizontalPodAutoscalerCondition": V2beta2HorizontalPodAutoscalerCondition, "V2beta2HorizontalPodAutoscalerList": V2beta2HorizontalPodAutoscalerList, "V2beta2HorizontalPodAutoscalerSpec": V2beta2HorizontalPodAutoscalerSpec, "V2beta2HorizontalPodAutoscalerStatus": V2beta2HorizontalPodAutoscalerStatus, "V2beta2MetricIdentifier": V2beta2MetricIdentifier, "V2beta2MetricSpec": V2beta2MetricSpec, "V2beta2MetricStatus": V2beta2MetricStatus, "V2beta2MetricTarget": V2beta2MetricTarget, "V2beta2MetricValueStatus": V2beta2MetricValueStatus, "V2beta2ObjectMetricSource": V2beta2ObjectMetricSource, "V2beta2ObjectMetricStatus": V2beta2ObjectMetricStatus, "V2beta2PodsMetricSource": V2beta2PodsMetricSource, "V2beta2PodsMetricStatus": V2beta2PodsMetricStatus, "V2beta2ResourceMetricSource": V2beta2ResourceMetricSource, "V2beta2ResourceMetricStatus": V2beta2ResourceMetricStatus, "VersionInfo": VersionInfo, }; class HttpBasicAuth { constructor() { this.username = ''; this.password = ''; } applyToRequest(requestOptions) { requestOptions.auth = { username: this.username, password: this.password }; } } exports.HttpBasicAuth = HttpBasicAuth; class ApiKeyAuth { constructor(location, paramName) { this.location = location; this.paramName = paramName; this.apiKey = ''; } applyToRequest(requestOptions) { if (this.location == "query") { requestOptions.qs[this.paramName] = this.apiKey; } else if (this.location == "header" && requestOptions && requestOptions.headers) { requestOptions.headers[this.paramName] = this.apiKey; } } } exports.ApiKeyAuth = ApiKeyAuth; class OAuth { constructor() { this.accessToken = ''; } applyToRequest(requestOptions) { if (requestOptions && requestOptions.headers) { requestOptions.headers["Authorization"] = "Bearer " + this.accessToken; } } } exports.OAuth = OAuth; class VoidAuth { constructor() { this.username = ''; this.password = ''; } applyToRequest(_) { // Do nothing } } exports.VoidAuth = VoidAuth; var AdmissionregistrationApiApiKeys; (function (AdmissionregistrationApiApiKeys) { AdmissionregistrationApiApiKeys[AdmissionregistrationApiApiKeys["BearerToken"] = 0] = "BearerToken"; })(AdmissionregistrationApiApiKeys = exports.AdmissionregistrationApiApiKeys || (exports.AdmissionregistrationApiApiKeys = {})); class AdmissionregistrationApi { constructor(basePathOrUsername, password, basePath) { this._basePath = defaultBasePath; this.defaultHeaders = {}; this._useQuerystring = false; this.authentications = { 'default': new VoidAuth(), 'BearerToken': new ApiKeyAuth('header', 'authorization'), }; if (password) { if (basePath) { this.basePath = basePath; } } else { if (basePathOrUsername) { this.basePath = basePathOrUsername; } } } set useQuerystring(value) { this._useQuerystring = value; } set basePath(basePath) { this._basePath = basePath; } get basePath() { return this._basePath; } setDefaultAuthentication(auth) { this.authentications.default = auth; } setApiKey(key, value) { this.authentications[AdmissionregistrationApiApiKeys[key]].apiKey = value; } /** * get information of a group * @param {*} [options] Override http request options. */ getAPIGroup(options = {}) { const localVarPath = this.basePath + '/apis/admissionregistration.k8s.io/'; let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'GET', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "V1APIGroup"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } } exports.AdmissionregistrationApi = AdmissionregistrationApi; var AdmissionregistrationV1alpha1ApiApiKeys; (function (AdmissionregistrationV1alpha1ApiApiKeys) { AdmissionregistrationV1alpha1ApiApiKeys[AdmissionregistrationV1alpha1ApiApiKeys["BearerToken"] = 0] = "BearerToken"; })(AdmissionregistrationV1alpha1ApiApiKeys = exports.AdmissionregistrationV1alpha1ApiApiKeys || (exports.AdmissionregistrationV1alpha1ApiApiKeys = {})); class AdmissionregistrationV1alpha1Api { constructor(basePathOrUsername, password, basePath) { this._basePath = defaultBasePath; this.defaultHeaders = {}; this._useQuerystring = false; this.authentications = { 'default': new VoidAuth(), 'BearerToken': new ApiKeyAuth('header', 'authorization'), }; if (password) { if (basePath) { this.basePath = basePath; } } else { if (basePathOrUsername) { this.basePath = basePathOrUsername; } } } set useQuerystring(value) { this._useQuerystring = value; } set basePath(basePath) { this._basePath = basePath; } get basePath() { return this._basePath; } setDefaultAuthentication(auth) { this.authentications.default = auth; } setApiKey(key, value) { this.authentications[AdmissionregistrationV1alpha1ApiApiKeys[key]].apiKey = value; } /** * create an InitializerConfiguration * @param body * @param includeUninitialized If true, partially initialized resources are included in the response. * @param pretty If 'true', then the output is pretty printed. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param {*} [options] Override http request options. */ createInitializerConfiguration(body, includeUninitialized, pretty, dryRun, options = {}) { const localVarPath = this.basePath + '/apis/admissionregistration.k8s.io/v1alpha1/initializerconfigurations'; let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling createInitializerConfiguration.'); } if (includeUninitialized !== undefined) { localVarQueryParameters['includeUninitialized'] = ObjectSerializer.serialize(includeUninitialized, "boolean"); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'POST', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: ObjectSerializer.serialize(body, "V1alpha1InitializerConfiguration") }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "V1alpha1InitializerConfiguration"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * delete collection of InitializerConfiguration * @param includeUninitialized If true, partially initialized resources are included in the response. * @param pretty If 'true', then the output is pretty printed. * @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. * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything. * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything. * @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. * @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. * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. * @param watch Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion. * @param {*} [options] Override http request options. */ deleteCollectionInitializerConfiguration(includeUninitialized, pretty, _continue, fieldSelector, labelSelector, limit, resourceVersion, timeoutSeconds, watch, options = {}) { const localVarPath = this.basePath + '/apis/admissionregistration.k8s.io/v1alpha1/initializerconfigurations'; let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; if (includeUninitialized !== undefined) { localVarQueryParameters['includeUninitialized'] = ObjectSerializer.serialize(includeUninitialized, "boolean"); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, "string"); } if (_continue !== undefined) { localVarQueryParameters['continue'] = ObjectSerializer.serialize(_continue, "string"); } if (fieldSelector !== undefined) { localVarQueryParameters['fieldSelector'] = ObjectSerializer.serialize(fieldSelector, "string"); } if (labelSelector !== undefined) { localVarQueryParameters['labelSelector'] = ObjectSerializer.serialize(labelSelector, "string"); } if (limit !== undefined) { localVarQueryParameters['limit'] = ObjectSerializer.serialize(limit, "number"); } if (resourceVersion !== undefined) { localVarQueryParameters['resourceVersion'] = ObjectSerializer.serialize(resourceVersion, "string"); } if (timeoutSeconds !== undefined) { localVarQueryParameters['timeoutSeconds'] = ObjectSerializer.serialize(timeoutSeconds, "number"); } if (watch !== undefined) { localVarQueryParameters['watch'] = ObjectSerializer.serialize(watch, "boolean"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'DELETE', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "V1Status"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * delete an InitializerConfiguration * @param name name of the InitializerConfiguration * @param pretty If 'true', then the output is pretty printed. * @param body * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @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. * @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. * @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. * @param {*} [options] Override http request options. */ deleteInitializerConfiguration(name, pretty, body, dryRun, gracePeriodSeconds, orphanDependents, propagationPolicy, options = {}) { const localVarPath = this.basePath + '/apis/admissionregistration.k8s.io/v1alpha1/initializerconfigurations/{name}' .replace('{' + 'name' + '}', encodeURIComponent(String(name))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling deleteInitializerConfiguration.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, "string"); } if (gracePeriodSeconds !== undefined) { localVarQueryParameters['gracePeriodSeconds'] = ObjectSerializer.serialize(gracePeriodSeconds, "number"); } if (orphanDependents !== undefined) { localVarQueryParameters['orphanDependents'] = ObjectSerializer.serialize(orphanDependents, "boolean"); } if (propagationPolicy !== undefined) { localVarQueryParameters['propagationPolicy'] = ObjectSerializer.serialize(propagationPolicy, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'DELETE', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: ObjectSerializer.serialize(body, "V1DeleteOptions") }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "V1Status"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * get available resources * @param {*} [options] Override http request options. */ getAPIResources(options = {}) { const localVarPath = this.basePath + '/apis/admissionregistration.k8s.io/v1alpha1/'; let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'GET', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "V1APIResourceList"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * list or watch objects of kind InitializerConfiguration * @param includeUninitialized If true, partially initialized resources are included in the response. * @param pretty If 'true', then the output is pretty printed. * @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. * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything. * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything. * @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. * @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. * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. * @param watch Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion. * @param {*} [options] Override http request options. */ listInitializerConfiguration(includeUninitialized, pretty, _continue, fieldSelector, labelSelector, limit, resourceVersion, timeoutSeconds, watch, options = {}) { const localVarPath = this.basePath + '/apis/admissionregistration.k8s.io/v1alpha1/initializerconfigurations'; let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; if (includeUninitialized !== undefined) { localVarQueryParameters['includeUninitialized'] = ObjectSerializer.serialize(includeUninitialized, "boolean"); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, "string"); } if (_continue !== undefined) { localVarQueryParameters['continue'] = ObjectSerializer.serialize(_continue, "string"); } if (fieldSelector !== undefined) { localVarQueryParameters['fieldSelector'] = ObjectSerializer.serialize(fieldSelector, "string"); } if (labelSelector !== undefined) { localVarQueryParameters['labelSelector'] = ObjectSerializer.serialize(labelSelector, "string"); } if (limit !== undefined) { localVarQueryParameters['limit'] = ObjectSerializer.serialize(limit, "number"); } if (resourceVersion !== undefined) { localVarQueryParameters['resourceVersion'] = ObjectSerializer.serialize(resourceVersion, "string"); } if (timeoutSeconds !== undefined) { localVarQueryParameters['timeoutSeconds'] = ObjectSerializer.serialize(timeoutSeconds, "number"); } if (watch !== undefined) { localVarQueryParameters['watch'] = ObjectSerializer.serialize(watch, "boolean"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'GET', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "V1alpha1InitializerConfigurationList"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * partially update the specified InitializerConfiguration * @param name name of the InitializerConfiguration * @param body * @param pretty If 'true', then the output is pretty printed. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param {*} [options] Override http request options. */ patchInitializerConfiguration(name, body, pretty, dryRun, options = {}) { const localVarPath = this.basePath + '/apis/admissionregistration.k8s.io/v1alpha1/initializerconfigurations/{name}' .replace('{' + 'name' + '}', encodeURIComponent(String(name))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling patchInitializerConfiguration.'); } // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling patchInitializerConfiguration.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'PATCH', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: ObjectSerializer.serialize(body, "any") }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "V1alpha1InitializerConfiguration"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * read the specified InitializerConfiguration * @param name name of the InitializerConfiguration * @param pretty If 'true', then the output is pretty printed. * @param exact Should the export be exact. Exact export maintains cluster-specific fields like 'Namespace'. * @param _export Should this value be exported. Export strips fields that a user can not specify. * @param {*} [options] Override http request options. */ readInitializerConfiguration(name, pretty, exact, _export, options = {}) { const localVarPath = this.basePath + '/apis/admissionregistration.k8s.io/v1alpha1/initializerconfigurations/{name}' .replace('{' + 'name' + '}', encodeURIComponent(String(name))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling readInitializerConfiguration.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, "string"); } if (exact !== undefined) { localVarQueryParameters['exact'] = ObjectSerializer.serialize(exact, "boolean"); } if (_export !== undefined) { localVarQueryParameters['export'] = ObjectSerializer.serialize(_export, "boolean"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'GET', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "V1alpha1InitializerConfiguration"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * replace the specified InitializerConfiguration * @param name name of the InitializerConfiguration * @param body * @param pretty If 'true', then the output is pretty printed. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param {*} [options] Override http request options. */ replaceInitializerConfiguration(name, body, pretty, dryRun, options = {}) { const localVarPath = this.basePath + '/apis/admissionregistration.k8s.io/v1alpha1/initializerconfigurations/{name}' .replace('{' + 'name' + '}', encodeURIComponent(String(name))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling replaceInitializerConfiguration.'); } // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling replaceInitializerConfiguration.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'PUT', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: ObjectSerializer.serialize(body, "V1alpha1InitializerConfiguration") }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "V1alpha1InitializerConfiguration"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } } exports.AdmissionregistrationV1alpha1Api = AdmissionregistrationV1alpha1Api; var AdmissionregistrationV1beta1ApiApiKeys; (function (AdmissionregistrationV1beta1ApiApiKeys) { AdmissionregistrationV1beta1ApiApiKeys[AdmissionregistrationV1beta1ApiApiKeys["BearerToken"] = 0] = "BearerToken"; })(AdmissionregistrationV1beta1ApiApiKeys = exports.AdmissionregistrationV1beta1ApiApiKeys || (exports.AdmissionregistrationV1beta1ApiApiKeys = {})); class AdmissionregistrationV1beta1Api { constructor(basePathOrUsername, password, basePath) { this._basePath = defaultBasePath; this.defaultHeaders = {}; this._useQuerystring = false; this.authentications = { 'default': new VoidAuth(), 'BearerToken': new ApiKeyAuth('header', 'authorization'), }; if (password) { if (basePath) { this.basePath = basePath; } } else { if (basePathOrUsername) { this.basePath = basePathOrUsername; } } } set useQuerystring(value) { this._useQuerystring = value; } set basePath(basePath) { this._basePath = basePath; } get basePath() { return this._basePath; } setDefaultAuthentication(auth) { this.authentications.default = auth; } setApiKey(key, value) { this.authentications[AdmissionregistrationV1beta1ApiApiKeys[key]].apiKey = value; } /** * create a MutatingWebhookConfiguration * @param body * @param includeUninitialized If true, partially initialized resources are included in the response. * @param pretty If 'true', then the output is pretty printed. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param {*} [options] Override http request options. */ createMutatingWebhookConfiguration(body, includeUninitialized, pretty, dryRun, options = {}) { const localVarPath = this.basePath + '/apis/admissionregistration.k8s.io/v1beta1/mutatingwebhookconfigurations'; let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling createMutatingWebhookConfiguration.'); } if (includeUninitialized !== undefined) { localVarQueryParameters['includeUninitialized'] = ObjectSerializer.serialize(includeUninitialized, "boolean"); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'POST', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: ObjectSerializer.serialize(body, "V1beta1MutatingWebhookConfiguration") }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "V1beta1MutatingWebhookConfiguration"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * create a ValidatingWebhookConfiguration * @param body * @param includeUninitialized If true, partially initialized resources are included in the response. * @param pretty If 'true', then the output is pretty printed. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param {*} [options] Override http request options. */ createValidatingWebhookConfiguration(body, includeUninitialized, pretty, dryRun, options = {}) { const localVarPath = this.basePath + '/apis/admissionregistration.k8s.io/v1beta1/validatingwebhookconfigurations'; let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling createValidatingWebhookConfiguration.'); } if (includeUninitialized !== undefined) { localVarQueryParameters['includeUninitialized'] = ObjectSerializer.serialize(includeUninitialized, "boolean"); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'POST', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: ObjectSerializer.serialize(body, "V1beta1ValidatingWebhookConfiguration") }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "V1beta1ValidatingWebhookConfiguration"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * delete collection of MutatingWebhookConfiguration * @param includeUninitialized If true, partially initialized resources are included in the response. * @param pretty If 'true', then the output is pretty printed. * @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. * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything. * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything. * @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. * @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. * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. * @param watch Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion. * @param {*} [options] Override http request options. */ deleteCollectionMutatingWebhookConfiguration(includeUninitialized, pretty, _continue, fieldSelector, labelSelector, limit, resourceVersion, timeoutSeconds, watch, options = {}) { const localVarPath = this.basePath + '/apis/admissionregistration.k8s.io/v1beta1/mutatingwebhookconfigurations'; let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; if (includeUninitialized !== undefined) { localVarQueryParameters['includeUninitialized'] = ObjectSerializer.serialize(includeUninitialized, "boolean"); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, "string"); } if (_continue !== undefined) { localVarQueryParameters['continue'] = ObjectSerializer.serialize(_continue, "string"); } if (fieldSelector !== undefined) { localVarQueryParameters['fieldSelector'] = ObjectSerializer.serialize(fieldSelector, "string"); } if (labelSelector !== undefined) { localVarQueryParameters['labelSelector'] = ObjectSerializer.serialize(labelSelector, "string"); } if (limit !== undefined) { localVarQueryParameters['limit'] = ObjectSerializer.serialize(limit, "number"); } if (resourceVersion !== undefined) { localVarQueryParameters['resourceVersion'] = ObjectSerializer.serialize(resourceVersion, "string"); } if (timeoutSeconds !== undefined) { localVarQueryParameters['timeoutSeconds'] = ObjectSerializer.serialize(timeoutSeconds, "number"); } if (watch !== undefined) { localVarQueryParameters['watch'] = ObjectSerializer.serialize(watch, "boolean"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'DELETE', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "V1Status"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * delete collection of ValidatingWebhookConfiguration * @param includeUninitialized If true, partially initialized resources are included in the response. * @param pretty If 'true', then the output is pretty printed. * @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. * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything. * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything. * @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. * @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. * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. * @param watch Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion. * @param {*} [options] Override http request options. */ deleteCollectionValidatingWebhookConfiguration(includeUninitialized, pretty, _continue, fieldSelector, labelSelector, limit, resourceVersion, timeoutSeconds, watch, options = {}) { const localVarPath = this.basePath + '/apis/admissionregistration.k8s.io/v1beta1/validatingwebhookconfigurations'; let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; if (includeUninitialized !== undefined) { localVarQueryParameters['includeUninitialized'] = ObjectSerializer.serialize(includeUninitialized, "boolean"); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, "string"); } if (_continue !== undefined) { localVarQueryParameters['continue'] = ObjectSerializer.serialize(_continue, "string"); } if (fieldSelector !== undefined) { localVarQueryParameters['fieldSelector'] = ObjectSerializer.serialize(fieldSelector, "string"); } if (labelSelector !== undefined) { localVarQueryParameters['labelSelector'] = ObjectSerializer.serialize(labelSelector, "string"); } if (limit !== undefined) { localVarQueryParameters['limit'] = ObjectSerializer.serialize(limit, "number"); } if (resourceVersion !== undefined) { localVarQueryParameters['resourceVersion'] = ObjectSerializer.serialize(resourceVersion, "string"); } if (timeoutSeconds !== undefined) { localVarQueryParameters['timeoutSeconds'] = ObjectSerializer.serialize(timeoutSeconds, "number"); } if (watch !== undefined) { localVarQueryParameters['watch'] = ObjectSerializer.serialize(watch, "boolean"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'DELETE', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "V1Status"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * delete a MutatingWebhookConfiguration * @param name name of the MutatingWebhookConfiguration * @param pretty If 'true', then the output is pretty printed. * @param body * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @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. * @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. * @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. * @param {*} [options] Override http request options. */ deleteMutatingWebhookConfiguration(name, pretty, body, dryRun, gracePeriodSeconds, orphanDependents, propagationPolicy, options = {}) { const localVarPath = this.basePath + '/apis/admissionregistration.k8s.io/v1beta1/mutatingwebhookconfigurations/{name}' .replace('{' + 'name' + '}', encodeURIComponent(String(name))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling deleteMutatingWebhookConfiguration.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, "string"); } if (gracePeriodSeconds !== undefined) { localVarQueryParameters['gracePeriodSeconds'] = ObjectSerializer.serialize(gracePeriodSeconds, "number"); } if (orphanDependents !== undefined) { localVarQueryParameters['orphanDependents'] = ObjectSerializer.serialize(orphanDependents, "boolean"); } if (propagationPolicy !== undefined) { localVarQueryParameters['propagationPolicy'] = ObjectSerializer.serialize(propagationPolicy, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'DELETE', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: ObjectSerializer.serialize(body, "V1DeleteOptions") }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "V1Status"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * delete a ValidatingWebhookConfiguration * @param name name of the ValidatingWebhookConfiguration * @param pretty If 'true', then the output is pretty printed. * @param body * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @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. * @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. * @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. * @param {*} [options] Override http request options. */ deleteValidatingWebhookConfiguration(name, pretty, body, dryRun, gracePeriodSeconds, orphanDependents, propagationPolicy, options = {}) { const localVarPath = this.basePath + '/apis/admissionregistration.k8s.io/v1beta1/validatingwebhookconfigurations/{name}' .replace('{' + 'name' + '}', encodeURIComponent(String(name))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling deleteValidatingWebhookConfiguration.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, "string"); } if (gracePeriodSeconds !== undefined) { localVarQueryParameters['gracePeriodSeconds'] = ObjectSerializer.serialize(gracePeriodSeconds, "number"); } if (orphanDependents !== undefined) { localVarQueryParameters['orphanDependents'] = ObjectSerializer.serialize(orphanDependents, "boolean"); } if (propagationPolicy !== undefined) { localVarQueryParameters['propagationPolicy'] = ObjectSerializer.serialize(propagationPolicy, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'DELETE', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: ObjectSerializer.serialize(body, "V1DeleteOptions") }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "V1Status"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * get available resources * @param {*} [options] Override http request options. */ getAPIResources(options = {}) { const localVarPath = this.basePath + '/apis/admissionregistration.k8s.io/v1beta1/'; let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'GET', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "V1APIResourceList"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * list or watch objects of kind MutatingWebhookConfiguration * @param includeUninitialized If true, partially initialized resources are included in the response. * @param pretty If 'true', then the output is pretty printed. * @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. * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything. * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything. * @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. * @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. * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. * @param watch Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion. * @param {*} [options] Override http request options. */ listMutatingWebhookConfiguration(includeUninitialized, pretty, _continue, fieldSelector, labelSelector, limit, resourceVersion, timeoutSeconds, watch, options = {}) { const localVarPath = this.basePath + '/apis/admissionregistration.k8s.io/v1beta1/mutatingwebhookconfigurations'; let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; if (includeUninitialized !== undefined) { localVarQueryParameters['includeUninitialized'] = ObjectSerializer.serialize(includeUninitialized, "boolean"); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, "string"); } if (_continue !== undefined) { localVarQueryParameters['continue'] = ObjectSerializer.serialize(_continue, "string"); } if (fieldSelector !== undefined) { localVarQueryParameters['fieldSelector'] = ObjectSerializer.serialize(fieldSelector, "string"); } if (labelSelector !== undefined) { localVarQueryParameters['labelSelector'] = ObjectSerializer.serialize(labelSelector, "string"); } if (limit !== undefined) { localVarQueryParameters['limit'] = ObjectSerializer.serialize(limit, "number"); } if (resourceVersion !== undefined) { localVarQueryParameters['resourceVersion'] = ObjectSerializer.serialize(resourceVersion, "string"); } if (timeoutSeconds !== undefined) { localVarQueryParameters['timeoutSeconds'] = ObjectSerializer.serialize(timeoutSeconds, "number"); } if (watch !== undefined) { localVarQueryParameters['watch'] = ObjectSerializer.serialize(watch, "boolean"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'GET', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "V1beta1MutatingWebhookConfigurationList"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * list or watch objects of kind ValidatingWebhookConfiguration * @param includeUninitialized If true, partially initialized resources are included in the response. * @param pretty If 'true', then the output is pretty printed. * @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. * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything. * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything. * @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. * @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. * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. * @param watch Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion. * @param {*} [options] Override http request options. */ listValidatingWebhookConfiguration(includeUninitialized, pretty, _continue, fieldSelector, labelSelector, limit, resourceVersion, timeoutSeconds, watch, options = {}) { const localVarPath = this.basePath + '/apis/admissionregistration.k8s.io/v1beta1/validatingwebhookconfigurations'; let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; if (includeUninitialized !== undefined) { localVarQueryParameters['includeUninitialized'] = ObjectSerializer.serialize(includeUninitialized, "boolean"); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, "string"); } if (_continue !== undefined) { localVarQueryParameters['continue'] = ObjectSerializer.serialize(_continue, "string"); } if (fieldSelector !== undefined) { localVarQueryParameters['fieldSelector'] = ObjectSerializer.serialize(fieldSelector, "string"); } if (labelSelector !== undefined) { localVarQueryParameters['labelSelector'] = ObjectSerializer.serialize(labelSelector, "string"); } if (limit !== undefined) { localVarQueryParameters['limit'] = ObjectSerializer.serialize(limit, "number"); } if (resourceVersion !== undefined) { localVarQueryParameters['resourceVersion'] = ObjectSerializer.serialize(resourceVersion, "string"); } if (timeoutSeconds !== undefined) { localVarQueryParameters['timeoutSeconds'] = ObjectSerializer.serialize(timeoutSeconds, "number"); } if (watch !== undefined) { localVarQueryParameters['watch'] = ObjectSerializer.serialize(watch, "boolean"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'GET', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "V1beta1ValidatingWebhookConfigurationList"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * partially update the specified MutatingWebhookConfiguration * @param name name of the MutatingWebhookConfiguration * @param body * @param pretty If 'true', then the output is pretty printed. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param {*} [options] Override http request options. */ patchMutatingWebhookConfiguration(name, body, pretty, dryRun, options = {}) { const localVarPath = this.basePath + '/apis/admissionregistration.k8s.io/v1beta1/mutatingwebhookconfigurations/{name}' .replace('{' + 'name' + '}', encodeURIComponent(String(name))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling patchMutatingWebhookConfiguration.'); } // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling patchMutatingWebhookConfiguration.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'PATCH', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: ObjectSerializer.serialize(body, "any") }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "V1beta1MutatingWebhookConfiguration"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * partially update the specified ValidatingWebhookConfiguration * @param name name of the ValidatingWebhookConfiguration * @param body * @param pretty If 'true', then the output is pretty printed. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param {*} [options] Override http request options. */ patchValidatingWebhookConfiguration(name, body, pretty, dryRun, options = {}) { const localVarPath = this.basePath + '/apis/admissionregistration.k8s.io/v1beta1/validatingwebhookconfigurations/{name}' .replace('{' + 'name' + '}', encodeURIComponent(String(name))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling patchValidatingWebhookConfiguration.'); } // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling patchValidatingWebhookConfiguration.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'PATCH', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: ObjectSerializer.serialize(body, "any") }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "V1beta1ValidatingWebhookConfiguration"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * read the specified MutatingWebhookConfiguration * @param name name of the MutatingWebhookConfiguration * @param pretty If 'true', then the output is pretty printed. * @param exact Should the export be exact. Exact export maintains cluster-specific fields like 'Namespace'. * @param _export Should this value be exported. Export strips fields that a user can not specify. * @param {*} [options] Override http request options. */ readMutatingWebhookConfiguration(name, pretty, exact, _export, options = {}) { const localVarPath = this.basePath + '/apis/admissionregistration.k8s.io/v1beta1/mutatingwebhookconfigurations/{name}' .replace('{' + 'name' + '}', encodeURIComponent(String(name))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling readMutatingWebhookConfiguration.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, "string"); } if (exact !== undefined) { localVarQueryParameters['exact'] = ObjectSerializer.serialize(exact, "boolean"); } if (_export !== undefined) { localVarQueryParameters['export'] = ObjectSerializer.serialize(_export, "boolean"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'GET', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "V1beta1MutatingWebhookConfiguration"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * read the specified ValidatingWebhookConfiguration * @param name name of the ValidatingWebhookConfiguration * @param pretty If 'true', then the output is pretty printed. * @param exact Should the export be exact. Exact export maintains cluster-specific fields like 'Namespace'. * @param _export Should this value be exported. Export strips fields that a user can not specify. * @param {*} [options] Override http request options. */ readValidatingWebhookConfiguration(name, pretty, exact, _export, options = {}) { const localVarPath = this.basePath + '/apis/admissionregistration.k8s.io/v1beta1/validatingwebhookconfigurations/{name}' .replace('{' + 'name' + '}', encodeURIComponent(String(name))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling readValidatingWebhookConfiguration.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, "string"); } if (exact !== undefined) { localVarQueryParameters['exact'] = ObjectSerializer.serialize(exact, "boolean"); } if (_export !== undefined) { localVarQueryParameters['export'] = ObjectSerializer.serialize(_export, "boolean"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'GET', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "V1beta1ValidatingWebhookConfiguration"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * replace the specified MutatingWebhookConfiguration * @param name name of the MutatingWebhookConfiguration * @param body * @param pretty If 'true', then the output is pretty printed. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param {*} [options] Override http request options. */ replaceMutatingWebhookConfiguration(name, body, pretty, dryRun, options = {}) { const localVarPath = this.basePath + '/apis/admissionregistration.k8s.io/v1beta1/mutatingwebhookconfigurations/{name}' .replace('{' + 'name' + '}', encodeURIComponent(String(name))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling replaceMutatingWebhookConfiguration.'); } // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling replaceMutatingWebhookConfiguration.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'PUT', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: ObjectSerializer.serialize(body, "V1beta1MutatingWebhookConfiguration") }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "V1beta1MutatingWebhookConfiguration"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * replace the specified ValidatingWebhookConfiguration * @param name name of the ValidatingWebhookConfiguration * @param body * @param pretty If 'true', then the output is pretty printed. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param {*} [options] Override http request options. */ replaceValidatingWebhookConfiguration(name, body, pretty, dryRun, options = {}) { const localVarPath = this.basePath + '/apis/admissionregistration.k8s.io/v1beta1/validatingwebhookconfigurations/{name}' .replace('{' + 'name' + '}', encodeURIComponent(String(name))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling replaceValidatingWebhookConfiguration.'); } // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling replaceValidatingWebhookConfiguration.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'PUT', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: ObjectSerializer.serialize(body, "V1beta1ValidatingWebhookConfiguration") }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "V1beta1ValidatingWebhookConfiguration"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } } exports.AdmissionregistrationV1beta1Api = AdmissionregistrationV1beta1Api; var ApiextensionsApiApiKeys; (function (ApiextensionsApiApiKeys) { ApiextensionsApiApiKeys[ApiextensionsApiApiKeys["BearerToken"] = 0] = "BearerToken"; })(ApiextensionsApiApiKeys = exports.ApiextensionsApiApiKeys || (exports.ApiextensionsApiApiKeys = {})); class ApiextensionsApi { constructor(basePathOrUsername, password, basePath) { this._basePath = defaultBasePath; this.defaultHeaders = {}; this._useQuerystring = false; this.authentications = { 'default': new VoidAuth(), 'BearerToken': new ApiKeyAuth('header', 'authorization'), }; if (password) { if (basePath) { this.basePath = basePath; } } else { if (basePathOrUsername) { this.basePath = basePathOrUsername; } } } set useQuerystring(value) { this._useQuerystring = value; } set basePath(basePath) { this._basePath = basePath; } get basePath() { return this._basePath; } setDefaultAuthentication(auth) { this.authentications.default = auth; } setApiKey(key, value) { this.authentications[ApiextensionsApiApiKeys[key]].apiKey = value; } /** * get information of a group * @param {*} [options] Override http request options. */ getAPIGroup(options = {}) { const localVarPath = this.basePath + '/apis/apiextensions.k8s.io/'; let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'GET', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "V1APIGroup"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } } exports.ApiextensionsApi = ApiextensionsApi; var ApiextensionsV1beta1ApiApiKeys; (function (ApiextensionsV1beta1ApiApiKeys) { ApiextensionsV1beta1ApiApiKeys[ApiextensionsV1beta1ApiApiKeys["BearerToken"] = 0] = "BearerToken"; })(ApiextensionsV1beta1ApiApiKeys = exports.ApiextensionsV1beta1ApiApiKeys || (exports.ApiextensionsV1beta1ApiApiKeys = {})); class ApiextensionsV1beta1Api { constructor(basePathOrUsername, password, basePath) { this._basePath = defaultBasePath; this.defaultHeaders = {}; this._useQuerystring = false; this.authentications = { 'default': new VoidAuth(), 'BearerToken': new ApiKeyAuth('header', 'authorization'), }; if (password) { if (basePath) { this.basePath = basePath; } } else { if (basePathOrUsername) { this.basePath = basePathOrUsername; } } } set useQuerystring(value) { this._useQuerystring = value; } set basePath(basePath) { this._basePath = basePath; } get basePath() { return this._basePath; } setDefaultAuthentication(auth) { this.authentications.default = auth; } setApiKey(key, value) { this.authentications[ApiextensionsV1beta1ApiApiKeys[key]].apiKey = value; } /** * create a CustomResourceDefinition * @param body * @param includeUninitialized If true, partially initialized resources are included in the response. * @param pretty If 'true', then the output is pretty printed. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param {*} [options] Override http request options. */ createCustomResourceDefinition(body, includeUninitialized, pretty, dryRun, options = {}) { const localVarPath = this.basePath + '/apis/apiextensions.k8s.io/v1beta1/customresourcedefinitions'; let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling createCustomResourceDefinition.'); } if (includeUninitialized !== undefined) { localVarQueryParameters['includeUninitialized'] = ObjectSerializer.serialize(includeUninitialized, "boolean"); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'POST', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: ObjectSerializer.serialize(body, "V1beta1CustomResourceDefinition") }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "V1beta1CustomResourceDefinition"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * delete collection of CustomResourceDefinition * @param includeUninitialized If true, partially initialized resources are included in the response. * @param pretty If 'true', then the output is pretty printed. * @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. * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything. * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything. * @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. * @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. * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. * @param watch Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion. * @param {*} [options] Override http request options. */ deleteCollectionCustomResourceDefinition(includeUninitialized, pretty, _continue, fieldSelector, labelSelector, limit, resourceVersion, timeoutSeconds, watch, options = {}) { const localVarPath = this.basePath + '/apis/apiextensions.k8s.io/v1beta1/customresourcedefinitions'; let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; if (includeUninitialized !== undefined) { localVarQueryParameters['includeUninitialized'] = ObjectSerializer.serialize(includeUninitialized, "boolean"); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, "string"); } if (_continue !== undefined) { localVarQueryParameters['continue'] = ObjectSerializer.serialize(_continue, "string"); } if (fieldSelector !== undefined) { localVarQueryParameters['fieldSelector'] = ObjectSerializer.serialize(fieldSelector, "string"); } if (labelSelector !== undefined) { localVarQueryParameters['labelSelector'] = ObjectSerializer.serialize(labelSelector, "string"); } if (limit !== undefined) { localVarQueryParameters['limit'] = ObjectSerializer.serialize(limit, "number"); } if (resourceVersion !== undefined) { localVarQueryParameters['resourceVersion'] = ObjectSerializer.serialize(resourceVersion, "string"); } if (timeoutSeconds !== undefined) { localVarQueryParameters['timeoutSeconds'] = ObjectSerializer.serialize(timeoutSeconds, "number"); } if (watch !== undefined) { localVarQueryParameters['watch'] = ObjectSerializer.serialize(watch, "boolean"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'DELETE', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "V1Status"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * delete a CustomResourceDefinition * @param name name of the CustomResourceDefinition * @param pretty If 'true', then the output is pretty printed. * @param body * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @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. * @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. * @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. * @param {*} [options] Override http request options. */ deleteCustomResourceDefinition(name, pretty, body, dryRun, gracePeriodSeconds, orphanDependents, propagationPolicy, options = {}) { const localVarPath = this.basePath + '/apis/apiextensions.k8s.io/v1beta1/customresourcedefinitions/{name}' .replace('{' + 'name' + '}', encodeURIComponent(String(name))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling deleteCustomResourceDefinition.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, "string"); } if (gracePeriodSeconds !== undefined) { localVarQueryParameters['gracePeriodSeconds'] = ObjectSerializer.serialize(gracePeriodSeconds, "number"); } if (orphanDependents !== undefined) { localVarQueryParameters['orphanDependents'] = ObjectSerializer.serialize(orphanDependents, "boolean"); } if (propagationPolicy !== undefined) { localVarQueryParameters['propagationPolicy'] = ObjectSerializer.serialize(propagationPolicy, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'DELETE', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: ObjectSerializer.serialize(body, "V1DeleteOptions") }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "V1Status"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * get available resources * @param {*} [options] Override http request options. */ getAPIResources(options = {}) { const localVarPath = this.basePath + '/apis/apiextensions.k8s.io/v1beta1/'; let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'GET', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "V1APIResourceList"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * list or watch objects of kind CustomResourceDefinition * @param includeUninitialized If true, partially initialized resources are included in the response. * @param pretty If 'true', then the output is pretty printed. * @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. * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything. * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything. * @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. * @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. * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. * @param watch Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion. * @param {*} [options] Override http request options. */ listCustomResourceDefinition(includeUninitialized, pretty, _continue, fieldSelector, labelSelector, limit, resourceVersion, timeoutSeconds, watch, options = {}) { const localVarPath = this.basePath + '/apis/apiextensions.k8s.io/v1beta1/customresourcedefinitions'; let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; if (includeUninitialized !== undefined) { localVarQueryParameters['includeUninitialized'] = ObjectSerializer.serialize(includeUninitialized, "boolean"); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, "string"); } if (_continue !== undefined) { localVarQueryParameters['continue'] = ObjectSerializer.serialize(_continue, "string"); } if (fieldSelector !== undefined) { localVarQueryParameters['fieldSelector'] = ObjectSerializer.serialize(fieldSelector, "string"); } if (labelSelector !== undefined) { localVarQueryParameters['labelSelector'] = ObjectSerializer.serialize(labelSelector, "string"); } if (limit !== undefined) { localVarQueryParameters['limit'] = ObjectSerializer.serialize(limit, "number"); } if (resourceVersion !== undefined) { localVarQueryParameters['resourceVersion'] = ObjectSerializer.serialize(resourceVersion, "string"); } if (timeoutSeconds !== undefined) { localVarQueryParameters['timeoutSeconds'] = ObjectSerializer.serialize(timeoutSeconds, "number"); } if (watch !== undefined) { localVarQueryParameters['watch'] = ObjectSerializer.serialize(watch, "boolean"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'GET', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "V1beta1CustomResourceDefinitionList"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * partially update the specified CustomResourceDefinition * @param name name of the CustomResourceDefinition * @param body * @param pretty If 'true', then the output is pretty printed. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param {*} [options] Override http request options. */ patchCustomResourceDefinition(name, body, pretty, dryRun, options = {}) { const localVarPath = this.basePath + '/apis/apiextensions.k8s.io/v1beta1/customresourcedefinitions/{name}' .replace('{' + 'name' + '}', encodeURIComponent(String(name))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling patchCustomResourceDefinition.'); } // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling patchCustomResourceDefinition.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'PATCH', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: ObjectSerializer.serialize(body, "any") }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "V1beta1CustomResourceDefinition"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * partially update status of the specified CustomResourceDefinition * @param name name of the CustomResourceDefinition * @param body * @param pretty If 'true', then the output is pretty printed. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param {*} [options] Override http request options. */ patchCustomResourceDefinitionStatus(name, body, pretty, dryRun, options = {}) { const localVarPath = this.basePath + '/apis/apiextensions.k8s.io/v1beta1/customresourcedefinitions/{name}/status' .replace('{' + 'name' + '}', encodeURIComponent(String(name))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling patchCustomResourceDefinitionStatus.'); } // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling patchCustomResourceDefinitionStatus.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'PATCH', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: ObjectSerializer.serialize(body, "any") }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "V1beta1CustomResourceDefinition"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * read the specified CustomResourceDefinition * @param name name of the CustomResourceDefinition * @param pretty If 'true', then the output is pretty printed. * @param exact Should the export be exact. Exact export maintains cluster-specific fields like 'Namespace'. * @param _export Should this value be exported. Export strips fields that a user can not specify. * @param {*} [options] Override http request options. */ readCustomResourceDefinition(name, pretty, exact, _export, options = {}) { const localVarPath = this.basePath + '/apis/apiextensions.k8s.io/v1beta1/customresourcedefinitions/{name}' .replace('{' + 'name' + '}', encodeURIComponent(String(name))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling readCustomResourceDefinition.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, "string"); } if (exact !== undefined) { localVarQueryParameters['exact'] = ObjectSerializer.serialize(exact, "boolean"); } if (_export !== undefined) { localVarQueryParameters['export'] = ObjectSerializer.serialize(_export, "boolean"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'GET', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "V1beta1CustomResourceDefinition"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * read status of the specified CustomResourceDefinition * @param name name of the CustomResourceDefinition * @param pretty If 'true', then the output is pretty printed. * @param {*} [options] Override http request options. */ readCustomResourceDefinitionStatus(name, pretty, options = {}) { const localVarPath = this.basePath + '/apis/apiextensions.k8s.io/v1beta1/customresourcedefinitions/{name}/status' .replace('{' + 'name' + '}', encodeURIComponent(String(name))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling readCustomResourceDefinitionStatus.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'GET', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "V1beta1CustomResourceDefinition"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * replace the specified CustomResourceDefinition * @param name name of the CustomResourceDefinition * @param body * @param pretty If 'true', then the output is pretty printed. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param {*} [options] Override http request options. */ replaceCustomResourceDefinition(name, body, pretty, dryRun, options = {}) { const localVarPath = this.basePath + '/apis/apiextensions.k8s.io/v1beta1/customresourcedefinitions/{name}' .replace('{' + 'name' + '}', encodeURIComponent(String(name))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling replaceCustomResourceDefinition.'); } // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling replaceCustomResourceDefinition.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'PUT', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: ObjectSerializer.serialize(body, "V1beta1CustomResourceDefinition") }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "V1beta1CustomResourceDefinition"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * replace status of the specified CustomResourceDefinition * @param name name of the CustomResourceDefinition * @param body * @param pretty If 'true', then the output is pretty printed. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param {*} [options] Override http request options. */ replaceCustomResourceDefinitionStatus(name, body, pretty, dryRun, options = {}) { const localVarPath = this.basePath + '/apis/apiextensions.k8s.io/v1beta1/customresourcedefinitions/{name}/status' .replace('{' + 'name' + '}', encodeURIComponent(String(name))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling replaceCustomResourceDefinitionStatus.'); } // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling replaceCustomResourceDefinitionStatus.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'PUT', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: ObjectSerializer.serialize(body, "V1beta1CustomResourceDefinition") }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "V1beta1CustomResourceDefinition"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } } exports.ApiextensionsV1beta1Api = ApiextensionsV1beta1Api; var ApiregistrationApiApiKeys; (function (ApiregistrationApiApiKeys) { ApiregistrationApiApiKeys[ApiregistrationApiApiKeys["BearerToken"] = 0] = "BearerToken"; })(ApiregistrationApiApiKeys = exports.ApiregistrationApiApiKeys || (exports.ApiregistrationApiApiKeys = {})); class ApiregistrationApi { constructor(basePathOrUsername, password, basePath) { this._basePath = defaultBasePath; this.defaultHeaders = {}; this._useQuerystring = false; this.authentications = { 'default': new VoidAuth(), 'BearerToken': new ApiKeyAuth('header', 'authorization'), }; if (password) { if (basePath) { this.basePath = basePath; } } else { if (basePathOrUsername) { this.basePath = basePathOrUsername; } } } set useQuerystring(value) { this._useQuerystring = value; } set basePath(basePath) { this._basePath = basePath; } get basePath() { return this._basePath; } setDefaultAuthentication(auth) { this.authentications.default = auth; } setApiKey(key, value) { this.authentications[ApiregistrationApiApiKeys[key]].apiKey = value; } /** * get information of a group * @param {*} [options] Override http request options. */ getAPIGroup(options = {}) { const localVarPath = this.basePath + '/apis/apiregistration.k8s.io/'; let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'GET', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "V1APIGroup"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } } exports.ApiregistrationApi = ApiregistrationApi; var ApiregistrationV1ApiApiKeys; (function (ApiregistrationV1ApiApiKeys) { ApiregistrationV1ApiApiKeys[ApiregistrationV1ApiApiKeys["BearerToken"] = 0] = "BearerToken"; })(ApiregistrationV1ApiApiKeys = exports.ApiregistrationV1ApiApiKeys || (exports.ApiregistrationV1ApiApiKeys = {})); class ApiregistrationV1Api { constructor(basePathOrUsername, password, basePath) { this._basePath = defaultBasePath; this.defaultHeaders = {}; this._useQuerystring = false; this.authentications = { 'default': new VoidAuth(), 'BearerToken': new ApiKeyAuth('header', 'authorization'), }; if (password) { if (basePath) { this.basePath = basePath; } } else { if (basePathOrUsername) { this.basePath = basePathOrUsername; } } } set useQuerystring(value) { this._useQuerystring = value; } set basePath(basePath) { this._basePath = basePath; } get basePath() { return this._basePath; } setDefaultAuthentication(auth) { this.authentications.default = auth; } setApiKey(key, value) { this.authentications[ApiregistrationV1ApiApiKeys[key]].apiKey = value; } /** * create an APIService * @param body * @param includeUninitialized If true, partially initialized resources are included in the response. * @param pretty If 'true', then the output is pretty printed. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param {*} [options] Override http request options. */ createAPIService(body, includeUninitialized, pretty, dryRun, options = {}) { const localVarPath = this.basePath + '/apis/apiregistration.k8s.io/v1/apiservices'; let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling createAPIService.'); } if (includeUninitialized !== undefined) { localVarQueryParameters['includeUninitialized'] = ObjectSerializer.serialize(includeUninitialized, "boolean"); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'POST', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: ObjectSerializer.serialize(body, "V1APIService") }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "V1APIService"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * delete an APIService * @param name name of the APIService * @param pretty If 'true', then the output is pretty printed. * @param body * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @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. * @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. * @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. * @param {*} [options] Override http request options. */ deleteAPIService(name, pretty, body, dryRun, gracePeriodSeconds, orphanDependents, propagationPolicy, options = {}) { const localVarPath = this.basePath + '/apis/apiregistration.k8s.io/v1/apiservices/{name}' .replace('{' + 'name' + '}', encodeURIComponent(String(name))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling deleteAPIService.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, "string"); } if (gracePeriodSeconds !== undefined) { localVarQueryParameters['gracePeriodSeconds'] = ObjectSerializer.serialize(gracePeriodSeconds, "number"); } if (orphanDependents !== undefined) { localVarQueryParameters['orphanDependents'] = ObjectSerializer.serialize(orphanDependents, "boolean"); } if (propagationPolicy !== undefined) { localVarQueryParameters['propagationPolicy'] = ObjectSerializer.serialize(propagationPolicy, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'DELETE', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: ObjectSerializer.serialize(body, "V1DeleteOptions") }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "V1Status"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * delete collection of APIService * @param includeUninitialized If true, partially initialized resources are included in the response. * @param pretty If 'true', then the output is pretty printed. * @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. * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything. * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything. * @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. * @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. * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. * @param watch Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion. * @param {*} [options] Override http request options. */ deleteCollectionAPIService(includeUninitialized, pretty, _continue, fieldSelector, labelSelector, limit, resourceVersion, timeoutSeconds, watch, options = {}) { const localVarPath = this.basePath + '/apis/apiregistration.k8s.io/v1/apiservices'; let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; if (includeUninitialized !== undefined) { localVarQueryParameters['includeUninitialized'] = ObjectSerializer.serialize(includeUninitialized, "boolean"); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, "string"); } if (_continue !== undefined) { localVarQueryParameters['continue'] = ObjectSerializer.serialize(_continue, "string"); } if (fieldSelector !== undefined) { localVarQueryParameters['fieldSelector'] = ObjectSerializer.serialize(fieldSelector, "string"); } if (labelSelector !== undefined) { localVarQueryParameters['labelSelector'] = ObjectSerializer.serialize(labelSelector, "string"); } if (limit !== undefined) { localVarQueryParameters['limit'] = ObjectSerializer.serialize(limit, "number"); } if (resourceVersion !== undefined) { localVarQueryParameters['resourceVersion'] = ObjectSerializer.serialize(resourceVersion, "string"); } if (timeoutSeconds !== undefined) { localVarQueryParameters['timeoutSeconds'] = ObjectSerializer.serialize(timeoutSeconds, "number"); } if (watch !== undefined) { localVarQueryParameters['watch'] = ObjectSerializer.serialize(watch, "boolean"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'DELETE', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "V1Status"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * get available resources * @param {*} [options] Override http request options. */ getAPIResources(options = {}) { const localVarPath = this.basePath + '/apis/apiregistration.k8s.io/v1/'; let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'GET', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "V1APIResourceList"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * list or watch objects of kind APIService * @param includeUninitialized If true, partially initialized resources are included in the response. * @param pretty If 'true', then the output is pretty printed. * @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. * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything. * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything. * @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. * @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. * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. * @param watch Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion. * @param {*} [options] Override http request options. */ listAPIService(includeUninitialized, pretty, _continue, fieldSelector, labelSelector, limit, resourceVersion, timeoutSeconds, watch, options = {}) { const localVarPath = this.basePath + '/apis/apiregistration.k8s.io/v1/apiservices'; let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; if (includeUninitialized !== undefined) { localVarQueryParameters['includeUninitialized'] = ObjectSerializer.serialize(includeUninitialized, "boolean"); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, "string"); } if (_continue !== undefined) { localVarQueryParameters['continue'] = ObjectSerializer.serialize(_continue, "string"); } if (fieldSelector !== undefined) { localVarQueryParameters['fieldSelector'] = ObjectSerializer.serialize(fieldSelector, "string"); } if (labelSelector !== undefined) { localVarQueryParameters['labelSelector'] = ObjectSerializer.serialize(labelSelector, "string"); } if (limit !== undefined) { localVarQueryParameters['limit'] = ObjectSerializer.serialize(limit, "number"); } if (resourceVersion !== undefined) { localVarQueryParameters['resourceVersion'] = ObjectSerializer.serialize(resourceVersion, "string"); } if (timeoutSeconds !== undefined) { localVarQueryParameters['timeoutSeconds'] = ObjectSerializer.serialize(timeoutSeconds, "number"); } if (watch !== undefined) { localVarQueryParameters['watch'] = ObjectSerializer.serialize(watch, "boolean"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'GET', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "V1APIServiceList"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * partially update the specified APIService * @param name name of the APIService * @param body * @param pretty If 'true', then the output is pretty printed. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param {*} [options] Override http request options. */ patchAPIService(name, body, pretty, dryRun, options = {}) { const localVarPath = this.basePath + '/apis/apiregistration.k8s.io/v1/apiservices/{name}' .replace('{' + 'name' + '}', encodeURIComponent(String(name))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling patchAPIService.'); } // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling patchAPIService.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'PATCH', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: ObjectSerializer.serialize(body, "any") }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "V1APIService"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * partially update status of the specified APIService * @param name name of the APIService * @param body * @param pretty If 'true', then the output is pretty printed. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param {*} [options] Override http request options. */ patchAPIServiceStatus(name, body, pretty, dryRun, options = {}) { const localVarPath = this.basePath + '/apis/apiregistration.k8s.io/v1/apiservices/{name}/status' .replace('{' + 'name' + '}', encodeURIComponent(String(name))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling patchAPIServiceStatus.'); } // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling patchAPIServiceStatus.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'PATCH', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: ObjectSerializer.serialize(body, "any") }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "V1APIService"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * read the specified APIService * @param name name of the APIService * @param pretty If 'true', then the output is pretty printed. * @param exact Should the export be exact. Exact export maintains cluster-specific fields like 'Namespace'. * @param _export Should this value be exported. Export strips fields that a user can not specify. * @param {*} [options] Override http request options. */ readAPIService(name, pretty, exact, _export, options = {}) { const localVarPath = this.basePath + '/apis/apiregistration.k8s.io/v1/apiservices/{name}' .replace('{' + 'name' + '}', encodeURIComponent(String(name))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling readAPIService.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, "string"); } if (exact !== undefined) { localVarQueryParameters['exact'] = ObjectSerializer.serialize(exact, "boolean"); } if (_export !== undefined) { localVarQueryParameters['export'] = ObjectSerializer.serialize(_export, "boolean"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'GET', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "V1APIService"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * read status of the specified APIService * @param name name of the APIService * @param pretty If 'true', then the output is pretty printed. * @param {*} [options] Override http request options. */ readAPIServiceStatus(name, pretty, options = {}) { const localVarPath = this.basePath + '/apis/apiregistration.k8s.io/v1/apiservices/{name}/status' .replace('{' + 'name' + '}', encodeURIComponent(String(name))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling readAPIServiceStatus.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'GET', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "V1APIService"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * replace the specified APIService * @param name name of the APIService * @param body * @param pretty If 'true', then the output is pretty printed. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param {*} [options] Override http request options. */ replaceAPIService(name, body, pretty, dryRun, options = {}) { const localVarPath = this.basePath + '/apis/apiregistration.k8s.io/v1/apiservices/{name}' .replace('{' + 'name' + '}', encodeURIComponent(String(name))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling replaceAPIService.'); } // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling replaceAPIService.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'PUT', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: ObjectSerializer.serialize(body, "V1APIService") }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "V1APIService"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * replace status of the specified APIService * @param name name of the APIService * @param body * @param pretty If 'true', then the output is pretty printed. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param {*} [options] Override http request options. */ replaceAPIServiceStatus(name, body, pretty, dryRun, options = {}) { const localVarPath = this.basePath + '/apis/apiregistration.k8s.io/v1/apiservices/{name}/status' .replace('{' + 'name' + '}', encodeURIComponent(String(name))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling replaceAPIServiceStatus.'); } // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling replaceAPIServiceStatus.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'PUT', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: ObjectSerializer.serialize(body, "V1APIService") }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "V1APIService"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } } exports.ApiregistrationV1Api = ApiregistrationV1Api; var ApiregistrationV1beta1ApiApiKeys; (function (ApiregistrationV1beta1ApiApiKeys) { ApiregistrationV1beta1ApiApiKeys[ApiregistrationV1beta1ApiApiKeys["BearerToken"] = 0] = "BearerToken"; })(ApiregistrationV1beta1ApiApiKeys = exports.ApiregistrationV1beta1ApiApiKeys || (exports.ApiregistrationV1beta1ApiApiKeys = {})); class ApiregistrationV1beta1Api { constructor(basePathOrUsername, password, basePath) { this._basePath = defaultBasePath; this.defaultHeaders = {}; this._useQuerystring = false; this.authentications = { 'default': new VoidAuth(), 'BearerToken': new ApiKeyAuth('header', 'authorization'), }; if (password) { if (basePath) { this.basePath = basePath; } } else { if (basePathOrUsername) { this.basePath = basePathOrUsername; } } } set useQuerystring(value) { this._useQuerystring = value; } set basePath(basePath) { this._basePath = basePath; } get basePath() { return this._basePath; } setDefaultAuthentication(auth) { this.authentications.default = auth; } setApiKey(key, value) { this.authentications[ApiregistrationV1beta1ApiApiKeys[key]].apiKey = value; } /** * create an APIService * @param body * @param includeUninitialized If true, partially initialized resources are included in the response. * @param pretty If 'true', then the output is pretty printed. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param {*} [options] Override http request options. */ createAPIService(body, includeUninitialized, pretty, dryRun, options = {}) { const localVarPath = this.basePath + '/apis/apiregistration.k8s.io/v1beta1/apiservices'; let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling createAPIService.'); } if (includeUninitialized !== undefined) { localVarQueryParameters['includeUninitialized'] = ObjectSerializer.serialize(includeUninitialized, "boolean"); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'POST', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: ObjectSerializer.serialize(body, "V1beta1APIService") }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "V1beta1APIService"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * delete an APIService * @param name name of the APIService * @param pretty If 'true', then the output is pretty printed. * @param body * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @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. * @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. * @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. * @param {*} [options] Override http request options. */ deleteAPIService(name, pretty, body, dryRun, gracePeriodSeconds, orphanDependents, propagationPolicy, options = {}) { const localVarPath = this.basePath + '/apis/apiregistration.k8s.io/v1beta1/apiservices/{name}' .replace('{' + 'name' + '}', encodeURIComponent(String(name))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling deleteAPIService.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, "string"); } if (gracePeriodSeconds !== undefined) { localVarQueryParameters['gracePeriodSeconds'] = ObjectSerializer.serialize(gracePeriodSeconds, "number"); } if (orphanDependents !== undefined) { localVarQueryParameters['orphanDependents'] = ObjectSerializer.serialize(orphanDependents, "boolean"); } if (propagationPolicy !== undefined) { localVarQueryParameters['propagationPolicy'] = ObjectSerializer.serialize(propagationPolicy, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'DELETE', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: ObjectSerializer.serialize(body, "V1DeleteOptions") }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "V1Status"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * delete collection of APIService * @param includeUninitialized If true, partially initialized resources are included in the response. * @param pretty If 'true', then the output is pretty printed. * @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. * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything. * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything. * @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. * @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. * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. * @param watch Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion. * @param {*} [options] Override http request options. */ deleteCollectionAPIService(includeUninitialized, pretty, _continue, fieldSelector, labelSelector, limit, resourceVersion, timeoutSeconds, watch, options = {}) { const localVarPath = this.basePath + '/apis/apiregistration.k8s.io/v1beta1/apiservices'; let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; if (includeUninitialized !== undefined) { localVarQueryParameters['includeUninitialized'] = ObjectSerializer.serialize(includeUninitialized, "boolean"); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, "string"); } if (_continue !== undefined) { localVarQueryParameters['continue'] = ObjectSerializer.serialize(_continue, "string"); } if (fieldSelector !== undefined) { localVarQueryParameters['fieldSelector'] = ObjectSerializer.serialize(fieldSelector, "string"); } if (labelSelector !== undefined) { localVarQueryParameters['labelSelector'] = ObjectSerializer.serialize(labelSelector, "string"); } if (limit !== undefined) { localVarQueryParameters['limit'] = ObjectSerializer.serialize(limit, "number"); } if (resourceVersion !== undefined) { localVarQueryParameters['resourceVersion'] = ObjectSerializer.serialize(resourceVersion, "string"); } if (timeoutSeconds !== undefined) { localVarQueryParameters['timeoutSeconds'] = ObjectSerializer.serialize(timeoutSeconds, "number"); } if (watch !== undefined) { localVarQueryParameters['watch'] = ObjectSerializer.serialize(watch, "boolean"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'DELETE', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "V1Status"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * get available resources * @param {*} [options] Override http request options. */ getAPIResources(options = {}) { const localVarPath = this.basePath + '/apis/apiregistration.k8s.io/v1beta1/'; let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'GET', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "V1APIResourceList"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * list or watch objects of kind APIService * @param includeUninitialized If true, partially initialized resources are included in the response. * @param pretty If 'true', then the output is pretty printed. * @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. * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything. * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything. * @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. * @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. * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. * @param watch Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion. * @param {*} [options] Override http request options. */ listAPIService(includeUninitialized, pretty, _continue, fieldSelector, labelSelector, limit, resourceVersion, timeoutSeconds, watch, options = {}) { const localVarPath = this.basePath + '/apis/apiregistration.k8s.io/v1beta1/apiservices'; let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; if (includeUninitialized !== undefined) { localVarQueryParameters['includeUninitialized'] = ObjectSerializer.serialize(includeUninitialized, "boolean"); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, "string"); } if (_continue !== undefined) { localVarQueryParameters['continue'] = ObjectSerializer.serialize(_continue, "string"); } if (fieldSelector !== undefined) { localVarQueryParameters['fieldSelector'] = ObjectSerializer.serialize(fieldSelector, "string"); } if (labelSelector !== undefined) { localVarQueryParameters['labelSelector'] = ObjectSerializer.serialize(labelSelector, "string"); } if (limit !== undefined) { localVarQueryParameters['limit'] = ObjectSerializer.serialize(limit, "number"); } if (resourceVersion !== undefined) { localVarQueryParameters['resourceVersion'] = ObjectSerializer.serialize(resourceVersion, "string"); } if (timeoutSeconds !== undefined) { localVarQueryParameters['timeoutSeconds'] = ObjectSerializer.serialize(timeoutSeconds, "number"); } if (watch !== undefined) { localVarQueryParameters['watch'] = ObjectSerializer.serialize(watch, "boolean"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'GET', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "V1beta1APIServiceList"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * partially update the specified APIService * @param name name of the APIService * @param body * @param pretty If 'true', then the output is pretty printed. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param {*} [options] Override http request options. */ patchAPIService(name, body, pretty, dryRun, options = {}) { const localVarPath = this.basePath + '/apis/apiregistration.k8s.io/v1beta1/apiservices/{name}' .replace('{' + 'name' + '}', encodeURIComponent(String(name))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling patchAPIService.'); } // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling patchAPIService.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'PATCH', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: ObjectSerializer.serialize(body, "any") }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "V1beta1APIService"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * partially update status of the specified APIService * @param name name of the APIService * @param body * @param pretty If 'true', then the output is pretty printed. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param {*} [options] Override http request options. */ patchAPIServiceStatus(name, body, pretty, dryRun, options = {}) { const localVarPath = this.basePath + '/apis/apiregistration.k8s.io/v1beta1/apiservices/{name}/status' .replace('{' + 'name' + '}', encodeURIComponent(String(name))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling patchAPIServiceStatus.'); } // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling patchAPIServiceStatus.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'PATCH', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: ObjectSerializer.serialize(body, "any") }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "V1beta1APIService"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * read the specified APIService * @param name name of the APIService * @param pretty If 'true', then the output is pretty printed. * @param exact Should the export be exact. Exact export maintains cluster-specific fields like 'Namespace'. * @param _export Should this value be exported. Export strips fields that a user can not specify. * @param {*} [options] Override http request options. */ readAPIService(name, pretty, exact, _export, options = {}) { const localVarPath = this.basePath + '/apis/apiregistration.k8s.io/v1beta1/apiservices/{name}' .replace('{' + 'name' + '}', encodeURIComponent(String(name))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling readAPIService.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, "string"); } if (exact !== undefined) { localVarQueryParameters['exact'] = ObjectSerializer.serialize(exact, "boolean"); } if (_export !== undefined) { localVarQueryParameters['export'] = ObjectSerializer.serialize(_export, "boolean"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'GET', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "V1beta1APIService"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * read status of the specified APIService * @param name name of the APIService * @param pretty If 'true', then the output is pretty printed. * @param {*} [options] Override http request options. */ readAPIServiceStatus(name, pretty, options = {}) { const localVarPath = this.basePath + '/apis/apiregistration.k8s.io/v1beta1/apiservices/{name}/status' .replace('{' + 'name' + '}', encodeURIComponent(String(name))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling readAPIServiceStatus.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'GET', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "V1beta1APIService"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * replace the specified APIService * @param name name of the APIService * @param body * @param pretty If 'true', then the output is pretty printed. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param {*} [options] Override http request options. */ replaceAPIService(name, body, pretty, dryRun, options = {}) { const localVarPath = this.basePath + '/apis/apiregistration.k8s.io/v1beta1/apiservices/{name}' .replace('{' + 'name' + '}', encodeURIComponent(String(name))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling replaceAPIService.'); } // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling replaceAPIService.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'PUT', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: ObjectSerializer.serialize(body, "V1beta1APIService") }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "V1beta1APIService"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * replace status of the specified APIService * @param name name of the APIService * @param body * @param pretty If 'true', then the output is pretty printed. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param {*} [options] Override http request options. */ replaceAPIServiceStatus(name, body, pretty, dryRun, options = {}) { const localVarPath = this.basePath + '/apis/apiregistration.k8s.io/v1beta1/apiservices/{name}/status' .replace('{' + 'name' + '}', encodeURIComponent(String(name))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling replaceAPIServiceStatus.'); } // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling replaceAPIServiceStatus.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'PUT', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: ObjectSerializer.serialize(body, "V1beta1APIService") }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "V1beta1APIService"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } } exports.ApiregistrationV1beta1Api = ApiregistrationV1beta1Api; var ApisApiApiKeys; (function (ApisApiApiKeys) { ApisApiApiKeys[ApisApiApiKeys["BearerToken"] = 0] = "BearerToken"; })(ApisApiApiKeys = exports.ApisApiApiKeys || (exports.ApisApiApiKeys = {})); class ApisApi { constructor(basePathOrUsername, password, basePath) { this._basePath = defaultBasePath; this.defaultHeaders = {}; this._useQuerystring = false; this.authentications = { 'default': new VoidAuth(), 'BearerToken': new ApiKeyAuth('header', 'authorization'), }; if (password) { if (basePath) { this.basePath = basePath; } } else { if (basePathOrUsername) { this.basePath = basePathOrUsername; } } } set useQuerystring(value) { this._useQuerystring = value; } set basePath(basePath) { this._basePath = basePath; } get basePath() { return this._basePath; } setDefaultAuthentication(auth) { this.authentications.default = auth; } setApiKey(key, value) { this.authentications[ApisApiApiKeys[key]].apiKey = value; } /** * get available API versions * @param {*} [options] Override http request options. */ getAPIVersions(options = {}) { const localVarPath = this.basePath + '/apis/'; let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'GET', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "V1APIGroupList"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } } exports.ApisApi = ApisApi; var AppsApiApiKeys; (function (AppsApiApiKeys) { AppsApiApiKeys[AppsApiApiKeys["BearerToken"] = 0] = "BearerToken"; })(AppsApiApiKeys = exports.AppsApiApiKeys || (exports.AppsApiApiKeys = {})); class AppsApi { constructor(basePathOrUsername, password, basePath) { this._basePath = defaultBasePath; this.defaultHeaders = {}; this._useQuerystring = false; this.authentications = { 'default': new VoidAuth(), 'BearerToken': new ApiKeyAuth('header', 'authorization'), }; if (password) { if (basePath) { this.basePath = basePath; } } else { if (basePathOrUsername) { this.basePath = basePathOrUsername; } } } set useQuerystring(value) { this._useQuerystring = value; } set basePath(basePath) { this._basePath = basePath; } get basePath() { return this._basePath; } setDefaultAuthentication(auth) { this.authentications.default = auth; } setApiKey(key, value) { this.authentications[AppsApiApiKeys[key]].apiKey = value; } /** * get information of a group * @param {*} [options] Override http request options. */ getAPIGroup(options = {}) { const localVarPath = this.basePath + '/apis/apps/'; let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'GET', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "V1APIGroup"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } } exports.AppsApi = AppsApi; var AppsV1ApiApiKeys; (function (AppsV1ApiApiKeys) { AppsV1ApiApiKeys[AppsV1ApiApiKeys["BearerToken"] = 0] = "BearerToken"; })(AppsV1ApiApiKeys = exports.AppsV1ApiApiKeys || (exports.AppsV1ApiApiKeys = {})); class AppsV1Api { constructor(basePathOrUsername, password, basePath) { this._basePath = defaultBasePath; this.defaultHeaders = {}; this._useQuerystring = false; this.authentications = { 'default': new VoidAuth(), 'BearerToken': new ApiKeyAuth('header', 'authorization'), }; if (password) { if (basePath) { this.basePath = basePath; } } else { if (basePathOrUsername) { this.basePath = basePathOrUsername; } } } set useQuerystring(value) { this._useQuerystring = value; } set basePath(basePath) { this._basePath = basePath; } get basePath() { return this._basePath; } setDefaultAuthentication(auth) { this.authentications.default = auth; } setApiKey(key, value) { this.authentications[AppsV1ApiApiKeys[key]].apiKey = value; } /** * create a ControllerRevision * @param namespace object name and auth scope, such as for teams and projects * @param body * @param includeUninitialized If true, partially initialized resources are included in the response. * @param pretty If 'true', then the output is pretty printed. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param {*} [options] Override http request options. */ createNamespacedControllerRevision(namespace, body, includeUninitialized, pretty, dryRun, options = {}) { const localVarPath = this.basePath + '/apis/apps/v1/namespaces/{namespace}/controllerrevisions' .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling createNamespacedControllerRevision.'); } // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling createNamespacedControllerRevision.'); } if (includeUninitialized !== undefined) { localVarQueryParameters['includeUninitialized'] = ObjectSerializer.serialize(includeUninitialized, "boolean"); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'POST', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: ObjectSerializer.serialize(body, "V1ControllerRevision") }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "V1ControllerRevision"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * create a DaemonSet * @param namespace object name and auth scope, such as for teams and projects * @param body * @param includeUninitialized If true, partially initialized resources are included in the response. * @param pretty If 'true', then the output is pretty printed. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param {*} [options] Override http request options. */ createNamespacedDaemonSet(namespace, body, includeUninitialized, pretty, dryRun, options = {}) { const localVarPath = this.basePath + '/apis/apps/v1/namespaces/{namespace}/daemonsets' .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling createNamespacedDaemonSet.'); } // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling createNamespacedDaemonSet.'); } if (includeUninitialized !== undefined) { localVarQueryParameters['includeUninitialized'] = ObjectSerializer.serialize(includeUninitialized, "boolean"); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'POST', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: ObjectSerializer.serialize(body, "V1DaemonSet") }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "V1DaemonSet"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * create a Deployment * @param namespace object name and auth scope, such as for teams and projects * @param body * @param includeUninitialized If true, partially initialized resources are included in the response. * @param pretty If 'true', then the output is pretty printed. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param {*} [options] Override http request options. */ createNamespacedDeployment(namespace, body, includeUninitialized, pretty, dryRun, options = {}) { const localVarPath = this.basePath + '/apis/apps/v1/namespaces/{namespace}/deployments' .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling createNamespacedDeployment.'); } // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling createNamespacedDeployment.'); } if (includeUninitialized !== undefined) { localVarQueryParameters['includeUninitialized'] = ObjectSerializer.serialize(includeUninitialized, "boolean"); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'POST', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: ObjectSerializer.serialize(body, "V1Deployment") }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "V1Deployment"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * create a ReplicaSet * @param namespace object name and auth scope, such as for teams and projects * @param body * @param includeUninitialized If true, partially initialized resources are included in the response. * @param pretty If 'true', then the output is pretty printed. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param {*} [options] Override http request options. */ createNamespacedReplicaSet(namespace, body, includeUninitialized, pretty, dryRun, options = {}) { const localVarPath = this.basePath + '/apis/apps/v1/namespaces/{namespace}/replicasets' .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling createNamespacedReplicaSet.'); } // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling createNamespacedReplicaSet.'); } if (includeUninitialized !== undefined) { localVarQueryParameters['includeUninitialized'] = ObjectSerializer.serialize(includeUninitialized, "boolean"); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'POST', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: ObjectSerializer.serialize(body, "V1ReplicaSet") }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "V1ReplicaSet"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * create a StatefulSet * @param namespace object name and auth scope, such as for teams and projects * @param body * @param includeUninitialized If true, partially initialized resources are included in the response. * @param pretty If 'true', then the output is pretty printed. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param {*} [options] Override http request options. */ createNamespacedStatefulSet(namespace, body, includeUninitialized, pretty, dryRun, options = {}) { const localVarPath = this.basePath + '/apis/apps/v1/namespaces/{namespace}/statefulsets' .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling createNamespacedStatefulSet.'); } // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling createNamespacedStatefulSet.'); } if (includeUninitialized !== undefined) { localVarQueryParameters['includeUninitialized'] = ObjectSerializer.serialize(includeUninitialized, "boolean"); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'POST', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: ObjectSerializer.serialize(body, "V1StatefulSet") }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "V1StatefulSet"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * delete collection of ControllerRevision * @param namespace object name and auth scope, such as for teams and projects * @param includeUninitialized If true, partially initialized resources are included in the response. * @param pretty If 'true', then the output is pretty printed. * @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. * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything. * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything. * @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. * @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. * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. * @param watch Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion. * @param {*} [options] Override http request options. */ deleteCollectionNamespacedControllerRevision(namespace, includeUninitialized, pretty, _continue, fieldSelector, labelSelector, limit, resourceVersion, timeoutSeconds, watch, options = {}) { const localVarPath = this.basePath + '/apis/apps/v1/namespaces/{namespace}/controllerrevisions' .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling deleteCollectionNamespacedControllerRevision.'); } if (includeUninitialized !== undefined) { localVarQueryParameters['includeUninitialized'] = ObjectSerializer.serialize(includeUninitialized, "boolean"); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, "string"); } if (_continue !== undefined) { localVarQueryParameters['continue'] = ObjectSerializer.serialize(_continue, "string"); } if (fieldSelector !== undefined) { localVarQueryParameters['fieldSelector'] = ObjectSerializer.serialize(fieldSelector, "string"); } if (labelSelector !== undefined) { localVarQueryParameters['labelSelector'] = ObjectSerializer.serialize(labelSelector, "string"); } if (limit !== undefined) { localVarQueryParameters['limit'] = ObjectSerializer.serialize(limit, "number"); } if (resourceVersion !== undefined) { localVarQueryParameters['resourceVersion'] = ObjectSerializer.serialize(resourceVersion, "string"); } if (timeoutSeconds !== undefined) { localVarQueryParameters['timeoutSeconds'] = ObjectSerializer.serialize(timeoutSeconds, "number"); } if (watch !== undefined) { localVarQueryParameters['watch'] = ObjectSerializer.serialize(watch, "boolean"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'DELETE', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "V1Status"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * delete collection of DaemonSet * @param namespace object name and auth scope, such as for teams and projects * @param includeUninitialized If true, partially initialized resources are included in the response. * @param pretty If 'true', then the output is pretty printed. * @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. * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything. * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything. * @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. * @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. * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. * @param watch Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion. * @param {*} [options] Override http request options. */ deleteCollectionNamespacedDaemonSet(namespace, includeUninitialized, pretty, _continue, fieldSelector, labelSelector, limit, resourceVersion, timeoutSeconds, watch, options = {}) { const localVarPath = this.basePath + '/apis/apps/v1/namespaces/{namespace}/daemonsets' .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling deleteCollectionNamespacedDaemonSet.'); } if (includeUninitialized !== undefined) { localVarQueryParameters['includeUninitialized'] = ObjectSerializer.serialize(includeUninitialized, "boolean"); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, "string"); } if (_continue !== undefined) { localVarQueryParameters['continue'] = ObjectSerializer.serialize(_continue, "string"); } if (fieldSelector !== undefined) { localVarQueryParameters['fieldSelector'] = ObjectSerializer.serialize(fieldSelector, "string"); } if (labelSelector !== undefined) { localVarQueryParameters['labelSelector'] = ObjectSerializer.serialize(labelSelector, "string"); } if (limit !== undefined) { localVarQueryParameters['limit'] = ObjectSerializer.serialize(limit, "number"); } if (resourceVersion !== undefined) { localVarQueryParameters['resourceVersion'] = ObjectSerializer.serialize(resourceVersion, "string"); } if (timeoutSeconds !== undefined) { localVarQueryParameters['timeoutSeconds'] = ObjectSerializer.serialize(timeoutSeconds, "number"); } if (watch !== undefined) { localVarQueryParameters['watch'] = ObjectSerializer.serialize(watch, "boolean"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'DELETE', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "V1Status"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * delete collection of Deployment * @param namespace object name and auth scope, such as for teams and projects * @param includeUninitialized If true, partially initialized resources are included in the response. * @param pretty If 'true', then the output is pretty printed. * @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. * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything. * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything. * @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. * @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. * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. * @param watch Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion. * @param {*} [options] Override http request options. */ deleteCollectionNamespacedDeployment(namespace, includeUninitialized, pretty, _continue, fieldSelector, labelSelector, limit, resourceVersion, timeoutSeconds, watch, options = {}) { const localVarPath = this.basePath + '/apis/apps/v1/namespaces/{namespace}/deployments' .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling deleteCollectionNamespacedDeployment.'); } if (includeUninitialized !== undefined) { localVarQueryParameters['includeUninitialized'] = ObjectSerializer.serialize(includeUninitialized, "boolean"); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, "string"); } if (_continue !== undefined) { localVarQueryParameters['continue'] = ObjectSerializer.serialize(_continue, "string"); } if (fieldSelector !== undefined) { localVarQueryParameters['fieldSelector'] = ObjectSerializer.serialize(fieldSelector, "string"); } if (labelSelector !== undefined) { localVarQueryParameters['labelSelector'] = ObjectSerializer.serialize(labelSelector, "string"); } if (limit !== undefined) { localVarQueryParameters['limit'] = ObjectSerializer.serialize(limit, "number"); } if (resourceVersion !== undefined) { localVarQueryParameters['resourceVersion'] = ObjectSerializer.serialize(resourceVersion, "string"); } if (timeoutSeconds !== undefined) { localVarQueryParameters['timeoutSeconds'] = ObjectSerializer.serialize(timeoutSeconds, "number"); } if (watch !== undefined) { localVarQueryParameters['watch'] = ObjectSerializer.serialize(watch, "boolean"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'DELETE', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "V1Status"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * delete collection of ReplicaSet * @param namespace object name and auth scope, such as for teams and projects * @param includeUninitialized If true, partially initialized resources are included in the response. * @param pretty If 'true', then the output is pretty printed. * @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. * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything. * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything. * @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. * @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. * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. * @param watch Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion. * @param {*} [options] Override http request options. */ deleteCollectionNamespacedReplicaSet(namespace, includeUninitialized, pretty, _continue, fieldSelector, labelSelector, limit, resourceVersion, timeoutSeconds, watch, options = {}) { const localVarPath = this.basePath + '/apis/apps/v1/namespaces/{namespace}/replicasets' .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling deleteCollectionNamespacedReplicaSet.'); } if (includeUninitialized !== undefined) { localVarQueryParameters['includeUninitialized'] = ObjectSerializer.serialize(includeUninitialized, "boolean"); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, "string"); } if (_continue !== undefined) { localVarQueryParameters['continue'] = ObjectSerializer.serialize(_continue, "string"); } if (fieldSelector !== undefined) { localVarQueryParameters['fieldSelector'] = ObjectSerializer.serialize(fieldSelector, "string"); } if (labelSelector !== undefined) { localVarQueryParameters['labelSelector'] = ObjectSerializer.serialize(labelSelector, "string"); } if (limit !== undefined) { localVarQueryParameters['limit'] = ObjectSerializer.serialize(limit, "number"); } if (resourceVersion !== undefined) { localVarQueryParameters['resourceVersion'] = ObjectSerializer.serialize(resourceVersion, "string"); } if (timeoutSeconds !== undefined) { localVarQueryParameters['timeoutSeconds'] = ObjectSerializer.serialize(timeoutSeconds, "number"); } if (watch !== undefined) { localVarQueryParameters['watch'] = ObjectSerializer.serialize(watch, "boolean"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'DELETE', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "V1Status"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * delete collection of StatefulSet * @param namespace object name and auth scope, such as for teams and projects * @param includeUninitialized If true, partially initialized resources are included in the response. * @param pretty If 'true', then the output is pretty printed. * @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. * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything. * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything. * @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. * @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. * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. * @param watch Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion. * @param {*} [options] Override http request options. */ deleteCollectionNamespacedStatefulSet(namespace, includeUninitialized, pretty, _continue, fieldSelector, labelSelector, limit, resourceVersion, timeoutSeconds, watch, options = {}) { const localVarPath = this.basePath + '/apis/apps/v1/namespaces/{namespace}/statefulsets' .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling deleteCollectionNamespacedStatefulSet.'); } if (includeUninitialized !== undefined) { localVarQueryParameters['includeUninitialized'] = ObjectSerializer.serialize(includeUninitialized, "boolean"); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, "string"); } if (_continue !== undefined) { localVarQueryParameters['continue'] = ObjectSerializer.serialize(_continue, "string"); } if (fieldSelector !== undefined) { localVarQueryParameters['fieldSelector'] = ObjectSerializer.serialize(fieldSelector, "string"); } if (labelSelector !== undefined) { localVarQueryParameters['labelSelector'] = ObjectSerializer.serialize(labelSelector, "string"); } if (limit !== undefined) { localVarQueryParameters['limit'] = ObjectSerializer.serialize(limit, "number"); } if (resourceVersion !== undefined) { localVarQueryParameters['resourceVersion'] = ObjectSerializer.serialize(resourceVersion, "string"); } if (timeoutSeconds !== undefined) { localVarQueryParameters['timeoutSeconds'] = ObjectSerializer.serialize(timeoutSeconds, "number"); } if (watch !== undefined) { localVarQueryParameters['watch'] = ObjectSerializer.serialize(watch, "boolean"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'DELETE', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "V1Status"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * delete a ControllerRevision * @param name name of the ControllerRevision * @param namespace object name and auth scope, such as for teams and projects * @param pretty If 'true', then the output is pretty printed. * @param body * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @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. * @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. * @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. * @param {*} [options] Override http request options. */ deleteNamespacedControllerRevision(name, namespace, pretty, body, dryRun, gracePeriodSeconds, orphanDependents, propagationPolicy, options = {}) { const localVarPath = this.basePath + '/apis/apps/v1/namespaces/{namespace}/controllerrevisions/{name}' .replace('{' + 'name' + '}', encodeURIComponent(String(name))) .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling deleteNamespacedControllerRevision.'); } // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling deleteNamespacedControllerRevision.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, "string"); } if (gracePeriodSeconds !== undefined) { localVarQueryParameters['gracePeriodSeconds'] = ObjectSerializer.serialize(gracePeriodSeconds, "number"); } if (orphanDependents !== undefined) { localVarQueryParameters['orphanDependents'] = ObjectSerializer.serialize(orphanDependents, "boolean"); } if (propagationPolicy !== undefined) { localVarQueryParameters['propagationPolicy'] = ObjectSerializer.serialize(propagationPolicy, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'DELETE', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: ObjectSerializer.serialize(body, "V1DeleteOptions") }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "V1Status"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * delete a DaemonSet * @param name name of the DaemonSet * @param namespace object name and auth scope, such as for teams and projects * @param pretty If 'true', then the output is pretty printed. * @param body * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @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. * @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. * @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. * @param {*} [options] Override http request options. */ deleteNamespacedDaemonSet(name, namespace, pretty, body, dryRun, gracePeriodSeconds, orphanDependents, propagationPolicy, options = {}) { const localVarPath = this.basePath + '/apis/apps/v1/namespaces/{namespace}/daemonsets/{name}' .replace('{' + 'name' + '}', encodeURIComponent(String(name))) .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling deleteNamespacedDaemonSet.'); } // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling deleteNamespacedDaemonSet.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, "string"); } if (gracePeriodSeconds !== undefined) { localVarQueryParameters['gracePeriodSeconds'] = ObjectSerializer.serialize(gracePeriodSeconds, "number"); } if (orphanDependents !== undefined) { localVarQueryParameters['orphanDependents'] = ObjectSerializer.serialize(orphanDependents, "boolean"); } if (propagationPolicy !== undefined) { localVarQueryParameters['propagationPolicy'] = ObjectSerializer.serialize(propagationPolicy, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'DELETE', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: ObjectSerializer.serialize(body, "V1DeleteOptions") }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "V1Status"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * delete a Deployment * @param name name of the Deployment * @param namespace object name and auth scope, such as for teams and projects * @param pretty If 'true', then the output is pretty printed. * @param body * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @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. * @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. * @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. * @param {*} [options] Override http request options. */ deleteNamespacedDeployment(name, namespace, pretty, body, dryRun, gracePeriodSeconds, orphanDependents, propagationPolicy, options = {}) { const localVarPath = this.basePath + '/apis/apps/v1/namespaces/{namespace}/deployments/{name}' .replace('{' + 'name' + '}', encodeURIComponent(String(name))) .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling deleteNamespacedDeployment.'); } // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling deleteNamespacedDeployment.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, "string"); } if (gracePeriodSeconds !== undefined) { localVarQueryParameters['gracePeriodSeconds'] = ObjectSerializer.serialize(gracePeriodSeconds, "number"); } if (orphanDependents !== undefined) { localVarQueryParameters['orphanDependents'] = ObjectSerializer.serialize(orphanDependents, "boolean"); } if (propagationPolicy !== undefined) { localVarQueryParameters['propagationPolicy'] = ObjectSerializer.serialize(propagationPolicy, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'DELETE', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: ObjectSerializer.serialize(body, "V1DeleteOptions") }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "V1Status"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * delete a ReplicaSet * @param name name of the ReplicaSet * @param namespace object name and auth scope, such as for teams and projects * @param pretty If 'true', then the output is pretty printed. * @param body * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @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. * @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. * @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. * @param {*} [options] Override http request options. */ deleteNamespacedReplicaSet(name, namespace, pretty, body, dryRun, gracePeriodSeconds, orphanDependents, propagationPolicy, options = {}) { const localVarPath = this.basePath + '/apis/apps/v1/namespaces/{namespace}/replicasets/{name}' .replace('{' + 'name' + '}', encodeURIComponent(String(name))) .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling deleteNamespacedReplicaSet.'); } // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling deleteNamespacedReplicaSet.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, "string"); } if (gracePeriodSeconds !== undefined) { localVarQueryParameters['gracePeriodSeconds'] = ObjectSerializer.serialize(gracePeriodSeconds, "number"); } if (orphanDependents !== undefined) { localVarQueryParameters['orphanDependents'] = ObjectSerializer.serialize(orphanDependents, "boolean"); } if (propagationPolicy !== undefined) { localVarQueryParameters['propagationPolicy'] = ObjectSerializer.serialize(propagationPolicy, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'DELETE', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: ObjectSerializer.serialize(body, "V1DeleteOptions") }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "V1Status"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * delete a StatefulSet * @param name name of the StatefulSet * @param namespace object name and auth scope, such as for teams and projects * @param pretty If 'true', then the output is pretty printed. * @param body * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @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. * @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. * @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. * @param {*} [options] Override http request options. */ deleteNamespacedStatefulSet(name, namespace, pretty, body, dryRun, gracePeriodSeconds, orphanDependents, propagationPolicy, options = {}) { const localVarPath = this.basePath + '/apis/apps/v1/namespaces/{namespace}/statefulsets/{name}' .replace('{' + 'name' + '}', encodeURIComponent(String(name))) .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling deleteNamespacedStatefulSet.'); } // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling deleteNamespacedStatefulSet.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, "string"); } if (gracePeriodSeconds !== undefined) { localVarQueryParameters['gracePeriodSeconds'] = ObjectSerializer.serialize(gracePeriodSeconds, "number"); } if (orphanDependents !== undefined) { localVarQueryParameters['orphanDependents'] = ObjectSerializer.serialize(orphanDependents, "boolean"); } if (propagationPolicy !== undefined) { localVarQueryParameters['propagationPolicy'] = ObjectSerializer.serialize(propagationPolicy, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'DELETE', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: ObjectSerializer.serialize(body, "V1DeleteOptions") }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "V1Status"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * get available resources * @param {*} [options] Override http request options. */ getAPIResources(options = {}) { const localVarPath = this.basePath + '/apis/apps/v1/'; let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'GET', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "V1APIResourceList"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * list or watch objects of kind ControllerRevision * @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. * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything. * @param includeUninitialized If true, partially initialized resources are included in the response. * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything. * @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. * @param pretty If 'true', then the output is pretty printed. * @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. * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. * @param watch Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion. * @param {*} [options] Override http request options. */ listControllerRevisionForAllNamespaces(_continue, fieldSelector, includeUninitialized, labelSelector, limit, pretty, resourceVersion, timeoutSeconds, watch, options = {}) { const localVarPath = this.basePath + '/apis/apps/v1/controllerrevisions'; let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; if (_continue !== undefined) { localVarQueryParameters['continue'] = ObjectSerializer.serialize(_continue, "string"); } if (fieldSelector !== undefined) { localVarQueryParameters['fieldSelector'] = ObjectSerializer.serialize(fieldSelector, "string"); } if (includeUninitialized !== undefined) { localVarQueryParameters['includeUninitialized'] = ObjectSerializer.serialize(includeUninitialized, "boolean"); } if (labelSelector !== undefined) { localVarQueryParameters['labelSelector'] = ObjectSerializer.serialize(labelSelector, "string"); } if (limit !== undefined) { localVarQueryParameters['limit'] = ObjectSerializer.serialize(limit, "number"); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, "string"); } if (resourceVersion !== undefined) { localVarQueryParameters['resourceVersion'] = ObjectSerializer.serialize(resourceVersion, "string"); } if (timeoutSeconds !== undefined) { localVarQueryParameters['timeoutSeconds'] = ObjectSerializer.serialize(timeoutSeconds, "number"); } if (watch !== undefined) { localVarQueryParameters['watch'] = ObjectSerializer.serialize(watch, "boolean"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'GET', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "V1ControllerRevisionList"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * list or watch objects of kind DaemonSet * @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. * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything. * @param includeUninitialized If true, partially initialized resources are included in the response. * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything. * @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. * @param pretty If 'true', then the output is pretty printed. * @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. * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. * @param watch Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion. * @param {*} [options] Override http request options. */ listDaemonSetForAllNamespaces(_continue, fieldSelector, includeUninitialized, labelSelector, limit, pretty, resourceVersion, timeoutSeconds, watch, options = {}) { const localVarPath = this.basePath + '/apis/apps/v1/daemonsets'; let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; if (_continue !== undefined) { localVarQueryParameters['continue'] = ObjectSerializer.serialize(_continue, "string"); } if (fieldSelector !== undefined) { localVarQueryParameters['fieldSelector'] = ObjectSerializer.serialize(fieldSelector, "string"); } if (includeUninitialized !== undefined) { localVarQueryParameters['includeUninitialized'] = ObjectSerializer.serialize(includeUninitialized, "boolean"); } if (labelSelector !== undefined) { localVarQueryParameters['labelSelector'] = ObjectSerializer.serialize(labelSelector, "string"); } if (limit !== undefined) { localVarQueryParameters['limit'] = ObjectSerializer.serialize(limit, "number"); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, "string"); } if (resourceVersion !== undefined) { localVarQueryParameters['resourceVersion'] = ObjectSerializer.serialize(resourceVersion, "string"); } if (timeoutSeconds !== undefined) { localVarQueryParameters['timeoutSeconds'] = ObjectSerializer.serialize(timeoutSeconds, "number"); } if (watch !== undefined) { localVarQueryParameters['watch'] = ObjectSerializer.serialize(watch, "boolean"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'GET', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "V1DaemonSetList"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * list or watch objects of kind Deployment * @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. * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything. * @param includeUninitialized If true, partially initialized resources are included in the response. * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything. * @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. * @param pretty If 'true', then the output is pretty printed. * @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. * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. * @param watch Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion. * @param {*} [options] Override http request options. */ listDeploymentForAllNamespaces(_continue, fieldSelector, includeUninitialized, labelSelector, limit, pretty, resourceVersion, timeoutSeconds, watch, options = {}) { const localVarPath = this.basePath + '/apis/apps/v1/deployments'; let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; if (_continue !== undefined) { localVarQueryParameters['continue'] = ObjectSerializer.serialize(_continue, "string"); } if (fieldSelector !== undefined) { localVarQueryParameters['fieldSelector'] = ObjectSerializer.serialize(fieldSelector, "string"); } if (includeUninitialized !== undefined) { localVarQueryParameters['includeUninitialized'] = ObjectSerializer.serialize(includeUninitialized, "boolean"); } if (labelSelector !== undefined) { localVarQueryParameters['labelSelector'] = ObjectSerializer.serialize(labelSelector, "string"); } if (limit !== undefined) { localVarQueryParameters['limit'] = ObjectSerializer.serialize(limit, "number"); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, "string"); } if (resourceVersion !== undefined) { localVarQueryParameters['resourceVersion'] = ObjectSerializer.serialize(resourceVersion, "string"); } if (timeoutSeconds !== undefined) { localVarQueryParameters['timeoutSeconds'] = ObjectSerializer.serialize(timeoutSeconds, "number"); } if (watch !== undefined) { localVarQueryParameters['watch'] = ObjectSerializer.serialize(watch, "boolean"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'GET', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "V1DeploymentList"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * list or watch objects of kind ControllerRevision * @param namespace object name and auth scope, such as for teams and projects * @param includeUninitialized If true, partially initialized resources are included in the response. * @param pretty If 'true', then the output is pretty printed. * @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. * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything. * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything. * @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. * @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. * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. * @param watch Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion. * @param {*} [options] Override http request options. */ listNamespacedControllerRevision(namespace, includeUninitialized, pretty, _continue, fieldSelector, labelSelector, limit, resourceVersion, timeoutSeconds, watch, options = {}) { const localVarPath = this.basePath + '/apis/apps/v1/namespaces/{namespace}/controllerrevisions' .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling listNamespacedControllerRevision.'); } if (includeUninitialized !== undefined) { localVarQueryParameters['includeUninitialized'] = ObjectSerializer.serialize(includeUninitialized, "boolean"); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, "string"); } if (_continue !== undefined) { localVarQueryParameters['continue'] = ObjectSerializer.serialize(_continue, "string"); } if (fieldSelector !== undefined) { localVarQueryParameters['fieldSelector'] = ObjectSerializer.serialize(fieldSelector, "string"); } if (labelSelector !== undefined) { localVarQueryParameters['labelSelector'] = ObjectSerializer.serialize(labelSelector, "string"); } if (limit !== undefined) { localVarQueryParameters['limit'] = ObjectSerializer.serialize(limit, "number"); } if (resourceVersion !== undefined) { localVarQueryParameters['resourceVersion'] = ObjectSerializer.serialize(resourceVersion, "string"); } if (timeoutSeconds !== undefined) { localVarQueryParameters['timeoutSeconds'] = ObjectSerializer.serialize(timeoutSeconds, "number"); } if (watch !== undefined) { localVarQueryParameters['watch'] = ObjectSerializer.serialize(watch, "boolean"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'GET', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "V1ControllerRevisionList"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * list or watch objects of kind DaemonSet * @param namespace object name and auth scope, such as for teams and projects * @param includeUninitialized If true, partially initialized resources are included in the response. * @param pretty If 'true', then the output is pretty printed. * @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. * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything. * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything. * @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. * @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. * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. * @param watch Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion. * @param {*} [options] Override http request options. */ listNamespacedDaemonSet(namespace, includeUninitialized, pretty, _continue, fieldSelector, labelSelector, limit, resourceVersion, timeoutSeconds, watch, options = {}) { const localVarPath = this.basePath + '/apis/apps/v1/namespaces/{namespace}/daemonsets' .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling listNamespacedDaemonSet.'); } if (includeUninitialized !== undefined) { localVarQueryParameters['includeUninitialized'] = ObjectSerializer.serialize(includeUninitialized, "boolean"); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, "string"); } if (_continue !== undefined) { localVarQueryParameters['continue'] = ObjectSerializer.serialize(_continue, "string"); } if (fieldSelector !== undefined) { localVarQueryParameters['fieldSelector'] = ObjectSerializer.serialize(fieldSelector, "string"); } if (labelSelector !== undefined) { localVarQueryParameters['labelSelector'] = ObjectSerializer.serialize(labelSelector, "string"); } if (limit !== undefined) { localVarQueryParameters['limit'] = ObjectSerializer.serialize(limit, "number"); } if (resourceVersion !== undefined) { localVarQueryParameters['resourceVersion'] = ObjectSerializer.serialize(resourceVersion, "string"); } if (timeoutSeconds !== undefined) { localVarQueryParameters['timeoutSeconds'] = ObjectSerializer.serialize(timeoutSeconds, "number"); } if (watch !== undefined) { localVarQueryParameters['watch'] = ObjectSerializer.serialize(watch, "boolean"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'GET', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "V1DaemonSetList"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * list or watch objects of kind Deployment * @param namespace object name and auth scope, such as for teams and projects * @param includeUninitialized If true, partially initialized resources are included in the response. * @param pretty If 'true', then the output is pretty printed. * @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. * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything. * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything. * @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. * @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. * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. * @param watch Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion. * @param {*} [options] Override http request options. */ listNamespacedDeployment(namespace, includeUninitialized, pretty, _continue, fieldSelector, labelSelector, limit, resourceVersion, timeoutSeconds, watch, options = {}) { const localVarPath = this.basePath + '/apis/apps/v1/namespaces/{namespace}/deployments' .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling listNamespacedDeployment.'); } if (includeUninitialized !== undefined) { localVarQueryParameters['includeUninitialized'] = ObjectSerializer.serialize(includeUninitialized, "boolean"); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, "string"); } if (_continue !== undefined) { localVarQueryParameters['continue'] = ObjectSerializer.serialize(_continue, "string"); } if (fieldSelector !== undefined) { localVarQueryParameters['fieldSelector'] = ObjectSerializer.serialize(fieldSelector, "string"); } if (labelSelector !== undefined) { localVarQueryParameters['labelSelector'] = ObjectSerializer.serialize(labelSelector, "string"); } if (limit !== undefined) { localVarQueryParameters['limit'] = ObjectSerializer.serialize(limit, "number"); } if (resourceVersion !== undefined) { localVarQueryParameters['resourceVersion'] = ObjectSerializer.serialize(resourceVersion, "string"); } if (timeoutSeconds !== undefined) { localVarQueryParameters['timeoutSeconds'] = ObjectSerializer.serialize(timeoutSeconds, "number"); } if (watch !== undefined) { localVarQueryParameters['watch'] = ObjectSerializer.serialize(watch, "boolean"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'GET', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "V1DeploymentList"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * list or watch objects of kind ReplicaSet * @param namespace object name and auth scope, such as for teams and projects * @param includeUninitialized If true, partially initialized resources are included in the response. * @param pretty If 'true', then the output is pretty printed. * @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. * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything. * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything. * @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. * @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. * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. * @param watch Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion. * @param {*} [options] Override http request options. */ listNamespacedReplicaSet(namespace, includeUninitialized, pretty, _continue, fieldSelector, labelSelector, limit, resourceVersion, timeoutSeconds, watch, options = {}) { const localVarPath = this.basePath + '/apis/apps/v1/namespaces/{namespace}/replicasets' .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling listNamespacedReplicaSet.'); } if (includeUninitialized !== undefined) { localVarQueryParameters['includeUninitialized'] = ObjectSerializer.serialize(includeUninitialized, "boolean"); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, "string"); } if (_continue !== undefined) { localVarQueryParameters['continue'] = ObjectSerializer.serialize(_continue, "string"); } if (fieldSelector !== undefined) { localVarQueryParameters['fieldSelector'] = ObjectSerializer.serialize(fieldSelector, "string"); } if (labelSelector !== undefined) { localVarQueryParameters['labelSelector'] = ObjectSerializer.serialize(labelSelector, "string"); } if (limit !== undefined) { localVarQueryParameters['limit'] = ObjectSerializer.serialize(limit, "number"); } if (resourceVersion !== undefined) { localVarQueryParameters['resourceVersion'] = ObjectSerializer.serialize(resourceVersion, "string"); } if (timeoutSeconds !== undefined) { localVarQueryParameters['timeoutSeconds'] = ObjectSerializer.serialize(timeoutSeconds, "number"); } if (watch !== undefined) { localVarQueryParameters['watch'] = ObjectSerializer.serialize(watch, "boolean"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'GET', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "V1ReplicaSetList"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * list or watch objects of kind StatefulSet * @param namespace object name and auth scope, such as for teams and projects * @param includeUninitialized If true, partially initialized resources are included in the response. * @param pretty If 'true', then the output is pretty printed. * @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. * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything. * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything. * @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. * @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. * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. * @param watch Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion. * @param {*} [options] Override http request options. */ listNamespacedStatefulSet(namespace, includeUninitialized, pretty, _continue, fieldSelector, labelSelector, limit, resourceVersion, timeoutSeconds, watch, options = {}) { const localVarPath = this.basePath + '/apis/apps/v1/namespaces/{namespace}/statefulsets' .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling listNamespacedStatefulSet.'); } if (includeUninitialized !== undefined) { localVarQueryParameters['includeUninitialized'] = ObjectSerializer.serialize(includeUninitialized, "boolean"); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, "string"); } if (_continue !== undefined) { localVarQueryParameters['continue'] = ObjectSerializer.serialize(_continue, "string"); } if (fieldSelector !== undefined) { localVarQueryParameters['fieldSelector'] = ObjectSerializer.serialize(fieldSelector, "string"); } if (labelSelector !== undefined) { localVarQueryParameters['labelSelector'] = ObjectSerializer.serialize(labelSelector, "string"); } if (limit !== undefined) { localVarQueryParameters['limit'] = ObjectSerializer.serialize(limit, "number"); } if (resourceVersion !== undefined) { localVarQueryParameters['resourceVersion'] = ObjectSerializer.serialize(resourceVersion, "string"); } if (timeoutSeconds !== undefined) { localVarQueryParameters['timeoutSeconds'] = ObjectSerializer.serialize(timeoutSeconds, "number"); } if (watch !== undefined) { localVarQueryParameters['watch'] = ObjectSerializer.serialize(watch, "boolean"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'GET', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "V1StatefulSetList"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * list or watch objects of kind ReplicaSet * @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. * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything. * @param includeUninitialized If true, partially initialized resources are included in the response. * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything. * @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. * @param pretty If 'true', then the output is pretty printed. * @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. * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. * @param watch Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion. * @param {*} [options] Override http request options. */ listReplicaSetForAllNamespaces(_continue, fieldSelector, includeUninitialized, labelSelector, limit, pretty, resourceVersion, timeoutSeconds, watch, options = {}) { const localVarPath = this.basePath + '/apis/apps/v1/replicasets'; let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; if (_continue !== undefined) { localVarQueryParameters['continue'] = ObjectSerializer.serialize(_continue, "string"); } if (fieldSelector !== undefined) { localVarQueryParameters['fieldSelector'] = ObjectSerializer.serialize(fieldSelector, "string"); } if (includeUninitialized !== undefined) { localVarQueryParameters['includeUninitialized'] = ObjectSerializer.serialize(includeUninitialized, "boolean"); } if (labelSelector !== undefined) { localVarQueryParameters['labelSelector'] = ObjectSerializer.serialize(labelSelector, "string"); } if (limit !== undefined) { localVarQueryParameters['limit'] = ObjectSerializer.serialize(limit, "number"); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, "string"); } if (resourceVersion !== undefined) { localVarQueryParameters['resourceVersion'] = ObjectSerializer.serialize(resourceVersion, "string"); } if (timeoutSeconds !== undefined) { localVarQueryParameters['timeoutSeconds'] = ObjectSerializer.serialize(timeoutSeconds, "number"); } if (watch !== undefined) { localVarQueryParameters['watch'] = ObjectSerializer.serialize(watch, "boolean"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'GET', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "V1ReplicaSetList"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * list or watch objects of kind StatefulSet * @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. * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything. * @param includeUninitialized If true, partially initialized resources are included in the response. * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything. * @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. * @param pretty If 'true', then the output is pretty printed. * @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. * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. * @param watch Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion. * @param {*} [options] Override http request options. */ listStatefulSetForAllNamespaces(_continue, fieldSelector, includeUninitialized, labelSelector, limit, pretty, resourceVersion, timeoutSeconds, watch, options = {}) { const localVarPath = this.basePath + '/apis/apps/v1/statefulsets'; let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; if (_continue !== undefined) { localVarQueryParameters['continue'] = ObjectSerializer.serialize(_continue, "string"); } if (fieldSelector !== undefined) { localVarQueryParameters['fieldSelector'] = ObjectSerializer.serialize(fieldSelector, "string"); } if (includeUninitialized !== undefined) { localVarQueryParameters['includeUninitialized'] = ObjectSerializer.serialize(includeUninitialized, "boolean"); } if (labelSelector !== undefined) { localVarQueryParameters['labelSelector'] = ObjectSerializer.serialize(labelSelector, "string"); } if (limit !== undefined) { localVarQueryParameters['limit'] = ObjectSerializer.serialize(limit, "number"); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, "string"); } if (resourceVersion !== undefined) { localVarQueryParameters['resourceVersion'] = ObjectSerializer.serialize(resourceVersion, "string"); } if (timeoutSeconds !== undefined) { localVarQueryParameters['timeoutSeconds'] = ObjectSerializer.serialize(timeoutSeconds, "number"); } if (watch !== undefined) { localVarQueryParameters['watch'] = ObjectSerializer.serialize(watch, "boolean"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'GET', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "V1StatefulSetList"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * partially update the specified ControllerRevision * @param name name of the ControllerRevision * @param namespace object name and auth scope, such as for teams and projects * @param body * @param pretty If 'true', then the output is pretty printed. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param {*} [options] Override http request options. */ patchNamespacedControllerRevision(name, namespace, body, pretty, dryRun, options = {}) { const localVarPath = this.basePath + '/apis/apps/v1/namespaces/{namespace}/controllerrevisions/{name}' .replace('{' + 'name' + '}', encodeURIComponent(String(name))) .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling patchNamespacedControllerRevision.'); } // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling patchNamespacedControllerRevision.'); } // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling patchNamespacedControllerRevision.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'PATCH', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: ObjectSerializer.serialize(body, "any") }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "V1ControllerRevision"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * partially update the specified DaemonSet * @param name name of the DaemonSet * @param namespace object name and auth scope, such as for teams and projects * @param body * @param pretty If 'true', then the output is pretty printed. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param {*} [options] Override http request options. */ patchNamespacedDaemonSet(name, namespace, body, pretty, dryRun, options = {}) { const localVarPath = this.basePath + '/apis/apps/v1/namespaces/{namespace}/daemonsets/{name}' .replace('{' + 'name' + '}', encodeURIComponent(String(name))) .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling patchNamespacedDaemonSet.'); } // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling patchNamespacedDaemonSet.'); } // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling patchNamespacedDaemonSet.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'PATCH', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: ObjectSerializer.serialize(body, "any") }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "V1DaemonSet"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * partially update status of the specified DaemonSet * @param name name of the DaemonSet * @param namespace object name and auth scope, such as for teams and projects * @param body * @param pretty If 'true', then the output is pretty printed. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param {*} [options] Override http request options. */ patchNamespacedDaemonSetStatus(name, namespace, body, pretty, dryRun, options = {}) { const localVarPath = this.basePath + '/apis/apps/v1/namespaces/{namespace}/daemonsets/{name}/status' .replace('{' + 'name' + '}', encodeURIComponent(String(name))) .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling patchNamespacedDaemonSetStatus.'); } // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling patchNamespacedDaemonSetStatus.'); } // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling patchNamespacedDaemonSetStatus.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'PATCH', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: ObjectSerializer.serialize(body, "any") }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "V1DaemonSet"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * partially update the specified Deployment * @param name name of the Deployment * @param namespace object name and auth scope, such as for teams and projects * @param body * @param pretty If 'true', then the output is pretty printed. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param {*} [options] Override http request options. */ patchNamespacedDeployment(name, namespace, body, pretty, dryRun, options = {}) { const localVarPath = this.basePath + '/apis/apps/v1/namespaces/{namespace}/deployments/{name}' .replace('{' + 'name' + '}', encodeURIComponent(String(name))) .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling patchNamespacedDeployment.'); } // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling patchNamespacedDeployment.'); } // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling patchNamespacedDeployment.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'PATCH', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: ObjectSerializer.serialize(body, "any") }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "V1Deployment"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * partially update scale of the specified Deployment * @param name name of the Scale * @param namespace object name and auth scope, such as for teams and projects * @param body * @param pretty If 'true', then the output is pretty printed. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param {*} [options] Override http request options. */ patchNamespacedDeploymentScale(name, namespace, body, pretty, dryRun, options = {}) { const localVarPath = this.basePath + '/apis/apps/v1/namespaces/{namespace}/deployments/{name}/scale' .replace('{' + 'name' + '}', encodeURIComponent(String(name))) .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling patchNamespacedDeploymentScale.'); } // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling patchNamespacedDeploymentScale.'); } // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling patchNamespacedDeploymentScale.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'PATCH', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: ObjectSerializer.serialize(body, "any") }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "V1Scale"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * partially update status of the specified Deployment * @param name name of the Deployment * @param namespace object name and auth scope, such as for teams and projects * @param body * @param pretty If 'true', then the output is pretty printed. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param {*} [options] Override http request options. */ patchNamespacedDeploymentStatus(name, namespace, body, pretty, dryRun, options = {}) { const localVarPath = this.basePath + '/apis/apps/v1/namespaces/{namespace}/deployments/{name}/status' .replace('{' + 'name' + '}', encodeURIComponent(String(name))) .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling patchNamespacedDeploymentStatus.'); } // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling patchNamespacedDeploymentStatus.'); } // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling patchNamespacedDeploymentStatus.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'PATCH', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: ObjectSerializer.serialize(body, "any") }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "V1Deployment"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * partially update the specified ReplicaSet * @param name name of the ReplicaSet * @param namespace object name and auth scope, such as for teams and projects * @param body * @param pretty If 'true', then the output is pretty printed. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param {*} [options] Override http request options. */ patchNamespacedReplicaSet(name, namespace, body, pretty, dryRun, options = {}) { const localVarPath = this.basePath + '/apis/apps/v1/namespaces/{namespace}/replicasets/{name}' .replace('{' + 'name' + '}', encodeURIComponent(String(name))) .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling patchNamespacedReplicaSet.'); } // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling patchNamespacedReplicaSet.'); } // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling patchNamespacedReplicaSet.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'PATCH', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: ObjectSerializer.serialize(body, "any") }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "V1ReplicaSet"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * partially update scale of the specified ReplicaSet * @param name name of the Scale * @param namespace object name and auth scope, such as for teams and projects * @param body * @param pretty If 'true', then the output is pretty printed. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param {*} [options] Override http request options. */ patchNamespacedReplicaSetScale(name, namespace, body, pretty, dryRun, options = {}) { const localVarPath = this.basePath + '/apis/apps/v1/namespaces/{namespace}/replicasets/{name}/scale' .replace('{' + 'name' + '}', encodeURIComponent(String(name))) .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling patchNamespacedReplicaSetScale.'); } // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling patchNamespacedReplicaSetScale.'); } // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling patchNamespacedReplicaSetScale.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'PATCH', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: ObjectSerializer.serialize(body, "any") }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "V1Scale"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * partially update status of the specified ReplicaSet * @param name name of the ReplicaSet * @param namespace object name and auth scope, such as for teams and projects * @param body * @param pretty If 'true', then the output is pretty printed. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param {*} [options] Override http request options. */ patchNamespacedReplicaSetStatus(name, namespace, body, pretty, dryRun, options = {}) { const localVarPath = this.basePath + '/apis/apps/v1/namespaces/{namespace}/replicasets/{name}/status' .replace('{' + 'name' + '}', encodeURIComponent(String(name))) .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling patchNamespacedReplicaSetStatus.'); } // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling patchNamespacedReplicaSetStatus.'); } // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling patchNamespacedReplicaSetStatus.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'PATCH', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: ObjectSerializer.serialize(body, "any") }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "V1ReplicaSet"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * partially update the specified StatefulSet * @param name name of the StatefulSet * @param namespace object name and auth scope, such as for teams and projects * @param body * @param pretty If 'true', then the output is pretty printed. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param {*} [options] Override http request options. */ patchNamespacedStatefulSet(name, namespace, body, pretty, dryRun, options = {}) { const localVarPath = this.basePath + '/apis/apps/v1/namespaces/{namespace}/statefulsets/{name}' .replace('{' + 'name' + '}', encodeURIComponent(String(name))) .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling patchNamespacedStatefulSet.'); } // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling patchNamespacedStatefulSet.'); } // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling patchNamespacedStatefulSet.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'PATCH', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: ObjectSerializer.serialize(body, "any") }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "V1StatefulSet"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * partially update scale of the specified StatefulSet * @param name name of the Scale * @param namespace object name and auth scope, such as for teams and projects * @param body * @param pretty If 'true', then the output is pretty printed. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param {*} [options] Override http request options. */ patchNamespacedStatefulSetScale(name, namespace, body, pretty, dryRun, options = {}) { const localVarPath = this.basePath + '/apis/apps/v1/namespaces/{namespace}/statefulsets/{name}/scale' .replace('{' + 'name' + '}', encodeURIComponent(String(name))) .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling patchNamespacedStatefulSetScale.'); } // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling patchNamespacedStatefulSetScale.'); } // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling patchNamespacedStatefulSetScale.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'PATCH', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: ObjectSerializer.serialize(body, "any") }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "V1Scale"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * partially update status of the specified StatefulSet * @param name name of the StatefulSet * @param namespace object name and auth scope, such as for teams and projects * @param body * @param pretty If 'true', then the output is pretty printed. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param {*} [options] Override http request options. */ patchNamespacedStatefulSetStatus(name, namespace, body, pretty, dryRun, options = {}) { const localVarPath = this.basePath + '/apis/apps/v1/namespaces/{namespace}/statefulsets/{name}/status' .replace('{' + 'name' + '}', encodeURIComponent(String(name))) .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling patchNamespacedStatefulSetStatus.'); } // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling patchNamespacedStatefulSetStatus.'); } // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling patchNamespacedStatefulSetStatus.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'PATCH', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: ObjectSerializer.serialize(body, "any") }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "V1StatefulSet"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * read the specified ControllerRevision * @param name name of the ControllerRevision * @param namespace object name and auth scope, such as for teams and projects * @param pretty If 'true', then the output is pretty printed. * @param exact Should the export be exact. Exact export maintains cluster-specific fields like 'Namespace'. * @param _export Should this value be exported. Export strips fields that a user can not specify. * @param {*} [options] Override http request options. */ readNamespacedControllerRevision(name, namespace, pretty, exact, _export, options = {}) { const localVarPath = this.basePath + '/apis/apps/v1/namespaces/{namespace}/controllerrevisions/{name}' .replace('{' + 'name' + '}', encodeURIComponent(String(name))) .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling readNamespacedControllerRevision.'); } // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling readNamespacedControllerRevision.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, "string"); } if (exact !== undefined) { localVarQueryParameters['exact'] = ObjectSerializer.serialize(exact, "boolean"); } if (_export !== undefined) { localVarQueryParameters['export'] = ObjectSerializer.serialize(_export, "boolean"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'GET', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "V1ControllerRevision"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * read the specified DaemonSet * @param name name of the DaemonSet * @param namespace object name and auth scope, such as for teams and projects * @param pretty If 'true', then the output is pretty printed. * @param exact Should the export be exact. Exact export maintains cluster-specific fields like 'Namespace'. * @param _export Should this value be exported. Export strips fields that a user can not specify. * @param {*} [options] Override http request options. */ readNamespacedDaemonSet(name, namespace, pretty, exact, _export, options = {}) { const localVarPath = this.basePath + '/apis/apps/v1/namespaces/{namespace}/daemonsets/{name}' .replace('{' + 'name' + '}', encodeURIComponent(String(name))) .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling readNamespacedDaemonSet.'); } // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling readNamespacedDaemonSet.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, "string"); } if (exact !== undefined) { localVarQueryParameters['exact'] = ObjectSerializer.serialize(exact, "boolean"); } if (_export !== undefined) { localVarQueryParameters['export'] = ObjectSerializer.serialize(_export, "boolean"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'GET', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "V1DaemonSet"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * read status of the specified DaemonSet * @param name name of the DaemonSet * @param namespace object name and auth scope, such as for teams and projects * @param pretty If 'true', then the output is pretty printed. * @param {*} [options] Override http request options. */ readNamespacedDaemonSetStatus(name, namespace, pretty, options = {}) { const localVarPath = this.basePath + '/apis/apps/v1/namespaces/{namespace}/daemonsets/{name}/status' .replace('{' + 'name' + '}', encodeURIComponent(String(name))) .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling readNamespacedDaemonSetStatus.'); } // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling readNamespacedDaemonSetStatus.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'GET', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "V1DaemonSet"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * read the specified Deployment * @param name name of the Deployment * @param namespace object name and auth scope, such as for teams and projects * @param pretty If 'true', then the output is pretty printed. * @param exact Should the export be exact. Exact export maintains cluster-specific fields like 'Namespace'. * @param _export Should this value be exported. Export strips fields that a user can not specify. * @param {*} [options] Override http request options. */ readNamespacedDeployment(name, namespace, pretty, exact, _export, options = {}) { const localVarPath = this.basePath + '/apis/apps/v1/namespaces/{namespace}/deployments/{name}' .replace('{' + 'name' + '}', encodeURIComponent(String(name))) .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling readNamespacedDeployment.'); } // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling readNamespacedDeployment.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, "string"); } if (exact !== undefined) { localVarQueryParameters['exact'] = ObjectSerializer.serialize(exact, "boolean"); } if (_export !== undefined) { localVarQueryParameters['export'] = ObjectSerializer.serialize(_export, "boolean"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'GET', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "V1Deployment"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * read scale of the specified Deployment * @param name name of the Scale * @param namespace object name and auth scope, such as for teams and projects * @param pretty If 'true', then the output is pretty printed. * @param {*} [options] Override http request options. */ readNamespacedDeploymentScale(name, namespace, pretty, options = {}) { const localVarPath = this.basePath + '/apis/apps/v1/namespaces/{namespace}/deployments/{name}/scale' .replace('{' + 'name' + '}', encodeURIComponent(String(name))) .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling readNamespacedDeploymentScale.'); } // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling readNamespacedDeploymentScale.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'GET', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "V1Scale"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * read status of the specified Deployment * @param name name of the Deployment * @param namespace object name and auth scope, such as for teams and projects * @param pretty If 'true', then the output is pretty printed. * @param {*} [options] Override http request options. */ readNamespacedDeploymentStatus(name, namespace, pretty, options = {}) { const localVarPath = this.basePath + '/apis/apps/v1/namespaces/{namespace}/deployments/{name}/status' .replace('{' + 'name' + '}', encodeURIComponent(String(name))) .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling readNamespacedDeploymentStatus.'); } // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling readNamespacedDeploymentStatus.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'GET', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "V1Deployment"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * read the specified ReplicaSet * @param name name of the ReplicaSet * @param namespace object name and auth scope, such as for teams and projects * @param pretty If 'true', then the output is pretty printed. * @param exact Should the export be exact. Exact export maintains cluster-specific fields like 'Namespace'. * @param _export Should this value be exported. Export strips fields that a user can not specify. * @param {*} [options] Override http request options. */ readNamespacedReplicaSet(name, namespace, pretty, exact, _export, options = {}) { const localVarPath = this.basePath + '/apis/apps/v1/namespaces/{namespace}/replicasets/{name}' .replace('{' + 'name' + '}', encodeURIComponent(String(name))) .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling readNamespacedReplicaSet.'); } // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling readNamespacedReplicaSet.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, "string"); } if (exact !== undefined) { localVarQueryParameters['exact'] = ObjectSerializer.serialize(exact, "boolean"); } if (_export !== undefined) { localVarQueryParameters['export'] = ObjectSerializer.serialize(_export, "boolean"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'GET', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "V1ReplicaSet"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * read scale of the specified ReplicaSet * @param name name of the Scale * @param namespace object name and auth scope, such as for teams and projects * @param pretty If 'true', then the output is pretty printed. * @param {*} [options] Override http request options. */ readNamespacedReplicaSetScale(name, namespace, pretty, options = {}) { const localVarPath = this.basePath + '/apis/apps/v1/namespaces/{namespace}/replicasets/{name}/scale' .replace('{' + 'name' + '}', encodeURIComponent(String(name))) .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling readNamespacedReplicaSetScale.'); } // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling readNamespacedReplicaSetScale.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'GET', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "V1Scale"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * read status of the specified ReplicaSet * @param name name of the ReplicaSet * @param namespace object name and auth scope, such as for teams and projects * @param pretty If 'true', then the output is pretty printed. * @param {*} [options] Override http request options. */ readNamespacedReplicaSetStatus(name, namespace, pretty, options = {}) { const localVarPath = this.basePath + '/apis/apps/v1/namespaces/{namespace}/replicasets/{name}/status' .replace('{' + 'name' + '}', encodeURIComponent(String(name))) .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling readNamespacedReplicaSetStatus.'); } // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling readNamespacedReplicaSetStatus.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'GET', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "V1ReplicaSet"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * read the specified StatefulSet * @param name name of the StatefulSet * @param namespace object name and auth scope, such as for teams and projects * @param pretty If 'true', then the output is pretty printed. * @param exact Should the export be exact. Exact export maintains cluster-specific fields like 'Namespace'. * @param _export Should this value be exported. Export strips fields that a user can not specify. * @param {*} [options] Override http request options. */ readNamespacedStatefulSet(name, namespace, pretty, exact, _export, options = {}) { const localVarPath = this.basePath + '/apis/apps/v1/namespaces/{namespace}/statefulsets/{name}' .replace('{' + 'name' + '}', encodeURIComponent(String(name))) .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling readNamespacedStatefulSet.'); } // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling readNamespacedStatefulSet.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, "string"); } if (exact !== undefined) { localVarQueryParameters['exact'] = ObjectSerializer.serialize(exact, "boolean"); } if (_export !== undefined) { localVarQueryParameters['export'] = ObjectSerializer.serialize(_export, "boolean"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'GET', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "V1StatefulSet"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * read scale of the specified StatefulSet * @param name name of the Scale * @param namespace object name and auth scope, such as for teams and projects * @param pretty If 'true', then the output is pretty printed. * @param {*} [options] Override http request options. */ readNamespacedStatefulSetScale(name, namespace, pretty, options = {}) { const localVarPath = this.basePath + '/apis/apps/v1/namespaces/{namespace}/statefulsets/{name}/scale' .replace('{' + 'name' + '}', encodeURIComponent(String(name))) .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling readNamespacedStatefulSetScale.'); } // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling readNamespacedStatefulSetScale.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'GET', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "V1Scale"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * read status of the specified StatefulSet * @param name name of the StatefulSet * @param namespace object name and auth scope, such as for teams and projects * @param pretty If 'true', then the output is pretty printed. * @param {*} [options] Override http request options. */ readNamespacedStatefulSetStatus(name, namespace, pretty, options = {}) { const localVarPath = this.basePath + '/apis/apps/v1/namespaces/{namespace}/statefulsets/{name}/status' .replace('{' + 'name' + '}', encodeURIComponent(String(name))) .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling readNamespacedStatefulSetStatus.'); } // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling readNamespacedStatefulSetStatus.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'GET', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "V1StatefulSet"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * replace the specified ControllerRevision * @param name name of the ControllerRevision * @param namespace object name and auth scope, such as for teams and projects * @param body * @param pretty If 'true', then the output is pretty printed. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param {*} [options] Override http request options. */ replaceNamespacedControllerRevision(name, namespace, body, pretty, dryRun, options = {}) { const localVarPath = this.basePath + '/apis/apps/v1/namespaces/{namespace}/controllerrevisions/{name}' .replace('{' + 'name' + '}', encodeURIComponent(String(name))) .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling replaceNamespacedControllerRevision.'); } // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling replaceNamespacedControllerRevision.'); } // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling replaceNamespacedControllerRevision.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'PUT', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: ObjectSerializer.serialize(body, "V1ControllerRevision") }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "V1ControllerRevision"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * replace the specified DaemonSet * @param name name of the DaemonSet * @param namespace object name and auth scope, such as for teams and projects * @param body * @param pretty If 'true', then the output is pretty printed. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param {*} [options] Override http request options. */ replaceNamespacedDaemonSet(name, namespace, body, pretty, dryRun, options = {}) { const localVarPath = this.basePath + '/apis/apps/v1/namespaces/{namespace}/daemonsets/{name}' .replace('{' + 'name' + '}', encodeURIComponent(String(name))) .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling replaceNamespacedDaemonSet.'); } // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling replaceNamespacedDaemonSet.'); } // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling replaceNamespacedDaemonSet.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'PUT', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: ObjectSerializer.serialize(body, "V1DaemonSet") }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "V1DaemonSet"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * replace status of the specified DaemonSet * @param name name of the DaemonSet * @param namespace object name and auth scope, such as for teams and projects * @param body * @param pretty If 'true', then the output is pretty printed. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param {*} [options] Override http request options. */ replaceNamespacedDaemonSetStatus(name, namespace, body, pretty, dryRun, options = {}) { const localVarPath = this.basePath + '/apis/apps/v1/namespaces/{namespace}/daemonsets/{name}/status' .replace('{' + 'name' + '}', encodeURIComponent(String(name))) .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling replaceNamespacedDaemonSetStatus.'); } // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling replaceNamespacedDaemonSetStatus.'); } // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling replaceNamespacedDaemonSetStatus.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'PUT', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: ObjectSerializer.serialize(body, "V1DaemonSet") }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "V1DaemonSet"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * replace the specified Deployment * @param name name of the Deployment * @param namespace object name and auth scope, such as for teams and projects * @param body * @param pretty If 'true', then the output is pretty printed. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param {*} [options] Override http request options. */ replaceNamespacedDeployment(name, namespace, body, pretty, dryRun, options = {}) { const localVarPath = this.basePath + '/apis/apps/v1/namespaces/{namespace}/deployments/{name}' .replace('{' + 'name' + '}', encodeURIComponent(String(name))) .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling replaceNamespacedDeployment.'); } // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling replaceNamespacedDeployment.'); } // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling replaceNamespacedDeployment.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'PUT', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: ObjectSerializer.serialize(body, "V1Deployment") }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "V1Deployment"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * replace scale of the specified Deployment * @param name name of the Scale * @param namespace object name and auth scope, such as for teams and projects * @param body * @param pretty If 'true', then the output is pretty printed. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param {*} [options] Override http request options. */ replaceNamespacedDeploymentScale(name, namespace, body, pretty, dryRun, options = {}) { const localVarPath = this.basePath + '/apis/apps/v1/namespaces/{namespace}/deployments/{name}/scale' .replace('{' + 'name' + '}', encodeURIComponent(String(name))) .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling replaceNamespacedDeploymentScale.'); } // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling replaceNamespacedDeploymentScale.'); } // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling replaceNamespacedDeploymentScale.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'PUT', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: ObjectSerializer.serialize(body, "V1Scale") }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "V1Scale"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * replace status of the specified Deployment * @param name name of the Deployment * @param namespace object name and auth scope, such as for teams and projects * @param body * @param pretty If 'true', then the output is pretty printed. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param {*} [options] Override http request options. */ replaceNamespacedDeploymentStatus(name, namespace, body, pretty, dryRun, options = {}) { const localVarPath = this.basePath + '/apis/apps/v1/namespaces/{namespace}/deployments/{name}/status' .replace('{' + 'name' + '}', encodeURIComponent(String(name))) .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling replaceNamespacedDeploymentStatus.'); } // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling replaceNamespacedDeploymentStatus.'); } // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling replaceNamespacedDeploymentStatus.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'PUT', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: ObjectSerializer.serialize(body, "V1Deployment") }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "V1Deployment"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * replace the specified ReplicaSet * @param name name of the ReplicaSet * @param namespace object name and auth scope, such as for teams and projects * @param body * @param pretty If 'true', then the output is pretty printed. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param {*} [options] Override http request options. */ replaceNamespacedReplicaSet(name, namespace, body, pretty, dryRun, options = {}) { const localVarPath = this.basePath + '/apis/apps/v1/namespaces/{namespace}/replicasets/{name}' .replace('{' + 'name' + '}', encodeURIComponent(String(name))) .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling replaceNamespacedReplicaSet.'); } // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling replaceNamespacedReplicaSet.'); } // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling replaceNamespacedReplicaSet.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'PUT', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: ObjectSerializer.serialize(body, "V1ReplicaSet") }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "V1ReplicaSet"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * replace scale of the specified ReplicaSet * @param name name of the Scale * @param namespace object name and auth scope, such as for teams and projects * @param body * @param pretty If 'true', then the output is pretty printed. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param {*} [options] Override http request options. */ replaceNamespacedReplicaSetScale(name, namespace, body, pretty, dryRun, options = {}) { const localVarPath = this.basePath + '/apis/apps/v1/namespaces/{namespace}/replicasets/{name}/scale' .replace('{' + 'name' + '}', encodeURIComponent(String(name))) .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling replaceNamespacedReplicaSetScale.'); } // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling replaceNamespacedReplicaSetScale.'); } // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling replaceNamespacedReplicaSetScale.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'PUT', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: ObjectSerializer.serialize(body, "V1Scale") }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "V1Scale"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * replace status of the specified ReplicaSet * @param name name of the ReplicaSet * @param namespace object name and auth scope, such as for teams and projects * @param body * @param pretty If 'true', then the output is pretty printed. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param {*} [options] Override http request options. */ replaceNamespacedReplicaSetStatus(name, namespace, body, pretty, dryRun, options = {}) { const localVarPath = this.basePath + '/apis/apps/v1/namespaces/{namespace}/replicasets/{name}/status' .replace('{' + 'name' + '}', encodeURIComponent(String(name))) .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling replaceNamespacedReplicaSetStatus.'); } // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling replaceNamespacedReplicaSetStatus.'); } // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling replaceNamespacedReplicaSetStatus.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'PUT', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: ObjectSerializer.serialize(body, "V1ReplicaSet") }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "V1ReplicaSet"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * replace the specified StatefulSet * @param name name of the StatefulSet * @param namespace object name and auth scope, such as for teams and projects * @param body * @param pretty If 'true', then the output is pretty printed. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param {*} [options] Override http request options. */ replaceNamespacedStatefulSet(name, namespace, body, pretty, dryRun, options = {}) { const localVarPath = this.basePath + '/apis/apps/v1/namespaces/{namespace}/statefulsets/{name}' .replace('{' + 'name' + '}', encodeURIComponent(String(name))) .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling replaceNamespacedStatefulSet.'); } // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling replaceNamespacedStatefulSet.'); } // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling replaceNamespacedStatefulSet.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'PUT', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: ObjectSerializer.serialize(body, "V1StatefulSet") }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "V1StatefulSet"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * replace scale of the specified StatefulSet * @param name name of the Scale * @param namespace object name and auth scope, such as for teams and projects * @param body * @param pretty If 'true', then the output is pretty printed. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param {*} [options] Override http request options. */ replaceNamespacedStatefulSetScale(name, namespace, body, pretty, dryRun, options = {}) { const localVarPath = this.basePath + '/apis/apps/v1/namespaces/{namespace}/statefulsets/{name}/scale' .replace('{' + 'name' + '}', encodeURIComponent(String(name))) .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling replaceNamespacedStatefulSetScale.'); } // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling replaceNamespacedStatefulSetScale.'); } // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling replaceNamespacedStatefulSetScale.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'PUT', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: ObjectSerializer.serialize(body, "V1Scale") }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "V1Scale"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * replace status of the specified StatefulSet * @param name name of the StatefulSet * @param namespace object name and auth scope, such as for teams and projects * @param body * @param pretty If 'true', then the output is pretty printed. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param {*} [options] Override http request options. */ replaceNamespacedStatefulSetStatus(name, namespace, body, pretty, dryRun, options = {}) { const localVarPath = this.basePath + '/apis/apps/v1/namespaces/{namespace}/statefulsets/{name}/status' .replace('{' + 'name' + '}', encodeURIComponent(String(name))) .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling replaceNamespacedStatefulSetStatus.'); } // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling replaceNamespacedStatefulSetStatus.'); } // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling replaceNamespacedStatefulSetStatus.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'PUT', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: ObjectSerializer.serialize(body, "V1StatefulSet") }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "V1StatefulSet"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } } exports.AppsV1Api = AppsV1Api; var AppsV1beta1ApiApiKeys; (function (AppsV1beta1ApiApiKeys) { AppsV1beta1ApiApiKeys[AppsV1beta1ApiApiKeys["BearerToken"] = 0] = "BearerToken"; })(AppsV1beta1ApiApiKeys = exports.AppsV1beta1ApiApiKeys || (exports.AppsV1beta1ApiApiKeys = {})); class AppsV1beta1Api { constructor(basePathOrUsername, password, basePath) { this._basePath = defaultBasePath; this.defaultHeaders = {}; this._useQuerystring = false; this.authentications = { 'default': new VoidAuth(), 'BearerToken': new ApiKeyAuth('header', 'authorization'), }; if (password) { if (basePath) { this.basePath = basePath; } } else { if (basePathOrUsername) { this.basePath = basePathOrUsername; } } } set useQuerystring(value) { this._useQuerystring = value; } set basePath(basePath) { this._basePath = basePath; } get basePath() { return this._basePath; } setDefaultAuthentication(auth) { this.authentications.default = auth; } setApiKey(key, value) { this.authentications[AppsV1beta1ApiApiKeys[key]].apiKey = value; } /** * create a ControllerRevision * @param namespace object name and auth scope, such as for teams and projects * @param body * @param includeUninitialized If true, partially initialized resources are included in the response. * @param pretty If 'true', then the output is pretty printed. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param {*} [options] Override http request options. */ createNamespacedControllerRevision(namespace, body, includeUninitialized, pretty, dryRun, options = {}) { const localVarPath = this.basePath + '/apis/apps/v1beta1/namespaces/{namespace}/controllerrevisions' .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling createNamespacedControllerRevision.'); } // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling createNamespacedControllerRevision.'); } if (includeUninitialized !== undefined) { localVarQueryParameters['includeUninitialized'] = ObjectSerializer.serialize(includeUninitialized, "boolean"); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'POST', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: ObjectSerializer.serialize(body, "V1beta1ControllerRevision") }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "V1beta1ControllerRevision"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * create a Deployment * @param namespace object name and auth scope, such as for teams and projects * @param body * @param includeUninitialized If true, partially initialized resources are included in the response. * @param pretty If 'true', then the output is pretty printed. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param {*} [options] Override http request options. */ createNamespacedDeployment(namespace, body, includeUninitialized, pretty, dryRun, options = {}) { const localVarPath = this.basePath + '/apis/apps/v1beta1/namespaces/{namespace}/deployments' .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling createNamespacedDeployment.'); } // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling createNamespacedDeployment.'); } if (includeUninitialized !== undefined) { localVarQueryParameters['includeUninitialized'] = ObjectSerializer.serialize(includeUninitialized, "boolean"); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'POST', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: ObjectSerializer.serialize(body, "AppsV1beta1Deployment") }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "AppsV1beta1Deployment"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * create rollback of a Deployment * @param name name of the DeploymentRollback * @param namespace object name and auth scope, such as for teams and projects * @param body * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param includeUninitialized If IncludeUninitialized is specified, the object may be returned without completing initialization. * @param pretty If 'true', then the output is pretty printed. * @param {*} [options] Override http request options. */ createNamespacedDeploymentRollback(name, namespace, body, dryRun, includeUninitialized, pretty, options = {}) { const localVarPath = this.basePath + '/apis/apps/v1beta1/namespaces/{namespace}/deployments/{name}/rollback' .replace('{' + 'name' + '}', encodeURIComponent(String(name))) .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling createNamespacedDeploymentRollback.'); } // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling createNamespacedDeploymentRollback.'); } // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling createNamespacedDeploymentRollback.'); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, "string"); } if (includeUninitialized !== undefined) { localVarQueryParameters['includeUninitialized'] = ObjectSerializer.serialize(includeUninitialized, "boolean"); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'POST', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: ObjectSerializer.serialize(body, "AppsV1beta1DeploymentRollback") }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "V1Status"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * create a StatefulSet * @param namespace object name and auth scope, such as for teams and projects * @param body * @param includeUninitialized If true, partially initialized resources are included in the response. * @param pretty If 'true', then the output is pretty printed. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param {*} [options] Override http request options. */ createNamespacedStatefulSet(namespace, body, includeUninitialized, pretty, dryRun, options = {}) { const localVarPath = this.basePath + '/apis/apps/v1beta1/namespaces/{namespace}/statefulsets' .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling createNamespacedStatefulSet.'); } // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling createNamespacedStatefulSet.'); } if (includeUninitialized !== undefined) { localVarQueryParameters['includeUninitialized'] = ObjectSerializer.serialize(includeUninitialized, "boolean"); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'POST', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: ObjectSerializer.serialize(body, "V1beta1StatefulSet") }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "V1beta1StatefulSet"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * delete collection of ControllerRevision * @param namespace object name and auth scope, such as for teams and projects * @param includeUninitialized If true, partially initialized resources are included in the response. * @param pretty If 'true', then the output is pretty printed. * @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. * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything. * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything. * @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. * @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. * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. * @param watch Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion. * @param {*} [options] Override http request options. */ deleteCollectionNamespacedControllerRevision(namespace, includeUninitialized, pretty, _continue, fieldSelector, labelSelector, limit, resourceVersion, timeoutSeconds, watch, options = {}) { const localVarPath = this.basePath + '/apis/apps/v1beta1/namespaces/{namespace}/controllerrevisions' .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling deleteCollectionNamespacedControllerRevision.'); } if (includeUninitialized !== undefined) { localVarQueryParameters['includeUninitialized'] = ObjectSerializer.serialize(includeUninitialized, "boolean"); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, "string"); } if (_continue !== undefined) { localVarQueryParameters['continue'] = ObjectSerializer.serialize(_continue, "string"); } if (fieldSelector !== undefined) { localVarQueryParameters['fieldSelector'] = ObjectSerializer.serialize(fieldSelector, "string"); } if (labelSelector !== undefined) { localVarQueryParameters['labelSelector'] = ObjectSerializer.serialize(labelSelector, "string"); } if (limit !== undefined) { localVarQueryParameters['limit'] = ObjectSerializer.serialize(limit, "number"); } if (resourceVersion !== undefined) { localVarQueryParameters['resourceVersion'] = ObjectSerializer.serialize(resourceVersion, "string"); } if (timeoutSeconds !== undefined) { localVarQueryParameters['timeoutSeconds'] = ObjectSerializer.serialize(timeoutSeconds, "number"); } if (watch !== undefined) { localVarQueryParameters['watch'] = ObjectSerializer.serialize(watch, "boolean"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'DELETE', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "V1Status"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * delete collection of Deployment * @param namespace object name and auth scope, such as for teams and projects * @param includeUninitialized If true, partially initialized resources are included in the response. * @param pretty If 'true', then the output is pretty printed. * @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. * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything. * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything. * @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. * @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. * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. * @param watch Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion. * @param {*} [options] Override http request options. */ deleteCollectionNamespacedDeployment(namespace, includeUninitialized, pretty, _continue, fieldSelector, labelSelector, limit, resourceVersion, timeoutSeconds, watch, options = {}) { const localVarPath = this.basePath + '/apis/apps/v1beta1/namespaces/{namespace}/deployments' .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling deleteCollectionNamespacedDeployment.'); } if (includeUninitialized !== undefined) { localVarQueryParameters['includeUninitialized'] = ObjectSerializer.serialize(includeUninitialized, "boolean"); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, "string"); } if (_continue !== undefined) { localVarQueryParameters['continue'] = ObjectSerializer.serialize(_continue, "string"); } if (fieldSelector !== undefined) { localVarQueryParameters['fieldSelector'] = ObjectSerializer.serialize(fieldSelector, "string"); } if (labelSelector !== undefined) { localVarQueryParameters['labelSelector'] = ObjectSerializer.serialize(labelSelector, "string"); } if (limit !== undefined) { localVarQueryParameters['limit'] = ObjectSerializer.serialize(limit, "number"); } if (resourceVersion !== undefined) { localVarQueryParameters['resourceVersion'] = ObjectSerializer.serialize(resourceVersion, "string"); } if (timeoutSeconds !== undefined) { localVarQueryParameters['timeoutSeconds'] = ObjectSerializer.serialize(timeoutSeconds, "number"); } if (watch !== undefined) { localVarQueryParameters['watch'] = ObjectSerializer.serialize(watch, "boolean"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'DELETE', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "V1Status"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * delete collection of StatefulSet * @param namespace object name and auth scope, such as for teams and projects * @param includeUninitialized If true, partially initialized resources are included in the response. * @param pretty If 'true', then the output is pretty printed. * @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. * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything. * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything. * @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. * @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. * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. * @param watch Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion. * @param {*} [options] Override http request options. */ deleteCollectionNamespacedStatefulSet(namespace, includeUninitialized, pretty, _continue, fieldSelector, labelSelector, limit, resourceVersion, timeoutSeconds, watch, options = {}) { const localVarPath = this.basePath + '/apis/apps/v1beta1/namespaces/{namespace}/statefulsets' .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling deleteCollectionNamespacedStatefulSet.'); } if (includeUninitialized !== undefined) { localVarQueryParameters['includeUninitialized'] = ObjectSerializer.serialize(includeUninitialized, "boolean"); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, "string"); } if (_continue !== undefined) { localVarQueryParameters['continue'] = ObjectSerializer.serialize(_continue, "string"); } if (fieldSelector !== undefined) { localVarQueryParameters['fieldSelector'] = ObjectSerializer.serialize(fieldSelector, "string"); } if (labelSelector !== undefined) { localVarQueryParameters['labelSelector'] = ObjectSerializer.serialize(labelSelector, "string"); } if (limit !== undefined) { localVarQueryParameters['limit'] = ObjectSerializer.serialize(limit, "number"); } if (resourceVersion !== undefined) { localVarQueryParameters['resourceVersion'] = ObjectSerializer.serialize(resourceVersion, "string"); } if (timeoutSeconds !== undefined) { localVarQueryParameters['timeoutSeconds'] = ObjectSerializer.serialize(timeoutSeconds, "number"); } if (watch !== undefined) { localVarQueryParameters['watch'] = ObjectSerializer.serialize(watch, "boolean"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'DELETE', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "V1Status"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * delete a ControllerRevision * @param name name of the ControllerRevision * @param namespace object name and auth scope, such as for teams and projects * @param pretty If 'true', then the output is pretty printed. * @param body * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @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. * @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. * @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. * @param {*} [options] Override http request options. */ deleteNamespacedControllerRevision(name, namespace, pretty, body, dryRun, gracePeriodSeconds, orphanDependents, propagationPolicy, options = {}) { const localVarPath = this.basePath + '/apis/apps/v1beta1/namespaces/{namespace}/controllerrevisions/{name}' .replace('{' + 'name' + '}', encodeURIComponent(String(name))) .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling deleteNamespacedControllerRevision.'); } // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling deleteNamespacedControllerRevision.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, "string"); } if (gracePeriodSeconds !== undefined) { localVarQueryParameters['gracePeriodSeconds'] = ObjectSerializer.serialize(gracePeriodSeconds, "number"); } if (orphanDependents !== undefined) { localVarQueryParameters['orphanDependents'] = ObjectSerializer.serialize(orphanDependents, "boolean"); } if (propagationPolicy !== undefined) { localVarQueryParameters['propagationPolicy'] = ObjectSerializer.serialize(propagationPolicy, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'DELETE', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: ObjectSerializer.serialize(body, "V1DeleteOptions") }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "V1Status"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * delete a Deployment * @param name name of the Deployment * @param namespace object name and auth scope, such as for teams and projects * @param pretty If 'true', then the output is pretty printed. * @param body * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @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. * @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. * @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. * @param {*} [options] Override http request options. */ deleteNamespacedDeployment(name, namespace, pretty, body, dryRun, gracePeriodSeconds, orphanDependents, propagationPolicy, options = {}) { const localVarPath = this.basePath + '/apis/apps/v1beta1/namespaces/{namespace}/deployments/{name}' .replace('{' + 'name' + '}', encodeURIComponent(String(name))) .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling deleteNamespacedDeployment.'); } // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling deleteNamespacedDeployment.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, "string"); } if (gracePeriodSeconds !== undefined) { localVarQueryParameters['gracePeriodSeconds'] = ObjectSerializer.serialize(gracePeriodSeconds, "number"); } if (orphanDependents !== undefined) { localVarQueryParameters['orphanDependents'] = ObjectSerializer.serialize(orphanDependents, "boolean"); } if (propagationPolicy !== undefined) { localVarQueryParameters['propagationPolicy'] = ObjectSerializer.serialize(propagationPolicy, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'DELETE', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: ObjectSerializer.serialize(body, "V1DeleteOptions") }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "V1Status"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * delete a StatefulSet * @param name name of the StatefulSet * @param namespace object name and auth scope, such as for teams and projects * @param pretty If 'true', then the output is pretty printed. * @param body * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @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. * @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. * @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. * @param {*} [options] Override http request options. */ deleteNamespacedStatefulSet(name, namespace, pretty, body, dryRun, gracePeriodSeconds, orphanDependents, propagationPolicy, options = {}) { const localVarPath = this.basePath + '/apis/apps/v1beta1/namespaces/{namespace}/statefulsets/{name}' .replace('{' + 'name' + '}', encodeURIComponent(String(name))) .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling deleteNamespacedStatefulSet.'); } // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling deleteNamespacedStatefulSet.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, "string"); } if (gracePeriodSeconds !== undefined) { localVarQueryParameters['gracePeriodSeconds'] = ObjectSerializer.serialize(gracePeriodSeconds, "number"); } if (orphanDependents !== undefined) { localVarQueryParameters['orphanDependents'] = ObjectSerializer.serialize(orphanDependents, "boolean"); } if (propagationPolicy !== undefined) { localVarQueryParameters['propagationPolicy'] = ObjectSerializer.serialize(propagationPolicy, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'DELETE', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: ObjectSerializer.serialize(body, "V1DeleteOptions") }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "V1Status"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * get available resources * @param {*} [options] Override http request options. */ getAPIResources(options = {}) { const localVarPath = this.basePath + '/apis/apps/v1beta1/'; let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'GET', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "V1APIResourceList"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * list or watch objects of kind ControllerRevision * @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. * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything. * @param includeUninitialized If true, partially initialized resources are included in the response. * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything. * @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. * @param pretty If 'true', then the output is pretty printed. * @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. * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. * @param watch Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion. * @param {*} [options] Override http request options. */ listControllerRevisionForAllNamespaces(_continue, fieldSelector, includeUninitialized, labelSelector, limit, pretty, resourceVersion, timeoutSeconds, watch, options = {}) { const localVarPath = this.basePath + '/apis/apps/v1beta1/controllerrevisions'; let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; if (_continue !== undefined) { localVarQueryParameters['continue'] = ObjectSerializer.serialize(_continue, "string"); } if (fieldSelector !== undefined) { localVarQueryParameters['fieldSelector'] = ObjectSerializer.serialize(fieldSelector, "string"); } if (includeUninitialized !== undefined) { localVarQueryParameters['includeUninitialized'] = ObjectSerializer.serialize(includeUninitialized, "boolean"); } if (labelSelector !== undefined) { localVarQueryParameters['labelSelector'] = ObjectSerializer.serialize(labelSelector, "string"); } if (limit !== undefined) { localVarQueryParameters['limit'] = ObjectSerializer.serialize(limit, "number"); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, "string"); } if (resourceVersion !== undefined) { localVarQueryParameters['resourceVersion'] = ObjectSerializer.serialize(resourceVersion, "string"); } if (timeoutSeconds !== undefined) { localVarQueryParameters['timeoutSeconds'] = ObjectSerializer.serialize(timeoutSeconds, "number"); } if (watch !== undefined) { localVarQueryParameters['watch'] = ObjectSerializer.serialize(watch, "boolean"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'GET', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "V1beta1ControllerRevisionList"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * list or watch objects of kind Deployment * @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. * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything. * @param includeUninitialized If true, partially initialized resources are included in the response. * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything. * @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. * @param pretty If 'true', then the output is pretty printed. * @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. * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. * @param watch Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion. * @param {*} [options] Override http request options. */ listDeploymentForAllNamespaces(_continue, fieldSelector, includeUninitialized, labelSelector, limit, pretty, resourceVersion, timeoutSeconds, watch, options = {}) { const localVarPath = this.basePath + '/apis/apps/v1beta1/deployments'; let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; if (_continue !== undefined) { localVarQueryParameters['continue'] = ObjectSerializer.serialize(_continue, "string"); } if (fieldSelector !== undefined) { localVarQueryParameters['fieldSelector'] = ObjectSerializer.serialize(fieldSelector, "string"); } if (includeUninitialized !== undefined) { localVarQueryParameters['includeUninitialized'] = ObjectSerializer.serialize(includeUninitialized, "boolean"); } if (labelSelector !== undefined) { localVarQueryParameters['labelSelector'] = ObjectSerializer.serialize(labelSelector, "string"); } if (limit !== undefined) { localVarQueryParameters['limit'] = ObjectSerializer.serialize(limit, "number"); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, "string"); } if (resourceVersion !== undefined) { localVarQueryParameters['resourceVersion'] = ObjectSerializer.serialize(resourceVersion, "string"); } if (timeoutSeconds !== undefined) { localVarQueryParameters['timeoutSeconds'] = ObjectSerializer.serialize(timeoutSeconds, "number"); } if (watch !== undefined) { localVarQueryParameters['watch'] = ObjectSerializer.serialize(watch, "boolean"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'GET', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "AppsV1beta1DeploymentList"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * list or watch objects of kind ControllerRevision * @param namespace object name and auth scope, such as for teams and projects * @param includeUninitialized If true, partially initialized resources are included in the response. * @param pretty If 'true', then the output is pretty printed. * @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. * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything. * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything. * @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. * @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. * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. * @param watch Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion. * @param {*} [options] Override http request options. */ listNamespacedControllerRevision(namespace, includeUninitialized, pretty, _continue, fieldSelector, labelSelector, limit, resourceVersion, timeoutSeconds, watch, options = {}) { const localVarPath = this.basePath + '/apis/apps/v1beta1/namespaces/{namespace}/controllerrevisions' .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling listNamespacedControllerRevision.'); } if (includeUninitialized !== undefined) { localVarQueryParameters['includeUninitialized'] = ObjectSerializer.serialize(includeUninitialized, "boolean"); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, "string"); } if (_continue !== undefined) { localVarQueryParameters['continue'] = ObjectSerializer.serialize(_continue, "string"); } if (fieldSelector !== undefined) { localVarQueryParameters['fieldSelector'] = ObjectSerializer.serialize(fieldSelector, "string"); } if (labelSelector !== undefined) { localVarQueryParameters['labelSelector'] = ObjectSerializer.serialize(labelSelector, "string"); } if (limit !== undefined) { localVarQueryParameters['limit'] = ObjectSerializer.serialize(limit, "number"); } if (resourceVersion !== undefined) { localVarQueryParameters['resourceVersion'] = ObjectSerializer.serialize(resourceVersion, "string"); } if (timeoutSeconds !== undefined) { localVarQueryParameters['timeoutSeconds'] = ObjectSerializer.serialize(timeoutSeconds, "number"); } if (watch !== undefined) { localVarQueryParameters['watch'] = ObjectSerializer.serialize(watch, "boolean"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'GET', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "V1beta1ControllerRevisionList"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * list or watch objects of kind Deployment * @param namespace object name and auth scope, such as for teams and projects * @param includeUninitialized If true, partially initialized resources are included in the response. * @param pretty If 'true', then the output is pretty printed. * @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. * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything. * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything. * @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. * @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. * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. * @param watch Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion. * @param {*} [options] Override http request options. */ listNamespacedDeployment(namespace, includeUninitialized, pretty, _continue, fieldSelector, labelSelector, limit, resourceVersion, timeoutSeconds, watch, options = {}) { const localVarPath = this.basePath + '/apis/apps/v1beta1/namespaces/{namespace}/deployments' .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling listNamespacedDeployment.'); } if (includeUninitialized !== undefined) { localVarQueryParameters['includeUninitialized'] = ObjectSerializer.serialize(includeUninitialized, "boolean"); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, "string"); } if (_continue !== undefined) { localVarQueryParameters['continue'] = ObjectSerializer.serialize(_continue, "string"); } if (fieldSelector !== undefined) { localVarQueryParameters['fieldSelector'] = ObjectSerializer.serialize(fieldSelector, "string"); } if (labelSelector !== undefined) { localVarQueryParameters['labelSelector'] = ObjectSerializer.serialize(labelSelector, "string"); } if (limit !== undefined) { localVarQueryParameters['limit'] = ObjectSerializer.serialize(limit, "number"); } if (resourceVersion !== undefined) { localVarQueryParameters['resourceVersion'] = ObjectSerializer.serialize(resourceVersion, "string"); } if (timeoutSeconds !== undefined) { localVarQueryParameters['timeoutSeconds'] = ObjectSerializer.serialize(timeoutSeconds, "number"); } if (watch !== undefined) { localVarQueryParameters['watch'] = ObjectSerializer.serialize(watch, "boolean"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'GET', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "AppsV1beta1DeploymentList"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * list or watch objects of kind StatefulSet * @param namespace object name and auth scope, such as for teams and projects * @param includeUninitialized If true, partially initialized resources are included in the response. * @param pretty If 'true', then the output is pretty printed. * @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. * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything. * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything. * @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. * @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. * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. * @param watch Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion. * @param {*} [options] Override http request options. */ listNamespacedStatefulSet(namespace, includeUninitialized, pretty, _continue, fieldSelector, labelSelector, limit, resourceVersion, timeoutSeconds, watch, options = {}) { const localVarPath = this.basePath + '/apis/apps/v1beta1/namespaces/{namespace}/statefulsets' .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling listNamespacedStatefulSet.'); } if (includeUninitialized !== undefined) { localVarQueryParameters['includeUninitialized'] = ObjectSerializer.serialize(includeUninitialized, "boolean"); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, "string"); } if (_continue !== undefined) { localVarQueryParameters['continue'] = ObjectSerializer.serialize(_continue, "string"); } if (fieldSelector !== undefined) { localVarQueryParameters['fieldSelector'] = ObjectSerializer.serialize(fieldSelector, "string"); } if (labelSelector !== undefined) { localVarQueryParameters['labelSelector'] = ObjectSerializer.serialize(labelSelector, "string"); } if (limit !== undefined) { localVarQueryParameters['limit'] = ObjectSerializer.serialize(limit, "number"); } if (resourceVersion !== undefined) { localVarQueryParameters['resourceVersion'] = ObjectSerializer.serialize(resourceVersion, "string"); } if (timeoutSeconds !== undefined) { localVarQueryParameters['timeoutSeconds'] = ObjectSerializer.serialize(timeoutSeconds, "number"); } if (watch !== undefined) { localVarQueryParameters['watch'] = ObjectSerializer.serialize(watch, "boolean"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'GET', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "V1beta1StatefulSetList"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * list or watch objects of kind StatefulSet * @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. * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything. * @param includeUninitialized If true, partially initialized resources are included in the response. * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything. * @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. * @param pretty If 'true', then the output is pretty printed. * @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. * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. * @param watch Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion. * @param {*} [options] Override http request options. */ listStatefulSetForAllNamespaces(_continue, fieldSelector, includeUninitialized, labelSelector, limit, pretty, resourceVersion, timeoutSeconds, watch, options = {}) { const localVarPath = this.basePath + '/apis/apps/v1beta1/statefulsets'; let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; if (_continue !== undefined) { localVarQueryParameters['continue'] = ObjectSerializer.serialize(_continue, "string"); } if (fieldSelector !== undefined) { localVarQueryParameters['fieldSelector'] = ObjectSerializer.serialize(fieldSelector, "string"); } if (includeUninitialized !== undefined) { localVarQueryParameters['includeUninitialized'] = ObjectSerializer.serialize(includeUninitialized, "boolean"); } if (labelSelector !== undefined) { localVarQueryParameters['labelSelector'] = ObjectSerializer.serialize(labelSelector, "string"); } if (limit !== undefined) { localVarQueryParameters['limit'] = ObjectSerializer.serialize(limit, "number"); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, "string"); } if (resourceVersion !== undefined) { localVarQueryParameters['resourceVersion'] = ObjectSerializer.serialize(resourceVersion, "string"); } if (timeoutSeconds !== undefined) { localVarQueryParameters['timeoutSeconds'] = ObjectSerializer.serialize(timeoutSeconds, "number"); } if (watch !== undefined) { localVarQueryParameters['watch'] = ObjectSerializer.serialize(watch, "boolean"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'GET', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "V1beta1StatefulSetList"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * partially update the specified ControllerRevision * @param name name of the ControllerRevision * @param namespace object name and auth scope, such as for teams and projects * @param body * @param pretty If 'true', then the output is pretty printed. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param {*} [options] Override http request options. */ patchNamespacedControllerRevision(name, namespace, body, pretty, dryRun, options = {}) { const localVarPath = this.basePath + '/apis/apps/v1beta1/namespaces/{namespace}/controllerrevisions/{name}' .replace('{' + 'name' + '}', encodeURIComponent(String(name))) .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling patchNamespacedControllerRevision.'); } // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling patchNamespacedControllerRevision.'); } // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling patchNamespacedControllerRevision.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'PATCH', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: ObjectSerializer.serialize(body, "any") }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "V1beta1ControllerRevision"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * partially update the specified Deployment * @param name name of the Deployment * @param namespace object name and auth scope, such as for teams and projects * @param body * @param pretty If 'true', then the output is pretty printed. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param {*} [options] Override http request options. */ patchNamespacedDeployment(name, namespace, body, pretty, dryRun, options = {}) { const localVarPath = this.basePath + '/apis/apps/v1beta1/namespaces/{namespace}/deployments/{name}' .replace('{' + 'name' + '}', encodeURIComponent(String(name))) .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling patchNamespacedDeployment.'); } // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling patchNamespacedDeployment.'); } // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling patchNamespacedDeployment.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'PATCH', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: ObjectSerializer.serialize(body, "any") }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "AppsV1beta1Deployment"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * partially update scale of the specified Deployment * @param name name of the Scale * @param namespace object name and auth scope, such as for teams and projects * @param body * @param pretty If 'true', then the output is pretty printed. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param {*} [options] Override http request options. */ patchNamespacedDeploymentScale(name, namespace, body, pretty, dryRun, options = {}) { const localVarPath = this.basePath + '/apis/apps/v1beta1/namespaces/{namespace}/deployments/{name}/scale' .replace('{' + 'name' + '}', encodeURIComponent(String(name))) .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling patchNamespacedDeploymentScale.'); } // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling patchNamespacedDeploymentScale.'); } // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling patchNamespacedDeploymentScale.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'PATCH', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: ObjectSerializer.serialize(body, "any") }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "AppsV1beta1Scale"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * partially update status of the specified Deployment * @param name name of the Deployment * @param namespace object name and auth scope, such as for teams and projects * @param body * @param pretty If 'true', then the output is pretty printed. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param {*} [options] Override http request options. */ patchNamespacedDeploymentStatus(name, namespace, body, pretty, dryRun, options = {}) { const localVarPath = this.basePath + '/apis/apps/v1beta1/namespaces/{namespace}/deployments/{name}/status' .replace('{' + 'name' + '}', encodeURIComponent(String(name))) .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling patchNamespacedDeploymentStatus.'); } // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling patchNamespacedDeploymentStatus.'); } // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling patchNamespacedDeploymentStatus.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'PATCH', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: ObjectSerializer.serialize(body, "any") }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "AppsV1beta1Deployment"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * partially update the specified StatefulSet * @param name name of the StatefulSet * @param namespace object name and auth scope, such as for teams and projects * @param body * @param pretty If 'true', then the output is pretty printed. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param {*} [options] Override http request options. */ patchNamespacedStatefulSet(name, namespace, body, pretty, dryRun, options = {}) { const localVarPath = this.basePath + '/apis/apps/v1beta1/namespaces/{namespace}/statefulsets/{name}' .replace('{' + 'name' + '}', encodeURIComponent(String(name))) .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling patchNamespacedStatefulSet.'); } // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling patchNamespacedStatefulSet.'); } // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling patchNamespacedStatefulSet.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'PATCH', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: ObjectSerializer.serialize(body, "any") }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "V1beta1StatefulSet"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * partially update scale of the specified StatefulSet * @param name name of the Scale * @param namespace object name and auth scope, such as for teams and projects * @param body * @param pretty If 'true', then the output is pretty printed. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param {*} [options] Override http request options. */ patchNamespacedStatefulSetScale(name, namespace, body, pretty, dryRun, options = {}) { const localVarPath = this.basePath + '/apis/apps/v1beta1/namespaces/{namespace}/statefulsets/{name}/scale' .replace('{' + 'name' + '}', encodeURIComponent(String(name))) .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling patchNamespacedStatefulSetScale.'); } // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling patchNamespacedStatefulSetScale.'); } // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling patchNamespacedStatefulSetScale.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'PATCH', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: ObjectSerializer.serialize(body, "any") }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "AppsV1beta1Scale"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * partially update status of the specified StatefulSet * @param name name of the StatefulSet * @param namespace object name and auth scope, such as for teams and projects * @param body * @param pretty If 'true', then the output is pretty printed. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param {*} [options] Override http request options. */ patchNamespacedStatefulSetStatus(name, namespace, body, pretty, dryRun, options = {}) { const localVarPath = this.basePath + '/apis/apps/v1beta1/namespaces/{namespace}/statefulsets/{name}/status' .replace('{' + 'name' + '}', encodeURIComponent(String(name))) .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling patchNamespacedStatefulSetStatus.'); } // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling patchNamespacedStatefulSetStatus.'); } // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling patchNamespacedStatefulSetStatus.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'PATCH', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: ObjectSerializer.serialize(body, "any") }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "V1beta1StatefulSet"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * read the specified ControllerRevision * @param name name of the ControllerRevision * @param namespace object name and auth scope, such as for teams and projects * @param pretty If 'true', then the output is pretty printed. * @param exact Should the export be exact. Exact export maintains cluster-specific fields like 'Namespace'. * @param _export Should this value be exported. Export strips fields that a user can not specify. * @param {*} [options] Override http request options. */ readNamespacedControllerRevision(name, namespace, pretty, exact, _export, options = {}) { const localVarPath = this.basePath + '/apis/apps/v1beta1/namespaces/{namespace}/controllerrevisions/{name}' .replace('{' + 'name' + '}', encodeURIComponent(String(name))) .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling readNamespacedControllerRevision.'); } // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling readNamespacedControllerRevision.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, "string"); } if (exact !== undefined) { localVarQueryParameters['exact'] = ObjectSerializer.serialize(exact, "boolean"); } if (_export !== undefined) { localVarQueryParameters['export'] = ObjectSerializer.serialize(_export, "boolean"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'GET', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "V1beta1ControllerRevision"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * read the specified Deployment * @param name name of the Deployment * @param namespace object name and auth scope, such as for teams and projects * @param pretty If 'true', then the output is pretty printed. * @param exact Should the export be exact. Exact export maintains cluster-specific fields like 'Namespace'. * @param _export Should this value be exported. Export strips fields that a user can not specify. * @param {*} [options] Override http request options. */ readNamespacedDeployment(name, namespace, pretty, exact, _export, options = {}) { const localVarPath = this.basePath + '/apis/apps/v1beta1/namespaces/{namespace}/deployments/{name}' .replace('{' + 'name' + '}', encodeURIComponent(String(name))) .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling readNamespacedDeployment.'); } // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling readNamespacedDeployment.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, "string"); } if (exact !== undefined) { localVarQueryParameters['exact'] = ObjectSerializer.serialize(exact, "boolean"); } if (_export !== undefined) { localVarQueryParameters['export'] = ObjectSerializer.serialize(_export, "boolean"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'GET', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "AppsV1beta1Deployment"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * read scale of the specified Deployment * @param name name of the Scale * @param namespace object name and auth scope, such as for teams and projects * @param pretty If 'true', then the output is pretty printed. * @param {*} [options] Override http request options. */ readNamespacedDeploymentScale(name, namespace, pretty, options = {}) { const localVarPath = this.basePath + '/apis/apps/v1beta1/namespaces/{namespace}/deployments/{name}/scale' .replace('{' + 'name' + '}', encodeURIComponent(String(name))) .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling readNamespacedDeploymentScale.'); } // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling readNamespacedDeploymentScale.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'GET', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "AppsV1beta1Scale"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * read status of the specified Deployment * @param name name of the Deployment * @param namespace object name and auth scope, such as for teams and projects * @param pretty If 'true', then the output is pretty printed. * @param {*} [options] Override http request options. */ readNamespacedDeploymentStatus(name, namespace, pretty, options = {}) { const localVarPath = this.basePath + '/apis/apps/v1beta1/namespaces/{namespace}/deployments/{name}/status' .replace('{' + 'name' + '}', encodeURIComponent(String(name))) .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling readNamespacedDeploymentStatus.'); } // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling readNamespacedDeploymentStatus.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'GET', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "AppsV1beta1Deployment"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * read the specified StatefulSet * @param name name of the StatefulSet * @param namespace object name and auth scope, such as for teams and projects * @param pretty If 'true', then the output is pretty printed. * @param exact Should the export be exact. Exact export maintains cluster-specific fields like 'Namespace'. * @param _export Should this value be exported. Export strips fields that a user can not specify. * @param {*} [options] Override http request options. */ readNamespacedStatefulSet(name, namespace, pretty, exact, _export, options = {}) { const localVarPath = this.basePath + '/apis/apps/v1beta1/namespaces/{namespace}/statefulsets/{name}' .replace('{' + 'name' + '}', encodeURIComponent(String(name))) .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling readNamespacedStatefulSet.'); } // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling readNamespacedStatefulSet.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, "string"); } if (exact !== undefined) { localVarQueryParameters['exact'] = ObjectSerializer.serialize(exact, "boolean"); } if (_export !== undefined) { localVarQueryParameters['export'] = ObjectSerializer.serialize(_export, "boolean"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'GET', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "V1beta1StatefulSet"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * read scale of the specified StatefulSet * @param name name of the Scale * @param namespace object name and auth scope, such as for teams and projects * @param pretty If 'true', then the output is pretty printed. * @param {*} [options] Override http request options. */ readNamespacedStatefulSetScale(name, namespace, pretty, options = {}) { const localVarPath = this.basePath + '/apis/apps/v1beta1/namespaces/{namespace}/statefulsets/{name}/scale' .replace('{' + 'name' + '}', encodeURIComponent(String(name))) .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling readNamespacedStatefulSetScale.'); } // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling readNamespacedStatefulSetScale.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'GET', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "AppsV1beta1Scale"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * read status of the specified StatefulSet * @param name name of the StatefulSet * @param namespace object name and auth scope, such as for teams and projects * @param pretty If 'true', then the output is pretty printed. * @param {*} [options] Override http request options. */ readNamespacedStatefulSetStatus(name, namespace, pretty, options = {}) { const localVarPath = this.basePath + '/apis/apps/v1beta1/namespaces/{namespace}/statefulsets/{name}/status' .replace('{' + 'name' + '}', encodeURIComponent(String(name))) .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling readNamespacedStatefulSetStatus.'); } // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling readNamespacedStatefulSetStatus.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'GET', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "V1beta1StatefulSet"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * replace the specified ControllerRevision * @param name name of the ControllerRevision * @param namespace object name and auth scope, such as for teams and projects * @param body * @param pretty If 'true', then the output is pretty printed. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param {*} [options] Override http request options. */ replaceNamespacedControllerRevision(name, namespace, body, pretty, dryRun, options = {}) { const localVarPath = this.basePath + '/apis/apps/v1beta1/namespaces/{namespace}/controllerrevisions/{name}' .replace('{' + 'name' + '}', encodeURIComponent(String(name))) .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling replaceNamespacedControllerRevision.'); } // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling replaceNamespacedControllerRevision.'); } // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling replaceNamespacedControllerRevision.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'PUT', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: ObjectSerializer.serialize(body, "V1beta1ControllerRevision") }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "V1beta1ControllerRevision"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * replace the specified Deployment * @param name name of the Deployment * @param namespace object name and auth scope, such as for teams and projects * @param body * @param pretty If 'true', then the output is pretty printed. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param {*} [options] Override http request options. */ replaceNamespacedDeployment(name, namespace, body, pretty, dryRun, options = {}) { const localVarPath = this.basePath + '/apis/apps/v1beta1/namespaces/{namespace}/deployments/{name}' .replace('{' + 'name' + '}', encodeURIComponent(String(name))) .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling replaceNamespacedDeployment.'); } // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling replaceNamespacedDeployment.'); } // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling replaceNamespacedDeployment.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'PUT', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: ObjectSerializer.serialize(body, "AppsV1beta1Deployment") }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "AppsV1beta1Deployment"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * replace scale of the specified Deployment * @param name name of the Scale * @param namespace object name and auth scope, such as for teams and projects * @param body * @param pretty If 'true', then the output is pretty printed. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param {*} [options] Override http request options. */ replaceNamespacedDeploymentScale(name, namespace, body, pretty, dryRun, options = {}) { const localVarPath = this.basePath + '/apis/apps/v1beta1/namespaces/{namespace}/deployments/{name}/scale' .replace('{' + 'name' + '}', encodeURIComponent(String(name))) .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling replaceNamespacedDeploymentScale.'); } // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling replaceNamespacedDeploymentScale.'); } // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling replaceNamespacedDeploymentScale.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'PUT', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: ObjectSerializer.serialize(body, "AppsV1beta1Scale") }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "AppsV1beta1Scale"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * replace status of the specified Deployment * @param name name of the Deployment * @param namespace object name and auth scope, such as for teams and projects * @param body * @param pretty If 'true', then the output is pretty printed. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param {*} [options] Override http request options. */ replaceNamespacedDeploymentStatus(name, namespace, body, pretty, dryRun, options = {}) { const localVarPath = this.basePath + '/apis/apps/v1beta1/namespaces/{namespace}/deployments/{name}/status' .replace('{' + 'name' + '}', encodeURIComponent(String(name))) .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling replaceNamespacedDeploymentStatus.'); } // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling replaceNamespacedDeploymentStatus.'); } // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling replaceNamespacedDeploymentStatus.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'PUT', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: ObjectSerializer.serialize(body, "AppsV1beta1Deployment") }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "AppsV1beta1Deployment"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * replace the specified StatefulSet * @param name name of the StatefulSet * @param namespace object name and auth scope, such as for teams and projects * @param body * @param pretty If 'true', then the output is pretty printed. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param {*} [options] Override http request options. */ replaceNamespacedStatefulSet(name, namespace, body, pretty, dryRun, options = {}) { const localVarPath = this.basePath + '/apis/apps/v1beta1/namespaces/{namespace}/statefulsets/{name}' .replace('{' + 'name' + '}', encodeURIComponent(String(name))) .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling replaceNamespacedStatefulSet.'); } // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling replaceNamespacedStatefulSet.'); } // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling replaceNamespacedStatefulSet.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'PUT', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: ObjectSerializer.serialize(body, "V1beta1StatefulSet") }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "V1beta1StatefulSet"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * replace scale of the specified StatefulSet * @param name name of the Scale * @param namespace object name and auth scope, such as for teams and projects * @param body * @param pretty If 'true', then the output is pretty printed. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param {*} [options] Override http request options. */ replaceNamespacedStatefulSetScale(name, namespace, body, pretty, dryRun, options = {}) { const localVarPath = this.basePath + '/apis/apps/v1beta1/namespaces/{namespace}/statefulsets/{name}/scale' .replace('{' + 'name' + '}', encodeURIComponent(String(name))) .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling replaceNamespacedStatefulSetScale.'); } // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling replaceNamespacedStatefulSetScale.'); } // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling replaceNamespacedStatefulSetScale.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'PUT', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: ObjectSerializer.serialize(body, "AppsV1beta1Scale") }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "AppsV1beta1Scale"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * replace status of the specified StatefulSet * @param name name of the StatefulSet * @param namespace object name and auth scope, such as for teams and projects * @param body * @param pretty If 'true', then the output is pretty printed. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param {*} [options] Override http request options. */ replaceNamespacedStatefulSetStatus(name, namespace, body, pretty, dryRun, options = {}) { const localVarPath = this.basePath + '/apis/apps/v1beta1/namespaces/{namespace}/statefulsets/{name}/status' .replace('{' + 'name' + '}', encodeURIComponent(String(name))) .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling replaceNamespacedStatefulSetStatus.'); } // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling replaceNamespacedStatefulSetStatus.'); } // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling replaceNamespacedStatefulSetStatus.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'PUT', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: ObjectSerializer.serialize(body, "V1beta1StatefulSet") }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "V1beta1StatefulSet"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } } exports.AppsV1beta1Api = AppsV1beta1Api; var AppsV1beta2ApiApiKeys; (function (AppsV1beta2ApiApiKeys) { AppsV1beta2ApiApiKeys[AppsV1beta2ApiApiKeys["BearerToken"] = 0] = "BearerToken"; })(AppsV1beta2ApiApiKeys = exports.AppsV1beta2ApiApiKeys || (exports.AppsV1beta2ApiApiKeys = {})); class AppsV1beta2Api { constructor(basePathOrUsername, password, basePath) { this._basePath = defaultBasePath; this.defaultHeaders = {}; this._useQuerystring = false; this.authentications = { 'default': new VoidAuth(), 'BearerToken': new ApiKeyAuth('header', 'authorization'), }; if (password) { if (basePath) { this.basePath = basePath; } } else { if (basePathOrUsername) { this.basePath = basePathOrUsername; } } } set useQuerystring(value) { this._useQuerystring = value; } set basePath(basePath) { this._basePath = basePath; } get basePath() { return this._basePath; } setDefaultAuthentication(auth) { this.authentications.default = auth; } setApiKey(key, value) { this.authentications[AppsV1beta2ApiApiKeys[key]].apiKey = value; } /** * create a ControllerRevision * @param namespace object name and auth scope, such as for teams and projects * @param body * @param includeUninitialized If true, partially initialized resources are included in the response. * @param pretty If 'true', then the output is pretty printed. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param {*} [options] Override http request options. */ createNamespacedControllerRevision(namespace, body, includeUninitialized, pretty, dryRun, options = {}) { const localVarPath = this.basePath + '/apis/apps/v1beta2/namespaces/{namespace}/controllerrevisions' .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling createNamespacedControllerRevision.'); } // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling createNamespacedControllerRevision.'); } if (includeUninitialized !== undefined) { localVarQueryParameters['includeUninitialized'] = ObjectSerializer.serialize(includeUninitialized, "boolean"); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'POST', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: ObjectSerializer.serialize(body, "V1beta2ControllerRevision") }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "V1beta2ControllerRevision"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * create a DaemonSet * @param namespace object name and auth scope, such as for teams and projects * @param body * @param includeUninitialized If true, partially initialized resources are included in the response. * @param pretty If 'true', then the output is pretty printed. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param {*} [options] Override http request options. */ createNamespacedDaemonSet(namespace, body, includeUninitialized, pretty, dryRun, options = {}) { const localVarPath = this.basePath + '/apis/apps/v1beta2/namespaces/{namespace}/daemonsets' .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling createNamespacedDaemonSet.'); } // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling createNamespacedDaemonSet.'); } if (includeUninitialized !== undefined) { localVarQueryParameters['includeUninitialized'] = ObjectSerializer.serialize(includeUninitialized, "boolean"); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'POST', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: ObjectSerializer.serialize(body, "V1beta2DaemonSet") }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "V1beta2DaemonSet"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * create a Deployment * @param namespace object name and auth scope, such as for teams and projects * @param body * @param includeUninitialized If true, partially initialized resources are included in the response. * @param pretty If 'true', then the output is pretty printed. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param {*} [options] Override http request options. */ createNamespacedDeployment(namespace, body, includeUninitialized, pretty, dryRun, options = {}) { const localVarPath = this.basePath + '/apis/apps/v1beta2/namespaces/{namespace}/deployments' .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling createNamespacedDeployment.'); } // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling createNamespacedDeployment.'); } if (includeUninitialized !== undefined) { localVarQueryParameters['includeUninitialized'] = ObjectSerializer.serialize(includeUninitialized, "boolean"); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'POST', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: ObjectSerializer.serialize(body, "V1beta2Deployment") }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "V1beta2Deployment"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * create a ReplicaSet * @param namespace object name and auth scope, such as for teams and projects * @param body * @param includeUninitialized If true, partially initialized resources are included in the response. * @param pretty If 'true', then the output is pretty printed. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param {*} [options] Override http request options. */ createNamespacedReplicaSet(namespace, body, includeUninitialized, pretty, dryRun, options = {}) { const localVarPath = this.basePath + '/apis/apps/v1beta2/namespaces/{namespace}/replicasets' .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling createNamespacedReplicaSet.'); } // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling createNamespacedReplicaSet.'); } if (includeUninitialized !== undefined) { localVarQueryParameters['includeUninitialized'] = ObjectSerializer.serialize(includeUninitialized, "boolean"); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'POST', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: ObjectSerializer.serialize(body, "V1beta2ReplicaSet") }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "V1beta2ReplicaSet"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * create a StatefulSet * @param namespace object name and auth scope, such as for teams and projects * @param body * @param includeUninitialized If true, partially initialized resources are included in the response. * @param pretty If 'true', then the output is pretty printed. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param {*} [options] Override http request options. */ createNamespacedStatefulSet(namespace, body, includeUninitialized, pretty, dryRun, options = {}) { const localVarPath = this.basePath + '/apis/apps/v1beta2/namespaces/{namespace}/statefulsets' .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling createNamespacedStatefulSet.'); } // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling createNamespacedStatefulSet.'); } if (includeUninitialized !== undefined) { localVarQueryParameters['includeUninitialized'] = ObjectSerializer.serialize(includeUninitialized, "boolean"); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'POST', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: ObjectSerializer.serialize(body, "V1beta2StatefulSet") }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "V1beta2StatefulSet"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * delete collection of ControllerRevision * @param namespace object name and auth scope, such as for teams and projects * @param includeUninitialized If true, partially initialized resources are included in the response. * @param pretty If 'true', then the output is pretty printed. * @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. * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything. * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything. * @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. * @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. * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. * @param watch Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion. * @param {*} [options] Override http request options. */ deleteCollectionNamespacedControllerRevision(namespace, includeUninitialized, pretty, _continue, fieldSelector, labelSelector, limit, resourceVersion, timeoutSeconds, watch, options = {}) { const localVarPath = this.basePath + '/apis/apps/v1beta2/namespaces/{namespace}/controllerrevisions' .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling deleteCollectionNamespacedControllerRevision.'); } if (includeUninitialized !== undefined) { localVarQueryParameters['includeUninitialized'] = ObjectSerializer.serialize(includeUninitialized, "boolean"); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, "string"); } if (_continue !== undefined) { localVarQueryParameters['continue'] = ObjectSerializer.serialize(_continue, "string"); } if (fieldSelector !== undefined) { localVarQueryParameters['fieldSelector'] = ObjectSerializer.serialize(fieldSelector, "string"); } if (labelSelector !== undefined) { localVarQueryParameters['labelSelector'] = ObjectSerializer.serialize(labelSelector, "string"); } if (limit !== undefined) { localVarQueryParameters['limit'] = ObjectSerializer.serialize(limit, "number"); } if (resourceVersion !== undefined) { localVarQueryParameters['resourceVersion'] = ObjectSerializer.serialize(resourceVersion, "string"); } if (timeoutSeconds !== undefined) { localVarQueryParameters['timeoutSeconds'] = ObjectSerializer.serialize(timeoutSeconds, "number"); } if (watch !== undefined) { localVarQueryParameters['watch'] = ObjectSerializer.serialize(watch, "boolean"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'DELETE', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "V1Status"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * delete collection of DaemonSet * @param namespace object name and auth scope, such as for teams and projects * @param includeUninitialized If true, partially initialized resources are included in the response. * @param pretty If 'true', then the output is pretty printed. * @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. * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything. * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything. * @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. * @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. * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. * @param watch Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion. * @param {*} [options] Override http request options. */ deleteCollectionNamespacedDaemonSet(namespace, includeUninitialized, pretty, _continue, fieldSelector, labelSelector, limit, resourceVersion, timeoutSeconds, watch, options = {}) { const localVarPath = this.basePath + '/apis/apps/v1beta2/namespaces/{namespace}/daemonsets' .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling deleteCollectionNamespacedDaemonSet.'); } if (includeUninitialized !== undefined) { localVarQueryParameters['includeUninitialized'] = ObjectSerializer.serialize(includeUninitialized, "boolean"); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, "string"); } if (_continue !== undefined) { localVarQueryParameters['continue'] = ObjectSerializer.serialize(_continue, "string"); } if (fieldSelector !== undefined) { localVarQueryParameters['fieldSelector'] = ObjectSerializer.serialize(fieldSelector, "string"); } if (labelSelector !== undefined) { localVarQueryParameters['labelSelector'] = ObjectSerializer.serialize(labelSelector, "string"); } if (limit !== undefined) { localVarQueryParameters['limit'] = ObjectSerializer.serialize(limit, "number"); } if (resourceVersion !== undefined) { localVarQueryParameters['resourceVersion'] = ObjectSerializer.serialize(resourceVersion, "string"); } if (timeoutSeconds !== undefined) { localVarQueryParameters['timeoutSeconds'] = ObjectSerializer.serialize(timeoutSeconds, "number"); } if (watch !== undefined) { localVarQueryParameters['watch'] = ObjectSerializer.serialize(watch, "boolean"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'DELETE', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "V1Status"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * delete collection of Deployment * @param namespace object name and auth scope, such as for teams and projects * @param includeUninitialized If true, partially initialized resources are included in the response. * @param pretty If 'true', then the output is pretty printed. * @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. * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything. * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything. * @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. * @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. * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. * @param watch Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion. * @param {*} [options] Override http request options. */ deleteCollectionNamespacedDeployment(namespace, includeUninitialized, pretty, _continue, fieldSelector, labelSelector, limit, resourceVersion, timeoutSeconds, watch, options = {}) { const localVarPath = this.basePath + '/apis/apps/v1beta2/namespaces/{namespace}/deployments' .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling deleteCollectionNamespacedDeployment.'); } if (includeUninitialized !== undefined) { localVarQueryParameters['includeUninitialized'] = ObjectSerializer.serialize(includeUninitialized, "boolean"); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, "string"); } if (_continue !== undefined) { localVarQueryParameters['continue'] = ObjectSerializer.serialize(_continue, "string"); } if (fieldSelector !== undefined) { localVarQueryParameters['fieldSelector'] = ObjectSerializer.serialize(fieldSelector, "string"); } if (labelSelector !== undefined) { localVarQueryParameters['labelSelector'] = ObjectSerializer.serialize(labelSelector, "string"); } if (limit !== undefined) { localVarQueryParameters['limit'] = ObjectSerializer.serialize(limit, "number"); } if (resourceVersion !== undefined) { localVarQueryParameters['resourceVersion'] = ObjectSerializer.serialize(resourceVersion, "string"); } if (timeoutSeconds !== undefined) { localVarQueryParameters['timeoutSeconds'] = ObjectSerializer.serialize(timeoutSeconds, "number"); } if (watch !== undefined) { localVarQueryParameters['watch'] = ObjectSerializer.serialize(watch, "boolean"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'DELETE', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "V1Status"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * delete collection of ReplicaSet * @param namespace object name and auth scope, such as for teams and projects * @param includeUninitialized If true, partially initialized resources are included in the response. * @param pretty If 'true', then the output is pretty printed. * @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. * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything. * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything. * @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. * @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. * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. * @param watch Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion. * @param {*} [options] Override http request options. */ deleteCollectionNamespacedReplicaSet(namespace, includeUninitialized, pretty, _continue, fieldSelector, labelSelector, limit, resourceVersion, timeoutSeconds, watch, options = {}) { const localVarPath = this.basePath + '/apis/apps/v1beta2/namespaces/{namespace}/replicasets' .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling deleteCollectionNamespacedReplicaSet.'); } if (includeUninitialized !== undefined) { localVarQueryParameters['includeUninitialized'] = ObjectSerializer.serialize(includeUninitialized, "boolean"); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, "string"); } if (_continue !== undefined) { localVarQueryParameters['continue'] = ObjectSerializer.serialize(_continue, "string"); } if (fieldSelector !== undefined) { localVarQueryParameters['fieldSelector'] = ObjectSerializer.serialize(fieldSelector, "string"); } if (labelSelector !== undefined) { localVarQueryParameters['labelSelector'] = ObjectSerializer.serialize(labelSelector, "string"); } if (limit !== undefined) { localVarQueryParameters['limit'] = ObjectSerializer.serialize(limit, "number"); } if (resourceVersion !== undefined) { localVarQueryParameters['resourceVersion'] = ObjectSerializer.serialize(resourceVersion, "string"); } if (timeoutSeconds !== undefined) { localVarQueryParameters['timeoutSeconds'] = ObjectSerializer.serialize(timeoutSeconds, "number"); } if (watch !== undefined) { localVarQueryParameters['watch'] = ObjectSerializer.serialize(watch, "boolean"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'DELETE', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "V1Status"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * delete collection of StatefulSet * @param namespace object name and auth scope, such as for teams and projects * @param includeUninitialized If true, partially initialized resources are included in the response. * @param pretty If 'true', then the output is pretty printed. * @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. * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything. * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything. * @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. * @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. * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. * @param watch Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion. * @param {*} [options] Override http request options. */ deleteCollectionNamespacedStatefulSet(namespace, includeUninitialized, pretty, _continue, fieldSelector, labelSelector, limit, resourceVersion, timeoutSeconds, watch, options = {}) { const localVarPath = this.basePath + '/apis/apps/v1beta2/namespaces/{namespace}/statefulsets' .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling deleteCollectionNamespacedStatefulSet.'); } if (includeUninitialized !== undefined) { localVarQueryParameters['includeUninitialized'] = ObjectSerializer.serialize(includeUninitialized, "boolean"); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, "string"); } if (_continue !== undefined) { localVarQueryParameters['continue'] = ObjectSerializer.serialize(_continue, "string"); } if (fieldSelector !== undefined) { localVarQueryParameters['fieldSelector'] = ObjectSerializer.serialize(fieldSelector, "string"); } if (labelSelector !== undefined) { localVarQueryParameters['labelSelector'] = ObjectSerializer.serialize(labelSelector, "string"); } if (limit !== undefined) { localVarQueryParameters['limit'] = ObjectSerializer.serialize(limit, "number"); } if (resourceVersion !== undefined) { localVarQueryParameters['resourceVersion'] = ObjectSerializer.serialize(resourceVersion, "string"); } if (timeoutSeconds !== undefined) { localVarQueryParameters['timeoutSeconds'] = ObjectSerializer.serialize(timeoutSeconds, "number"); } if (watch !== undefined) { localVarQueryParameters['watch'] = ObjectSerializer.serialize(watch, "boolean"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'DELETE', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "V1Status"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * delete a ControllerRevision * @param name name of the ControllerRevision * @param namespace object name and auth scope, such as for teams and projects * @param pretty If 'true', then the output is pretty printed. * @param body * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @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. * @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. * @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. * @param {*} [options] Override http request options. */ deleteNamespacedControllerRevision(name, namespace, pretty, body, dryRun, gracePeriodSeconds, orphanDependents, propagationPolicy, options = {}) { const localVarPath = this.basePath + '/apis/apps/v1beta2/namespaces/{namespace}/controllerrevisions/{name}' .replace('{' + 'name' + '}', encodeURIComponent(String(name))) .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling deleteNamespacedControllerRevision.'); } // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling deleteNamespacedControllerRevision.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, "string"); } if (gracePeriodSeconds !== undefined) { localVarQueryParameters['gracePeriodSeconds'] = ObjectSerializer.serialize(gracePeriodSeconds, "number"); } if (orphanDependents !== undefined) { localVarQueryParameters['orphanDependents'] = ObjectSerializer.serialize(orphanDependents, "boolean"); } if (propagationPolicy !== undefined) { localVarQueryParameters['propagationPolicy'] = ObjectSerializer.serialize(propagationPolicy, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'DELETE', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: ObjectSerializer.serialize(body, "V1DeleteOptions") }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "V1Status"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * delete a DaemonSet * @param name name of the DaemonSet * @param namespace object name and auth scope, such as for teams and projects * @param pretty If 'true', then the output is pretty printed. * @param body * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @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. * @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. * @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. * @param {*} [options] Override http request options. */ deleteNamespacedDaemonSet(name, namespace, pretty, body, dryRun, gracePeriodSeconds, orphanDependents, propagationPolicy, options = {}) { const localVarPath = this.basePath + '/apis/apps/v1beta2/namespaces/{namespace}/daemonsets/{name}' .replace('{' + 'name' + '}', encodeURIComponent(String(name))) .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling deleteNamespacedDaemonSet.'); } // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling deleteNamespacedDaemonSet.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, "string"); } if (gracePeriodSeconds !== undefined) { localVarQueryParameters['gracePeriodSeconds'] = ObjectSerializer.serialize(gracePeriodSeconds, "number"); } if (orphanDependents !== undefined) { localVarQueryParameters['orphanDependents'] = ObjectSerializer.serialize(orphanDependents, "boolean"); } if (propagationPolicy !== undefined) { localVarQueryParameters['propagationPolicy'] = ObjectSerializer.serialize(propagationPolicy, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'DELETE', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: ObjectSerializer.serialize(body, "V1DeleteOptions") }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "V1Status"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * delete a Deployment * @param name name of the Deployment * @param namespace object name and auth scope, such as for teams and projects * @param pretty If 'true', then the output is pretty printed. * @param body * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @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. * @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. * @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. * @param {*} [options] Override http request options. */ deleteNamespacedDeployment(name, namespace, pretty, body, dryRun, gracePeriodSeconds, orphanDependents, propagationPolicy, options = {}) { const localVarPath = this.basePath + '/apis/apps/v1beta2/namespaces/{namespace}/deployments/{name}' .replace('{' + 'name' + '}', encodeURIComponent(String(name))) .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling deleteNamespacedDeployment.'); } // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling deleteNamespacedDeployment.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, "string"); } if (gracePeriodSeconds !== undefined) { localVarQueryParameters['gracePeriodSeconds'] = ObjectSerializer.serialize(gracePeriodSeconds, "number"); } if (orphanDependents !== undefined) { localVarQueryParameters['orphanDependents'] = ObjectSerializer.serialize(orphanDependents, "boolean"); } if (propagationPolicy !== undefined) { localVarQueryParameters['propagationPolicy'] = ObjectSerializer.serialize(propagationPolicy, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'DELETE', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: ObjectSerializer.serialize(body, "V1DeleteOptions") }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "V1Status"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * delete a ReplicaSet * @param name name of the ReplicaSet * @param namespace object name and auth scope, such as for teams and projects * @param pretty If 'true', then the output is pretty printed. * @param body * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @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. * @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. * @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. * @param {*} [options] Override http request options. */ deleteNamespacedReplicaSet(name, namespace, pretty, body, dryRun, gracePeriodSeconds, orphanDependents, propagationPolicy, options = {}) { const localVarPath = this.basePath + '/apis/apps/v1beta2/namespaces/{namespace}/replicasets/{name}' .replace('{' + 'name' + '}', encodeURIComponent(String(name))) .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling deleteNamespacedReplicaSet.'); } // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling deleteNamespacedReplicaSet.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, "string"); } if (gracePeriodSeconds !== undefined) { localVarQueryParameters['gracePeriodSeconds'] = ObjectSerializer.serialize(gracePeriodSeconds, "number"); } if (orphanDependents !== undefined) { localVarQueryParameters['orphanDependents'] = ObjectSerializer.serialize(orphanDependents, "boolean"); } if (propagationPolicy !== undefined) { localVarQueryParameters['propagationPolicy'] = ObjectSerializer.serialize(propagationPolicy, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'DELETE', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: ObjectSerializer.serialize(body, "V1DeleteOptions") }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "V1Status"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * delete a StatefulSet * @param name name of the StatefulSet * @param namespace object name and auth scope, such as for teams and projects * @param pretty If 'true', then the output is pretty printed. * @param body * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @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. * @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. * @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. * @param {*} [options] Override http request options. */ deleteNamespacedStatefulSet(name, namespace, pretty, body, dryRun, gracePeriodSeconds, orphanDependents, propagationPolicy, options = {}) { const localVarPath = this.basePath + '/apis/apps/v1beta2/namespaces/{namespace}/statefulsets/{name}' .replace('{' + 'name' + '}', encodeURIComponent(String(name))) .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling deleteNamespacedStatefulSet.'); } // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling deleteNamespacedStatefulSet.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, "string"); } if (gracePeriodSeconds !== undefined) { localVarQueryParameters['gracePeriodSeconds'] = ObjectSerializer.serialize(gracePeriodSeconds, "number"); } if (orphanDependents !== undefined) { localVarQueryParameters['orphanDependents'] = ObjectSerializer.serialize(orphanDependents, "boolean"); } if (propagationPolicy !== undefined) { localVarQueryParameters['propagationPolicy'] = ObjectSerializer.serialize(propagationPolicy, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'DELETE', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: ObjectSerializer.serialize(body, "V1DeleteOptions") }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "V1Status"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * get available resources * @param {*} [options] Override http request options. */ getAPIResources(options = {}) { const localVarPath = this.basePath + '/apis/apps/v1beta2/'; let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'GET', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "V1APIResourceList"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * list or watch objects of kind ControllerRevision * @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. * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything. * @param includeUninitialized If true, partially initialized resources are included in the response. * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything. * @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. * @param pretty If 'true', then the output is pretty printed. * @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. * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. * @param watch Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion. * @param {*} [options] Override http request options. */ listControllerRevisionForAllNamespaces(_continue, fieldSelector, includeUninitialized, labelSelector, limit, pretty, resourceVersion, timeoutSeconds, watch, options = {}) { const localVarPath = this.basePath + '/apis/apps/v1beta2/controllerrevisions'; let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; if (_continue !== undefined) { localVarQueryParameters['continue'] = ObjectSerializer.serialize(_continue, "string"); } if (fieldSelector !== undefined) { localVarQueryParameters['fieldSelector'] = ObjectSerializer.serialize(fieldSelector, "string"); } if (includeUninitialized !== undefined) { localVarQueryParameters['includeUninitialized'] = ObjectSerializer.serialize(includeUninitialized, "boolean"); } if (labelSelector !== undefined) { localVarQueryParameters['labelSelector'] = ObjectSerializer.serialize(labelSelector, "string"); } if (limit !== undefined) { localVarQueryParameters['limit'] = ObjectSerializer.serialize(limit, "number"); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, "string"); } if (resourceVersion !== undefined) { localVarQueryParameters['resourceVersion'] = ObjectSerializer.serialize(resourceVersion, "string"); } if (timeoutSeconds !== undefined) { localVarQueryParameters['timeoutSeconds'] = ObjectSerializer.serialize(timeoutSeconds, "number"); } if (watch !== undefined) { localVarQueryParameters['watch'] = ObjectSerializer.serialize(watch, "boolean"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'GET', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "V1beta2ControllerRevisionList"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * list or watch objects of kind DaemonSet * @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. * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything. * @param includeUninitialized If true, partially initialized resources are included in the response. * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything. * @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. * @param pretty If 'true', then the output is pretty printed. * @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. * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. * @param watch Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion. * @param {*} [options] Override http request options. */ listDaemonSetForAllNamespaces(_continue, fieldSelector, includeUninitialized, labelSelector, limit, pretty, resourceVersion, timeoutSeconds, watch, options = {}) { const localVarPath = this.basePath + '/apis/apps/v1beta2/daemonsets'; let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; if (_continue !== undefined) { localVarQueryParameters['continue'] = ObjectSerializer.serialize(_continue, "string"); } if (fieldSelector !== undefined) { localVarQueryParameters['fieldSelector'] = ObjectSerializer.serialize(fieldSelector, "string"); } if (includeUninitialized !== undefined) { localVarQueryParameters['includeUninitialized'] = ObjectSerializer.serialize(includeUninitialized, "boolean"); } if (labelSelector !== undefined) { localVarQueryParameters['labelSelector'] = ObjectSerializer.serialize(labelSelector, "string"); } if (limit !== undefined) { localVarQueryParameters['limit'] = ObjectSerializer.serialize(limit, "number"); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, "string"); } if (resourceVersion !== undefined) { localVarQueryParameters['resourceVersion'] = ObjectSerializer.serialize(resourceVersion, "string"); } if (timeoutSeconds !== undefined) { localVarQueryParameters['timeoutSeconds'] = ObjectSerializer.serialize(timeoutSeconds, "number"); } if (watch !== undefined) { localVarQueryParameters['watch'] = ObjectSerializer.serialize(watch, "boolean"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'GET', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "V1beta2DaemonSetList"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * list or watch objects of kind Deployment * @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. * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything. * @param includeUninitialized If true, partially initialized resources are included in the response. * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything. * @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. * @param pretty If 'true', then the output is pretty printed. * @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. * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. * @param watch Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion. * @param {*} [options] Override http request options. */ listDeploymentForAllNamespaces(_continue, fieldSelector, includeUninitialized, labelSelector, limit, pretty, resourceVersion, timeoutSeconds, watch, options = {}) { const localVarPath = this.basePath + '/apis/apps/v1beta2/deployments'; let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; if (_continue !== undefined) { localVarQueryParameters['continue'] = ObjectSerializer.serialize(_continue, "string"); } if (fieldSelector !== undefined) { localVarQueryParameters['fieldSelector'] = ObjectSerializer.serialize(fieldSelector, "string"); } if (includeUninitialized !== undefined) { localVarQueryParameters['includeUninitialized'] = ObjectSerializer.serialize(includeUninitialized, "boolean"); } if (labelSelector !== undefined) { localVarQueryParameters['labelSelector'] = ObjectSerializer.serialize(labelSelector, "string"); } if (limit !== undefined) { localVarQueryParameters['limit'] = ObjectSerializer.serialize(limit, "number"); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, "string"); } if (resourceVersion !== undefined) { localVarQueryParameters['resourceVersion'] = ObjectSerializer.serialize(resourceVersion, "string"); } if (timeoutSeconds !== undefined) { localVarQueryParameters['timeoutSeconds'] = ObjectSerializer.serialize(timeoutSeconds, "number"); } if (watch !== undefined) { localVarQueryParameters['watch'] = ObjectSerializer.serialize(watch, "boolean"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'GET', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "V1beta2DeploymentList"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * list or watch objects of kind ControllerRevision * @param namespace object name and auth scope, such as for teams and projects * @param includeUninitialized If true, partially initialized resources are included in the response. * @param pretty If 'true', then the output is pretty printed. * @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. * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything. * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything. * @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. * @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. * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. * @param watch Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion. * @param {*} [options] Override http request options. */ listNamespacedControllerRevision(namespace, includeUninitialized, pretty, _continue, fieldSelector, labelSelector, limit, resourceVersion, timeoutSeconds, watch, options = {}) { const localVarPath = this.basePath + '/apis/apps/v1beta2/namespaces/{namespace}/controllerrevisions' .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling listNamespacedControllerRevision.'); } if (includeUninitialized !== undefined) { localVarQueryParameters['includeUninitialized'] = ObjectSerializer.serialize(includeUninitialized, "boolean"); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, "string"); } if (_continue !== undefined) { localVarQueryParameters['continue'] = ObjectSerializer.serialize(_continue, "string"); } if (fieldSelector !== undefined) { localVarQueryParameters['fieldSelector'] = ObjectSerializer.serialize(fieldSelector, "string"); } if (labelSelector !== undefined) { localVarQueryParameters['labelSelector'] = ObjectSerializer.serialize(labelSelector, "string"); } if (limit !== undefined) { localVarQueryParameters['limit'] = ObjectSerializer.serialize(limit, "number"); } if (resourceVersion !== undefined) { localVarQueryParameters['resourceVersion'] = ObjectSerializer.serialize(resourceVersion, "string"); } if (timeoutSeconds !== undefined) { localVarQueryParameters['timeoutSeconds'] = ObjectSerializer.serialize(timeoutSeconds, "number"); } if (watch !== undefined) { localVarQueryParameters['watch'] = ObjectSerializer.serialize(watch, "boolean"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'GET', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "V1beta2ControllerRevisionList"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * list or watch objects of kind DaemonSet * @param namespace object name and auth scope, such as for teams and projects * @param includeUninitialized If true, partially initialized resources are included in the response. * @param pretty If 'true', then the output is pretty printed. * @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. * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything. * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything. * @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. * @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. * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. * @param watch Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion. * @param {*} [options] Override http request options. */ listNamespacedDaemonSet(namespace, includeUninitialized, pretty, _continue, fieldSelector, labelSelector, limit, resourceVersion, timeoutSeconds, watch, options = {}) { const localVarPath = this.basePath + '/apis/apps/v1beta2/namespaces/{namespace}/daemonsets' .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling listNamespacedDaemonSet.'); } if (includeUninitialized !== undefined) { localVarQueryParameters['includeUninitialized'] = ObjectSerializer.serialize(includeUninitialized, "boolean"); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, "string"); } if (_continue !== undefined) { localVarQueryParameters['continue'] = ObjectSerializer.serialize(_continue, "string"); } if (fieldSelector !== undefined) { localVarQueryParameters['fieldSelector'] = ObjectSerializer.serialize(fieldSelector, "string"); } if (labelSelector !== undefined) { localVarQueryParameters['labelSelector'] = ObjectSerializer.serialize(labelSelector, "string"); } if (limit !== undefined) { localVarQueryParameters['limit'] = ObjectSerializer.serialize(limit, "number"); } if (resourceVersion !== undefined) { localVarQueryParameters['resourceVersion'] = ObjectSerializer.serialize(resourceVersion, "string"); } if (timeoutSeconds !== undefined) { localVarQueryParameters['timeoutSeconds'] = ObjectSerializer.serialize(timeoutSeconds, "number"); } if (watch !== undefined) { localVarQueryParameters['watch'] = ObjectSerializer.serialize(watch, "boolean"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'GET', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "V1beta2DaemonSetList"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * list or watch objects of kind Deployment * @param namespace object name and auth scope, such as for teams and projects * @param includeUninitialized If true, partially initialized resources are included in the response. * @param pretty If 'true', then the output is pretty printed. * @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. * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything. * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything. * @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. * @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. * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. * @param watch Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion. * @param {*} [options] Override http request options. */ listNamespacedDeployment(namespace, includeUninitialized, pretty, _continue, fieldSelector, labelSelector, limit, resourceVersion, timeoutSeconds, watch, options = {}) { const localVarPath = this.basePath + '/apis/apps/v1beta2/namespaces/{namespace}/deployments' .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling listNamespacedDeployment.'); } if (includeUninitialized !== undefined) { localVarQueryParameters['includeUninitialized'] = ObjectSerializer.serialize(includeUninitialized, "boolean"); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, "string"); } if (_continue !== undefined) { localVarQueryParameters['continue'] = ObjectSerializer.serialize(_continue, "string"); } if (fieldSelector !== undefined) { localVarQueryParameters['fieldSelector'] = ObjectSerializer.serialize(fieldSelector, "string"); } if (labelSelector !== undefined) { localVarQueryParameters['labelSelector'] = ObjectSerializer.serialize(labelSelector, "string"); } if (limit !== undefined) { localVarQueryParameters['limit'] = ObjectSerializer.serialize(limit, "number"); } if (resourceVersion !== undefined) { localVarQueryParameters['resourceVersion'] = ObjectSerializer.serialize(resourceVersion, "string"); } if (timeoutSeconds !== undefined) { localVarQueryParameters['timeoutSeconds'] = ObjectSerializer.serialize(timeoutSeconds, "number"); } if (watch !== undefined) { localVarQueryParameters['watch'] = ObjectSerializer.serialize(watch, "boolean"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'GET', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "V1beta2DeploymentList"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * list or watch objects of kind ReplicaSet * @param namespace object name and auth scope, such as for teams and projects * @param includeUninitialized If true, partially initialized resources are included in the response. * @param pretty If 'true', then the output is pretty printed. * @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. * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything. * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything. * @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. * @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. * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. * @param watch Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion. * @param {*} [options] Override http request options. */ listNamespacedReplicaSet(namespace, includeUninitialized, pretty, _continue, fieldSelector, labelSelector, limit, resourceVersion, timeoutSeconds, watch, options = {}) { const localVarPath = this.basePath + '/apis/apps/v1beta2/namespaces/{namespace}/replicasets' .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling listNamespacedReplicaSet.'); } if (includeUninitialized !== undefined) { localVarQueryParameters['includeUninitialized'] = ObjectSerializer.serialize(includeUninitialized, "boolean"); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, "string"); } if (_continue !== undefined) { localVarQueryParameters['continue'] = ObjectSerializer.serialize(_continue, "string"); } if (fieldSelector !== undefined) { localVarQueryParameters['fieldSelector'] = ObjectSerializer.serialize(fieldSelector, "string"); } if (labelSelector !== undefined) { localVarQueryParameters['labelSelector'] = ObjectSerializer.serialize(labelSelector, "string"); } if (limit !== undefined) { localVarQueryParameters['limit'] = ObjectSerializer.serialize(limit, "number"); } if (resourceVersion !== undefined) { localVarQueryParameters['resourceVersion'] = ObjectSerializer.serialize(resourceVersion, "string"); } if (timeoutSeconds !== undefined) { localVarQueryParameters['timeoutSeconds'] = ObjectSerializer.serialize(timeoutSeconds, "number"); } if (watch !== undefined) { localVarQueryParameters['watch'] = ObjectSerializer.serialize(watch, "boolean"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'GET', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "V1beta2ReplicaSetList"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * list or watch objects of kind StatefulSet * @param namespace object name and auth scope, such as for teams and projects * @param includeUninitialized If true, partially initialized resources are included in the response. * @param pretty If 'true', then the output is pretty printed. * @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. * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything. * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything. * @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. * @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. * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. * @param watch Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion. * @param {*} [options] Override http request options. */ listNamespacedStatefulSet(namespace, includeUninitialized, pretty, _continue, fieldSelector, labelSelector, limit, resourceVersion, timeoutSeconds, watch, options = {}) { const localVarPath = this.basePath + '/apis/apps/v1beta2/namespaces/{namespace}/statefulsets' .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling listNamespacedStatefulSet.'); } if (includeUninitialized !== undefined) { localVarQueryParameters['includeUninitialized'] = ObjectSerializer.serialize(includeUninitialized, "boolean"); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, "string"); } if (_continue !== undefined) { localVarQueryParameters['continue'] = ObjectSerializer.serialize(_continue, "string"); } if (fieldSelector !== undefined) { localVarQueryParameters['fieldSelector'] = ObjectSerializer.serialize(fieldSelector, "string"); } if (labelSelector !== undefined) { localVarQueryParameters['labelSelector'] = ObjectSerializer.serialize(labelSelector, "string"); } if (limit !== undefined) { localVarQueryParameters['limit'] = ObjectSerializer.serialize(limit, "number"); } if (resourceVersion !== undefined) { localVarQueryParameters['resourceVersion'] = ObjectSerializer.serialize(resourceVersion, "string"); } if (timeoutSeconds !== undefined) { localVarQueryParameters['timeoutSeconds'] = ObjectSerializer.serialize(timeoutSeconds, "number"); } if (watch !== undefined) { localVarQueryParameters['watch'] = ObjectSerializer.serialize(watch, "boolean"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'GET', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "V1beta2StatefulSetList"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * list or watch objects of kind ReplicaSet * @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. * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything. * @param includeUninitialized If true, partially initialized resources are included in the response. * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything. * @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. * @param pretty If 'true', then the output is pretty printed. * @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. * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. * @param watch Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion. * @param {*} [options] Override http request options. */ listReplicaSetForAllNamespaces(_continue, fieldSelector, includeUninitialized, labelSelector, limit, pretty, resourceVersion, timeoutSeconds, watch, options = {}) { const localVarPath = this.basePath + '/apis/apps/v1beta2/replicasets'; let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; if (_continue !== undefined) { localVarQueryParameters['continue'] = ObjectSerializer.serialize(_continue, "string"); } if (fieldSelector !== undefined) { localVarQueryParameters['fieldSelector'] = ObjectSerializer.serialize(fieldSelector, "string"); } if (includeUninitialized !== undefined) { localVarQueryParameters['includeUninitialized'] = ObjectSerializer.serialize(includeUninitialized, "boolean"); } if (labelSelector !== undefined) { localVarQueryParameters['labelSelector'] = ObjectSerializer.serialize(labelSelector, "string"); } if (limit !== undefined) { localVarQueryParameters['limit'] = ObjectSerializer.serialize(limit, "number"); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, "string"); } if (resourceVersion !== undefined) { localVarQueryParameters['resourceVersion'] = ObjectSerializer.serialize(resourceVersion, "string"); } if (timeoutSeconds !== undefined) { localVarQueryParameters['timeoutSeconds'] = ObjectSerializer.serialize(timeoutSeconds, "number"); } if (watch !== undefined) { localVarQueryParameters['watch'] = ObjectSerializer.serialize(watch, "boolean"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'GET', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "V1beta2ReplicaSetList"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * list or watch objects of kind StatefulSet * @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. * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything. * @param includeUninitialized If true, partially initialized resources are included in the response. * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything. * @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. * @param pretty If 'true', then the output is pretty printed. * @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. * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. * @param watch Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion. * @param {*} [options] Override http request options. */ listStatefulSetForAllNamespaces(_continue, fieldSelector, includeUninitialized, labelSelector, limit, pretty, resourceVersion, timeoutSeconds, watch, options = {}) { const localVarPath = this.basePath + '/apis/apps/v1beta2/statefulsets'; let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; if (_continue !== undefined) { localVarQueryParameters['continue'] = ObjectSerializer.serialize(_continue, "string"); } if (fieldSelector !== undefined) { localVarQueryParameters['fieldSelector'] = ObjectSerializer.serialize(fieldSelector, "string"); } if (includeUninitialized !== undefined) { localVarQueryParameters['includeUninitialized'] = ObjectSerializer.serialize(includeUninitialized, "boolean"); } if (labelSelector !== undefined) { localVarQueryParameters['labelSelector'] = ObjectSerializer.serialize(labelSelector, "string"); } if (limit !== undefined) { localVarQueryParameters['limit'] = ObjectSerializer.serialize(limit, "number"); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, "string"); } if (resourceVersion !== undefined) { localVarQueryParameters['resourceVersion'] = ObjectSerializer.serialize(resourceVersion, "string"); } if (timeoutSeconds !== undefined) { localVarQueryParameters['timeoutSeconds'] = ObjectSerializer.serialize(timeoutSeconds, "number"); } if (watch !== undefined) { localVarQueryParameters['watch'] = ObjectSerializer.serialize(watch, "boolean"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'GET', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "V1beta2StatefulSetList"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * partially update the specified ControllerRevision * @param name name of the ControllerRevision * @param namespace object name and auth scope, such as for teams and projects * @param body * @param pretty If 'true', then the output is pretty printed. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param {*} [options] Override http request options. */ patchNamespacedControllerRevision(name, namespace, body, pretty, dryRun, options = {}) { const localVarPath = this.basePath + '/apis/apps/v1beta2/namespaces/{namespace}/controllerrevisions/{name}' .replace('{' + 'name' + '}', encodeURIComponent(String(name))) .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling patchNamespacedControllerRevision.'); } // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling patchNamespacedControllerRevision.'); } // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling patchNamespacedControllerRevision.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'PATCH', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: ObjectSerializer.serialize(body, "any") }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "V1beta2ControllerRevision"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * partially update the specified DaemonSet * @param name name of the DaemonSet * @param namespace object name and auth scope, such as for teams and projects * @param body * @param pretty If 'true', then the output is pretty printed. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param {*} [options] Override http request options. */ patchNamespacedDaemonSet(name, namespace, body, pretty, dryRun, options = {}) { const localVarPath = this.basePath + '/apis/apps/v1beta2/namespaces/{namespace}/daemonsets/{name}' .replace('{' + 'name' + '}', encodeURIComponent(String(name))) .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling patchNamespacedDaemonSet.'); } // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling patchNamespacedDaemonSet.'); } // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling patchNamespacedDaemonSet.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'PATCH', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: ObjectSerializer.serialize(body, "any") }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "V1beta2DaemonSet"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * partially update status of the specified DaemonSet * @param name name of the DaemonSet * @param namespace object name and auth scope, such as for teams and projects * @param body * @param pretty If 'true', then the output is pretty printed. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param {*} [options] Override http request options. */ patchNamespacedDaemonSetStatus(name, namespace, body, pretty, dryRun, options = {}) { const localVarPath = this.basePath + '/apis/apps/v1beta2/namespaces/{namespace}/daemonsets/{name}/status' .replace('{' + 'name' + '}', encodeURIComponent(String(name))) .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling patchNamespacedDaemonSetStatus.'); } // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling patchNamespacedDaemonSetStatus.'); } // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling patchNamespacedDaemonSetStatus.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'PATCH', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: ObjectSerializer.serialize(body, "any") }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "V1beta2DaemonSet"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * partially update the specified Deployment * @param name name of the Deployment * @param namespace object name and auth scope, such as for teams and projects * @param body * @param pretty If 'true', then the output is pretty printed. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param {*} [options] Override http request options. */ patchNamespacedDeployment(name, namespace, body, pretty, dryRun, options = {}) { const localVarPath = this.basePath + '/apis/apps/v1beta2/namespaces/{namespace}/deployments/{name}' .replace('{' + 'name' + '}', encodeURIComponent(String(name))) .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling patchNamespacedDeployment.'); } // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling patchNamespacedDeployment.'); } // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling patchNamespacedDeployment.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'PATCH', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: ObjectSerializer.serialize(body, "any") }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "V1beta2Deployment"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * partially update scale of the specified Deployment * @param name name of the Scale * @param namespace object name and auth scope, such as for teams and projects * @param body * @param pretty If 'true', then the output is pretty printed. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param {*} [options] Override http request options. */ patchNamespacedDeploymentScale(name, namespace, body, pretty, dryRun, options = {}) { const localVarPath = this.basePath + '/apis/apps/v1beta2/namespaces/{namespace}/deployments/{name}/scale' .replace('{' + 'name' + '}', encodeURIComponent(String(name))) .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling patchNamespacedDeploymentScale.'); } // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling patchNamespacedDeploymentScale.'); } // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling patchNamespacedDeploymentScale.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'PATCH', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: ObjectSerializer.serialize(body, "any") }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "V1beta2Scale"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * partially update status of the specified Deployment * @param name name of the Deployment * @param namespace object name and auth scope, such as for teams and projects * @param body * @param pretty If 'true', then the output is pretty printed. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param {*} [options] Override http request options. */ patchNamespacedDeploymentStatus(name, namespace, body, pretty, dryRun, options = {}) { const localVarPath = this.basePath + '/apis/apps/v1beta2/namespaces/{namespace}/deployments/{name}/status' .replace('{' + 'name' + '}', encodeURIComponent(String(name))) .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling patchNamespacedDeploymentStatus.'); } // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling patchNamespacedDeploymentStatus.'); } // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling patchNamespacedDeploymentStatus.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'PATCH', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: ObjectSerializer.serialize(body, "any") }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "V1beta2Deployment"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * partially update the specified ReplicaSet * @param name name of the ReplicaSet * @param namespace object name and auth scope, such as for teams and projects * @param body * @param pretty If 'true', then the output is pretty printed. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param {*} [options] Override http request options. */ patchNamespacedReplicaSet(name, namespace, body, pretty, dryRun, options = {}) { const localVarPath = this.basePath + '/apis/apps/v1beta2/namespaces/{namespace}/replicasets/{name}' .replace('{' + 'name' + '}', encodeURIComponent(String(name))) .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling patchNamespacedReplicaSet.'); } // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling patchNamespacedReplicaSet.'); } // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling patchNamespacedReplicaSet.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'PATCH', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: ObjectSerializer.serialize(body, "any") }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "V1beta2ReplicaSet"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * partially update scale of the specified ReplicaSet * @param name name of the Scale * @param namespace object name and auth scope, such as for teams and projects * @param body * @param pretty If 'true', then the output is pretty printed. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param {*} [options] Override http request options. */ patchNamespacedReplicaSetScale(name, namespace, body, pretty, dryRun, options = {}) { const localVarPath = this.basePath + '/apis/apps/v1beta2/namespaces/{namespace}/replicasets/{name}/scale' .replace('{' + 'name' + '}', encodeURIComponent(String(name))) .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling patchNamespacedReplicaSetScale.'); } // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling patchNamespacedReplicaSetScale.'); } // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling patchNamespacedReplicaSetScale.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'PATCH', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: ObjectSerializer.serialize(body, "any") }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "V1beta2Scale"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * partially update status of the specified ReplicaSet * @param name name of the ReplicaSet * @param namespace object name and auth scope, such as for teams and projects * @param body * @param pretty If 'true', then the output is pretty printed. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param {*} [options] Override http request options. */ patchNamespacedReplicaSetStatus(name, namespace, body, pretty, dryRun, options = {}) { const localVarPath = this.basePath + '/apis/apps/v1beta2/namespaces/{namespace}/replicasets/{name}/status' .replace('{' + 'name' + '}', encodeURIComponent(String(name))) .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling patchNamespacedReplicaSetStatus.'); } // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling patchNamespacedReplicaSetStatus.'); } // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling patchNamespacedReplicaSetStatus.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'PATCH', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: ObjectSerializer.serialize(body, "any") }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "V1beta2ReplicaSet"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * partially update the specified StatefulSet * @param name name of the StatefulSet * @param namespace object name and auth scope, such as for teams and projects * @param body * @param pretty If 'true', then the output is pretty printed. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param {*} [options] Override http request options. */ patchNamespacedStatefulSet(name, namespace, body, pretty, dryRun, options = {}) { const localVarPath = this.basePath + '/apis/apps/v1beta2/namespaces/{namespace}/statefulsets/{name}' .replace('{' + 'name' + '}', encodeURIComponent(String(name))) .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling patchNamespacedStatefulSet.'); } // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling patchNamespacedStatefulSet.'); } // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling patchNamespacedStatefulSet.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'PATCH', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: ObjectSerializer.serialize(body, "any") }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "V1beta2StatefulSet"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * partially update scale of the specified StatefulSet * @param name name of the Scale * @param namespace object name and auth scope, such as for teams and projects * @param body * @param pretty If 'true', then the output is pretty printed. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param {*} [options] Override http request options. */ patchNamespacedStatefulSetScale(name, namespace, body, pretty, dryRun, options = {}) { const localVarPath = this.basePath + '/apis/apps/v1beta2/namespaces/{namespace}/statefulsets/{name}/scale' .replace('{' + 'name' + '}', encodeURIComponent(String(name))) .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling patchNamespacedStatefulSetScale.'); } // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling patchNamespacedStatefulSetScale.'); } // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling patchNamespacedStatefulSetScale.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'PATCH', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: ObjectSerializer.serialize(body, "any") }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "V1beta2Scale"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * partially update status of the specified StatefulSet * @param name name of the StatefulSet * @param namespace object name and auth scope, such as for teams and projects * @param body * @param pretty If 'true', then the output is pretty printed. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param {*} [options] Override http request options. */ patchNamespacedStatefulSetStatus(name, namespace, body, pretty, dryRun, options = {}) { const localVarPath = this.basePath + '/apis/apps/v1beta2/namespaces/{namespace}/statefulsets/{name}/status' .replace('{' + 'name' + '}', encodeURIComponent(String(name))) .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling patchNamespacedStatefulSetStatus.'); } // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling patchNamespacedStatefulSetStatus.'); } // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling patchNamespacedStatefulSetStatus.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'PATCH', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: ObjectSerializer.serialize(body, "any") }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "V1beta2StatefulSet"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * read the specified ControllerRevision * @param name name of the ControllerRevision * @param namespace object name and auth scope, such as for teams and projects * @param pretty If 'true', then the output is pretty printed. * @param exact Should the export be exact. Exact export maintains cluster-specific fields like 'Namespace'. * @param _export Should this value be exported. Export strips fields that a user can not specify. * @param {*} [options] Override http request options. */ readNamespacedControllerRevision(name, namespace, pretty, exact, _export, options = {}) { const localVarPath = this.basePath + '/apis/apps/v1beta2/namespaces/{namespace}/controllerrevisions/{name}' .replace('{' + 'name' + '}', encodeURIComponent(String(name))) .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling readNamespacedControllerRevision.'); } // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling readNamespacedControllerRevision.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, "string"); } if (exact !== undefined) { localVarQueryParameters['exact'] = ObjectSerializer.serialize(exact, "boolean"); } if (_export !== undefined) { localVarQueryParameters['export'] = ObjectSerializer.serialize(_export, "boolean"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'GET', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "V1beta2ControllerRevision"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * read the specified DaemonSet * @param name name of the DaemonSet * @param namespace object name and auth scope, such as for teams and projects * @param pretty If 'true', then the output is pretty printed. * @param exact Should the export be exact. Exact export maintains cluster-specific fields like 'Namespace'. * @param _export Should this value be exported. Export strips fields that a user can not specify. * @param {*} [options] Override http request options. */ readNamespacedDaemonSet(name, namespace, pretty, exact, _export, options = {}) { const localVarPath = this.basePath + '/apis/apps/v1beta2/namespaces/{namespace}/daemonsets/{name}' .replace('{' + 'name' + '}', encodeURIComponent(String(name))) .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling readNamespacedDaemonSet.'); } // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling readNamespacedDaemonSet.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, "string"); } if (exact !== undefined) { localVarQueryParameters['exact'] = ObjectSerializer.serialize(exact, "boolean"); } if (_export !== undefined) { localVarQueryParameters['export'] = ObjectSerializer.serialize(_export, "boolean"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'GET', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "V1beta2DaemonSet"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * read status of the specified DaemonSet * @param name name of the DaemonSet * @param namespace object name and auth scope, such as for teams and projects * @param pretty If 'true', then the output is pretty printed. * @param {*} [options] Override http request options. */ readNamespacedDaemonSetStatus(name, namespace, pretty, options = {}) { const localVarPath = this.basePath + '/apis/apps/v1beta2/namespaces/{namespace}/daemonsets/{name}/status' .replace('{' + 'name' + '}', encodeURIComponent(String(name))) .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling readNamespacedDaemonSetStatus.'); } // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling readNamespacedDaemonSetStatus.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'GET', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "V1beta2DaemonSet"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * read the specified Deployment * @param name name of the Deployment * @param namespace object name and auth scope, such as for teams and projects * @param pretty If 'true', then the output is pretty printed. * @param exact Should the export be exact. Exact export maintains cluster-specific fields like 'Namespace'. * @param _export Should this value be exported. Export strips fields that a user can not specify. * @param {*} [options] Override http request options. */ readNamespacedDeployment(name, namespace, pretty, exact, _export, options = {}) { const localVarPath = this.basePath + '/apis/apps/v1beta2/namespaces/{namespace}/deployments/{name}' .replace('{' + 'name' + '}', encodeURIComponent(String(name))) .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling readNamespacedDeployment.'); } // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling readNamespacedDeployment.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, "string"); } if (exact !== undefined) { localVarQueryParameters['exact'] = ObjectSerializer.serialize(exact, "boolean"); } if (_export !== undefined) { localVarQueryParameters['export'] = ObjectSerializer.serialize(_export, "boolean"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'GET', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "V1beta2Deployment"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * read scale of the specified Deployment * @param name name of the Scale * @param namespace object name and auth scope, such as for teams and projects * @param pretty If 'true', then the output is pretty printed. * @param {*} [options] Override http request options. */ readNamespacedDeploymentScale(name, namespace, pretty, options = {}) { const localVarPath = this.basePath + '/apis/apps/v1beta2/namespaces/{namespace}/deployments/{name}/scale' .replace('{' + 'name' + '}', encodeURIComponent(String(name))) .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling readNamespacedDeploymentScale.'); } // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling readNamespacedDeploymentScale.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'GET', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "V1beta2Scale"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * read status of the specified Deployment * @param name name of the Deployment * @param namespace object name and auth scope, such as for teams and projects * @param pretty If 'true', then the output is pretty printed. * @param {*} [options] Override http request options. */ readNamespacedDeploymentStatus(name, namespace, pretty, options = {}) { const localVarPath = this.basePath + '/apis/apps/v1beta2/namespaces/{namespace}/deployments/{name}/status' .replace('{' + 'name' + '}', encodeURIComponent(String(name))) .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling readNamespacedDeploymentStatus.'); } // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling readNamespacedDeploymentStatus.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'GET', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "V1beta2Deployment"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * read the specified ReplicaSet * @param name name of the ReplicaSet * @param namespace object name and auth scope, such as for teams and projects * @param pretty If 'true', then the output is pretty printed. * @param exact Should the export be exact. Exact export maintains cluster-specific fields like 'Namespace'. * @param _export Should this value be exported. Export strips fields that a user can not specify. * @param {*} [options] Override http request options. */ readNamespacedReplicaSet(name, namespace, pretty, exact, _export, options = {}) { const localVarPath = this.basePath + '/apis/apps/v1beta2/namespaces/{namespace}/replicasets/{name}' .replace('{' + 'name' + '}', encodeURIComponent(String(name))) .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling readNamespacedReplicaSet.'); } // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling readNamespacedReplicaSet.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, "string"); } if (exact !== undefined) { localVarQueryParameters['exact'] = ObjectSerializer.serialize(exact, "boolean"); } if (_export !== undefined) { localVarQueryParameters['export'] = ObjectSerializer.serialize(_export, "boolean"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'GET', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "V1beta2ReplicaSet"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * read scale of the specified ReplicaSet * @param name name of the Scale * @param namespace object name and auth scope, such as for teams and projects * @param pretty If 'true', then the output is pretty printed. * @param {*} [options] Override http request options. */ readNamespacedReplicaSetScale(name, namespace, pretty, options = {}) { const localVarPath = this.basePath + '/apis/apps/v1beta2/namespaces/{namespace}/replicasets/{name}/scale' .replace('{' + 'name' + '}', encodeURIComponent(String(name))) .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling readNamespacedReplicaSetScale.'); } // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling readNamespacedReplicaSetScale.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'GET', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "V1beta2Scale"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * read status of the specified ReplicaSet * @param name name of the ReplicaSet * @param namespace object name and auth scope, such as for teams and projects * @param pretty If 'true', then the output is pretty printed. * @param {*} [options] Override http request options. */ readNamespacedReplicaSetStatus(name, namespace, pretty, options = {}) { const localVarPath = this.basePath + '/apis/apps/v1beta2/namespaces/{namespace}/replicasets/{name}/status' .replace('{' + 'name' + '}', encodeURIComponent(String(name))) .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling readNamespacedReplicaSetStatus.'); } // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling readNamespacedReplicaSetStatus.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'GET', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "V1beta2ReplicaSet"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * read the specified StatefulSet * @param name name of the StatefulSet * @param namespace object name and auth scope, such as for teams and projects * @param pretty If 'true', then the output is pretty printed. * @param exact Should the export be exact. Exact export maintains cluster-specific fields like 'Namespace'. * @param _export Should this value be exported. Export strips fields that a user can not specify. * @param {*} [options] Override http request options. */ readNamespacedStatefulSet(name, namespace, pretty, exact, _export, options = {}) { const localVarPath = this.basePath + '/apis/apps/v1beta2/namespaces/{namespace}/statefulsets/{name}' .replace('{' + 'name' + '}', encodeURIComponent(String(name))) .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling readNamespacedStatefulSet.'); } // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling readNamespacedStatefulSet.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, "string"); } if (exact !== undefined) { localVarQueryParameters['exact'] = ObjectSerializer.serialize(exact, "boolean"); } if (_export !== undefined) { localVarQueryParameters['export'] = ObjectSerializer.serialize(_export, "boolean"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'GET', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "V1beta2StatefulSet"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * read scale of the specified StatefulSet * @param name name of the Scale * @param namespace object name and auth scope, such as for teams and projects * @param pretty If 'true', then the output is pretty printed. * @param {*} [options] Override http request options. */ readNamespacedStatefulSetScale(name, namespace, pretty, options = {}) { const localVarPath = this.basePath + '/apis/apps/v1beta2/namespaces/{namespace}/statefulsets/{name}/scale' .replace('{' + 'name' + '}', encodeURIComponent(String(name))) .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling readNamespacedStatefulSetScale.'); } // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling readNamespacedStatefulSetScale.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'GET', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "V1beta2Scale"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * read status of the specified StatefulSet * @param name name of the StatefulSet * @param namespace object name and auth scope, such as for teams and projects * @param pretty If 'true', then the output is pretty printed. * @param {*} [options] Override http request options. */ readNamespacedStatefulSetStatus(name, namespace, pretty, options = {}) { const localVarPath = this.basePath + '/apis/apps/v1beta2/namespaces/{namespace}/statefulsets/{name}/status' .replace('{' + 'name' + '}', encodeURIComponent(String(name))) .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling readNamespacedStatefulSetStatus.'); } // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling readNamespacedStatefulSetStatus.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'GET', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "V1beta2StatefulSet"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * replace the specified ControllerRevision * @param name name of the ControllerRevision * @param namespace object name and auth scope, such as for teams and projects * @param body * @param pretty If 'true', then the output is pretty printed. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param {*} [options] Override http request options. */ replaceNamespacedControllerRevision(name, namespace, body, pretty, dryRun, options = {}) { const localVarPath = this.basePath + '/apis/apps/v1beta2/namespaces/{namespace}/controllerrevisions/{name}' .replace('{' + 'name' + '}', encodeURIComponent(String(name))) .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling replaceNamespacedControllerRevision.'); } // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling replaceNamespacedControllerRevision.'); } // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling replaceNamespacedControllerRevision.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'PUT', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: ObjectSerializer.serialize(body, "V1beta2ControllerRevision") }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "V1beta2ControllerRevision"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * replace the specified DaemonSet * @param name name of the DaemonSet * @param namespace object name and auth scope, such as for teams and projects * @param body * @param pretty If 'true', then the output is pretty printed. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param {*} [options] Override http request options. */ replaceNamespacedDaemonSet(name, namespace, body, pretty, dryRun, options = {}) { const localVarPath = this.basePath + '/apis/apps/v1beta2/namespaces/{namespace}/daemonsets/{name}' .replace('{' + 'name' + '}', encodeURIComponent(String(name))) .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling replaceNamespacedDaemonSet.'); } // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling replaceNamespacedDaemonSet.'); } // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling replaceNamespacedDaemonSet.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'PUT', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: ObjectSerializer.serialize(body, "V1beta2DaemonSet") }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "V1beta2DaemonSet"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * replace status of the specified DaemonSet * @param name name of the DaemonSet * @param namespace object name and auth scope, such as for teams and projects * @param body * @param pretty If 'true', then the output is pretty printed. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param {*} [options] Override http request options. */ replaceNamespacedDaemonSetStatus(name, namespace, body, pretty, dryRun, options = {}) { const localVarPath = this.basePath + '/apis/apps/v1beta2/namespaces/{namespace}/daemonsets/{name}/status' .replace('{' + 'name' + '}', encodeURIComponent(String(name))) .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling replaceNamespacedDaemonSetStatus.'); } // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling replaceNamespacedDaemonSetStatus.'); } // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling replaceNamespacedDaemonSetStatus.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'PUT', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: ObjectSerializer.serialize(body, "V1beta2DaemonSet") }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "V1beta2DaemonSet"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * replace the specified Deployment * @param name name of the Deployment * @param namespace object name and auth scope, such as for teams and projects * @param body * @param pretty If 'true', then the output is pretty printed. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param {*} [options] Override http request options. */ replaceNamespacedDeployment(name, namespace, body, pretty, dryRun, options = {}) { const localVarPath = this.basePath + '/apis/apps/v1beta2/namespaces/{namespace}/deployments/{name}' .replace('{' + 'name' + '}', encodeURIComponent(String(name))) .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling replaceNamespacedDeployment.'); } // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling replaceNamespacedDeployment.'); } // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling replaceNamespacedDeployment.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'PUT', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: ObjectSerializer.serialize(body, "V1beta2Deployment") }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "V1beta2Deployment"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * replace scale of the specified Deployment * @param name name of the Scale * @param namespace object name and auth scope, such as for teams and projects * @param body * @param pretty If 'true', then the output is pretty printed. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param {*} [options] Override http request options. */ replaceNamespacedDeploymentScale(name, namespace, body, pretty, dryRun, options = {}) { const localVarPath = this.basePath + '/apis/apps/v1beta2/namespaces/{namespace}/deployments/{name}/scale' .replace('{' + 'name' + '}', encodeURIComponent(String(name))) .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling replaceNamespacedDeploymentScale.'); } // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling replaceNamespacedDeploymentScale.'); } // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling replaceNamespacedDeploymentScale.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'PUT', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: ObjectSerializer.serialize(body, "V1beta2Scale") }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "V1beta2Scale"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * replace status of the specified Deployment * @param name name of the Deployment * @param namespace object name and auth scope, such as for teams and projects * @param body * @param pretty If 'true', then the output is pretty printed. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param {*} [options] Override http request options. */ replaceNamespacedDeploymentStatus(name, namespace, body, pretty, dryRun, options = {}) { const localVarPath = this.basePath + '/apis/apps/v1beta2/namespaces/{namespace}/deployments/{name}/status' .replace('{' + 'name' + '}', encodeURIComponent(String(name))) .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling replaceNamespacedDeploymentStatus.'); } // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling replaceNamespacedDeploymentStatus.'); } // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling replaceNamespacedDeploymentStatus.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'PUT', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: ObjectSerializer.serialize(body, "V1beta2Deployment") }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "V1beta2Deployment"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * replace the specified ReplicaSet * @param name name of the ReplicaSet * @param namespace object name and auth scope, such as for teams and projects * @param body * @param pretty If 'true', then the output is pretty printed. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param {*} [options] Override http request options. */ replaceNamespacedReplicaSet(name, namespace, body, pretty, dryRun, options = {}) { const localVarPath = this.basePath + '/apis/apps/v1beta2/namespaces/{namespace}/replicasets/{name}' .replace('{' + 'name' + '}', encodeURIComponent(String(name))) .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling replaceNamespacedReplicaSet.'); } // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling replaceNamespacedReplicaSet.'); } // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling replaceNamespacedReplicaSet.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'PUT', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: ObjectSerializer.serialize(body, "V1beta2ReplicaSet") }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "V1beta2ReplicaSet"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * replace scale of the specified ReplicaSet * @param name name of the Scale * @param namespace object name and auth scope, such as for teams and projects * @param body * @param pretty If 'true', then the output is pretty printed. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param {*} [options] Override http request options. */ replaceNamespacedReplicaSetScale(name, namespace, body, pretty, dryRun, options = {}) { const localVarPath = this.basePath + '/apis/apps/v1beta2/namespaces/{namespace}/replicasets/{name}/scale' .replace('{' + 'name' + '}', encodeURIComponent(String(name))) .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling replaceNamespacedReplicaSetScale.'); } // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling replaceNamespacedReplicaSetScale.'); } // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling replaceNamespacedReplicaSetScale.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'PUT', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: ObjectSerializer.serialize(body, "V1beta2Scale") }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "V1beta2Scale"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * replace status of the specified ReplicaSet * @param name name of the ReplicaSet * @param namespace object name and auth scope, such as for teams and projects * @param body * @param pretty If 'true', then the output is pretty printed. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param {*} [options] Override http request options. */ replaceNamespacedReplicaSetStatus(name, namespace, body, pretty, dryRun, options = {}) { const localVarPath = this.basePath + '/apis/apps/v1beta2/namespaces/{namespace}/replicasets/{name}/status' .replace('{' + 'name' + '}', encodeURIComponent(String(name))) .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling replaceNamespacedReplicaSetStatus.'); } // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling replaceNamespacedReplicaSetStatus.'); } // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling replaceNamespacedReplicaSetStatus.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'PUT', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: ObjectSerializer.serialize(body, "V1beta2ReplicaSet") }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "V1beta2ReplicaSet"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * replace the specified StatefulSet * @param name name of the StatefulSet * @param namespace object name and auth scope, such as for teams and projects * @param body * @param pretty If 'true', then the output is pretty printed. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param {*} [options] Override http request options. */ replaceNamespacedStatefulSet(name, namespace, body, pretty, dryRun, options = {}) { const localVarPath = this.basePath + '/apis/apps/v1beta2/namespaces/{namespace}/statefulsets/{name}' .replace('{' + 'name' + '}', encodeURIComponent(String(name))) .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling replaceNamespacedStatefulSet.'); } // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling replaceNamespacedStatefulSet.'); } // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling replaceNamespacedStatefulSet.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'PUT', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: ObjectSerializer.serialize(body, "V1beta2StatefulSet") }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "V1beta2StatefulSet"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * replace scale of the specified StatefulSet * @param name name of the Scale * @param namespace object name and auth scope, such as for teams and projects * @param body * @param pretty If 'true', then the output is pretty printed. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param {*} [options] Override http request options. */ replaceNamespacedStatefulSetScale(name, namespace, body, pretty, dryRun, options = {}) { const localVarPath = this.basePath + '/apis/apps/v1beta2/namespaces/{namespace}/statefulsets/{name}/scale' .replace('{' + 'name' + '}', encodeURIComponent(String(name))) .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling replaceNamespacedStatefulSetScale.'); } // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling replaceNamespacedStatefulSetScale.'); } // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling replaceNamespacedStatefulSetScale.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'PUT', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: ObjectSerializer.serialize(body, "V1beta2Scale") }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "V1beta2Scale"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * replace status of the specified StatefulSet * @param name name of the StatefulSet * @param namespace object name and auth scope, such as for teams and projects * @param body * @param pretty If 'true', then the output is pretty printed. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param {*} [options] Override http request options. */ replaceNamespacedStatefulSetStatus(name, namespace, body, pretty, dryRun, options = {}) { const localVarPath = this.basePath + '/apis/apps/v1beta2/namespaces/{namespace}/statefulsets/{name}/status' .replace('{' + 'name' + '}', encodeURIComponent(String(name))) .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling replaceNamespacedStatefulSetStatus.'); } // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling replaceNamespacedStatefulSetStatus.'); } // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling replaceNamespacedStatefulSetStatus.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'PUT', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: ObjectSerializer.serialize(body, "V1beta2StatefulSet") }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "V1beta2StatefulSet"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } } exports.AppsV1beta2Api = AppsV1beta2Api; var AuditregistrationApiApiKeys; (function (AuditregistrationApiApiKeys) { AuditregistrationApiApiKeys[AuditregistrationApiApiKeys["BearerToken"] = 0] = "BearerToken"; })(AuditregistrationApiApiKeys = exports.AuditregistrationApiApiKeys || (exports.AuditregistrationApiApiKeys = {})); class AuditregistrationApi { constructor(basePathOrUsername, password, basePath) { this._basePath = defaultBasePath; this.defaultHeaders = {}; this._useQuerystring = false; this.authentications = { 'default': new VoidAuth(), 'BearerToken': new ApiKeyAuth('header', 'authorization'), }; if (password) { if (basePath) { this.basePath = basePath; } } else { if (basePathOrUsername) { this.basePath = basePathOrUsername; } } } set useQuerystring(value) { this._useQuerystring = value; } set basePath(basePath) { this._basePath = basePath; } get basePath() { return this._basePath; } setDefaultAuthentication(auth) { this.authentications.default = auth; } setApiKey(key, value) { this.authentications[AuditregistrationApiApiKeys[key]].apiKey = value; } /** * get information of a group * @param {*} [options] Override http request options. */ getAPIGroup(options = {}) { const localVarPath = this.basePath + '/apis/auditregistration.k8s.io/'; let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'GET', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "V1APIGroup"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } } exports.AuditregistrationApi = AuditregistrationApi; var AuditregistrationV1alpha1ApiApiKeys; (function (AuditregistrationV1alpha1ApiApiKeys) { AuditregistrationV1alpha1ApiApiKeys[AuditregistrationV1alpha1ApiApiKeys["BearerToken"] = 0] = "BearerToken"; })(AuditregistrationV1alpha1ApiApiKeys = exports.AuditregistrationV1alpha1ApiApiKeys || (exports.AuditregistrationV1alpha1ApiApiKeys = {})); class AuditregistrationV1alpha1Api { constructor(basePathOrUsername, password, basePath) { this._basePath = defaultBasePath; this.defaultHeaders = {}; this._useQuerystring = false; this.authentications = { 'default': new VoidAuth(), 'BearerToken': new ApiKeyAuth('header', 'authorization'), }; if (password) { if (basePath) { this.basePath = basePath; } } else { if (basePathOrUsername) { this.basePath = basePathOrUsername; } } } set useQuerystring(value) { this._useQuerystring = value; } set basePath(basePath) { this._basePath = basePath; } get basePath() { return this._basePath; } setDefaultAuthentication(auth) { this.authentications.default = auth; } setApiKey(key, value) { this.authentications[AuditregistrationV1alpha1ApiApiKeys[key]].apiKey = value; } /** * create an AuditSink * @param body * @param includeUninitialized If true, partially initialized resources are included in the response. * @param pretty If 'true', then the output is pretty printed. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param {*} [options] Override http request options. */ createAuditSink(body, includeUninitialized, pretty, dryRun, options = {}) { const localVarPath = this.basePath + '/apis/auditregistration.k8s.io/v1alpha1/auditsinks'; let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling createAuditSink.'); } if (includeUninitialized !== undefined) { localVarQueryParameters['includeUninitialized'] = ObjectSerializer.serialize(includeUninitialized, "boolean"); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'POST', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: ObjectSerializer.serialize(body, "V1alpha1AuditSink") }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "V1alpha1AuditSink"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * delete an AuditSink * @param name name of the AuditSink * @param pretty If 'true', then the output is pretty printed. * @param body * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @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. * @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. * @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. * @param {*} [options] Override http request options. */ deleteAuditSink(name, pretty, body, dryRun, gracePeriodSeconds, orphanDependents, propagationPolicy, options = {}) { const localVarPath = this.basePath + '/apis/auditregistration.k8s.io/v1alpha1/auditsinks/{name}' .replace('{' + 'name' + '}', encodeURIComponent(String(name))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling deleteAuditSink.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, "string"); } if (gracePeriodSeconds !== undefined) { localVarQueryParameters['gracePeriodSeconds'] = ObjectSerializer.serialize(gracePeriodSeconds, "number"); } if (orphanDependents !== undefined) { localVarQueryParameters['orphanDependents'] = ObjectSerializer.serialize(orphanDependents, "boolean"); } if (propagationPolicy !== undefined) { localVarQueryParameters['propagationPolicy'] = ObjectSerializer.serialize(propagationPolicy, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'DELETE', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: ObjectSerializer.serialize(body, "V1DeleteOptions") }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "V1Status"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * delete collection of AuditSink * @param includeUninitialized If true, partially initialized resources are included in the response. * @param pretty If 'true', then the output is pretty printed. * @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. * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything. * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything. * @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. * @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. * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. * @param watch Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion. * @param {*} [options] Override http request options. */ deleteCollectionAuditSink(includeUninitialized, pretty, _continue, fieldSelector, labelSelector, limit, resourceVersion, timeoutSeconds, watch, options = {}) { const localVarPath = this.basePath + '/apis/auditregistration.k8s.io/v1alpha1/auditsinks'; let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; if (includeUninitialized !== undefined) { localVarQueryParameters['includeUninitialized'] = ObjectSerializer.serialize(includeUninitialized, "boolean"); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, "string"); } if (_continue !== undefined) { localVarQueryParameters['continue'] = ObjectSerializer.serialize(_continue, "string"); } if (fieldSelector !== undefined) { localVarQueryParameters['fieldSelector'] = ObjectSerializer.serialize(fieldSelector, "string"); } if (labelSelector !== undefined) { localVarQueryParameters['labelSelector'] = ObjectSerializer.serialize(labelSelector, "string"); } if (limit !== undefined) { localVarQueryParameters['limit'] = ObjectSerializer.serialize(limit, "number"); } if (resourceVersion !== undefined) { localVarQueryParameters['resourceVersion'] = ObjectSerializer.serialize(resourceVersion, "string"); } if (timeoutSeconds !== undefined) { localVarQueryParameters['timeoutSeconds'] = ObjectSerializer.serialize(timeoutSeconds, "number"); } if (watch !== undefined) { localVarQueryParameters['watch'] = ObjectSerializer.serialize(watch, "boolean"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'DELETE', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "V1Status"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * get available resources * @param {*} [options] Override http request options. */ getAPIResources(options = {}) { const localVarPath = this.basePath + '/apis/auditregistration.k8s.io/v1alpha1/'; let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'GET', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "V1APIResourceList"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * list or watch objects of kind AuditSink * @param includeUninitialized If true, partially initialized resources are included in the response. * @param pretty If 'true', then the output is pretty printed. * @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. * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything. * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything. * @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. * @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. * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. * @param watch Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion. * @param {*} [options] Override http request options. */ listAuditSink(includeUninitialized, pretty, _continue, fieldSelector, labelSelector, limit, resourceVersion, timeoutSeconds, watch, options = {}) { const localVarPath = this.basePath + '/apis/auditregistration.k8s.io/v1alpha1/auditsinks'; let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; if (includeUninitialized !== undefined) { localVarQueryParameters['includeUninitialized'] = ObjectSerializer.serialize(includeUninitialized, "boolean"); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, "string"); } if (_continue !== undefined) { localVarQueryParameters['continue'] = ObjectSerializer.serialize(_continue, "string"); } if (fieldSelector !== undefined) { localVarQueryParameters['fieldSelector'] = ObjectSerializer.serialize(fieldSelector, "string"); } if (labelSelector !== undefined) { localVarQueryParameters['labelSelector'] = ObjectSerializer.serialize(labelSelector, "string"); } if (limit !== undefined) { localVarQueryParameters['limit'] = ObjectSerializer.serialize(limit, "number"); } if (resourceVersion !== undefined) { localVarQueryParameters['resourceVersion'] = ObjectSerializer.serialize(resourceVersion, "string"); } if (timeoutSeconds !== undefined) { localVarQueryParameters['timeoutSeconds'] = ObjectSerializer.serialize(timeoutSeconds, "number"); } if (watch !== undefined) { localVarQueryParameters['watch'] = ObjectSerializer.serialize(watch, "boolean"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'GET', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "V1alpha1AuditSinkList"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * partially update the specified AuditSink * @param name name of the AuditSink * @param body * @param pretty If 'true', then the output is pretty printed. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param {*} [options] Override http request options. */ patchAuditSink(name, body, pretty, dryRun, options = {}) { const localVarPath = this.basePath + '/apis/auditregistration.k8s.io/v1alpha1/auditsinks/{name}' .replace('{' + 'name' + '}', encodeURIComponent(String(name))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling patchAuditSink.'); } // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling patchAuditSink.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'PATCH', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: ObjectSerializer.serialize(body, "any") }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "V1alpha1AuditSink"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * read the specified AuditSink * @param name name of the AuditSink * @param pretty If 'true', then the output is pretty printed. * @param exact Should the export be exact. Exact export maintains cluster-specific fields like 'Namespace'. * @param _export Should this value be exported. Export strips fields that a user can not specify. * @param {*} [options] Override http request options. */ readAuditSink(name, pretty, exact, _export, options = {}) { const localVarPath = this.basePath + '/apis/auditregistration.k8s.io/v1alpha1/auditsinks/{name}' .replace('{' + 'name' + '}', encodeURIComponent(String(name))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling readAuditSink.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, "string"); } if (exact !== undefined) { localVarQueryParameters['exact'] = ObjectSerializer.serialize(exact, "boolean"); } if (_export !== undefined) { localVarQueryParameters['export'] = ObjectSerializer.serialize(_export, "boolean"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'GET', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "V1alpha1AuditSink"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * replace the specified AuditSink * @param name name of the AuditSink * @param body * @param pretty If 'true', then the output is pretty printed. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param {*} [options] Override http request options. */ replaceAuditSink(name, body, pretty, dryRun, options = {}) { const localVarPath = this.basePath + '/apis/auditregistration.k8s.io/v1alpha1/auditsinks/{name}' .replace('{' + 'name' + '}', encodeURIComponent(String(name))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling replaceAuditSink.'); } // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling replaceAuditSink.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'PUT', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: ObjectSerializer.serialize(body, "V1alpha1AuditSink") }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "V1alpha1AuditSink"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } } exports.AuditregistrationV1alpha1Api = AuditregistrationV1alpha1Api; var AuthenticationApiApiKeys; (function (AuthenticationApiApiKeys) { AuthenticationApiApiKeys[AuthenticationApiApiKeys["BearerToken"] = 0] = "BearerToken"; })(AuthenticationApiApiKeys = exports.AuthenticationApiApiKeys || (exports.AuthenticationApiApiKeys = {})); class AuthenticationApi { constructor(basePathOrUsername, password, basePath) { this._basePath = defaultBasePath; this.defaultHeaders = {}; this._useQuerystring = false; this.authentications = { 'default': new VoidAuth(), 'BearerToken': new ApiKeyAuth('header', 'authorization'), }; if (password) { if (basePath) { this.basePath = basePath; } } else { if (basePathOrUsername) { this.basePath = basePathOrUsername; } } } set useQuerystring(value) { this._useQuerystring = value; } set basePath(basePath) { this._basePath = basePath; } get basePath() { return this._basePath; } setDefaultAuthentication(auth) { this.authentications.default = auth; } setApiKey(key, value) { this.authentications[AuthenticationApiApiKeys[key]].apiKey = value; } /** * get information of a group * @param {*} [options] Override http request options. */ getAPIGroup(options = {}) { const localVarPath = this.basePath + '/apis/authentication.k8s.io/'; let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'GET', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "V1APIGroup"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } } exports.AuthenticationApi = AuthenticationApi; var AuthenticationV1ApiApiKeys; (function (AuthenticationV1ApiApiKeys) { AuthenticationV1ApiApiKeys[AuthenticationV1ApiApiKeys["BearerToken"] = 0] = "BearerToken"; })(AuthenticationV1ApiApiKeys = exports.AuthenticationV1ApiApiKeys || (exports.AuthenticationV1ApiApiKeys = {})); class AuthenticationV1Api { constructor(basePathOrUsername, password, basePath) { this._basePath = defaultBasePath; this.defaultHeaders = {}; this._useQuerystring = false; this.authentications = { 'default': new VoidAuth(), 'BearerToken': new ApiKeyAuth('header', 'authorization'), }; if (password) { if (basePath) { this.basePath = basePath; } } else { if (basePathOrUsername) { this.basePath = basePathOrUsername; } } } set useQuerystring(value) { this._useQuerystring = value; } set basePath(basePath) { this._basePath = basePath; } get basePath() { return this._basePath; } setDefaultAuthentication(auth) { this.authentications.default = auth; } setApiKey(key, value) { this.authentications[AuthenticationV1ApiApiKeys[key]].apiKey = value; } /** * create a TokenReview * @param body * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param includeUninitialized If IncludeUninitialized is specified, the object may be returned without completing initialization. * @param pretty If 'true', then the output is pretty printed. * @param {*} [options] Override http request options. */ createTokenReview(body, dryRun, includeUninitialized, pretty, options = {}) { const localVarPath = this.basePath + '/apis/authentication.k8s.io/v1/tokenreviews'; let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling createTokenReview.'); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, "string"); } if (includeUninitialized !== undefined) { localVarQueryParameters['includeUninitialized'] = ObjectSerializer.serialize(includeUninitialized, "boolean"); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'POST', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: ObjectSerializer.serialize(body, "V1TokenReview") }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "V1TokenReview"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * get available resources * @param {*} [options] Override http request options. */ getAPIResources(options = {}) { const localVarPath = this.basePath + '/apis/authentication.k8s.io/v1/'; let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'GET', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "V1APIResourceList"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } } exports.AuthenticationV1Api = AuthenticationV1Api; var AuthenticationV1beta1ApiApiKeys; (function (AuthenticationV1beta1ApiApiKeys) { AuthenticationV1beta1ApiApiKeys[AuthenticationV1beta1ApiApiKeys["BearerToken"] = 0] = "BearerToken"; })(AuthenticationV1beta1ApiApiKeys = exports.AuthenticationV1beta1ApiApiKeys || (exports.AuthenticationV1beta1ApiApiKeys = {})); class AuthenticationV1beta1Api { constructor(basePathOrUsername, password, basePath) { this._basePath = defaultBasePath; this.defaultHeaders = {}; this._useQuerystring = false; this.authentications = { 'default': new VoidAuth(), 'BearerToken': new ApiKeyAuth('header', 'authorization'), }; if (password) { if (basePath) { this.basePath = basePath; } } else { if (basePathOrUsername) { this.basePath = basePathOrUsername; } } } set useQuerystring(value) { this._useQuerystring = value; } set basePath(basePath) { this._basePath = basePath; } get basePath() { return this._basePath; } setDefaultAuthentication(auth) { this.authentications.default = auth; } setApiKey(key, value) { this.authentications[AuthenticationV1beta1ApiApiKeys[key]].apiKey = value; } /** * create a TokenReview * @param body * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param includeUninitialized If IncludeUninitialized is specified, the object may be returned without completing initialization. * @param pretty If 'true', then the output is pretty printed. * @param {*} [options] Override http request options. */ createTokenReview(body, dryRun, includeUninitialized, pretty, options = {}) { const localVarPath = this.basePath + '/apis/authentication.k8s.io/v1beta1/tokenreviews'; let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling createTokenReview.'); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, "string"); } if (includeUninitialized !== undefined) { localVarQueryParameters['includeUninitialized'] = ObjectSerializer.serialize(includeUninitialized, "boolean"); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'POST', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: ObjectSerializer.serialize(body, "V1beta1TokenReview") }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "V1beta1TokenReview"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * get available resources * @param {*} [options] Override http request options. */ getAPIResources(options = {}) { const localVarPath = this.basePath + '/apis/authentication.k8s.io/v1beta1/'; let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'GET', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "V1APIResourceList"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } } exports.AuthenticationV1beta1Api = AuthenticationV1beta1Api; var AuthorizationApiApiKeys; (function (AuthorizationApiApiKeys) { AuthorizationApiApiKeys[AuthorizationApiApiKeys["BearerToken"] = 0] = "BearerToken"; })(AuthorizationApiApiKeys = exports.AuthorizationApiApiKeys || (exports.AuthorizationApiApiKeys = {})); class AuthorizationApi { constructor(basePathOrUsername, password, basePath) { this._basePath = defaultBasePath; this.defaultHeaders = {}; this._useQuerystring = false; this.authentications = { 'default': new VoidAuth(), 'BearerToken': new ApiKeyAuth('header', 'authorization'), }; if (password) { if (basePath) { this.basePath = basePath; } } else { if (basePathOrUsername) { this.basePath = basePathOrUsername; } } } set useQuerystring(value) { this._useQuerystring = value; } set basePath(basePath) { this._basePath = basePath; } get basePath() { return this._basePath; } setDefaultAuthentication(auth) { this.authentications.default = auth; } setApiKey(key, value) { this.authentications[AuthorizationApiApiKeys[key]].apiKey = value; } /** * get information of a group * @param {*} [options] Override http request options. */ getAPIGroup(options = {}) { const localVarPath = this.basePath + '/apis/authorization.k8s.io/'; let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'GET', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "V1APIGroup"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } } exports.AuthorizationApi = AuthorizationApi; var AuthorizationV1ApiApiKeys; (function (AuthorizationV1ApiApiKeys) { AuthorizationV1ApiApiKeys[AuthorizationV1ApiApiKeys["BearerToken"] = 0] = "BearerToken"; })(AuthorizationV1ApiApiKeys = exports.AuthorizationV1ApiApiKeys || (exports.AuthorizationV1ApiApiKeys = {})); class AuthorizationV1Api { constructor(basePathOrUsername, password, basePath) { this._basePath = defaultBasePath; this.defaultHeaders = {}; this._useQuerystring = false; this.authentications = { 'default': new VoidAuth(), 'BearerToken': new ApiKeyAuth('header', 'authorization'), }; if (password) { if (basePath) { this.basePath = basePath; } } else { if (basePathOrUsername) { this.basePath = basePathOrUsername; } } } set useQuerystring(value) { this._useQuerystring = value; } set basePath(basePath) { this._basePath = basePath; } get basePath() { return this._basePath; } setDefaultAuthentication(auth) { this.authentications.default = auth; } setApiKey(key, value) { this.authentications[AuthorizationV1ApiApiKeys[key]].apiKey = value; } /** * create a LocalSubjectAccessReview * @param namespace object name and auth scope, such as for teams and projects * @param body * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param includeUninitialized If IncludeUninitialized is specified, the object may be returned without completing initialization. * @param pretty If 'true', then the output is pretty printed. * @param {*} [options] Override http request options. */ createNamespacedLocalSubjectAccessReview(namespace, body, dryRun, includeUninitialized, pretty, options = {}) { const localVarPath = this.basePath + '/apis/authorization.k8s.io/v1/namespaces/{namespace}/localsubjectaccessreviews' .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling createNamespacedLocalSubjectAccessReview.'); } // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling createNamespacedLocalSubjectAccessReview.'); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, "string"); } if (includeUninitialized !== undefined) { localVarQueryParameters['includeUninitialized'] = ObjectSerializer.serialize(includeUninitialized, "boolean"); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'POST', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: ObjectSerializer.serialize(body, "V1LocalSubjectAccessReview") }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "V1LocalSubjectAccessReview"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * create a SelfSubjectAccessReview * @param body * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param includeUninitialized If IncludeUninitialized is specified, the object may be returned without completing initialization. * @param pretty If 'true', then the output is pretty printed. * @param {*} [options] Override http request options. */ createSelfSubjectAccessReview(body, dryRun, includeUninitialized, pretty, options = {}) { const localVarPath = this.basePath + '/apis/authorization.k8s.io/v1/selfsubjectaccessreviews'; let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling createSelfSubjectAccessReview.'); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, "string"); } if (includeUninitialized !== undefined) { localVarQueryParameters['includeUninitialized'] = ObjectSerializer.serialize(includeUninitialized, "boolean"); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'POST', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: ObjectSerializer.serialize(body, "V1SelfSubjectAccessReview") }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "V1SelfSubjectAccessReview"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * create a SelfSubjectRulesReview * @param body * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param includeUninitialized If IncludeUninitialized is specified, the object may be returned without completing initialization. * @param pretty If 'true', then the output is pretty printed. * @param {*} [options] Override http request options. */ createSelfSubjectRulesReview(body, dryRun, includeUninitialized, pretty, options = {}) { const localVarPath = this.basePath + '/apis/authorization.k8s.io/v1/selfsubjectrulesreviews'; let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling createSelfSubjectRulesReview.'); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, "string"); } if (includeUninitialized !== undefined) { localVarQueryParameters['includeUninitialized'] = ObjectSerializer.serialize(includeUninitialized, "boolean"); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'POST', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: ObjectSerializer.serialize(body, "V1SelfSubjectRulesReview") }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "V1SelfSubjectRulesReview"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * create a SubjectAccessReview * @param body * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param includeUninitialized If IncludeUninitialized is specified, the object may be returned without completing initialization. * @param pretty If 'true', then the output is pretty printed. * @param {*} [options] Override http request options. */ createSubjectAccessReview(body, dryRun, includeUninitialized, pretty, options = {}) { const localVarPath = this.basePath + '/apis/authorization.k8s.io/v1/subjectaccessreviews'; let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling createSubjectAccessReview.'); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, "string"); } if (includeUninitialized !== undefined) { localVarQueryParameters['includeUninitialized'] = ObjectSerializer.serialize(includeUninitialized, "boolean"); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'POST', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: ObjectSerializer.serialize(body, "V1SubjectAccessReview") }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "V1SubjectAccessReview"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * get available resources * @param {*} [options] Override http request options. */ getAPIResources(options = {}) { const localVarPath = this.basePath + '/apis/authorization.k8s.io/v1/'; let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'GET', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "V1APIResourceList"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } } exports.AuthorizationV1Api = AuthorizationV1Api; var AuthorizationV1beta1ApiApiKeys; (function (AuthorizationV1beta1ApiApiKeys) { AuthorizationV1beta1ApiApiKeys[AuthorizationV1beta1ApiApiKeys["BearerToken"] = 0] = "BearerToken"; })(AuthorizationV1beta1ApiApiKeys = exports.AuthorizationV1beta1ApiApiKeys || (exports.AuthorizationV1beta1ApiApiKeys = {})); class AuthorizationV1beta1Api { constructor(basePathOrUsername, password, basePath) { this._basePath = defaultBasePath; this.defaultHeaders = {}; this._useQuerystring = false; this.authentications = { 'default': new VoidAuth(), 'BearerToken': new ApiKeyAuth('header', 'authorization'), }; if (password) { if (basePath) { this.basePath = basePath; } } else { if (basePathOrUsername) { this.basePath = basePathOrUsername; } } } set useQuerystring(value) { this._useQuerystring = value; } set basePath(basePath) { this._basePath = basePath; } get basePath() { return this._basePath; } setDefaultAuthentication(auth) { this.authentications.default = auth; } setApiKey(key, value) { this.authentications[AuthorizationV1beta1ApiApiKeys[key]].apiKey = value; } /** * create a LocalSubjectAccessReview * @param namespace object name and auth scope, such as for teams and projects * @param body * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param includeUninitialized If IncludeUninitialized is specified, the object may be returned without completing initialization. * @param pretty If 'true', then the output is pretty printed. * @param {*} [options] Override http request options. */ createNamespacedLocalSubjectAccessReview(namespace, body, dryRun, includeUninitialized, pretty, options = {}) { const localVarPath = this.basePath + '/apis/authorization.k8s.io/v1beta1/namespaces/{namespace}/localsubjectaccessreviews' .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling createNamespacedLocalSubjectAccessReview.'); } // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling createNamespacedLocalSubjectAccessReview.'); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, "string"); } if (includeUninitialized !== undefined) { localVarQueryParameters['includeUninitialized'] = ObjectSerializer.serialize(includeUninitialized, "boolean"); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'POST', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: ObjectSerializer.serialize(body, "V1beta1LocalSubjectAccessReview") }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "V1beta1LocalSubjectAccessReview"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * create a SelfSubjectAccessReview * @param body * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param includeUninitialized If IncludeUninitialized is specified, the object may be returned without completing initialization. * @param pretty If 'true', then the output is pretty printed. * @param {*} [options] Override http request options. */ createSelfSubjectAccessReview(body, dryRun, includeUninitialized, pretty, options = {}) { const localVarPath = this.basePath + '/apis/authorization.k8s.io/v1beta1/selfsubjectaccessreviews'; let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling createSelfSubjectAccessReview.'); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, "string"); } if (includeUninitialized !== undefined) { localVarQueryParameters['includeUninitialized'] = ObjectSerializer.serialize(includeUninitialized, "boolean"); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'POST', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: ObjectSerializer.serialize(body, "V1beta1SelfSubjectAccessReview") }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "V1beta1SelfSubjectAccessReview"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * create a SelfSubjectRulesReview * @param body * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param includeUninitialized If IncludeUninitialized is specified, the object may be returned without completing initialization. * @param pretty If 'true', then the output is pretty printed. * @param {*} [options] Override http request options. */ createSelfSubjectRulesReview(body, dryRun, includeUninitialized, pretty, options = {}) { const localVarPath = this.basePath + '/apis/authorization.k8s.io/v1beta1/selfsubjectrulesreviews'; let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling createSelfSubjectRulesReview.'); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, "string"); } if (includeUninitialized !== undefined) { localVarQueryParameters['includeUninitialized'] = ObjectSerializer.serialize(includeUninitialized, "boolean"); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'POST', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: ObjectSerializer.serialize(body, "V1beta1SelfSubjectRulesReview") }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "V1beta1SelfSubjectRulesReview"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * create a SubjectAccessReview * @param body * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param includeUninitialized If IncludeUninitialized is specified, the object may be returned without completing initialization. * @param pretty If 'true', then the output is pretty printed. * @param {*} [options] Override http request options. */ createSubjectAccessReview(body, dryRun, includeUninitialized, pretty, options = {}) { const localVarPath = this.basePath + '/apis/authorization.k8s.io/v1beta1/subjectaccessreviews'; let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling createSubjectAccessReview.'); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, "string"); } if (includeUninitialized !== undefined) { localVarQueryParameters['includeUninitialized'] = ObjectSerializer.serialize(includeUninitialized, "boolean"); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'POST', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: ObjectSerializer.serialize(body, "V1beta1SubjectAccessReview") }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "V1beta1SubjectAccessReview"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * get available resources * @param {*} [options] Override http request options. */ getAPIResources(options = {}) { const localVarPath = this.basePath + '/apis/authorization.k8s.io/v1beta1/'; let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'GET', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "V1APIResourceList"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } } exports.AuthorizationV1beta1Api = AuthorizationV1beta1Api; var AutoscalingApiApiKeys; (function (AutoscalingApiApiKeys) { AutoscalingApiApiKeys[AutoscalingApiApiKeys["BearerToken"] = 0] = "BearerToken"; })(AutoscalingApiApiKeys = exports.AutoscalingApiApiKeys || (exports.AutoscalingApiApiKeys = {})); class AutoscalingApi { constructor(basePathOrUsername, password, basePath) { this._basePath = defaultBasePath; this.defaultHeaders = {}; this._useQuerystring = false; this.authentications = { 'default': new VoidAuth(), 'BearerToken': new ApiKeyAuth('header', 'authorization'), }; if (password) { if (basePath) { this.basePath = basePath; } } else { if (basePathOrUsername) { this.basePath = basePathOrUsername; } } } set useQuerystring(value) { this._useQuerystring = value; } set basePath(basePath) { this._basePath = basePath; } get basePath() { return this._basePath; } setDefaultAuthentication(auth) { this.authentications.default = auth; } setApiKey(key, value) { this.authentications[AutoscalingApiApiKeys[key]].apiKey = value; } /** * get information of a group * @param {*} [options] Override http request options. */ getAPIGroup(options = {}) { const localVarPath = this.basePath + '/apis/autoscaling/'; let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'GET', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "V1APIGroup"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } } exports.AutoscalingApi = AutoscalingApi; var AutoscalingV1ApiApiKeys; (function (AutoscalingV1ApiApiKeys) { AutoscalingV1ApiApiKeys[AutoscalingV1ApiApiKeys["BearerToken"] = 0] = "BearerToken"; })(AutoscalingV1ApiApiKeys = exports.AutoscalingV1ApiApiKeys || (exports.AutoscalingV1ApiApiKeys = {})); class AutoscalingV1Api { constructor(basePathOrUsername, password, basePath) { this._basePath = defaultBasePath; this.defaultHeaders = {}; this._useQuerystring = false; this.authentications = { 'default': new VoidAuth(), 'BearerToken': new ApiKeyAuth('header', 'authorization'), }; if (password) { if (basePath) { this.basePath = basePath; } } else { if (basePathOrUsername) { this.basePath = basePathOrUsername; } } } set useQuerystring(value) { this._useQuerystring = value; } set basePath(basePath) { this._basePath = basePath; } get basePath() { return this._basePath; } setDefaultAuthentication(auth) { this.authentications.default = auth; } setApiKey(key, value) { this.authentications[AutoscalingV1ApiApiKeys[key]].apiKey = value; } /** * create a HorizontalPodAutoscaler * @param namespace object name and auth scope, such as for teams and projects * @param body * @param includeUninitialized If true, partially initialized resources are included in the response. * @param pretty If 'true', then the output is pretty printed. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param {*} [options] Override http request options. */ createNamespacedHorizontalPodAutoscaler(namespace, body, includeUninitialized, pretty, dryRun, options = {}) { const localVarPath = this.basePath + '/apis/autoscaling/v1/namespaces/{namespace}/horizontalpodautoscalers' .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling createNamespacedHorizontalPodAutoscaler.'); } // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling createNamespacedHorizontalPodAutoscaler.'); } if (includeUninitialized !== undefined) { localVarQueryParameters['includeUninitialized'] = ObjectSerializer.serialize(includeUninitialized, "boolean"); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'POST', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: ObjectSerializer.serialize(body, "V1HorizontalPodAutoscaler") }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "V1HorizontalPodAutoscaler"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * delete collection of HorizontalPodAutoscaler * @param namespace object name and auth scope, such as for teams and projects * @param includeUninitialized If true, partially initialized resources are included in the response. * @param pretty If 'true', then the output is pretty printed. * @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. * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything. * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything. * @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. * @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. * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. * @param watch Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion. * @param {*} [options] Override http request options. */ deleteCollectionNamespacedHorizontalPodAutoscaler(namespace, includeUninitialized, pretty, _continue, fieldSelector, labelSelector, limit, resourceVersion, timeoutSeconds, watch, options = {}) { const localVarPath = this.basePath + '/apis/autoscaling/v1/namespaces/{namespace}/horizontalpodautoscalers' .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling deleteCollectionNamespacedHorizontalPodAutoscaler.'); } if (includeUninitialized !== undefined) { localVarQueryParameters['includeUninitialized'] = ObjectSerializer.serialize(includeUninitialized, "boolean"); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, "string"); } if (_continue !== undefined) { localVarQueryParameters['continue'] = ObjectSerializer.serialize(_continue, "string"); } if (fieldSelector !== undefined) { localVarQueryParameters['fieldSelector'] = ObjectSerializer.serialize(fieldSelector, "string"); } if (labelSelector !== undefined) { localVarQueryParameters['labelSelector'] = ObjectSerializer.serialize(labelSelector, "string"); } if (limit !== undefined) { localVarQueryParameters['limit'] = ObjectSerializer.serialize(limit, "number"); } if (resourceVersion !== undefined) { localVarQueryParameters['resourceVersion'] = ObjectSerializer.serialize(resourceVersion, "string"); } if (timeoutSeconds !== undefined) { localVarQueryParameters['timeoutSeconds'] = ObjectSerializer.serialize(timeoutSeconds, "number"); } if (watch !== undefined) { localVarQueryParameters['watch'] = ObjectSerializer.serialize(watch, "boolean"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'DELETE', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "V1Status"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * delete a HorizontalPodAutoscaler * @param name name of the HorizontalPodAutoscaler * @param namespace object name and auth scope, such as for teams and projects * @param pretty If 'true', then the output is pretty printed. * @param body * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @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. * @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. * @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. * @param {*} [options] Override http request options. */ deleteNamespacedHorizontalPodAutoscaler(name, namespace, pretty, body, dryRun, gracePeriodSeconds, orphanDependents, propagationPolicy, options = {}) { const localVarPath = this.basePath + '/apis/autoscaling/v1/namespaces/{namespace}/horizontalpodautoscalers/{name}' .replace('{' + 'name' + '}', encodeURIComponent(String(name))) .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling deleteNamespacedHorizontalPodAutoscaler.'); } // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling deleteNamespacedHorizontalPodAutoscaler.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, "string"); } if (gracePeriodSeconds !== undefined) { localVarQueryParameters['gracePeriodSeconds'] = ObjectSerializer.serialize(gracePeriodSeconds, "number"); } if (orphanDependents !== undefined) { localVarQueryParameters['orphanDependents'] = ObjectSerializer.serialize(orphanDependents, "boolean"); } if (propagationPolicy !== undefined) { localVarQueryParameters['propagationPolicy'] = ObjectSerializer.serialize(propagationPolicy, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'DELETE', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: ObjectSerializer.serialize(body, "V1DeleteOptions") }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "V1Status"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * get available resources * @param {*} [options] Override http request options. */ getAPIResources(options = {}) { const localVarPath = this.basePath + '/apis/autoscaling/v1/'; let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'GET', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "V1APIResourceList"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * list or watch objects of kind HorizontalPodAutoscaler * @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. * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything. * @param includeUninitialized If true, partially initialized resources are included in the response. * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything. * @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. * @param pretty If 'true', then the output is pretty printed. * @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. * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. * @param watch Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion. * @param {*} [options] Override http request options. */ listHorizontalPodAutoscalerForAllNamespaces(_continue, fieldSelector, includeUninitialized, labelSelector, limit, pretty, resourceVersion, timeoutSeconds, watch, options = {}) { const localVarPath = this.basePath + '/apis/autoscaling/v1/horizontalpodautoscalers'; let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; if (_continue !== undefined) { localVarQueryParameters['continue'] = ObjectSerializer.serialize(_continue, "string"); } if (fieldSelector !== undefined) { localVarQueryParameters['fieldSelector'] = ObjectSerializer.serialize(fieldSelector, "string"); } if (includeUninitialized !== undefined) { localVarQueryParameters['includeUninitialized'] = ObjectSerializer.serialize(includeUninitialized, "boolean"); } if (labelSelector !== undefined) { localVarQueryParameters['labelSelector'] = ObjectSerializer.serialize(labelSelector, "string"); } if (limit !== undefined) { localVarQueryParameters['limit'] = ObjectSerializer.serialize(limit, "number"); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, "string"); } if (resourceVersion !== undefined) { localVarQueryParameters['resourceVersion'] = ObjectSerializer.serialize(resourceVersion, "string"); } if (timeoutSeconds !== undefined) { localVarQueryParameters['timeoutSeconds'] = ObjectSerializer.serialize(timeoutSeconds, "number"); } if (watch !== undefined) { localVarQueryParameters['watch'] = ObjectSerializer.serialize(watch, "boolean"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'GET', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "V1HorizontalPodAutoscalerList"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * list or watch objects of kind HorizontalPodAutoscaler * @param namespace object name and auth scope, such as for teams and projects * @param includeUninitialized If true, partially initialized resources are included in the response. * @param pretty If 'true', then the output is pretty printed. * @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. * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything. * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything. * @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. * @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. * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. * @param watch Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion. * @param {*} [options] Override http request options. */ listNamespacedHorizontalPodAutoscaler(namespace, includeUninitialized, pretty, _continue, fieldSelector, labelSelector, limit, resourceVersion, timeoutSeconds, watch, options = {}) { const localVarPath = this.basePath + '/apis/autoscaling/v1/namespaces/{namespace}/horizontalpodautoscalers' .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling listNamespacedHorizontalPodAutoscaler.'); } if (includeUninitialized !== undefined) { localVarQueryParameters['includeUninitialized'] = ObjectSerializer.serialize(includeUninitialized, "boolean"); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, "string"); } if (_continue !== undefined) { localVarQueryParameters['continue'] = ObjectSerializer.serialize(_continue, "string"); } if (fieldSelector !== undefined) { localVarQueryParameters['fieldSelector'] = ObjectSerializer.serialize(fieldSelector, "string"); } if (labelSelector !== undefined) { localVarQueryParameters['labelSelector'] = ObjectSerializer.serialize(labelSelector, "string"); } if (limit !== undefined) { localVarQueryParameters['limit'] = ObjectSerializer.serialize(limit, "number"); } if (resourceVersion !== undefined) { localVarQueryParameters['resourceVersion'] = ObjectSerializer.serialize(resourceVersion, "string"); } if (timeoutSeconds !== undefined) { localVarQueryParameters['timeoutSeconds'] = ObjectSerializer.serialize(timeoutSeconds, "number"); } if (watch !== undefined) { localVarQueryParameters['watch'] = ObjectSerializer.serialize(watch, "boolean"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'GET', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "V1HorizontalPodAutoscalerList"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * partially update the specified HorizontalPodAutoscaler * @param name name of the HorizontalPodAutoscaler * @param namespace object name and auth scope, such as for teams and projects * @param body * @param pretty If 'true', then the output is pretty printed. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param {*} [options] Override http request options. */ patchNamespacedHorizontalPodAutoscaler(name, namespace, body, pretty, dryRun, options = {}) { const localVarPath = this.basePath + '/apis/autoscaling/v1/namespaces/{namespace}/horizontalpodautoscalers/{name}' .replace('{' + 'name' + '}', encodeURIComponent(String(name))) .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling patchNamespacedHorizontalPodAutoscaler.'); } // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling patchNamespacedHorizontalPodAutoscaler.'); } // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling patchNamespacedHorizontalPodAutoscaler.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'PATCH', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: ObjectSerializer.serialize(body, "any") }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "V1HorizontalPodAutoscaler"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * partially update status of the specified HorizontalPodAutoscaler * @param name name of the HorizontalPodAutoscaler * @param namespace object name and auth scope, such as for teams and projects * @param body * @param pretty If 'true', then the output is pretty printed. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param {*} [options] Override http request options. */ patchNamespacedHorizontalPodAutoscalerStatus(name, namespace, body, pretty, dryRun, options = {}) { const localVarPath = this.basePath + '/apis/autoscaling/v1/namespaces/{namespace}/horizontalpodautoscalers/{name}/status' .replace('{' + 'name' + '}', encodeURIComponent(String(name))) .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling patchNamespacedHorizontalPodAutoscalerStatus.'); } // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling patchNamespacedHorizontalPodAutoscalerStatus.'); } // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling patchNamespacedHorizontalPodAutoscalerStatus.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'PATCH', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: ObjectSerializer.serialize(body, "any") }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "V1HorizontalPodAutoscaler"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * read the specified HorizontalPodAutoscaler * @param name name of the HorizontalPodAutoscaler * @param namespace object name and auth scope, such as for teams and projects * @param pretty If 'true', then the output is pretty printed. * @param exact Should the export be exact. Exact export maintains cluster-specific fields like 'Namespace'. * @param _export Should this value be exported. Export strips fields that a user can not specify. * @param {*} [options] Override http request options. */ readNamespacedHorizontalPodAutoscaler(name, namespace, pretty, exact, _export, options = {}) { const localVarPath = this.basePath + '/apis/autoscaling/v1/namespaces/{namespace}/horizontalpodautoscalers/{name}' .replace('{' + 'name' + '}', encodeURIComponent(String(name))) .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling readNamespacedHorizontalPodAutoscaler.'); } // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling readNamespacedHorizontalPodAutoscaler.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, "string"); } if (exact !== undefined) { localVarQueryParameters['exact'] = ObjectSerializer.serialize(exact, "boolean"); } if (_export !== undefined) { localVarQueryParameters['export'] = ObjectSerializer.serialize(_export, "boolean"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'GET', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "V1HorizontalPodAutoscaler"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * read status of the specified HorizontalPodAutoscaler * @param name name of the HorizontalPodAutoscaler * @param namespace object name and auth scope, such as for teams and projects * @param pretty If 'true', then the output is pretty printed. * @param {*} [options] Override http request options. */ readNamespacedHorizontalPodAutoscalerStatus(name, namespace, pretty, options = {}) { const localVarPath = this.basePath + '/apis/autoscaling/v1/namespaces/{namespace}/horizontalpodautoscalers/{name}/status' .replace('{' + 'name' + '}', encodeURIComponent(String(name))) .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling readNamespacedHorizontalPodAutoscalerStatus.'); } // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling readNamespacedHorizontalPodAutoscalerStatus.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'GET', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "V1HorizontalPodAutoscaler"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * replace the specified HorizontalPodAutoscaler * @param name name of the HorizontalPodAutoscaler * @param namespace object name and auth scope, such as for teams and projects * @param body * @param pretty If 'true', then the output is pretty printed. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param {*} [options] Override http request options. */ replaceNamespacedHorizontalPodAutoscaler(name, namespace, body, pretty, dryRun, options = {}) { const localVarPath = this.basePath + '/apis/autoscaling/v1/namespaces/{namespace}/horizontalpodautoscalers/{name}' .replace('{' + 'name' + '}', encodeURIComponent(String(name))) .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling replaceNamespacedHorizontalPodAutoscaler.'); } // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling replaceNamespacedHorizontalPodAutoscaler.'); } // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling replaceNamespacedHorizontalPodAutoscaler.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'PUT', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: ObjectSerializer.serialize(body, "V1HorizontalPodAutoscaler") }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "V1HorizontalPodAutoscaler"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * replace status of the specified HorizontalPodAutoscaler * @param name name of the HorizontalPodAutoscaler * @param namespace object name and auth scope, such as for teams and projects * @param body * @param pretty If 'true', then the output is pretty printed. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param {*} [options] Override http request options. */ replaceNamespacedHorizontalPodAutoscalerStatus(name, namespace, body, pretty, dryRun, options = {}) { const localVarPath = this.basePath + '/apis/autoscaling/v1/namespaces/{namespace}/horizontalpodautoscalers/{name}/status' .replace('{' + 'name' + '}', encodeURIComponent(String(name))) .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling replaceNamespacedHorizontalPodAutoscalerStatus.'); } // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling replaceNamespacedHorizontalPodAutoscalerStatus.'); } // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling replaceNamespacedHorizontalPodAutoscalerStatus.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'PUT', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: ObjectSerializer.serialize(body, "V1HorizontalPodAutoscaler") }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "V1HorizontalPodAutoscaler"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } } exports.AutoscalingV1Api = AutoscalingV1Api; var AutoscalingV2beta1ApiApiKeys; (function (AutoscalingV2beta1ApiApiKeys) { AutoscalingV2beta1ApiApiKeys[AutoscalingV2beta1ApiApiKeys["BearerToken"] = 0] = "BearerToken"; })(AutoscalingV2beta1ApiApiKeys = exports.AutoscalingV2beta1ApiApiKeys || (exports.AutoscalingV2beta1ApiApiKeys = {})); class AutoscalingV2beta1Api { constructor(basePathOrUsername, password, basePath) { this._basePath = defaultBasePath; this.defaultHeaders = {}; this._useQuerystring = false; this.authentications = { 'default': new VoidAuth(), 'BearerToken': new ApiKeyAuth('header', 'authorization'), }; if (password) { if (basePath) { this.basePath = basePath; } } else { if (basePathOrUsername) { this.basePath = basePathOrUsername; } } } set useQuerystring(value) { this._useQuerystring = value; } set basePath(basePath) { this._basePath = basePath; } get basePath() { return this._basePath; } setDefaultAuthentication(auth) { this.authentications.default = auth; } setApiKey(key, value) { this.authentications[AutoscalingV2beta1ApiApiKeys[key]].apiKey = value; } /** * create a HorizontalPodAutoscaler * @param namespace object name and auth scope, such as for teams and projects * @param body * @param includeUninitialized If true, partially initialized resources are included in the response. * @param pretty If 'true', then the output is pretty printed. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param {*} [options] Override http request options. */ createNamespacedHorizontalPodAutoscaler(namespace, body, includeUninitialized, pretty, dryRun, options = {}) { const localVarPath = this.basePath + '/apis/autoscaling/v2beta1/namespaces/{namespace}/horizontalpodautoscalers' .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling createNamespacedHorizontalPodAutoscaler.'); } // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling createNamespacedHorizontalPodAutoscaler.'); } if (includeUninitialized !== undefined) { localVarQueryParameters['includeUninitialized'] = ObjectSerializer.serialize(includeUninitialized, "boolean"); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'POST', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: ObjectSerializer.serialize(body, "V2beta1HorizontalPodAutoscaler") }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "V2beta1HorizontalPodAutoscaler"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * delete collection of HorizontalPodAutoscaler * @param namespace object name and auth scope, such as for teams and projects * @param includeUninitialized If true, partially initialized resources are included in the response. * @param pretty If 'true', then the output is pretty printed. * @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. * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything. * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything. * @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. * @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. * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. * @param watch Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion. * @param {*} [options] Override http request options. */ deleteCollectionNamespacedHorizontalPodAutoscaler(namespace, includeUninitialized, pretty, _continue, fieldSelector, labelSelector, limit, resourceVersion, timeoutSeconds, watch, options = {}) { const localVarPath = this.basePath + '/apis/autoscaling/v2beta1/namespaces/{namespace}/horizontalpodautoscalers' .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling deleteCollectionNamespacedHorizontalPodAutoscaler.'); } if (includeUninitialized !== undefined) { localVarQueryParameters['includeUninitialized'] = ObjectSerializer.serialize(includeUninitialized, "boolean"); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, "string"); } if (_continue !== undefined) { localVarQueryParameters['continue'] = ObjectSerializer.serialize(_continue, "string"); } if (fieldSelector !== undefined) { localVarQueryParameters['fieldSelector'] = ObjectSerializer.serialize(fieldSelector, "string"); } if (labelSelector !== undefined) { localVarQueryParameters['labelSelector'] = ObjectSerializer.serialize(labelSelector, "string"); } if (limit !== undefined) { localVarQueryParameters['limit'] = ObjectSerializer.serialize(limit, "number"); } if (resourceVersion !== undefined) { localVarQueryParameters['resourceVersion'] = ObjectSerializer.serialize(resourceVersion, "string"); } if (timeoutSeconds !== undefined) { localVarQueryParameters['timeoutSeconds'] = ObjectSerializer.serialize(timeoutSeconds, "number"); } if (watch !== undefined) { localVarQueryParameters['watch'] = ObjectSerializer.serialize(watch, "boolean"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'DELETE', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "V1Status"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * delete a HorizontalPodAutoscaler * @param name name of the HorizontalPodAutoscaler * @param namespace object name and auth scope, such as for teams and projects * @param pretty If 'true', then the output is pretty printed. * @param body * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @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. * @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. * @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. * @param {*} [options] Override http request options. */ deleteNamespacedHorizontalPodAutoscaler(name, namespace, pretty, body, dryRun, gracePeriodSeconds, orphanDependents, propagationPolicy, options = {}) { const localVarPath = this.basePath + '/apis/autoscaling/v2beta1/namespaces/{namespace}/horizontalpodautoscalers/{name}' .replace('{' + 'name' + '}', encodeURIComponent(String(name))) .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling deleteNamespacedHorizontalPodAutoscaler.'); } // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling deleteNamespacedHorizontalPodAutoscaler.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, "string"); } if (gracePeriodSeconds !== undefined) { localVarQueryParameters['gracePeriodSeconds'] = ObjectSerializer.serialize(gracePeriodSeconds, "number"); } if (orphanDependents !== undefined) { localVarQueryParameters['orphanDependents'] = ObjectSerializer.serialize(orphanDependents, "boolean"); } if (propagationPolicy !== undefined) { localVarQueryParameters['propagationPolicy'] = ObjectSerializer.serialize(propagationPolicy, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'DELETE', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: ObjectSerializer.serialize(body, "V1DeleteOptions") }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "V1Status"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * get available resources * @param {*} [options] Override http request options. */ getAPIResources(options = {}) { const localVarPath = this.basePath + '/apis/autoscaling/v2beta1/'; let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'GET', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "V1APIResourceList"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * list or watch objects of kind HorizontalPodAutoscaler * @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. * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything. * @param includeUninitialized If true, partially initialized resources are included in the response. * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything. * @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. * @param pretty If 'true', then the output is pretty printed. * @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. * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. * @param watch Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion. * @param {*} [options] Override http request options. */ listHorizontalPodAutoscalerForAllNamespaces(_continue, fieldSelector, includeUninitialized, labelSelector, limit, pretty, resourceVersion, timeoutSeconds, watch, options = {}) { const localVarPath = this.basePath + '/apis/autoscaling/v2beta1/horizontalpodautoscalers'; let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; if (_continue !== undefined) { localVarQueryParameters['continue'] = ObjectSerializer.serialize(_continue, "string"); } if (fieldSelector !== undefined) { localVarQueryParameters['fieldSelector'] = ObjectSerializer.serialize(fieldSelector, "string"); } if (includeUninitialized !== undefined) { localVarQueryParameters['includeUninitialized'] = ObjectSerializer.serialize(includeUninitialized, "boolean"); } if (labelSelector !== undefined) { localVarQueryParameters['labelSelector'] = ObjectSerializer.serialize(labelSelector, "string"); } if (limit !== undefined) { localVarQueryParameters['limit'] = ObjectSerializer.serialize(limit, "number"); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, "string"); } if (resourceVersion !== undefined) { localVarQueryParameters['resourceVersion'] = ObjectSerializer.serialize(resourceVersion, "string"); } if (timeoutSeconds !== undefined) { localVarQueryParameters['timeoutSeconds'] = ObjectSerializer.serialize(timeoutSeconds, "number"); } if (watch !== undefined) { localVarQueryParameters['watch'] = ObjectSerializer.serialize(watch, "boolean"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'GET', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "V2beta1HorizontalPodAutoscalerList"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * list or watch objects of kind HorizontalPodAutoscaler * @param namespace object name and auth scope, such as for teams and projects * @param includeUninitialized If true, partially initialized resources are included in the response. * @param pretty If 'true', then the output is pretty printed. * @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. * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything. * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything. * @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. * @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. * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. * @param watch Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion. * @param {*} [options] Override http request options. */ listNamespacedHorizontalPodAutoscaler(namespace, includeUninitialized, pretty, _continue, fieldSelector, labelSelector, limit, resourceVersion, timeoutSeconds, watch, options = {}) { const localVarPath = this.basePath + '/apis/autoscaling/v2beta1/namespaces/{namespace}/horizontalpodautoscalers' .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling listNamespacedHorizontalPodAutoscaler.'); } if (includeUninitialized !== undefined) { localVarQueryParameters['includeUninitialized'] = ObjectSerializer.serialize(includeUninitialized, "boolean"); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, "string"); } if (_continue !== undefined) { localVarQueryParameters['continue'] = ObjectSerializer.serialize(_continue, "string"); } if (fieldSelector !== undefined) { localVarQueryParameters['fieldSelector'] = ObjectSerializer.serialize(fieldSelector, "string"); } if (labelSelector !== undefined) { localVarQueryParameters['labelSelector'] = ObjectSerializer.serialize(labelSelector, "string"); } if (limit !== undefined) { localVarQueryParameters['limit'] = ObjectSerializer.serialize(limit, "number"); } if (resourceVersion !== undefined) { localVarQueryParameters['resourceVersion'] = ObjectSerializer.serialize(resourceVersion, "string"); } if (timeoutSeconds !== undefined) { localVarQueryParameters['timeoutSeconds'] = ObjectSerializer.serialize(timeoutSeconds, "number"); } if (watch !== undefined) { localVarQueryParameters['watch'] = ObjectSerializer.serialize(watch, "boolean"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'GET', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "V2beta1HorizontalPodAutoscalerList"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * partially update the specified HorizontalPodAutoscaler * @param name name of the HorizontalPodAutoscaler * @param namespace object name and auth scope, such as for teams and projects * @param body * @param pretty If 'true', then the output is pretty printed. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param {*} [options] Override http request options. */ patchNamespacedHorizontalPodAutoscaler(name, namespace, body, pretty, dryRun, options = {}) { const localVarPath = this.basePath + '/apis/autoscaling/v2beta1/namespaces/{namespace}/horizontalpodautoscalers/{name}' .replace('{' + 'name' + '}', encodeURIComponent(String(name))) .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling patchNamespacedHorizontalPodAutoscaler.'); } // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling patchNamespacedHorizontalPodAutoscaler.'); } // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling patchNamespacedHorizontalPodAutoscaler.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'PATCH', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: ObjectSerializer.serialize(body, "any") }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "V2beta1HorizontalPodAutoscaler"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * partially update status of the specified HorizontalPodAutoscaler * @param name name of the HorizontalPodAutoscaler * @param namespace object name and auth scope, such as for teams and projects * @param body * @param pretty If 'true', then the output is pretty printed. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param {*} [options] Override http request options. */ patchNamespacedHorizontalPodAutoscalerStatus(name, namespace, body, pretty, dryRun, options = {}) { const localVarPath = this.basePath + '/apis/autoscaling/v2beta1/namespaces/{namespace}/horizontalpodautoscalers/{name}/status' .replace('{' + 'name' + '}', encodeURIComponent(String(name))) .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling patchNamespacedHorizontalPodAutoscalerStatus.'); } // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling patchNamespacedHorizontalPodAutoscalerStatus.'); } // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling patchNamespacedHorizontalPodAutoscalerStatus.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'PATCH', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: ObjectSerializer.serialize(body, "any") }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "V2beta1HorizontalPodAutoscaler"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * read the specified HorizontalPodAutoscaler * @param name name of the HorizontalPodAutoscaler * @param namespace object name and auth scope, such as for teams and projects * @param pretty If 'true', then the output is pretty printed. * @param exact Should the export be exact. Exact export maintains cluster-specific fields like 'Namespace'. * @param _export Should this value be exported. Export strips fields that a user can not specify. * @param {*} [options] Override http request options. */ readNamespacedHorizontalPodAutoscaler(name, namespace, pretty, exact, _export, options = {}) { const localVarPath = this.basePath + '/apis/autoscaling/v2beta1/namespaces/{namespace}/horizontalpodautoscalers/{name}' .replace('{' + 'name' + '}', encodeURIComponent(String(name))) .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling readNamespacedHorizontalPodAutoscaler.'); } // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling readNamespacedHorizontalPodAutoscaler.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, "string"); } if (exact !== undefined) { localVarQueryParameters['exact'] = ObjectSerializer.serialize(exact, "boolean"); } if (_export !== undefined) { localVarQueryParameters['export'] = ObjectSerializer.serialize(_export, "boolean"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'GET', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "V2beta1HorizontalPodAutoscaler"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * read status of the specified HorizontalPodAutoscaler * @param name name of the HorizontalPodAutoscaler * @param namespace object name and auth scope, such as for teams and projects * @param pretty If 'true', then the output is pretty printed. * @param {*} [options] Override http request options. */ readNamespacedHorizontalPodAutoscalerStatus(name, namespace, pretty, options = {}) { const localVarPath = this.basePath + '/apis/autoscaling/v2beta1/namespaces/{namespace}/horizontalpodautoscalers/{name}/status' .replace('{' + 'name' + '}', encodeURIComponent(String(name))) .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling readNamespacedHorizontalPodAutoscalerStatus.'); } // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling readNamespacedHorizontalPodAutoscalerStatus.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'GET', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "V2beta1HorizontalPodAutoscaler"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * replace the specified HorizontalPodAutoscaler * @param name name of the HorizontalPodAutoscaler * @param namespace object name and auth scope, such as for teams and projects * @param body * @param pretty If 'true', then the output is pretty printed. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param {*} [options] Override http request options. */ replaceNamespacedHorizontalPodAutoscaler(name, namespace, body, pretty, dryRun, options = {}) { const localVarPath = this.basePath + '/apis/autoscaling/v2beta1/namespaces/{namespace}/horizontalpodautoscalers/{name}' .replace('{' + 'name' + '}', encodeURIComponent(String(name))) .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling replaceNamespacedHorizontalPodAutoscaler.'); } // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling replaceNamespacedHorizontalPodAutoscaler.'); } // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling replaceNamespacedHorizontalPodAutoscaler.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'PUT', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: ObjectSerializer.serialize(body, "V2beta1HorizontalPodAutoscaler") }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "V2beta1HorizontalPodAutoscaler"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * replace status of the specified HorizontalPodAutoscaler * @param name name of the HorizontalPodAutoscaler * @param namespace object name and auth scope, such as for teams and projects * @param body * @param pretty If 'true', then the output is pretty printed. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param {*} [options] Override http request options. */ replaceNamespacedHorizontalPodAutoscalerStatus(name, namespace, body, pretty, dryRun, options = {}) { const localVarPath = this.basePath + '/apis/autoscaling/v2beta1/namespaces/{namespace}/horizontalpodautoscalers/{name}/status' .replace('{' + 'name' + '}', encodeURIComponent(String(name))) .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling replaceNamespacedHorizontalPodAutoscalerStatus.'); } // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling replaceNamespacedHorizontalPodAutoscalerStatus.'); } // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling replaceNamespacedHorizontalPodAutoscalerStatus.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'PUT', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: ObjectSerializer.serialize(body, "V2beta1HorizontalPodAutoscaler") }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "V2beta1HorizontalPodAutoscaler"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } } exports.AutoscalingV2beta1Api = AutoscalingV2beta1Api; var AutoscalingV2beta2ApiApiKeys; (function (AutoscalingV2beta2ApiApiKeys) { AutoscalingV2beta2ApiApiKeys[AutoscalingV2beta2ApiApiKeys["BearerToken"] = 0] = "BearerToken"; })(AutoscalingV2beta2ApiApiKeys = exports.AutoscalingV2beta2ApiApiKeys || (exports.AutoscalingV2beta2ApiApiKeys = {})); class AutoscalingV2beta2Api { constructor(basePathOrUsername, password, basePath) { this._basePath = defaultBasePath; this.defaultHeaders = {}; this._useQuerystring = false; this.authentications = { 'default': new VoidAuth(), 'BearerToken': new ApiKeyAuth('header', 'authorization'), }; if (password) { if (basePath) { this.basePath = basePath; } } else { if (basePathOrUsername) { this.basePath = basePathOrUsername; } } } set useQuerystring(value) { this._useQuerystring = value; } set basePath(basePath) { this._basePath = basePath; } get basePath() { return this._basePath; } setDefaultAuthentication(auth) { this.authentications.default = auth; } setApiKey(key, value) { this.authentications[AutoscalingV2beta2ApiApiKeys[key]].apiKey = value; } /** * create a HorizontalPodAutoscaler * @param namespace object name and auth scope, such as for teams and projects * @param body * @param includeUninitialized If true, partially initialized resources are included in the response. * @param pretty If 'true', then the output is pretty printed. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param {*} [options] Override http request options. */ createNamespacedHorizontalPodAutoscaler(namespace, body, includeUninitialized, pretty, dryRun, options = {}) { const localVarPath = this.basePath + '/apis/autoscaling/v2beta2/namespaces/{namespace}/horizontalpodautoscalers' .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling createNamespacedHorizontalPodAutoscaler.'); } // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling createNamespacedHorizontalPodAutoscaler.'); } if (includeUninitialized !== undefined) { localVarQueryParameters['includeUninitialized'] = ObjectSerializer.serialize(includeUninitialized, "boolean"); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'POST', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: ObjectSerializer.serialize(body, "V2beta2HorizontalPodAutoscaler") }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "V2beta2HorizontalPodAutoscaler"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * delete collection of HorizontalPodAutoscaler * @param namespace object name and auth scope, such as for teams and projects * @param includeUninitialized If true, partially initialized resources are included in the response. * @param pretty If 'true', then the output is pretty printed. * @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. * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything. * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything. * @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. * @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. * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. * @param watch Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion. * @param {*} [options] Override http request options. */ deleteCollectionNamespacedHorizontalPodAutoscaler(namespace, includeUninitialized, pretty, _continue, fieldSelector, labelSelector, limit, resourceVersion, timeoutSeconds, watch, options = {}) { const localVarPath = this.basePath + '/apis/autoscaling/v2beta2/namespaces/{namespace}/horizontalpodautoscalers' .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling deleteCollectionNamespacedHorizontalPodAutoscaler.'); } if (includeUninitialized !== undefined) { localVarQueryParameters['includeUninitialized'] = ObjectSerializer.serialize(includeUninitialized, "boolean"); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, "string"); } if (_continue !== undefined) { localVarQueryParameters['continue'] = ObjectSerializer.serialize(_continue, "string"); } if (fieldSelector !== undefined) { localVarQueryParameters['fieldSelector'] = ObjectSerializer.serialize(fieldSelector, "string"); } if (labelSelector !== undefined) { localVarQueryParameters['labelSelector'] = ObjectSerializer.serialize(labelSelector, "string"); } if (limit !== undefined) { localVarQueryParameters['limit'] = ObjectSerializer.serialize(limit, "number"); } if (resourceVersion !== undefined) { localVarQueryParameters['resourceVersion'] = ObjectSerializer.serialize(resourceVersion, "string"); } if (timeoutSeconds !== undefined) { localVarQueryParameters['timeoutSeconds'] = ObjectSerializer.serialize(timeoutSeconds, "number"); } if (watch !== undefined) { localVarQueryParameters['watch'] = ObjectSerializer.serialize(watch, "boolean"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'DELETE', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "V1Status"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * delete a HorizontalPodAutoscaler * @param name name of the HorizontalPodAutoscaler * @param namespace object name and auth scope, such as for teams and projects * @param pretty If 'true', then the output is pretty printed. * @param body * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @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. * @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. * @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. * @param {*} [options] Override http request options. */ deleteNamespacedHorizontalPodAutoscaler(name, namespace, pretty, body, dryRun, gracePeriodSeconds, orphanDependents, propagationPolicy, options = {}) { const localVarPath = this.basePath + '/apis/autoscaling/v2beta2/namespaces/{namespace}/horizontalpodautoscalers/{name}' .replace('{' + 'name' + '}', encodeURIComponent(String(name))) .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling deleteNamespacedHorizontalPodAutoscaler.'); } // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling deleteNamespacedHorizontalPodAutoscaler.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, "string"); } if (gracePeriodSeconds !== undefined) { localVarQueryParameters['gracePeriodSeconds'] = ObjectSerializer.serialize(gracePeriodSeconds, "number"); } if (orphanDependents !== undefined) { localVarQueryParameters['orphanDependents'] = ObjectSerializer.serialize(orphanDependents, "boolean"); } if (propagationPolicy !== undefined) { localVarQueryParameters['propagationPolicy'] = ObjectSerializer.serialize(propagationPolicy, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'DELETE', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: ObjectSerializer.serialize(body, "V1DeleteOptions") }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "V1Status"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * get available resources * @param {*} [options] Override http request options. */ getAPIResources(options = {}) { const localVarPath = this.basePath + '/apis/autoscaling/v2beta2/'; let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'GET', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "V1APIResourceList"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * list or watch objects of kind HorizontalPodAutoscaler * @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. * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything. * @param includeUninitialized If true, partially initialized resources are included in the response. * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything. * @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. * @param pretty If 'true', then the output is pretty printed. * @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. * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. * @param watch Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion. * @param {*} [options] Override http request options. */ listHorizontalPodAutoscalerForAllNamespaces(_continue, fieldSelector, includeUninitialized, labelSelector, limit, pretty, resourceVersion, timeoutSeconds, watch, options = {}) { const localVarPath = this.basePath + '/apis/autoscaling/v2beta2/horizontalpodautoscalers'; let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; if (_continue !== undefined) { localVarQueryParameters['continue'] = ObjectSerializer.serialize(_continue, "string"); } if (fieldSelector !== undefined) { localVarQueryParameters['fieldSelector'] = ObjectSerializer.serialize(fieldSelector, "string"); } if (includeUninitialized !== undefined) { localVarQueryParameters['includeUninitialized'] = ObjectSerializer.serialize(includeUninitialized, "boolean"); } if (labelSelector !== undefined) { localVarQueryParameters['labelSelector'] = ObjectSerializer.serialize(labelSelector, "string"); } if (limit !== undefined) { localVarQueryParameters['limit'] = ObjectSerializer.serialize(limit, "number"); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, "string"); } if (resourceVersion !== undefined) { localVarQueryParameters['resourceVersion'] = ObjectSerializer.serialize(resourceVersion, "string"); } if (timeoutSeconds !== undefined) { localVarQueryParameters['timeoutSeconds'] = ObjectSerializer.serialize(timeoutSeconds, "number"); } if (watch !== undefined) { localVarQueryParameters['watch'] = ObjectSerializer.serialize(watch, "boolean"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'GET', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "V2beta2HorizontalPodAutoscalerList"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * list or watch objects of kind HorizontalPodAutoscaler * @param namespace object name and auth scope, such as for teams and projects * @param includeUninitialized If true, partially initialized resources are included in the response. * @param pretty If 'true', then the output is pretty printed. * @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. * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything. * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything. * @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. * @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. * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. * @param watch Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion. * @param {*} [options] Override http request options. */ listNamespacedHorizontalPodAutoscaler(namespace, includeUninitialized, pretty, _continue, fieldSelector, labelSelector, limit, resourceVersion, timeoutSeconds, watch, options = {}) { const localVarPath = this.basePath + '/apis/autoscaling/v2beta2/namespaces/{namespace}/horizontalpodautoscalers' .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling listNamespacedHorizontalPodAutoscaler.'); } if (includeUninitialized !== undefined) { localVarQueryParameters['includeUninitialized'] = ObjectSerializer.serialize(includeUninitialized, "boolean"); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, "string"); } if (_continue !== undefined) { localVarQueryParameters['continue'] = ObjectSerializer.serialize(_continue, "string"); } if (fieldSelector !== undefined) { localVarQueryParameters['fieldSelector'] = ObjectSerializer.serialize(fieldSelector, "string"); } if (labelSelector !== undefined) { localVarQueryParameters['labelSelector'] = ObjectSerializer.serialize(labelSelector, "string"); } if (limit !== undefined) { localVarQueryParameters['limit'] = ObjectSerializer.serialize(limit, "number"); } if (resourceVersion !== undefined) { localVarQueryParameters['resourceVersion'] = ObjectSerializer.serialize(resourceVersion, "string"); } if (timeoutSeconds !== undefined) { localVarQueryParameters['timeoutSeconds'] = ObjectSerializer.serialize(timeoutSeconds, "number"); } if (watch !== undefined) { localVarQueryParameters['watch'] = ObjectSerializer.serialize(watch, "boolean"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'GET', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "V2beta2HorizontalPodAutoscalerList"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * partially update the specified HorizontalPodAutoscaler * @param name name of the HorizontalPodAutoscaler * @param namespace object name and auth scope, such as for teams and projects * @param body * @param pretty If 'true', then the output is pretty printed. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param {*} [options] Override http request options. */ patchNamespacedHorizontalPodAutoscaler(name, namespace, body, pretty, dryRun, options = {}) { const localVarPath = this.basePath + '/apis/autoscaling/v2beta2/namespaces/{namespace}/horizontalpodautoscalers/{name}' .replace('{' + 'name' + '}', encodeURIComponent(String(name))) .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling patchNamespacedHorizontalPodAutoscaler.'); } // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling patchNamespacedHorizontalPodAutoscaler.'); } // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling patchNamespacedHorizontalPodAutoscaler.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'PATCH', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: ObjectSerializer.serialize(body, "any") }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "V2beta2HorizontalPodAutoscaler"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * partially update status of the specified HorizontalPodAutoscaler * @param name name of the HorizontalPodAutoscaler * @param namespace object name and auth scope, such as for teams and projects * @param body * @param pretty If 'true', then the output is pretty printed. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param {*} [options] Override http request options. */ patchNamespacedHorizontalPodAutoscalerStatus(name, namespace, body, pretty, dryRun, options = {}) { const localVarPath = this.basePath + '/apis/autoscaling/v2beta2/namespaces/{namespace}/horizontalpodautoscalers/{name}/status' .replace('{' + 'name' + '}', encodeURIComponent(String(name))) .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling patchNamespacedHorizontalPodAutoscalerStatus.'); } // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling patchNamespacedHorizontalPodAutoscalerStatus.'); } // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling patchNamespacedHorizontalPodAutoscalerStatus.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'PATCH', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: ObjectSerializer.serialize(body, "any") }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "V2beta2HorizontalPodAutoscaler"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * read the specified HorizontalPodAutoscaler * @param name name of the HorizontalPodAutoscaler * @param namespace object name and auth scope, such as for teams and projects * @param pretty If 'true', then the output is pretty printed. * @param exact Should the export be exact. Exact export maintains cluster-specific fields like 'Namespace'. * @param _export Should this value be exported. Export strips fields that a user can not specify. * @param {*} [options] Override http request options. */ readNamespacedHorizontalPodAutoscaler(name, namespace, pretty, exact, _export, options = {}) { const localVarPath = this.basePath + '/apis/autoscaling/v2beta2/namespaces/{namespace}/horizontalpodautoscalers/{name}' .replace('{' + 'name' + '}', encodeURIComponent(String(name))) .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling readNamespacedHorizontalPodAutoscaler.'); } // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling readNamespacedHorizontalPodAutoscaler.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, "string"); } if (exact !== undefined) { localVarQueryParameters['exact'] = ObjectSerializer.serialize(exact, "boolean"); } if (_export !== undefined) { localVarQueryParameters['export'] = ObjectSerializer.serialize(_export, "boolean"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'GET', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "V2beta2HorizontalPodAutoscaler"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * read status of the specified HorizontalPodAutoscaler * @param name name of the HorizontalPodAutoscaler * @param namespace object name and auth scope, such as for teams and projects * @param pretty If 'true', then the output is pretty printed. * @param {*} [options] Override http request options. */ readNamespacedHorizontalPodAutoscalerStatus(name, namespace, pretty, options = {}) { const localVarPath = this.basePath + '/apis/autoscaling/v2beta2/namespaces/{namespace}/horizontalpodautoscalers/{name}/status' .replace('{' + 'name' + '}', encodeURIComponent(String(name))) .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling readNamespacedHorizontalPodAutoscalerStatus.'); } // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling readNamespacedHorizontalPodAutoscalerStatus.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'GET', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "V2beta2HorizontalPodAutoscaler"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * replace the specified HorizontalPodAutoscaler * @param name name of the HorizontalPodAutoscaler * @param namespace object name and auth scope, such as for teams and projects * @param body * @param pretty If 'true', then the output is pretty printed. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param {*} [options] Override http request options. */ replaceNamespacedHorizontalPodAutoscaler(name, namespace, body, pretty, dryRun, options = {}) { const localVarPath = this.basePath + '/apis/autoscaling/v2beta2/namespaces/{namespace}/horizontalpodautoscalers/{name}' .replace('{' + 'name' + '}', encodeURIComponent(String(name))) .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling replaceNamespacedHorizontalPodAutoscaler.'); } // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling replaceNamespacedHorizontalPodAutoscaler.'); } // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling replaceNamespacedHorizontalPodAutoscaler.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'PUT', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: ObjectSerializer.serialize(body, "V2beta2HorizontalPodAutoscaler") }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "V2beta2HorizontalPodAutoscaler"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * replace status of the specified HorizontalPodAutoscaler * @param name name of the HorizontalPodAutoscaler * @param namespace object name and auth scope, such as for teams and projects * @param body * @param pretty If 'true', then the output is pretty printed. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param {*} [options] Override http request options. */ replaceNamespacedHorizontalPodAutoscalerStatus(name, namespace, body, pretty, dryRun, options = {}) { const localVarPath = this.basePath + '/apis/autoscaling/v2beta2/namespaces/{namespace}/horizontalpodautoscalers/{name}/status' .replace('{' + 'name' + '}', encodeURIComponent(String(name))) .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling replaceNamespacedHorizontalPodAutoscalerStatus.'); } // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling replaceNamespacedHorizontalPodAutoscalerStatus.'); } // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling replaceNamespacedHorizontalPodAutoscalerStatus.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'PUT', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: ObjectSerializer.serialize(body, "V2beta2HorizontalPodAutoscaler") }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "V2beta2HorizontalPodAutoscaler"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } } exports.AutoscalingV2beta2Api = AutoscalingV2beta2Api; var BatchApiApiKeys; (function (BatchApiApiKeys) { BatchApiApiKeys[BatchApiApiKeys["BearerToken"] = 0] = "BearerToken"; })(BatchApiApiKeys = exports.BatchApiApiKeys || (exports.BatchApiApiKeys = {})); class BatchApi { constructor(basePathOrUsername, password, basePath) { this._basePath = defaultBasePath; this.defaultHeaders = {}; this._useQuerystring = false; this.authentications = { 'default': new VoidAuth(), 'BearerToken': new ApiKeyAuth('header', 'authorization'), }; if (password) { if (basePath) { this.basePath = basePath; } } else { if (basePathOrUsername) { this.basePath = basePathOrUsername; } } } set useQuerystring(value) { this._useQuerystring = value; } set basePath(basePath) { this._basePath = basePath; } get basePath() { return this._basePath; } setDefaultAuthentication(auth) { this.authentications.default = auth; } setApiKey(key, value) { this.authentications[BatchApiApiKeys[key]].apiKey = value; } /** * get information of a group * @param {*} [options] Override http request options. */ getAPIGroup(options = {}) { const localVarPath = this.basePath + '/apis/batch/'; let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'GET', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "V1APIGroup"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } } exports.BatchApi = BatchApi; var BatchV1ApiApiKeys; (function (BatchV1ApiApiKeys) { BatchV1ApiApiKeys[BatchV1ApiApiKeys["BearerToken"] = 0] = "BearerToken"; })(BatchV1ApiApiKeys = exports.BatchV1ApiApiKeys || (exports.BatchV1ApiApiKeys = {})); class BatchV1Api { constructor(basePathOrUsername, password, basePath) { this._basePath = defaultBasePath; this.defaultHeaders = {}; this._useQuerystring = false; this.authentications = { 'default': new VoidAuth(), 'BearerToken': new ApiKeyAuth('header', 'authorization'), }; if (password) { if (basePath) { this.basePath = basePath; } } else { if (basePathOrUsername) { this.basePath = basePathOrUsername; } } } set useQuerystring(value) { this._useQuerystring = value; } set basePath(basePath) { this._basePath = basePath; } get basePath() { return this._basePath; } setDefaultAuthentication(auth) { this.authentications.default = auth; } setApiKey(key, value) { this.authentications[BatchV1ApiApiKeys[key]].apiKey = value; } /** * create a Job * @param namespace object name and auth scope, such as for teams and projects * @param body * @param includeUninitialized If true, partially initialized resources are included in the response. * @param pretty If 'true', then the output is pretty printed. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param {*} [options] Override http request options. */ createNamespacedJob(namespace, body, includeUninitialized, pretty, dryRun, options = {}) { const localVarPath = this.basePath + '/apis/batch/v1/namespaces/{namespace}/jobs' .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling createNamespacedJob.'); } // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling createNamespacedJob.'); } if (includeUninitialized !== undefined) { localVarQueryParameters['includeUninitialized'] = ObjectSerializer.serialize(includeUninitialized, "boolean"); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'POST', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: ObjectSerializer.serialize(body, "V1Job") }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "V1Job"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * delete collection of Job * @param namespace object name and auth scope, such as for teams and projects * @param includeUninitialized If true, partially initialized resources are included in the response. * @param pretty If 'true', then the output is pretty printed. * @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. * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything. * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything. * @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. * @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. * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. * @param watch Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion. * @param {*} [options] Override http request options. */ deleteCollectionNamespacedJob(namespace, includeUninitialized, pretty, _continue, fieldSelector, labelSelector, limit, resourceVersion, timeoutSeconds, watch, options = {}) { const localVarPath = this.basePath + '/apis/batch/v1/namespaces/{namespace}/jobs' .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling deleteCollectionNamespacedJob.'); } if (includeUninitialized !== undefined) { localVarQueryParameters['includeUninitialized'] = ObjectSerializer.serialize(includeUninitialized, "boolean"); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, "string"); } if (_continue !== undefined) { localVarQueryParameters['continue'] = ObjectSerializer.serialize(_continue, "string"); } if (fieldSelector !== undefined) { localVarQueryParameters['fieldSelector'] = ObjectSerializer.serialize(fieldSelector, "string"); } if (labelSelector !== undefined) { localVarQueryParameters['labelSelector'] = ObjectSerializer.serialize(labelSelector, "string"); } if (limit !== undefined) { localVarQueryParameters['limit'] = ObjectSerializer.serialize(limit, "number"); } if (resourceVersion !== undefined) { localVarQueryParameters['resourceVersion'] = ObjectSerializer.serialize(resourceVersion, "string"); } if (timeoutSeconds !== undefined) { localVarQueryParameters['timeoutSeconds'] = ObjectSerializer.serialize(timeoutSeconds, "number"); } if (watch !== undefined) { localVarQueryParameters['watch'] = ObjectSerializer.serialize(watch, "boolean"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'DELETE', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "V1Status"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * delete a Job * @param name name of the Job * @param namespace object name and auth scope, such as for teams and projects * @param pretty If 'true', then the output is pretty printed. * @param body * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @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. * @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. * @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. * @param {*} [options] Override http request options. */ deleteNamespacedJob(name, namespace, pretty, body, dryRun, gracePeriodSeconds, orphanDependents, propagationPolicy, options = {}) { const localVarPath = this.basePath + '/apis/batch/v1/namespaces/{namespace}/jobs/{name}' .replace('{' + 'name' + '}', encodeURIComponent(String(name))) .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling deleteNamespacedJob.'); } // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling deleteNamespacedJob.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, "string"); } if (gracePeriodSeconds !== undefined) { localVarQueryParameters['gracePeriodSeconds'] = ObjectSerializer.serialize(gracePeriodSeconds, "number"); } if (orphanDependents !== undefined) { localVarQueryParameters['orphanDependents'] = ObjectSerializer.serialize(orphanDependents, "boolean"); } if (propagationPolicy !== undefined) { localVarQueryParameters['propagationPolicy'] = ObjectSerializer.serialize(propagationPolicy, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'DELETE', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: ObjectSerializer.serialize(body, "V1DeleteOptions") }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "V1Status"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * get available resources * @param {*} [options] Override http request options. */ getAPIResources(options = {}) { const localVarPath = this.basePath + '/apis/batch/v1/'; let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'GET', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "V1APIResourceList"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * list or watch objects of kind Job * @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. * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything. * @param includeUninitialized If true, partially initialized resources are included in the response. * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything. * @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. * @param pretty If 'true', then the output is pretty printed. * @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. * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. * @param watch Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion. * @param {*} [options] Override http request options. */ listJobForAllNamespaces(_continue, fieldSelector, includeUninitialized, labelSelector, limit, pretty, resourceVersion, timeoutSeconds, watch, options = {}) { const localVarPath = this.basePath + '/apis/batch/v1/jobs'; let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; if (_continue !== undefined) { localVarQueryParameters['continue'] = ObjectSerializer.serialize(_continue, "string"); } if (fieldSelector !== undefined) { localVarQueryParameters['fieldSelector'] = ObjectSerializer.serialize(fieldSelector, "string"); } if (includeUninitialized !== undefined) { localVarQueryParameters['includeUninitialized'] = ObjectSerializer.serialize(includeUninitialized, "boolean"); } if (labelSelector !== undefined) { localVarQueryParameters['labelSelector'] = ObjectSerializer.serialize(labelSelector, "string"); } if (limit !== undefined) { localVarQueryParameters['limit'] = ObjectSerializer.serialize(limit, "number"); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, "string"); } if (resourceVersion !== undefined) { localVarQueryParameters['resourceVersion'] = ObjectSerializer.serialize(resourceVersion, "string"); } if (timeoutSeconds !== undefined) { localVarQueryParameters['timeoutSeconds'] = ObjectSerializer.serialize(timeoutSeconds, "number"); } if (watch !== undefined) { localVarQueryParameters['watch'] = ObjectSerializer.serialize(watch, "boolean"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'GET', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "V1JobList"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * list or watch objects of kind Job * @param namespace object name and auth scope, such as for teams and projects * @param includeUninitialized If true, partially initialized resources are included in the response. * @param pretty If 'true', then the output is pretty printed. * @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. * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything. * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything. * @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. * @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. * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. * @param watch Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion. * @param {*} [options] Override http request options. */ listNamespacedJob(namespace, includeUninitialized, pretty, _continue, fieldSelector, labelSelector, limit, resourceVersion, timeoutSeconds, watch, options = {}) { const localVarPath = this.basePath + '/apis/batch/v1/namespaces/{namespace}/jobs' .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling listNamespacedJob.'); } if (includeUninitialized !== undefined) { localVarQueryParameters['includeUninitialized'] = ObjectSerializer.serialize(includeUninitialized, "boolean"); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, "string"); } if (_continue !== undefined) { localVarQueryParameters['continue'] = ObjectSerializer.serialize(_continue, "string"); } if (fieldSelector !== undefined) { localVarQueryParameters['fieldSelector'] = ObjectSerializer.serialize(fieldSelector, "string"); } if (labelSelector !== undefined) { localVarQueryParameters['labelSelector'] = ObjectSerializer.serialize(labelSelector, "string"); } if (limit !== undefined) { localVarQueryParameters['limit'] = ObjectSerializer.serialize(limit, "number"); } if (resourceVersion !== undefined) { localVarQueryParameters['resourceVersion'] = ObjectSerializer.serialize(resourceVersion, "string"); } if (timeoutSeconds !== undefined) { localVarQueryParameters['timeoutSeconds'] = ObjectSerializer.serialize(timeoutSeconds, "number"); } if (watch !== undefined) { localVarQueryParameters['watch'] = ObjectSerializer.serialize(watch, "boolean"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'GET', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "V1JobList"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * partially update the specified Job * @param name name of the Job * @param namespace object name and auth scope, such as for teams and projects * @param body * @param pretty If 'true', then the output is pretty printed. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param {*} [options] Override http request options. */ patchNamespacedJob(name, namespace, body, pretty, dryRun, options = {}) { const localVarPath = this.basePath + '/apis/batch/v1/namespaces/{namespace}/jobs/{name}' .replace('{' + 'name' + '}', encodeURIComponent(String(name))) .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling patchNamespacedJob.'); } // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling patchNamespacedJob.'); } // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling patchNamespacedJob.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'PATCH', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: ObjectSerializer.serialize(body, "any") }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "V1Job"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * partially update status of the specified Job * @param name name of the Job * @param namespace object name and auth scope, such as for teams and projects * @param body * @param pretty If 'true', then the output is pretty printed. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param {*} [options] Override http request options. */ patchNamespacedJobStatus(name, namespace, body, pretty, dryRun, options = {}) { const localVarPath = this.basePath + '/apis/batch/v1/namespaces/{namespace}/jobs/{name}/status' .replace('{' + 'name' + '}', encodeURIComponent(String(name))) .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling patchNamespacedJobStatus.'); } // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling patchNamespacedJobStatus.'); } // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling patchNamespacedJobStatus.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'PATCH', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: ObjectSerializer.serialize(body, "any") }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "V1Job"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * read the specified Job * @param name name of the Job * @param namespace object name and auth scope, such as for teams and projects * @param pretty If 'true', then the output is pretty printed. * @param exact Should the export be exact. Exact export maintains cluster-specific fields like 'Namespace'. * @param _export Should this value be exported. Export strips fields that a user can not specify. * @param {*} [options] Override http request options. */ readNamespacedJob(name, namespace, pretty, exact, _export, options = {}) { const localVarPath = this.basePath + '/apis/batch/v1/namespaces/{namespace}/jobs/{name}' .replace('{' + 'name' + '}', encodeURIComponent(String(name))) .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling readNamespacedJob.'); } // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling readNamespacedJob.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, "string"); } if (exact !== undefined) { localVarQueryParameters['exact'] = ObjectSerializer.serialize(exact, "boolean"); } if (_export !== undefined) { localVarQueryParameters['export'] = ObjectSerializer.serialize(_export, "boolean"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'GET', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "V1Job"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * read status of the specified Job * @param name name of the Job * @param namespace object name and auth scope, such as for teams and projects * @param pretty If 'true', then the output is pretty printed. * @param {*} [options] Override http request options. */ readNamespacedJobStatus(name, namespace, pretty, options = {}) { const localVarPath = this.basePath + '/apis/batch/v1/namespaces/{namespace}/jobs/{name}/status' .replace('{' + 'name' + '}', encodeURIComponent(String(name))) .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling readNamespacedJobStatus.'); } // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling readNamespacedJobStatus.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'GET', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "V1Job"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * replace the specified Job * @param name name of the Job * @param namespace object name and auth scope, such as for teams and projects * @param body * @param pretty If 'true', then the output is pretty printed. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param {*} [options] Override http request options. */ replaceNamespacedJob(name, namespace, body, pretty, dryRun, options = {}) { const localVarPath = this.basePath + '/apis/batch/v1/namespaces/{namespace}/jobs/{name}' .replace('{' + 'name' + '}', encodeURIComponent(String(name))) .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling replaceNamespacedJob.'); } // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling replaceNamespacedJob.'); } // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling replaceNamespacedJob.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'PUT', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: ObjectSerializer.serialize(body, "V1Job") }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "V1Job"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * replace status of the specified Job * @param name name of the Job * @param namespace object name and auth scope, such as for teams and projects * @param body * @param pretty If 'true', then the output is pretty printed. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param {*} [options] Override http request options. */ replaceNamespacedJobStatus(name, namespace, body, pretty, dryRun, options = {}) { const localVarPath = this.basePath + '/apis/batch/v1/namespaces/{namespace}/jobs/{name}/status' .replace('{' + 'name' + '}', encodeURIComponent(String(name))) .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling replaceNamespacedJobStatus.'); } // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling replaceNamespacedJobStatus.'); } // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling replaceNamespacedJobStatus.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'PUT', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: ObjectSerializer.serialize(body, "V1Job") }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "V1Job"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } } exports.BatchV1Api = BatchV1Api; var BatchV1beta1ApiApiKeys; (function (BatchV1beta1ApiApiKeys) { BatchV1beta1ApiApiKeys[BatchV1beta1ApiApiKeys["BearerToken"] = 0] = "BearerToken"; })(BatchV1beta1ApiApiKeys = exports.BatchV1beta1ApiApiKeys || (exports.BatchV1beta1ApiApiKeys = {})); class BatchV1beta1Api { constructor(basePathOrUsername, password, basePath) { this._basePath = defaultBasePath; this.defaultHeaders = {}; this._useQuerystring = false; this.authentications = { 'default': new VoidAuth(), 'BearerToken': new ApiKeyAuth('header', 'authorization'), }; if (password) { if (basePath) { this.basePath = basePath; } } else { if (basePathOrUsername) { this.basePath = basePathOrUsername; } } } set useQuerystring(value) { this._useQuerystring = value; } set basePath(basePath) { this._basePath = basePath; } get basePath() { return this._basePath; } setDefaultAuthentication(auth) { this.authentications.default = auth; } setApiKey(key, value) { this.authentications[BatchV1beta1ApiApiKeys[key]].apiKey = value; } /** * create a CronJob * @param namespace object name and auth scope, such as for teams and projects * @param body * @param includeUninitialized If true, partially initialized resources are included in the response. * @param pretty If 'true', then the output is pretty printed. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param {*} [options] Override http request options. */ createNamespacedCronJob(namespace, body, includeUninitialized, pretty, dryRun, options = {}) { const localVarPath = this.basePath + '/apis/batch/v1beta1/namespaces/{namespace}/cronjobs' .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling createNamespacedCronJob.'); } // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling createNamespacedCronJob.'); } if (includeUninitialized !== undefined) { localVarQueryParameters['includeUninitialized'] = ObjectSerializer.serialize(includeUninitialized, "boolean"); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'POST', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: ObjectSerializer.serialize(body, "V1beta1CronJob") }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "V1beta1CronJob"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * delete collection of CronJob * @param namespace object name and auth scope, such as for teams and projects * @param includeUninitialized If true, partially initialized resources are included in the response. * @param pretty If 'true', then the output is pretty printed. * @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. * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything. * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything. * @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. * @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. * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. * @param watch Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion. * @param {*} [options] Override http request options. */ deleteCollectionNamespacedCronJob(namespace, includeUninitialized, pretty, _continue, fieldSelector, labelSelector, limit, resourceVersion, timeoutSeconds, watch, options = {}) { const localVarPath = this.basePath + '/apis/batch/v1beta1/namespaces/{namespace}/cronjobs' .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling deleteCollectionNamespacedCronJob.'); } if (includeUninitialized !== undefined) { localVarQueryParameters['includeUninitialized'] = ObjectSerializer.serialize(includeUninitialized, "boolean"); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, "string"); } if (_continue !== undefined) { localVarQueryParameters['continue'] = ObjectSerializer.serialize(_continue, "string"); } if (fieldSelector !== undefined) { localVarQueryParameters['fieldSelector'] = ObjectSerializer.serialize(fieldSelector, "string"); } if (labelSelector !== undefined) { localVarQueryParameters['labelSelector'] = ObjectSerializer.serialize(labelSelector, "string"); } if (limit !== undefined) { localVarQueryParameters['limit'] = ObjectSerializer.serialize(limit, "number"); } if (resourceVersion !== undefined) { localVarQueryParameters['resourceVersion'] = ObjectSerializer.serialize(resourceVersion, "string"); } if (timeoutSeconds !== undefined) { localVarQueryParameters['timeoutSeconds'] = ObjectSerializer.serialize(timeoutSeconds, "number"); } if (watch !== undefined) { localVarQueryParameters['watch'] = ObjectSerializer.serialize(watch, "boolean"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'DELETE', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "V1Status"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * delete a CronJob * @param name name of the CronJob * @param namespace object name and auth scope, such as for teams and projects * @param pretty If 'true', then the output is pretty printed. * @param body * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @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. * @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. * @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. * @param {*} [options] Override http request options. */ deleteNamespacedCronJob(name, namespace, pretty, body, dryRun, gracePeriodSeconds, orphanDependents, propagationPolicy, options = {}) { const localVarPath = this.basePath + '/apis/batch/v1beta1/namespaces/{namespace}/cronjobs/{name}' .replace('{' + 'name' + '}', encodeURIComponent(String(name))) .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling deleteNamespacedCronJob.'); } // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling deleteNamespacedCronJob.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, "string"); } if (gracePeriodSeconds !== undefined) { localVarQueryParameters['gracePeriodSeconds'] = ObjectSerializer.serialize(gracePeriodSeconds, "number"); } if (orphanDependents !== undefined) { localVarQueryParameters['orphanDependents'] = ObjectSerializer.serialize(orphanDependents, "boolean"); } if (propagationPolicy !== undefined) { localVarQueryParameters['propagationPolicy'] = ObjectSerializer.serialize(propagationPolicy, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'DELETE', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: ObjectSerializer.serialize(body, "V1DeleteOptions") }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "V1Status"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * get available resources * @param {*} [options] Override http request options. */ getAPIResources(options = {}) { const localVarPath = this.basePath + '/apis/batch/v1beta1/'; let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'GET', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "V1APIResourceList"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * list or watch objects of kind CronJob * @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. * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything. * @param includeUninitialized If true, partially initialized resources are included in the response. * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything. * @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. * @param pretty If 'true', then the output is pretty printed. * @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. * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. * @param watch Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion. * @param {*} [options] Override http request options. */ listCronJobForAllNamespaces(_continue, fieldSelector, includeUninitialized, labelSelector, limit, pretty, resourceVersion, timeoutSeconds, watch, options = {}) { const localVarPath = this.basePath + '/apis/batch/v1beta1/cronjobs'; let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; if (_continue !== undefined) { localVarQueryParameters['continue'] = ObjectSerializer.serialize(_continue, "string"); } if (fieldSelector !== undefined) { localVarQueryParameters['fieldSelector'] = ObjectSerializer.serialize(fieldSelector, "string"); } if (includeUninitialized !== undefined) { localVarQueryParameters['includeUninitialized'] = ObjectSerializer.serialize(includeUninitialized, "boolean"); } if (labelSelector !== undefined) { localVarQueryParameters['labelSelector'] = ObjectSerializer.serialize(labelSelector, "string"); } if (limit !== undefined) { localVarQueryParameters['limit'] = ObjectSerializer.serialize(limit, "number"); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, "string"); } if (resourceVersion !== undefined) { localVarQueryParameters['resourceVersion'] = ObjectSerializer.serialize(resourceVersion, "string"); } if (timeoutSeconds !== undefined) { localVarQueryParameters['timeoutSeconds'] = ObjectSerializer.serialize(timeoutSeconds, "number"); } if (watch !== undefined) { localVarQueryParameters['watch'] = ObjectSerializer.serialize(watch, "boolean"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'GET', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "V1beta1CronJobList"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * list or watch objects of kind CronJob * @param namespace object name and auth scope, such as for teams and projects * @param includeUninitialized If true, partially initialized resources are included in the response. * @param pretty If 'true', then the output is pretty printed. * @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. * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything. * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything. * @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. * @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. * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. * @param watch Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion. * @param {*} [options] Override http request options. */ listNamespacedCronJob(namespace, includeUninitialized, pretty, _continue, fieldSelector, labelSelector, limit, resourceVersion, timeoutSeconds, watch, options = {}) { const localVarPath = this.basePath + '/apis/batch/v1beta1/namespaces/{namespace}/cronjobs' .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling listNamespacedCronJob.'); } if (includeUninitialized !== undefined) { localVarQueryParameters['includeUninitialized'] = ObjectSerializer.serialize(includeUninitialized, "boolean"); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, "string"); } if (_continue !== undefined) { localVarQueryParameters['continue'] = ObjectSerializer.serialize(_continue, "string"); } if (fieldSelector !== undefined) { localVarQueryParameters['fieldSelector'] = ObjectSerializer.serialize(fieldSelector, "string"); } if (labelSelector !== undefined) { localVarQueryParameters['labelSelector'] = ObjectSerializer.serialize(labelSelector, "string"); } if (limit !== undefined) { localVarQueryParameters['limit'] = ObjectSerializer.serialize(limit, "number"); } if (resourceVersion !== undefined) { localVarQueryParameters['resourceVersion'] = ObjectSerializer.serialize(resourceVersion, "string"); } if (timeoutSeconds !== undefined) { localVarQueryParameters['timeoutSeconds'] = ObjectSerializer.serialize(timeoutSeconds, "number"); } if (watch !== undefined) { localVarQueryParameters['watch'] = ObjectSerializer.serialize(watch, "boolean"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'GET', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "V1beta1CronJobList"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * partially update the specified CronJob * @param name name of the CronJob * @param namespace object name and auth scope, such as for teams and projects * @param body * @param pretty If 'true', then the output is pretty printed. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param {*} [options] Override http request options. */ patchNamespacedCronJob(name, namespace, body, pretty, dryRun, options = {}) { const localVarPath = this.basePath + '/apis/batch/v1beta1/namespaces/{namespace}/cronjobs/{name}' .replace('{' + 'name' + '}', encodeURIComponent(String(name))) .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling patchNamespacedCronJob.'); } // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling patchNamespacedCronJob.'); } // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling patchNamespacedCronJob.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'PATCH', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: ObjectSerializer.serialize(body, "any") }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "V1beta1CronJob"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * partially update status of the specified CronJob * @param name name of the CronJob * @param namespace object name and auth scope, such as for teams and projects * @param body * @param pretty If 'true', then the output is pretty printed. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param {*} [options] Override http request options. */ patchNamespacedCronJobStatus(name, namespace, body, pretty, dryRun, options = {}) { const localVarPath = this.basePath + '/apis/batch/v1beta1/namespaces/{namespace}/cronjobs/{name}/status' .replace('{' + 'name' + '}', encodeURIComponent(String(name))) .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling patchNamespacedCronJobStatus.'); } // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling patchNamespacedCronJobStatus.'); } // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling patchNamespacedCronJobStatus.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'PATCH', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: ObjectSerializer.serialize(body, "any") }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "V1beta1CronJob"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * read the specified CronJob * @param name name of the CronJob * @param namespace object name and auth scope, such as for teams and projects * @param pretty If 'true', then the output is pretty printed. * @param exact Should the export be exact. Exact export maintains cluster-specific fields like 'Namespace'. * @param _export Should this value be exported. Export strips fields that a user can not specify. * @param {*} [options] Override http request options. */ readNamespacedCronJob(name, namespace, pretty, exact, _export, options = {}) { const localVarPath = this.basePath + '/apis/batch/v1beta1/namespaces/{namespace}/cronjobs/{name}' .replace('{' + 'name' + '}', encodeURIComponent(String(name))) .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling readNamespacedCronJob.'); } // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling readNamespacedCronJob.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, "string"); } if (exact !== undefined) { localVarQueryParameters['exact'] = ObjectSerializer.serialize(exact, "boolean"); } if (_export !== undefined) { localVarQueryParameters['export'] = ObjectSerializer.serialize(_export, "boolean"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'GET', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "V1beta1CronJob"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * read status of the specified CronJob * @param name name of the CronJob * @param namespace object name and auth scope, such as for teams and projects * @param pretty If 'true', then the output is pretty printed. * @param {*} [options] Override http request options. */ readNamespacedCronJobStatus(name, namespace, pretty, options = {}) { const localVarPath = this.basePath + '/apis/batch/v1beta1/namespaces/{namespace}/cronjobs/{name}/status' .replace('{' + 'name' + '}', encodeURIComponent(String(name))) .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling readNamespacedCronJobStatus.'); } // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling readNamespacedCronJobStatus.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'GET', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "V1beta1CronJob"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * replace the specified CronJob * @param name name of the CronJob * @param namespace object name and auth scope, such as for teams and projects * @param body * @param pretty If 'true', then the output is pretty printed. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param {*} [options] Override http request options. */ replaceNamespacedCronJob(name, namespace, body, pretty, dryRun, options = {}) { const localVarPath = this.basePath + '/apis/batch/v1beta1/namespaces/{namespace}/cronjobs/{name}' .replace('{' + 'name' + '}', encodeURIComponent(String(name))) .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling replaceNamespacedCronJob.'); } // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling replaceNamespacedCronJob.'); } // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling replaceNamespacedCronJob.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'PUT', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: ObjectSerializer.serialize(body, "V1beta1CronJob") }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "V1beta1CronJob"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * replace status of the specified CronJob * @param name name of the CronJob * @param namespace object name and auth scope, such as for teams and projects * @param body * @param pretty If 'true', then the output is pretty printed. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param {*} [options] Override http request options. */ replaceNamespacedCronJobStatus(name, namespace, body, pretty, dryRun, options = {}) { const localVarPath = this.basePath + '/apis/batch/v1beta1/namespaces/{namespace}/cronjobs/{name}/status' .replace('{' + 'name' + '}', encodeURIComponent(String(name))) .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling replaceNamespacedCronJobStatus.'); } // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling replaceNamespacedCronJobStatus.'); } // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling replaceNamespacedCronJobStatus.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'PUT', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: ObjectSerializer.serialize(body, "V1beta1CronJob") }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "V1beta1CronJob"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } } exports.BatchV1beta1Api = BatchV1beta1Api; var BatchV2alpha1ApiApiKeys; (function (BatchV2alpha1ApiApiKeys) { BatchV2alpha1ApiApiKeys[BatchV2alpha1ApiApiKeys["BearerToken"] = 0] = "BearerToken"; })(BatchV2alpha1ApiApiKeys = exports.BatchV2alpha1ApiApiKeys || (exports.BatchV2alpha1ApiApiKeys = {})); class BatchV2alpha1Api { constructor(basePathOrUsername, password, basePath) { this._basePath = defaultBasePath; this.defaultHeaders = {}; this._useQuerystring = false; this.authentications = { 'default': new VoidAuth(), 'BearerToken': new ApiKeyAuth('header', 'authorization'), }; if (password) { if (basePath) { this.basePath = basePath; } } else { if (basePathOrUsername) { this.basePath = basePathOrUsername; } } } set useQuerystring(value) { this._useQuerystring = value; } set basePath(basePath) { this._basePath = basePath; } get basePath() { return this._basePath; } setDefaultAuthentication(auth) { this.authentications.default = auth; } setApiKey(key, value) { this.authentications[BatchV2alpha1ApiApiKeys[key]].apiKey = value; } /** * create a CronJob * @param namespace object name and auth scope, such as for teams and projects * @param body * @param includeUninitialized If true, partially initialized resources are included in the response. * @param pretty If 'true', then the output is pretty printed. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param {*} [options] Override http request options. */ createNamespacedCronJob(namespace, body, includeUninitialized, pretty, dryRun, options = {}) { const localVarPath = this.basePath + '/apis/batch/v2alpha1/namespaces/{namespace}/cronjobs' .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling createNamespacedCronJob.'); } // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling createNamespacedCronJob.'); } if (includeUninitialized !== undefined) { localVarQueryParameters['includeUninitialized'] = ObjectSerializer.serialize(includeUninitialized, "boolean"); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'POST', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: ObjectSerializer.serialize(body, "V2alpha1CronJob") }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "V2alpha1CronJob"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * delete collection of CronJob * @param namespace object name and auth scope, such as for teams and projects * @param includeUninitialized If true, partially initialized resources are included in the response. * @param pretty If 'true', then the output is pretty printed. * @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. * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything. * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything. * @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. * @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. * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. * @param watch Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion. * @param {*} [options] Override http request options. */ deleteCollectionNamespacedCronJob(namespace, includeUninitialized, pretty, _continue, fieldSelector, labelSelector, limit, resourceVersion, timeoutSeconds, watch, options = {}) { const localVarPath = this.basePath + '/apis/batch/v2alpha1/namespaces/{namespace}/cronjobs' .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling deleteCollectionNamespacedCronJob.'); } if (includeUninitialized !== undefined) { localVarQueryParameters['includeUninitialized'] = ObjectSerializer.serialize(includeUninitialized, "boolean"); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, "string"); } if (_continue !== undefined) { localVarQueryParameters['continue'] = ObjectSerializer.serialize(_continue, "string"); } if (fieldSelector !== undefined) { localVarQueryParameters['fieldSelector'] = ObjectSerializer.serialize(fieldSelector, "string"); } if (labelSelector !== undefined) { localVarQueryParameters['labelSelector'] = ObjectSerializer.serialize(labelSelector, "string"); } if (limit !== undefined) { localVarQueryParameters['limit'] = ObjectSerializer.serialize(limit, "number"); } if (resourceVersion !== undefined) { localVarQueryParameters['resourceVersion'] = ObjectSerializer.serialize(resourceVersion, "string"); } if (timeoutSeconds !== undefined) { localVarQueryParameters['timeoutSeconds'] = ObjectSerializer.serialize(timeoutSeconds, "number"); } if (watch !== undefined) { localVarQueryParameters['watch'] = ObjectSerializer.serialize(watch, "boolean"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'DELETE', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "V1Status"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * delete a CronJob * @param name name of the CronJob * @param namespace object name and auth scope, such as for teams and projects * @param pretty If 'true', then the output is pretty printed. * @param body * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @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. * @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. * @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. * @param {*} [options] Override http request options. */ deleteNamespacedCronJob(name, namespace, pretty, body, dryRun, gracePeriodSeconds, orphanDependents, propagationPolicy, options = {}) { const localVarPath = this.basePath + '/apis/batch/v2alpha1/namespaces/{namespace}/cronjobs/{name}' .replace('{' + 'name' + '}', encodeURIComponent(String(name))) .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling deleteNamespacedCronJob.'); } // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling deleteNamespacedCronJob.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, "string"); } if (gracePeriodSeconds !== undefined) { localVarQueryParameters['gracePeriodSeconds'] = ObjectSerializer.serialize(gracePeriodSeconds, "number"); } if (orphanDependents !== undefined) { localVarQueryParameters['orphanDependents'] = ObjectSerializer.serialize(orphanDependents, "boolean"); } if (propagationPolicy !== undefined) { localVarQueryParameters['propagationPolicy'] = ObjectSerializer.serialize(propagationPolicy, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'DELETE', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: ObjectSerializer.serialize(body, "V1DeleteOptions") }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "V1Status"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * get available resources * @param {*} [options] Override http request options. */ getAPIResources(options = {}) { const localVarPath = this.basePath + '/apis/batch/v2alpha1/'; let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'GET', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "V1APIResourceList"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * list or watch objects of kind CronJob * @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. * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything. * @param includeUninitialized If true, partially initialized resources are included in the response. * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything. * @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. * @param pretty If 'true', then the output is pretty printed. * @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. * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. * @param watch Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion. * @param {*} [options] Override http request options. */ listCronJobForAllNamespaces(_continue, fieldSelector, includeUninitialized, labelSelector, limit, pretty, resourceVersion, timeoutSeconds, watch, options = {}) { const localVarPath = this.basePath + '/apis/batch/v2alpha1/cronjobs'; let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; if (_continue !== undefined) { localVarQueryParameters['continue'] = ObjectSerializer.serialize(_continue, "string"); } if (fieldSelector !== undefined) { localVarQueryParameters['fieldSelector'] = ObjectSerializer.serialize(fieldSelector, "string"); } if (includeUninitialized !== undefined) { localVarQueryParameters['includeUninitialized'] = ObjectSerializer.serialize(includeUninitialized, "boolean"); } if (labelSelector !== undefined) { localVarQueryParameters['labelSelector'] = ObjectSerializer.serialize(labelSelector, "string"); } if (limit !== undefined) { localVarQueryParameters['limit'] = ObjectSerializer.serialize(limit, "number"); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, "string"); } if (resourceVersion !== undefined) { localVarQueryParameters['resourceVersion'] = ObjectSerializer.serialize(resourceVersion, "string"); } if (timeoutSeconds !== undefined) { localVarQueryParameters['timeoutSeconds'] = ObjectSerializer.serialize(timeoutSeconds, "number"); } if (watch !== undefined) { localVarQueryParameters['watch'] = ObjectSerializer.serialize(watch, "boolean"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'GET', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "V2alpha1CronJobList"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * list or watch objects of kind CronJob * @param namespace object name and auth scope, such as for teams and projects * @param includeUninitialized If true, partially initialized resources are included in the response. * @param pretty If 'true', then the output is pretty printed. * @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. * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything. * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything. * @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. * @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. * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. * @param watch Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion. * @param {*} [options] Override http request options. */ listNamespacedCronJob(namespace, includeUninitialized, pretty, _continue, fieldSelector, labelSelector, limit, resourceVersion, timeoutSeconds, watch, options = {}) { const localVarPath = this.basePath + '/apis/batch/v2alpha1/namespaces/{namespace}/cronjobs' .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling listNamespacedCronJob.'); } if (includeUninitialized !== undefined) { localVarQueryParameters['includeUninitialized'] = ObjectSerializer.serialize(includeUninitialized, "boolean"); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, "string"); } if (_continue !== undefined) { localVarQueryParameters['continue'] = ObjectSerializer.serialize(_continue, "string"); } if (fieldSelector !== undefined) { localVarQueryParameters['fieldSelector'] = ObjectSerializer.serialize(fieldSelector, "string"); } if (labelSelector !== undefined) { localVarQueryParameters['labelSelector'] = ObjectSerializer.serialize(labelSelector, "string"); } if (limit !== undefined) { localVarQueryParameters['limit'] = ObjectSerializer.serialize(limit, "number"); } if (resourceVersion !== undefined) { localVarQueryParameters['resourceVersion'] = ObjectSerializer.serialize(resourceVersion, "string"); } if (timeoutSeconds !== undefined) { localVarQueryParameters['timeoutSeconds'] = ObjectSerializer.serialize(timeoutSeconds, "number"); } if (watch !== undefined) { localVarQueryParameters['watch'] = ObjectSerializer.serialize(watch, "boolean"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'GET', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "V2alpha1CronJobList"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * partially update the specified CronJob * @param name name of the CronJob * @param namespace object name and auth scope, such as for teams and projects * @param body * @param pretty If 'true', then the output is pretty printed. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param {*} [options] Override http request options. */ patchNamespacedCronJob(name, namespace, body, pretty, dryRun, options = {}) { const localVarPath = this.basePath + '/apis/batch/v2alpha1/namespaces/{namespace}/cronjobs/{name}' .replace('{' + 'name' + '}', encodeURIComponent(String(name))) .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling patchNamespacedCronJob.'); } // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling patchNamespacedCronJob.'); } // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling patchNamespacedCronJob.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'PATCH', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: ObjectSerializer.serialize(body, "any") }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "V2alpha1CronJob"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * partially update status of the specified CronJob * @param name name of the CronJob * @param namespace object name and auth scope, such as for teams and projects * @param body * @param pretty If 'true', then the output is pretty printed. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param {*} [options] Override http request options. */ patchNamespacedCronJobStatus(name, namespace, body, pretty, dryRun, options = {}) { const localVarPath = this.basePath + '/apis/batch/v2alpha1/namespaces/{namespace}/cronjobs/{name}/status' .replace('{' + 'name' + '}', encodeURIComponent(String(name))) .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling patchNamespacedCronJobStatus.'); } // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling patchNamespacedCronJobStatus.'); } // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling patchNamespacedCronJobStatus.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'PATCH', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: ObjectSerializer.serialize(body, "any") }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "V2alpha1CronJob"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * read the specified CronJob * @param name name of the CronJob * @param namespace object name and auth scope, such as for teams and projects * @param pretty If 'true', then the output is pretty printed. * @param exact Should the export be exact. Exact export maintains cluster-specific fields like 'Namespace'. * @param _export Should this value be exported. Export strips fields that a user can not specify. * @param {*} [options] Override http request options. */ readNamespacedCronJob(name, namespace, pretty, exact, _export, options = {}) { const localVarPath = this.basePath + '/apis/batch/v2alpha1/namespaces/{namespace}/cronjobs/{name}' .replace('{' + 'name' + '}', encodeURIComponent(String(name))) .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling readNamespacedCronJob.'); } // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling readNamespacedCronJob.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, "string"); } if (exact !== undefined) { localVarQueryParameters['exact'] = ObjectSerializer.serialize(exact, "boolean"); } if (_export !== undefined) { localVarQueryParameters['export'] = ObjectSerializer.serialize(_export, "boolean"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'GET', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "V2alpha1CronJob"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * read status of the specified CronJob * @param name name of the CronJob * @param namespace object name and auth scope, such as for teams and projects * @param pretty If 'true', then the output is pretty printed. * @param {*} [options] Override http request options. */ readNamespacedCronJobStatus(name, namespace, pretty, options = {}) { const localVarPath = this.basePath + '/apis/batch/v2alpha1/namespaces/{namespace}/cronjobs/{name}/status' .replace('{' + 'name' + '}', encodeURIComponent(String(name))) .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling readNamespacedCronJobStatus.'); } // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling readNamespacedCronJobStatus.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'GET', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "V2alpha1CronJob"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * replace the specified CronJob * @param name name of the CronJob * @param namespace object name and auth scope, such as for teams and projects * @param body * @param pretty If 'true', then the output is pretty printed. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param {*} [options] Override http request options. */ replaceNamespacedCronJob(name, namespace, body, pretty, dryRun, options = {}) { const localVarPath = this.basePath + '/apis/batch/v2alpha1/namespaces/{namespace}/cronjobs/{name}' .replace('{' + 'name' + '}', encodeURIComponent(String(name))) .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling replaceNamespacedCronJob.'); } // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling replaceNamespacedCronJob.'); } // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling replaceNamespacedCronJob.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'PUT', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: ObjectSerializer.serialize(body, "V2alpha1CronJob") }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "V2alpha1CronJob"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * replace status of the specified CronJob * @param name name of the CronJob * @param namespace object name and auth scope, such as for teams and projects * @param body * @param pretty If 'true', then the output is pretty printed. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param {*} [options] Override http request options. */ replaceNamespacedCronJobStatus(name, namespace, body, pretty, dryRun, options = {}) { const localVarPath = this.basePath + '/apis/batch/v2alpha1/namespaces/{namespace}/cronjobs/{name}/status' .replace('{' + 'name' + '}', encodeURIComponent(String(name))) .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling replaceNamespacedCronJobStatus.'); } // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling replaceNamespacedCronJobStatus.'); } // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling replaceNamespacedCronJobStatus.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'PUT', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: ObjectSerializer.serialize(body, "V2alpha1CronJob") }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "V2alpha1CronJob"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } } exports.BatchV2alpha1Api = BatchV2alpha1Api; var CertificatesApiApiKeys; (function (CertificatesApiApiKeys) { CertificatesApiApiKeys[CertificatesApiApiKeys["BearerToken"] = 0] = "BearerToken"; })(CertificatesApiApiKeys = exports.CertificatesApiApiKeys || (exports.CertificatesApiApiKeys = {})); class CertificatesApi { constructor(basePathOrUsername, password, basePath) { this._basePath = defaultBasePath; this.defaultHeaders = {}; this._useQuerystring = false; this.authentications = { 'default': new VoidAuth(), 'BearerToken': new ApiKeyAuth('header', 'authorization'), }; if (password) { if (basePath) { this.basePath = basePath; } } else { if (basePathOrUsername) { this.basePath = basePathOrUsername; } } } set useQuerystring(value) { this._useQuerystring = value; } set basePath(basePath) { this._basePath = basePath; } get basePath() { return this._basePath; } setDefaultAuthentication(auth) { this.authentications.default = auth; } setApiKey(key, value) { this.authentications[CertificatesApiApiKeys[key]].apiKey = value; } /** * get information of a group * @param {*} [options] Override http request options. */ getAPIGroup(options = {}) { const localVarPath = this.basePath + '/apis/certificates.k8s.io/'; let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'GET', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "V1APIGroup"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } } exports.CertificatesApi = CertificatesApi; var CertificatesV1beta1ApiApiKeys; (function (CertificatesV1beta1ApiApiKeys) { CertificatesV1beta1ApiApiKeys[CertificatesV1beta1ApiApiKeys["BearerToken"] = 0] = "BearerToken"; })(CertificatesV1beta1ApiApiKeys = exports.CertificatesV1beta1ApiApiKeys || (exports.CertificatesV1beta1ApiApiKeys = {})); class CertificatesV1beta1Api { constructor(basePathOrUsername, password, basePath) { this._basePath = defaultBasePath; this.defaultHeaders = {}; this._useQuerystring = false; this.authentications = { 'default': new VoidAuth(), 'BearerToken': new ApiKeyAuth('header', 'authorization'), }; if (password) { if (basePath) { this.basePath = basePath; } } else { if (basePathOrUsername) { this.basePath = basePathOrUsername; } } } set useQuerystring(value) { this._useQuerystring = value; } set basePath(basePath) { this._basePath = basePath; } get basePath() { return this._basePath; } setDefaultAuthentication(auth) { this.authentications.default = auth; } setApiKey(key, value) { this.authentications[CertificatesV1beta1ApiApiKeys[key]].apiKey = value; } /** * create a CertificateSigningRequest * @param body * @param includeUninitialized If true, partially initialized resources are included in the response. * @param pretty If 'true', then the output is pretty printed. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param {*} [options] Override http request options. */ createCertificateSigningRequest(body, includeUninitialized, pretty, dryRun, options = {}) { const localVarPath = this.basePath + '/apis/certificates.k8s.io/v1beta1/certificatesigningrequests'; let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling createCertificateSigningRequest.'); } if (includeUninitialized !== undefined) { localVarQueryParameters['includeUninitialized'] = ObjectSerializer.serialize(includeUninitialized, "boolean"); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'POST', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: ObjectSerializer.serialize(body, "V1beta1CertificateSigningRequest") }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "V1beta1CertificateSigningRequest"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * delete a CertificateSigningRequest * @param name name of the CertificateSigningRequest * @param pretty If 'true', then the output is pretty printed. * @param body * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @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. * @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. * @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. * @param {*} [options] Override http request options. */ deleteCertificateSigningRequest(name, pretty, body, dryRun, gracePeriodSeconds, orphanDependents, propagationPolicy, options = {}) { const localVarPath = this.basePath + '/apis/certificates.k8s.io/v1beta1/certificatesigningrequests/{name}' .replace('{' + 'name' + '}', encodeURIComponent(String(name))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling deleteCertificateSigningRequest.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, "string"); } if (gracePeriodSeconds !== undefined) { localVarQueryParameters['gracePeriodSeconds'] = ObjectSerializer.serialize(gracePeriodSeconds, "number"); } if (orphanDependents !== undefined) { localVarQueryParameters['orphanDependents'] = ObjectSerializer.serialize(orphanDependents, "boolean"); } if (propagationPolicy !== undefined) { localVarQueryParameters['propagationPolicy'] = ObjectSerializer.serialize(propagationPolicy, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'DELETE', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: ObjectSerializer.serialize(body, "V1DeleteOptions") }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "V1Status"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * delete collection of CertificateSigningRequest * @param includeUninitialized If true, partially initialized resources are included in the response. * @param pretty If 'true', then the output is pretty printed. * @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. * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything. * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything. * @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. * @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. * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. * @param watch Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion. * @param {*} [options] Override http request options. */ deleteCollectionCertificateSigningRequest(includeUninitialized, pretty, _continue, fieldSelector, labelSelector, limit, resourceVersion, timeoutSeconds, watch, options = {}) { const localVarPath = this.basePath + '/apis/certificates.k8s.io/v1beta1/certificatesigningrequests'; let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; if (includeUninitialized !== undefined) { localVarQueryParameters['includeUninitialized'] = ObjectSerializer.serialize(includeUninitialized, "boolean"); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, "string"); } if (_continue !== undefined) { localVarQueryParameters['continue'] = ObjectSerializer.serialize(_continue, "string"); } if (fieldSelector !== undefined) { localVarQueryParameters['fieldSelector'] = ObjectSerializer.serialize(fieldSelector, "string"); } if (labelSelector !== undefined) { localVarQueryParameters['labelSelector'] = ObjectSerializer.serialize(labelSelector, "string"); } if (limit !== undefined) { localVarQueryParameters['limit'] = ObjectSerializer.serialize(limit, "number"); } if (resourceVersion !== undefined) { localVarQueryParameters['resourceVersion'] = ObjectSerializer.serialize(resourceVersion, "string"); } if (timeoutSeconds !== undefined) { localVarQueryParameters['timeoutSeconds'] = ObjectSerializer.serialize(timeoutSeconds, "number"); } if (watch !== undefined) { localVarQueryParameters['watch'] = ObjectSerializer.serialize(watch, "boolean"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'DELETE', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "V1Status"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * get available resources * @param {*} [options] Override http request options. */ getAPIResources(options = {}) { const localVarPath = this.basePath + '/apis/certificates.k8s.io/v1beta1/'; let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'GET', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "V1APIResourceList"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * list or watch objects of kind CertificateSigningRequest * @param includeUninitialized If true, partially initialized resources are included in the response. * @param pretty If 'true', then the output is pretty printed. * @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. * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything. * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything. * @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. * @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. * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. * @param watch Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion. * @param {*} [options] Override http request options. */ listCertificateSigningRequest(includeUninitialized, pretty, _continue, fieldSelector, labelSelector, limit, resourceVersion, timeoutSeconds, watch, options = {}) { const localVarPath = this.basePath + '/apis/certificates.k8s.io/v1beta1/certificatesigningrequests'; let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; if (includeUninitialized !== undefined) { localVarQueryParameters['includeUninitialized'] = ObjectSerializer.serialize(includeUninitialized, "boolean"); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, "string"); } if (_continue !== undefined) { localVarQueryParameters['continue'] = ObjectSerializer.serialize(_continue, "string"); } if (fieldSelector !== undefined) { localVarQueryParameters['fieldSelector'] = ObjectSerializer.serialize(fieldSelector, "string"); } if (labelSelector !== undefined) { localVarQueryParameters['labelSelector'] = ObjectSerializer.serialize(labelSelector, "string"); } if (limit !== undefined) { localVarQueryParameters['limit'] = ObjectSerializer.serialize(limit, "number"); } if (resourceVersion !== undefined) { localVarQueryParameters['resourceVersion'] = ObjectSerializer.serialize(resourceVersion, "string"); } if (timeoutSeconds !== undefined) { localVarQueryParameters['timeoutSeconds'] = ObjectSerializer.serialize(timeoutSeconds, "number"); } if (watch !== undefined) { localVarQueryParameters['watch'] = ObjectSerializer.serialize(watch, "boolean"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'GET', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "V1beta1CertificateSigningRequestList"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * partially update the specified CertificateSigningRequest * @param name name of the CertificateSigningRequest * @param body * @param pretty If 'true', then the output is pretty printed. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param {*} [options] Override http request options. */ patchCertificateSigningRequest(name, body, pretty, dryRun, options = {}) { const localVarPath = this.basePath + '/apis/certificates.k8s.io/v1beta1/certificatesigningrequests/{name}' .replace('{' + 'name' + '}', encodeURIComponent(String(name))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling patchCertificateSigningRequest.'); } // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling patchCertificateSigningRequest.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'PATCH', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: ObjectSerializer.serialize(body, "any") }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "V1beta1CertificateSigningRequest"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * partially update status of the specified CertificateSigningRequest * @param name name of the CertificateSigningRequest * @param body * @param pretty If 'true', then the output is pretty printed. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param {*} [options] Override http request options. */ patchCertificateSigningRequestStatus(name, body, pretty, dryRun, options = {}) { const localVarPath = this.basePath + '/apis/certificates.k8s.io/v1beta1/certificatesigningrequests/{name}/status' .replace('{' + 'name' + '}', encodeURIComponent(String(name))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling patchCertificateSigningRequestStatus.'); } // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling patchCertificateSigningRequestStatus.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'PATCH', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: ObjectSerializer.serialize(body, "any") }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "V1beta1CertificateSigningRequest"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * read the specified CertificateSigningRequest * @param name name of the CertificateSigningRequest * @param pretty If 'true', then the output is pretty printed. * @param exact Should the export be exact. Exact export maintains cluster-specific fields like 'Namespace'. * @param _export Should this value be exported. Export strips fields that a user can not specify. * @param {*} [options] Override http request options. */ readCertificateSigningRequest(name, pretty, exact, _export, options = {}) { const localVarPath = this.basePath + '/apis/certificates.k8s.io/v1beta1/certificatesigningrequests/{name}' .replace('{' + 'name' + '}', encodeURIComponent(String(name))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling readCertificateSigningRequest.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, "string"); } if (exact !== undefined) { localVarQueryParameters['exact'] = ObjectSerializer.serialize(exact, "boolean"); } if (_export !== undefined) { localVarQueryParameters['export'] = ObjectSerializer.serialize(_export, "boolean"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'GET', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "V1beta1CertificateSigningRequest"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * read status of the specified CertificateSigningRequest * @param name name of the CertificateSigningRequest * @param pretty If 'true', then the output is pretty printed. * @param {*} [options] Override http request options. */ readCertificateSigningRequestStatus(name, pretty, options = {}) { const localVarPath = this.basePath + '/apis/certificates.k8s.io/v1beta1/certificatesigningrequests/{name}/status' .replace('{' + 'name' + '}', encodeURIComponent(String(name))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling readCertificateSigningRequestStatus.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'GET', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "V1beta1CertificateSigningRequest"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * replace the specified CertificateSigningRequest * @param name name of the CertificateSigningRequest * @param body * @param pretty If 'true', then the output is pretty printed. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param {*} [options] Override http request options. */ replaceCertificateSigningRequest(name, body, pretty, dryRun, options = {}) { const localVarPath = this.basePath + '/apis/certificates.k8s.io/v1beta1/certificatesigningrequests/{name}' .replace('{' + 'name' + '}', encodeURIComponent(String(name))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling replaceCertificateSigningRequest.'); } // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling replaceCertificateSigningRequest.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'PUT', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: ObjectSerializer.serialize(body, "V1beta1CertificateSigningRequest") }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "V1beta1CertificateSigningRequest"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * replace approval of the specified CertificateSigningRequest * @param name name of the CertificateSigningRequest * @param body * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param pretty If 'true', then the output is pretty printed. * @param {*} [options] Override http request options. */ replaceCertificateSigningRequestApproval(name, body, dryRun, pretty, options = {}) { const localVarPath = this.basePath + '/apis/certificates.k8s.io/v1beta1/certificatesigningrequests/{name}/approval' .replace('{' + 'name' + '}', encodeURIComponent(String(name))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling replaceCertificateSigningRequestApproval.'); } // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling replaceCertificateSigningRequestApproval.'); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, "string"); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'PUT', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: ObjectSerializer.serialize(body, "V1beta1CertificateSigningRequest") }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "V1beta1CertificateSigningRequest"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * replace status of the specified CertificateSigningRequest * @param name name of the CertificateSigningRequest * @param body * @param pretty If 'true', then the output is pretty printed. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param {*} [options] Override http request options. */ replaceCertificateSigningRequestStatus(name, body, pretty, dryRun, options = {}) { const localVarPath = this.basePath + '/apis/certificates.k8s.io/v1beta1/certificatesigningrequests/{name}/status' .replace('{' + 'name' + '}', encodeURIComponent(String(name))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling replaceCertificateSigningRequestStatus.'); } // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling replaceCertificateSigningRequestStatus.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'PUT', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: ObjectSerializer.serialize(body, "V1beta1CertificateSigningRequest") }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "V1beta1CertificateSigningRequest"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } } exports.CertificatesV1beta1Api = CertificatesV1beta1Api; var CoordinationApiApiKeys; (function (CoordinationApiApiKeys) { CoordinationApiApiKeys[CoordinationApiApiKeys["BearerToken"] = 0] = "BearerToken"; })(CoordinationApiApiKeys = exports.CoordinationApiApiKeys || (exports.CoordinationApiApiKeys = {})); class CoordinationApi { constructor(basePathOrUsername, password, basePath) { this._basePath = defaultBasePath; this.defaultHeaders = {}; this._useQuerystring = false; this.authentications = { 'default': new VoidAuth(), 'BearerToken': new ApiKeyAuth('header', 'authorization'), }; if (password) { if (basePath) { this.basePath = basePath; } } else { if (basePathOrUsername) { this.basePath = basePathOrUsername; } } } set useQuerystring(value) { this._useQuerystring = value; } set basePath(basePath) { this._basePath = basePath; } get basePath() { return this._basePath; } setDefaultAuthentication(auth) { this.authentications.default = auth; } setApiKey(key, value) { this.authentications[CoordinationApiApiKeys[key]].apiKey = value; } /** * get information of a group * @param {*} [options] Override http request options. */ getAPIGroup(options = {}) { const localVarPath = this.basePath + '/apis/coordination.k8s.io/'; let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'GET', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "V1APIGroup"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } } exports.CoordinationApi = CoordinationApi; var CoordinationV1beta1ApiApiKeys; (function (CoordinationV1beta1ApiApiKeys) { CoordinationV1beta1ApiApiKeys[CoordinationV1beta1ApiApiKeys["BearerToken"] = 0] = "BearerToken"; })(CoordinationV1beta1ApiApiKeys = exports.CoordinationV1beta1ApiApiKeys || (exports.CoordinationV1beta1ApiApiKeys = {})); class CoordinationV1beta1Api { constructor(basePathOrUsername, password, basePath) { this._basePath = defaultBasePath; this.defaultHeaders = {}; this._useQuerystring = false; this.authentications = { 'default': new VoidAuth(), 'BearerToken': new ApiKeyAuth('header', 'authorization'), }; if (password) { if (basePath) { this.basePath = basePath; } } else { if (basePathOrUsername) { this.basePath = basePathOrUsername; } } } set useQuerystring(value) { this._useQuerystring = value; } set basePath(basePath) { this._basePath = basePath; } get basePath() { return this._basePath; } setDefaultAuthentication(auth) { this.authentications.default = auth; } setApiKey(key, value) { this.authentications[CoordinationV1beta1ApiApiKeys[key]].apiKey = value; } /** * create a Lease * @param namespace object name and auth scope, such as for teams and projects * @param body * @param includeUninitialized If true, partially initialized resources are included in the response. * @param pretty If 'true', then the output is pretty printed. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param {*} [options] Override http request options. */ createNamespacedLease(namespace, body, includeUninitialized, pretty, dryRun, options = {}) { const localVarPath = this.basePath + '/apis/coordination.k8s.io/v1beta1/namespaces/{namespace}/leases' .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling createNamespacedLease.'); } // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling createNamespacedLease.'); } if (includeUninitialized !== undefined) { localVarQueryParameters['includeUninitialized'] = ObjectSerializer.serialize(includeUninitialized, "boolean"); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'POST', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: ObjectSerializer.serialize(body, "V1beta1Lease") }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "V1beta1Lease"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * delete collection of Lease * @param namespace object name and auth scope, such as for teams and projects * @param includeUninitialized If true, partially initialized resources are included in the response. * @param pretty If 'true', then the output is pretty printed. * @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. * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything. * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything. * @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. * @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. * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. * @param watch Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion. * @param {*} [options] Override http request options. */ deleteCollectionNamespacedLease(namespace, includeUninitialized, pretty, _continue, fieldSelector, labelSelector, limit, resourceVersion, timeoutSeconds, watch, options = {}) { const localVarPath = this.basePath + '/apis/coordination.k8s.io/v1beta1/namespaces/{namespace}/leases' .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling deleteCollectionNamespacedLease.'); } if (includeUninitialized !== undefined) { localVarQueryParameters['includeUninitialized'] = ObjectSerializer.serialize(includeUninitialized, "boolean"); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, "string"); } if (_continue !== undefined) { localVarQueryParameters['continue'] = ObjectSerializer.serialize(_continue, "string"); } if (fieldSelector !== undefined) { localVarQueryParameters['fieldSelector'] = ObjectSerializer.serialize(fieldSelector, "string"); } if (labelSelector !== undefined) { localVarQueryParameters['labelSelector'] = ObjectSerializer.serialize(labelSelector, "string"); } if (limit !== undefined) { localVarQueryParameters['limit'] = ObjectSerializer.serialize(limit, "number"); } if (resourceVersion !== undefined) { localVarQueryParameters['resourceVersion'] = ObjectSerializer.serialize(resourceVersion, "string"); } if (timeoutSeconds !== undefined) { localVarQueryParameters['timeoutSeconds'] = ObjectSerializer.serialize(timeoutSeconds, "number"); } if (watch !== undefined) { localVarQueryParameters['watch'] = ObjectSerializer.serialize(watch, "boolean"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'DELETE', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "V1Status"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * delete a Lease * @param name name of the Lease * @param namespace object name and auth scope, such as for teams and projects * @param pretty If 'true', then the output is pretty printed. * @param body * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @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. * @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. * @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. * @param {*} [options] Override http request options. */ deleteNamespacedLease(name, namespace, pretty, body, dryRun, gracePeriodSeconds, orphanDependents, propagationPolicy, options = {}) { const localVarPath = this.basePath + '/apis/coordination.k8s.io/v1beta1/namespaces/{namespace}/leases/{name}' .replace('{' + 'name' + '}', encodeURIComponent(String(name))) .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling deleteNamespacedLease.'); } // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling deleteNamespacedLease.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, "string"); } if (gracePeriodSeconds !== undefined) { localVarQueryParameters['gracePeriodSeconds'] = ObjectSerializer.serialize(gracePeriodSeconds, "number"); } if (orphanDependents !== undefined) { localVarQueryParameters['orphanDependents'] = ObjectSerializer.serialize(orphanDependents, "boolean"); } if (propagationPolicy !== undefined) { localVarQueryParameters['propagationPolicy'] = ObjectSerializer.serialize(propagationPolicy, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'DELETE', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: ObjectSerializer.serialize(body, "V1DeleteOptions") }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "V1Status"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * get available resources * @param {*} [options] Override http request options. */ getAPIResources(options = {}) { const localVarPath = this.basePath + '/apis/coordination.k8s.io/v1beta1/'; let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'GET', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "V1APIResourceList"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * list or watch objects of kind Lease * @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. * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything. * @param includeUninitialized If true, partially initialized resources are included in the response. * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything. * @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. * @param pretty If 'true', then the output is pretty printed. * @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. * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. * @param watch Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion. * @param {*} [options] Override http request options. */ listLeaseForAllNamespaces(_continue, fieldSelector, includeUninitialized, labelSelector, limit, pretty, resourceVersion, timeoutSeconds, watch, options = {}) { const localVarPath = this.basePath + '/apis/coordination.k8s.io/v1beta1/leases'; let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; if (_continue !== undefined) { localVarQueryParameters['continue'] = ObjectSerializer.serialize(_continue, "string"); } if (fieldSelector !== undefined) { localVarQueryParameters['fieldSelector'] = ObjectSerializer.serialize(fieldSelector, "string"); } if (includeUninitialized !== undefined) { localVarQueryParameters['includeUninitialized'] = ObjectSerializer.serialize(includeUninitialized, "boolean"); } if (labelSelector !== undefined) { localVarQueryParameters['labelSelector'] = ObjectSerializer.serialize(labelSelector, "string"); } if (limit !== undefined) { localVarQueryParameters['limit'] = ObjectSerializer.serialize(limit, "number"); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, "string"); } if (resourceVersion !== undefined) { localVarQueryParameters['resourceVersion'] = ObjectSerializer.serialize(resourceVersion, "string"); } if (timeoutSeconds !== undefined) { localVarQueryParameters['timeoutSeconds'] = ObjectSerializer.serialize(timeoutSeconds, "number"); } if (watch !== undefined) { localVarQueryParameters['watch'] = ObjectSerializer.serialize(watch, "boolean"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'GET', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "V1beta1LeaseList"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * list or watch objects of kind Lease * @param namespace object name and auth scope, such as for teams and projects * @param includeUninitialized If true, partially initialized resources are included in the response. * @param pretty If 'true', then the output is pretty printed. * @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. * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything. * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything. * @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. * @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. * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. * @param watch Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion. * @param {*} [options] Override http request options. */ listNamespacedLease(namespace, includeUninitialized, pretty, _continue, fieldSelector, labelSelector, limit, resourceVersion, timeoutSeconds, watch, options = {}) { const localVarPath = this.basePath + '/apis/coordination.k8s.io/v1beta1/namespaces/{namespace}/leases' .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling listNamespacedLease.'); } if (includeUninitialized !== undefined) { localVarQueryParameters['includeUninitialized'] = ObjectSerializer.serialize(includeUninitialized, "boolean"); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, "string"); } if (_continue !== undefined) { localVarQueryParameters['continue'] = ObjectSerializer.serialize(_continue, "string"); } if (fieldSelector !== undefined) { localVarQueryParameters['fieldSelector'] = ObjectSerializer.serialize(fieldSelector, "string"); } if (labelSelector !== undefined) { localVarQueryParameters['labelSelector'] = ObjectSerializer.serialize(labelSelector, "string"); } if (limit !== undefined) { localVarQueryParameters['limit'] = ObjectSerializer.serialize(limit, "number"); } if (resourceVersion !== undefined) { localVarQueryParameters['resourceVersion'] = ObjectSerializer.serialize(resourceVersion, "string"); } if (timeoutSeconds !== undefined) { localVarQueryParameters['timeoutSeconds'] = ObjectSerializer.serialize(timeoutSeconds, "number"); } if (watch !== undefined) { localVarQueryParameters['watch'] = ObjectSerializer.serialize(watch, "boolean"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'GET', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "V1beta1LeaseList"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * partially update the specified Lease * @param name name of the Lease * @param namespace object name and auth scope, such as for teams and projects * @param body * @param pretty If 'true', then the output is pretty printed. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param {*} [options] Override http request options. */ patchNamespacedLease(name, namespace, body, pretty, dryRun, options = {}) { const localVarPath = this.basePath + '/apis/coordination.k8s.io/v1beta1/namespaces/{namespace}/leases/{name}' .replace('{' + 'name' + '}', encodeURIComponent(String(name))) .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling patchNamespacedLease.'); } // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling patchNamespacedLease.'); } // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling patchNamespacedLease.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'PATCH', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: ObjectSerializer.serialize(body, "any") }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "V1beta1Lease"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * read the specified Lease * @param name name of the Lease * @param namespace object name and auth scope, such as for teams and projects * @param pretty If 'true', then the output is pretty printed. * @param exact Should the export be exact. Exact export maintains cluster-specific fields like 'Namespace'. * @param _export Should this value be exported. Export strips fields that a user can not specify. * @param {*} [options] Override http request options. */ readNamespacedLease(name, namespace, pretty, exact, _export, options = {}) { const localVarPath = this.basePath + '/apis/coordination.k8s.io/v1beta1/namespaces/{namespace}/leases/{name}' .replace('{' + 'name' + '}', encodeURIComponent(String(name))) .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling readNamespacedLease.'); } // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling readNamespacedLease.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, "string"); } if (exact !== undefined) { localVarQueryParameters['exact'] = ObjectSerializer.serialize(exact, "boolean"); } if (_export !== undefined) { localVarQueryParameters['export'] = ObjectSerializer.serialize(_export, "boolean"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'GET', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "V1beta1Lease"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * replace the specified Lease * @param name name of the Lease * @param namespace object name and auth scope, such as for teams and projects * @param body * @param pretty If 'true', then the output is pretty printed. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param {*} [options] Override http request options. */ replaceNamespacedLease(name, namespace, body, pretty, dryRun, options = {}) { const localVarPath = this.basePath + '/apis/coordination.k8s.io/v1beta1/namespaces/{namespace}/leases/{name}' .replace('{' + 'name' + '}', encodeURIComponent(String(name))) .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling replaceNamespacedLease.'); } // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling replaceNamespacedLease.'); } // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling replaceNamespacedLease.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'PUT', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: ObjectSerializer.serialize(body, "V1beta1Lease") }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "V1beta1Lease"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } } exports.CoordinationV1beta1Api = CoordinationV1beta1Api; var CoreApiApiKeys; (function (CoreApiApiKeys) { CoreApiApiKeys[CoreApiApiKeys["BearerToken"] = 0] = "BearerToken"; })(CoreApiApiKeys = exports.CoreApiApiKeys || (exports.CoreApiApiKeys = {})); class CoreApi { constructor(basePathOrUsername, password, basePath) { this._basePath = defaultBasePath; this.defaultHeaders = {}; this._useQuerystring = false; this.authentications = { 'default': new VoidAuth(), 'BearerToken': new ApiKeyAuth('header', 'authorization'), }; if (password) { if (basePath) { this.basePath = basePath; } } else { if (basePathOrUsername) { this.basePath = basePathOrUsername; } } } set useQuerystring(value) { this._useQuerystring = value; } set basePath(basePath) { this._basePath = basePath; } get basePath() { return this._basePath; } setDefaultAuthentication(auth) { this.authentications.default = auth; } setApiKey(key, value) { this.authentications[CoreApiApiKeys[key]].apiKey = value; } /** * get available API versions * @param {*} [options] Override http request options. */ getAPIVersions(options = {}) { const localVarPath = this.basePath + '/api/'; let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'GET', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "V1APIVersions"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } } exports.CoreApi = CoreApi; var CoreV1ApiApiKeys; (function (CoreV1ApiApiKeys) { CoreV1ApiApiKeys[CoreV1ApiApiKeys["BearerToken"] = 0] = "BearerToken"; })(CoreV1ApiApiKeys = exports.CoreV1ApiApiKeys || (exports.CoreV1ApiApiKeys = {})); class CoreV1Api { constructor(basePathOrUsername, password, basePath) { this._basePath = defaultBasePath; this.defaultHeaders = {}; this._useQuerystring = false; this.authentications = { 'default': new VoidAuth(), 'BearerToken': new ApiKeyAuth('header', 'authorization'), }; if (password) { if (basePath) { this.basePath = basePath; } } else { if (basePathOrUsername) { this.basePath = basePathOrUsername; } } } set useQuerystring(value) { this._useQuerystring = value; } set basePath(basePath) { this._basePath = basePath; } get basePath() { return this._basePath; } setDefaultAuthentication(auth) { this.authentications.default = auth; } setApiKey(key, value) { this.authentications[CoreV1ApiApiKeys[key]].apiKey = value; } /** * connect DELETE requests to proxy of Pod * @param name name of the PodProxyOptions * @param namespace object name and auth scope, such as for teams and projects * @param path Path is the URL path to use for the current proxy request to pod. * @param {*} [options] Override http request options. */ connectDeleteNamespacedPodProxy(name, namespace, path, options = {}) { const localVarPath = this.basePath + '/api/v1/namespaces/{namespace}/pods/{name}/proxy' .replace('{' + 'name' + '}', encodeURIComponent(String(name))) .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling connectDeleteNamespacedPodProxy.'); } // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling connectDeleteNamespacedPodProxy.'); } if (path !== undefined) { localVarQueryParameters['path'] = ObjectSerializer.serialize(path, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'DELETE', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "string"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * connect DELETE requests to proxy of Pod * @param name name of the PodProxyOptions * @param namespace object name and auth scope, such as for teams and projects * @param path path to the resource * @param path2 Path is the URL path to use for the current proxy request to pod. * @param {*} [options] Override http request options. */ connectDeleteNamespacedPodProxyWithPath(name, namespace, path, path2, options = {}) { const localVarPath = this.basePath + '/api/v1/namespaces/{namespace}/pods/{name}/proxy/{path}' .replace('{' + 'name' + '}', encodeURIComponent(String(name))) .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))) .replace('{' + 'path' + '}', encodeURIComponent(String(path))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling connectDeleteNamespacedPodProxyWithPath.'); } // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling connectDeleteNamespacedPodProxyWithPath.'); } // verify required parameter 'path' is not null or undefined if (path === null || path === undefined) { throw new Error('Required parameter path was null or undefined when calling connectDeleteNamespacedPodProxyWithPath.'); } if (path2 !== undefined) { localVarQueryParameters['path'] = ObjectSerializer.serialize(path2, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'DELETE', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "string"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * connect DELETE requests to proxy of Service * @param name name of the ServiceProxyOptions * @param namespace object name and auth scope, such as for teams and projects * @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. * @param {*} [options] Override http request options. */ connectDeleteNamespacedServiceProxy(name, namespace, path, options = {}) { const localVarPath = this.basePath + '/api/v1/namespaces/{namespace}/services/{name}/proxy' .replace('{' + 'name' + '}', encodeURIComponent(String(name))) .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling connectDeleteNamespacedServiceProxy.'); } // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling connectDeleteNamespacedServiceProxy.'); } if (path !== undefined) { localVarQueryParameters['path'] = ObjectSerializer.serialize(path, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'DELETE', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "string"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * connect DELETE requests to proxy of Service * @param name name of the ServiceProxyOptions * @param namespace object name and auth scope, such as for teams and projects * @param path path to the resource * @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. * @param {*} [options] Override http request options. */ connectDeleteNamespacedServiceProxyWithPath(name, namespace, path, path2, options = {}) { const localVarPath = this.basePath + '/api/v1/namespaces/{namespace}/services/{name}/proxy/{path}' .replace('{' + 'name' + '}', encodeURIComponent(String(name))) .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))) .replace('{' + 'path' + '}', encodeURIComponent(String(path))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling connectDeleteNamespacedServiceProxyWithPath.'); } // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling connectDeleteNamespacedServiceProxyWithPath.'); } // verify required parameter 'path' is not null or undefined if (path === null || path === undefined) { throw new Error('Required parameter path was null or undefined when calling connectDeleteNamespacedServiceProxyWithPath.'); } if (path2 !== undefined) { localVarQueryParameters['path'] = ObjectSerializer.serialize(path2, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'DELETE', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "string"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * connect DELETE requests to proxy of Node * @param name name of the NodeProxyOptions * @param path Path is the URL path to use for the current proxy request to node. * @param {*} [options] Override http request options. */ connectDeleteNodeProxy(name, path, options = {}) { const localVarPath = this.basePath + '/api/v1/nodes/{name}/proxy' .replace('{' + 'name' + '}', encodeURIComponent(String(name))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling connectDeleteNodeProxy.'); } if (path !== undefined) { localVarQueryParameters['path'] = ObjectSerializer.serialize(path, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'DELETE', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "string"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * connect DELETE requests to proxy of Node * @param name name of the NodeProxyOptions * @param path path to the resource * @param path2 Path is the URL path to use for the current proxy request to node. * @param {*} [options] Override http request options. */ connectDeleteNodeProxyWithPath(name, path, path2, options = {}) { const localVarPath = this.basePath + '/api/v1/nodes/{name}/proxy/{path}' .replace('{' + 'name' + '}', encodeURIComponent(String(name))) .replace('{' + 'path' + '}', encodeURIComponent(String(path))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling connectDeleteNodeProxyWithPath.'); } // verify required parameter 'path' is not null or undefined if (path === null || path === undefined) { throw new Error('Required parameter path was null or undefined when calling connectDeleteNodeProxyWithPath.'); } if (path2 !== undefined) { localVarQueryParameters['path'] = ObjectSerializer.serialize(path2, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'DELETE', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "string"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * connect GET requests to attach of Pod * @param name name of the PodAttachOptions * @param namespace object name and auth scope, such as for teams and projects * @param container The container in which to execute the command. Defaults to only container if there is only one container in the pod. * @param stderr Stderr if true indicates that stderr is to be redirected for the attach call. Defaults to true. * @param stdin Stdin if true, redirects the standard input stream of the pod for this call. Defaults to false. * @param stdout Stdout if true indicates that stdout is to be redirected for the attach call. Defaults to true. * @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. * @param {*} [options] Override http request options. */ connectGetNamespacedPodAttach(name, namespace, container, stderr, stdin, stdout, tty, options = {}) { const localVarPath = this.basePath + '/api/v1/namespaces/{namespace}/pods/{name}/attach' .replace('{' + 'name' + '}', encodeURIComponent(String(name))) .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling connectGetNamespacedPodAttach.'); } // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling connectGetNamespacedPodAttach.'); } if (container !== undefined) { localVarQueryParameters['container'] = ObjectSerializer.serialize(container, "string"); } if (stderr !== undefined) { localVarQueryParameters['stderr'] = ObjectSerializer.serialize(stderr, "boolean"); } if (stdin !== undefined) { localVarQueryParameters['stdin'] = ObjectSerializer.serialize(stdin, "boolean"); } if (stdout !== undefined) { localVarQueryParameters['stdout'] = ObjectSerializer.serialize(stdout, "boolean"); } if (tty !== undefined) { localVarQueryParameters['tty'] = ObjectSerializer.serialize(tty, "boolean"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'GET', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "string"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * connect GET requests to exec of Pod * @param name name of the PodExecOptions * @param namespace object name and auth scope, such as for teams and projects * @param command Command is the remote command to execute. argv array. Not executed within a shell. * @param container Container in which to execute the command. Defaults to only container if there is only one container in the pod. * @param stderr Redirect the standard error stream of the pod for this call. Defaults to true. * @param stdin Redirect the standard input stream of the pod for this call. Defaults to false. * @param stdout Redirect the standard output stream of the pod for this call. Defaults to true. * @param tty TTY if true indicates that a tty will be allocated for the exec call. Defaults to false. * @param {*} [options] Override http request options. */ connectGetNamespacedPodExec(name, namespace, command, container, stderr, stdin, stdout, tty, options = {}) { const localVarPath = this.basePath + '/api/v1/namespaces/{namespace}/pods/{name}/exec' .replace('{' + 'name' + '}', encodeURIComponent(String(name))) .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling connectGetNamespacedPodExec.'); } // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling connectGetNamespacedPodExec.'); } if (command !== undefined) { localVarQueryParameters['command'] = ObjectSerializer.serialize(command, "string"); } if (container !== undefined) { localVarQueryParameters['container'] = ObjectSerializer.serialize(container, "string"); } if (stderr !== undefined) { localVarQueryParameters['stderr'] = ObjectSerializer.serialize(stderr, "boolean"); } if (stdin !== undefined) { localVarQueryParameters['stdin'] = ObjectSerializer.serialize(stdin, "boolean"); } if (stdout !== undefined) { localVarQueryParameters['stdout'] = ObjectSerializer.serialize(stdout, "boolean"); } if (tty !== undefined) { localVarQueryParameters['tty'] = ObjectSerializer.serialize(tty, "boolean"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'GET', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "string"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * connect GET requests to portforward of Pod * @param name name of the PodPortForwardOptions * @param namespace object name and auth scope, such as for teams and projects * @param ports List of ports to forward Required when using WebSockets * @param {*} [options] Override http request options. */ connectGetNamespacedPodPortforward(name, namespace, ports, options = {}) { const localVarPath = this.basePath + '/api/v1/namespaces/{namespace}/pods/{name}/portforward' .replace('{' + 'name' + '}', encodeURIComponent(String(name))) .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling connectGetNamespacedPodPortforward.'); } // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling connectGetNamespacedPodPortforward.'); } if (ports !== undefined) { localVarQueryParameters['ports'] = ObjectSerializer.serialize(ports, "number"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'GET', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "string"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * connect GET requests to proxy of Pod * @param name name of the PodProxyOptions * @param namespace object name and auth scope, such as for teams and projects * @param path Path is the URL path to use for the current proxy request to pod. * @param {*} [options] Override http request options. */ connectGetNamespacedPodProxy(name, namespace, path, options = {}) { const localVarPath = this.basePath + '/api/v1/namespaces/{namespace}/pods/{name}/proxy' .replace('{' + 'name' + '}', encodeURIComponent(String(name))) .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling connectGetNamespacedPodProxy.'); } // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling connectGetNamespacedPodProxy.'); } if (path !== undefined) { localVarQueryParameters['path'] = ObjectSerializer.serialize(path, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'GET', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "string"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * connect GET requests to proxy of Pod * @param name name of the PodProxyOptions * @param namespace object name and auth scope, such as for teams and projects * @param path path to the resource * @param path2 Path is the URL path to use for the current proxy request to pod. * @param {*} [options] Override http request options. */ connectGetNamespacedPodProxyWithPath(name, namespace, path, path2, options = {}) { const localVarPath = this.basePath + '/api/v1/namespaces/{namespace}/pods/{name}/proxy/{path}' .replace('{' + 'name' + '}', encodeURIComponent(String(name))) .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))) .replace('{' + 'path' + '}', encodeURIComponent(String(path))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling connectGetNamespacedPodProxyWithPath.'); } // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling connectGetNamespacedPodProxyWithPath.'); } // verify required parameter 'path' is not null or undefined if (path === null || path === undefined) { throw new Error('Required parameter path was null or undefined when calling connectGetNamespacedPodProxyWithPath.'); } if (path2 !== undefined) { localVarQueryParameters['path'] = ObjectSerializer.serialize(path2, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'GET', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "string"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * connect GET requests to proxy of Service * @param name name of the ServiceProxyOptions * @param namespace object name and auth scope, such as for teams and projects * @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. * @param {*} [options] Override http request options. */ connectGetNamespacedServiceProxy(name, namespace, path, options = {}) { const localVarPath = this.basePath + '/api/v1/namespaces/{namespace}/services/{name}/proxy' .replace('{' + 'name' + '}', encodeURIComponent(String(name))) .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling connectGetNamespacedServiceProxy.'); } // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling connectGetNamespacedServiceProxy.'); } if (path !== undefined) { localVarQueryParameters['path'] = ObjectSerializer.serialize(path, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'GET', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "string"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * connect GET requests to proxy of Service * @param name name of the ServiceProxyOptions * @param namespace object name and auth scope, such as for teams and projects * @param path path to the resource * @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. * @param {*} [options] Override http request options. */ connectGetNamespacedServiceProxyWithPath(name, namespace, path, path2, options = {}) { const localVarPath = this.basePath + '/api/v1/namespaces/{namespace}/services/{name}/proxy/{path}' .replace('{' + 'name' + '}', encodeURIComponent(String(name))) .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))) .replace('{' + 'path' + '}', encodeURIComponent(String(path))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling connectGetNamespacedServiceProxyWithPath.'); } // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling connectGetNamespacedServiceProxyWithPath.'); } // verify required parameter 'path' is not null or undefined if (path === null || path === undefined) { throw new Error('Required parameter path was null or undefined when calling connectGetNamespacedServiceProxyWithPath.'); } if (path2 !== undefined) { localVarQueryParameters['path'] = ObjectSerializer.serialize(path2, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'GET', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "string"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * connect GET requests to proxy of Node * @param name name of the NodeProxyOptions * @param path Path is the URL path to use for the current proxy request to node. * @param {*} [options] Override http request options. */ connectGetNodeProxy(name, path, options = {}) { const localVarPath = this.basePath + '/api/v1/nodes/{name}/proxy' .replace('{' + 'name' + '}', encodeURIComponent(String(name))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling connectGetNodeProxy.'); } if (path !== undefined) { localVarQueryParameters['path'] = ObjectSerializer.serialize(path, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'GET', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "string"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * connect GET requests to proxy of Node * @param name name of the NodeProxyOptions * @param path path to the resource * @param path2 Path is the URL path to use for the current proxy request to node. * @param {*} [options] Override http request options. */ connectGetNodeProxyWithPath(name, path, path2, options = {}) { const localVarPath = this.basePath + '/api/v1/nodes/{name}/proxy/{path}' .replace('{' + 'name' + '}', encodeURIComponent(String(name))) .replace('{' + 'path' + '}', encodeURIComponent(String(path))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling connectGetNodeProxyWithPath.'); } // verify required parameter 'path' is not null or undefined if (path === null || path === undefined) { throw new Error('Required parameter path was null or undefined when calling connectGetNodeProxyWithPath.'); } if (path2 !== undefined) { localVarQueryParameters['path'] = ObjectSerializer.serialize(path2, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'GET', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "string"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * connect HEAD requests to proxy of Pod * @param name name of the PodProxyOptions * @param namespace object name and auth scope, such as for teams and projects * @param path Path is the URL path to use for the current proxy request to pod. * @param {*} [options] Override http request options. */ connectHeadNamespacedPodProxy(name, namespace, path, options = {}) { const localVarPath = this.basePath + '/api/v1/namespaces/{namespace}/pods/{name}/proxy' .replace('{' + 'name' + '}', encodeURIComponent(String(name))) .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling connectHeadNamespacedPodProxy.'); } // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling connectHeadNamespacedPodProxy.'); } if (path !== undefined) { localVarQueryParameters['path'] = ObjectSerializer.serialize(path, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'HEAD', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "string"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * connect HEAD requests to proxy of Pod * @param name name of the PodProxyOptions * @param namespace object name and auth scope, such as for teams and projects * @param path path to the resource * @param path2 Path is the URL path to use for the current proxy request to pod. * @param {*} [options] Override http request options. */ connectHeadNamespacedPodProxyWithPath(name, namespace, path, path2, options = {}) { const localVarPath = this.basePath + '/api/v1/namespaces/{namespace}/pods/{name}/proxy/{path}' .replace('{' + 'name' + '}', encodeURIComponent(String(name))) .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))) .replace('{' + 'path' + '}', encodeURIComponent(String(path))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling connectHeadNamespacedPodProxyWithPath.'); } // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling connectHeadNamespacedPodProxyWithPath.'); } // verify required parameter 'path' is not null or undefined if (path === null || path === undefined) { throw new Error('Required parameter path was null or undefined when calling connectHeadNamespacedPodProxyWithPath.'); } if (path2 !== undefined) { localVarQueryParameters['path'] = ObjectSerializer.serialize(path2, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'HEAD', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "string"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * connect HEAD requests to proxy of Service * @param name name of the ServiceProxyOptions * @param namespace object name and auth scope, such as for teams and projects * @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. * @param {*} [options] Override http request options. */ connectHeadNamespacedServiceProxy(name, namespace, path, options = {}) { const localVarPath = this.basePath + '/api/v1/namespaces/{namespace}/services/{name}/proxy' .replace('{' + 'name' + '}', encodeURIComponent(String(name))) .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling connectHeadNamespacedServiceProxy.'); } // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling connectHeadNamespacedServiceProxy.'); } if (path !== undefined) { localVarQueryParameters['path'] = ObjectSerializer.serialize(path, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'HEAD', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "string"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * connect HEAD requests to proxy of Service * @param name name of the ServiceProxyOptions * @param namespace object name and auth scope, such as for teams and projects * @param path path to the resource * @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. * @param {*} [options] Override http request options. */ connectHeadNamespacedServiceProxyWithPath(name, namespace, path, path2, options = {}) { const localVarPath = this.basePath + '/api/v1/namespaces/{namespace}/services/{name}/proxy/{path}' .replace('{' + 'name' + '}', encodeURIComponent(String(name))) .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))) .replace('{' + 'path' + '}', encodeURIComponent(String(path))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling connectHeadNamespacedServiceProxyWithPath.'); } // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling connectHeadNamespacedServiceProxyWithPath.'); } // verify required parameter 'path' is not null or undefined if (path === null || path === undefined) { throw new Error('Required parameter path was null or undefined when calling connectHeadNamespacedServiceProxyWithPath.'); } if (path2 !== undefined) { localVarQueryParameters['path'] = ObjectSerializer.serialize(path2, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'HEAD', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "string"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * connect HEAD requests to proxy of Node * @param name name of the NodeProxyOptions * @param path Path is the URL path to use for the current proxy request to node. * @param {*} [options] Override http request options. */ connectHeadNodeProxy(name, path, options = {}) { const localVarPath = this.basePath + '/api/v1/nodes/{name}/proxy' .replace('{' + 'name' + '}', encodeURIComponent(String(name))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling connectHeadNodeProxy.'); } if (path !== undefined) { localVarQueryParameters['path'] = ObjectSerializer.serialize(path, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'HEAD', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "string"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * connect HEAD requests to proxy of Node * @param name name of the NodeProxyOptions * @param path path to the resource * @param path2 Path is the URL path to use for the current proxy request to node. * @param {*} [options] Override http request options. */ connectHeadNodeProxyWithPath(name, path, path2, options = {}) { const localVarPath = this.basePath + '/api/v1/nodes/{name}/proxy/{path}' .replace('{' + 'name' + '}', encodeURIComponent(String(name))) .replace('{' + 'path' + '}', encodeURIComponent(String(path))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling connectHeadNodeProxyWithPath.'); } // verify required parameter 'path' is not null or undefined if (path === null || path === undefined) { throw new Error('Required parameter path was null or undefined when calling connectHeadNodeProxyWithPath.'); } if (path2 !== undefined) { localVarQueryParameters['path'] = ObjectSerializer.serialize(path2, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'HEAD', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "string"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * connect OPTIONS requests to proxy of Pod * @param name name of the PodProxyOptions * @param namespace object name and auth scope, such as for teams and projects * @param path Path is the URL path to use for the current proxy request to pod. * @param {*} [options] Override http request options. */ connectOptionsNamespacedPodProxy(name, namespace, path, options = {}) { const localVarPath = this.basePath + '/api/v1/namespaces/{namespace}/pods/{name}/proxy' .replace('{' + 'name' + '}', encodeURIComponent(String(name))) .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling connectOptionsNamespacedPodProxy.'); } // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling connectOptionsNamespacedPodProxy.'); } if (path !== undefined) { localVarQueryParameters['path'] = ObjectSerializer.serialize(path, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'OPTIONS', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "string"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * connect OPTIONS requests to proxy of Pod * @param name name of the PodProxyOptions * @param namespace object name and auth scope, such as for teams and projects * @param path path to the resource * @param path2 Path is the URL path to use for the current proxy request to pod. * @param {*} [options] Override http request options. */ connectOptionsNamespacedPodProxyWithPath(name, namespace, path, path2, options = {}) { const localVarPath = this.basePath + '/api/v1/namespaces/{namespace}/pods/{name}/proxy/{path}' .replace('{' + 'name' + '}', encodeURIComponent(String(name))) .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))) .replace('{' + 'path' + '}', encodeURIComponent(String(path))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling connectOptionsNamespacedPodProxyWithPath.'); } // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling connectOptionsNamespacedPodProxyWithPath.'); } // verify required parameter 'path' is not null or undefined if (path === null || path === undefined) { throw new Error('Required parameter path was null or undefined when calling connectOptionsNamespacedPodProxyWithPath.'); } if (path2 !== undefined) { localVarQueryParameters['path'] = ObjectSerializer.serialize(path2, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'OPTIONS', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "string"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * connect OPTIONS requests to proxy of Service * @param name name of the ServiceProxyOptions * @param namespace object name and auth scope, such as for teams and projects * @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. * @param {*} [options] Override http request options. */ connectOptionsNamespacedServiceProxy(name, namespace, path, options = {}) { const localVarPath = this.basePath + '/api/v1/namespaces/{namespace}/services/{name}/proxy' .replace('{' + 'name' + '}', encodeURIComponent(String(name))) .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling connectOptionsNamespacedServiceProxy.'); } // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling connectOptionsNamespacedServiceProxy.'); } if (path !== undefined) { localVarQueryParameters['path'] = ObjectSerializer.serialize(path, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'OPTIONS', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "string"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * connect OPTIONS requests to proxy of Service * @param name name of the ServiceProxyOptions * @param namespace object name and auth scope, such as for teams and projects * @param path path to the resource * @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. * @param {*} [options] Override http request options. */ connectOptionsNamespacedServiceProxyWithPath(name, namespace, path, path2, options = {}) { const localVarPath = this.basePath + '/api/v1/namespaces/{namespace}/services/{name}/proxy/{path}' .replace('{' + 'name' + '}', encodeURIComponent(String(name))) .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))) .replace('{' + 'path' + '}', encodeURIComponent(String(path))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling connectOptionsNamespacedServiceProxyWithPath.'); } // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling connectOptionsNamespacedServiceProxyWithPath.'); } // verify required parameter 'path' is not null or undefined if (path === null || path === undefined) { throw new Error('Required parameter path was null or undefined when calling connectOptionsNamespacedServiceProxyWithPath.'); } if (path2 !== undefined) { localVarQueryParameters['path'] = ObjectSerializer.serialize(path2, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'OPTIONS', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "string"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * connect OPTIONS requests to proxy of Node * @param name name of the NodeProxyOptions * @param path Path is the URL path to use for the current proxy request to node. * @param {*} [options] Override http request options. */ connectOptionsNodeProxy(name, path, options = {}) { const localVarPath = this.basePath + '/api/v1/nodes/{name}/proxy' .replace('{' + 'name' + '}', encodeURIComponent(String(name))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling connectOptionsNodeProxy.'); } if (path !== undefined) { localVarQueryParameters['path'] = ObjectSerializer.serialize(path, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'OPTIONS', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "string"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * connect OPTIONS requests to proxy of Node * @param name name of the NodeProxyOptions * @param path path to the resource * @param path2 Path is the URL path to use for the current proxy request to node. * @param {*} [options] Override http request options. */ connectOptionsNodeProxyWithPath(name, path, path2, options = {}) { const localVarPath = this.basePath + '/api/v1/nodes/{name}/proxy/{path}' .replace('{' + 'name' + '}', encodeURIComponent(String(name))) .replace('{' + 'path' + '}', encodeURIComponent(String(path))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling connectOptionsNodeProxyWithPath.'); } // verify required parameter 'path' is not null or undefined if (path === null || path === undefined) { throw new Error('Required parameter path was null or undefined when calling connectOptionsNodeProxyWithPath.'); } if (path2 !== undefined) { localVarQueryParameters['path'] = ObjectSerializer.serialize(path2, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'OPTIONS', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "string"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * connect PATCH requests to proxy of Pod * @param name name of the PodProxyOptions * @param namespace object name and auth scope, such as for teams and projects * @param path Path is the URL path to use for the current proxy request to pod. * @param {*} [options] Override http request options. */ connectPatchNamespacedPodProxy(name, namespace, path, options = {}) { const localVarPath = this.basePath + '/api/v1/namespaces/{namespace}/pods/{name}/proxy' .replace('{' + 'name' + '}', encodeURIComponent(String(name))) .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling connectPatchNamespacedPodProxy.'); } // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling connectPatchNamespacedPodProxy.'); } if (path !== undefined) { localVarQueryParameters['path'] = ObjectSerializer.serialize(path, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'PATCH', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "string"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * connect PATCH requests to proxy of Pod * @param name name of the PodProxyOptions * @param namespace object name and auth scope, such as for teams and projects * @param path path to the resource * @param path2 Path is the URL path to use for the current proxy request to pod. * @param {*} [options] Override http request options. */ connectPatchNamespacedPodProxyWithPath(name, namespace, path, path2, options = {}) { const localVarPath = this.basePath + '/api/v1/namespaces/{namespace}/pods/{name}/proxy/{path}' .replace('{' + 'name' + '}', encodeURIComponent(String(name))) .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))) .replace('{' + 'path' + '}', encodeURIComponent(String(path))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling connectPatchNamespacedPodProxyWithPath.'); } // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling connectPatchNamespacedPodProxyWithPath.'); } // verify required parameter 'path' is not null or undefined if (path === null || path === undefined) { throw new Error('Required parameter path was null or undefined when calling connectPatchNamespacedPodProxyWithPath.'); } if (path2 !== undefined) { localVarQueryParameters['path'] = ObjectSerializer.serialize(path2, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'PATCH', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "string"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * connect PATCH requests to proxy of Service * @param name name of the ServiceProxyOptions * @param namespace object name and auth scope, such as for teams and projects * @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. * @param {*} [options] Override http request options. */ connectPatchNamespacedServiceProxy(name, namespace, path, options = {}) { const localVarPath = this.basePath + '/api/v1/namespaces/{namespace}/services/{name}/proxy' .replace('{' + 'name' + '}', encodeURIComponent(String(name))) .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling connectPatchNamespacedServiceProxy.'); } // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling connectPatchNamespacedServiceProxy.'); } if (path !== undefined) { localVarQueryParameters['path'] = ObjectSerializer.serialize(path, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'PATCH', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "string"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * connect PATCH requests to proxy of Service * @param name name of the ServiceProxyOptions * @param namespace object name and auth scope, such as for teams and projects * @param path path to the resource * @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. * @param {*} [options] Override http request options. */ connectPatchNamespacedServiceProxyWithPath(name, namespace, path, path2, options = {}) { const localVarPath = this.basePath + '/api/v1/namespaces/{namespace}/services/{name}/proxy/{path}' .replace('{' + 'name' + '}', encodeURIComponent(String(name))) .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))) .replace('{' + 'path' + '}', encodeURIComponent(String(path))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling connectPatchNamespacedServiceProxyWithPath.'); } // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling connectPatchNamespacedServiceProxyWithPath.'); } // verify required parameter 'path' is not null or undefined if (path === null || path === undefined) { throw new Error('Required parameter path was null or undefined when calling connectPatchNamespacedServiceProxyWithPath.'); } if (path2 !== undefined) { localVarQueryParameters['path'] = ObjectSerializer.serialize(path2, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'PATCH', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "string"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * connect PATCH requests to proxy of Node * @param name name of the NodeProxyOptions * @param path Path is the URL path to use for the current proxy request to node. * @param {*} [options] Override http request options. */ connectPatchNodeProxy(name, path, options = {}) { const localVarPath = this.basePath + '/api/v1/nodes/{name}/proxy' .replace('{' + 'name' + '}', encodeURIComponent(String(name))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling connectPatchNodeProxy.'); } if (path !== undefined) { localVarQueryParameters['path'] = ObjectSerializer.serialize(path, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'PATCH', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "string"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * connect PATCH requests to proxy of Node * @param name name of the NodeProxyOptions * @param path path to the resource * @param path2 Path is the URL path to use for the current proxy request to node. * @param {*} [options] Override http request options. */ connectPatchNodeProxyWithPath(name, path, path2, options = {}) { const localVarPath = this.basePath + '/api/v1/nodes/{name}/proxy/{path}' .replace('{' + 'name' + '}', encodeURIComponent(String(name))) .replace('{' + 'path' + '}', encodeURIComponent(String(path))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling connectPatchNodeProxyWithPath.'); } // verify required parameter 'path' is not null or undefined if (path === null || path === undefined) { throw new Error('Required parameter path was null or undefined when calling connectPatchNodeProxyWithPath.'); } if (path2 !== undefined) { localVarQueryParameters['path'] = ObjectSerializer.serialize(path2, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'PATCH', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "string"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * connect POST requests to attach of Pod * @param name name of the PodAttachOptions * @param namespace object name and auth scope, such as for teams and projects * @param container The container in which to execute the command. Defaults to only container if there is only one container in the pod. * @param stderr Stderr if true indicates that stderr is to be redirected for the attach call. Defaults to true. * @param stdin Stdin if true, redirects the standard input stream of the pod for this call. Defaults to false. * @param stdout Stdout if true indicates that stdout is to be redirected for the attach call. Defaults to true. * @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. * @param {*} [options] Override http request options. */ connectPostNamespacedPodAttach(name, namespace, container, stderr, stdin, stdout, tty, options = {}) { const localVarPath = this.basePath + '/api/v1/namespaces/{namespace}/pods/{name}/attach' .replace('{' + 'name' + '}', encodeURIComponent(String(name))) .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling connectPostNamespacedPodAttach.'); } // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling connectPostNamespacedPodAttach.'); } if (container !== undefined) { localVarQueryParameters['container'] = ObjectSerializer.serialize(container, "string"); } if (stderr !== undefined) { localVarQueryParameters['stderr'] = ObjectSerializer.serialize(stderr, "boolean"); } if (stdin !== undefined) { localVarQueryParameters['stdin'] = ObjectSerializer.serialize(stdin, "boolean"); } if (stdout !== undefined) { localVarQueryParameters['stdout'] = ObjectSerializer.serialize(stdout, "boolean"); } if (tty !== undefined) { localVarQueryParameters['tty'] = ObjectSerializer.serialize(tty, "boolean"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'POST', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "string"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * connect POST requests to exec of Pod * @param name name of the PodExecOptions * @param namespace object name and auth scope, such as for teams and projects * @param command Command is the remote command to execute. argv array. Not executed within a shell. * @param container Container in which to execute the command. Defaults to only container if there is only one container in the pod. * @param stderr Redirect the standard error stream of the pod for this call. Defaults to true. * @param stdin Redirect the standard input stream of the pod for this call. Defaults to false. * @param stdout Redirect the standard output stream of the pod for this call. Defaults to true. * @param tty TTY if true indicates that a tty will be allocated for the exec call. Defaults to false. * @param {*} [options] Override http request options. */ connectPostNamespacedPodExec(name, namespace, command, container, stderr, stdin, stdout, tty, options = {}) { const localVarPath = this.basePath + '/api/v1/namespaces/{namespace}/pods/{name}/exec' .replace('{' + 'name' + '}', encodeURIComponent(String(name))) .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling connectPostNamespacedPodExec.'); } // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling connectPostNamespacedPodExec.'); } if (command !== undefined) { localVarQueryParameters['command'] = ObjectSerializer.serialize(command, "string"); } if (container !== undefined) { localVarQueryParameters['container'] = ObjectSerializer.serialize(container, "string"); } if (stderr !== undefined) { localVarQueryParameters['stderr'] = ObjectSerializer.serialize(stderr, "boolean"); } if (stdin !== undefined) { localVarQueryParameters['stdin'] = ObjectSerializer.serialize(stdin, "boolean"); } if (stdout !== undefined) { localVarQueryParameters['stdout'] = ObjectSerializer.serialize(stdout, "boolean"); } if (tty !== undefined) { localVarQueryParameters['tty'] = ObjectSerializer.serialize(tty, "boolean"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'POST', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "string"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * connect POST requests to portforward of Pod * @param name name of the PodPortForwardOptions * @param namespace object name and auth scope, such as for teams and projects * @param ports List of ports to forward Required when using WebSockets * @param {*} [options] Override http request options. */ connectPostNamespacedPodPortforward(name, namespace, ports, options = {}) { const localVarPath = this.basePath + '/api/v1/namespaces/{namespace}/pods/{name}/portforward' .replace('{' + 'name' + '}', encodeURIComponent(String(name))) .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling connectPostNamespacedPodPortforward.'); } // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling connectPostNamespacedPodPortforward.'); } if (ports !== undefined) { localVarQueryParameters['ports'] = ObjectSerializer.serialize(ports, "number"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'POST', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "string"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * connect POST requests to proxy of Pod * @param name name of the PodProxyOptions * @param namespace object name and auth scope, such as for teams and projects * @param path Path is the URL path to use for the current proxy request to pod. * @param {*} [options] Override http request options. */ connectPostNamespacedPodProxy(name, namespace, path, options = {}) { const localVarPath = this.basePath + '/api/v1/namespaces/{namespace}/pods/{name}/proxy' .replace('{' + 'name' + '}', encodeURIComponent(String(name))) .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling connectPostNamespacedPodProxy.'); } // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling connectPostNamespacedPodProxy.'); } if (path !== undefined) { localVarQueryParameters['path'] = ObjectSerializer.serialize(path, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'POST', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "string"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * connect POST requests to proxy of Pod * @param name name of the PodProxyOptions * @param namespace object name and auth scope, such as for teams and projects * @param path path to the resource * @param path2 Path is the URL path to use for the current proxy request to pod. * @param {*} [options] Override http request options. */ connectPostNamespacedPodProxyWithPath(name, namespace, path, path2, options = {}) { const localVarPath = this.basePath + '/api/v1/namespaces/{namespace}/pods/{name}/proxy/{path}' .replace('{' + 'name' + '}', encodeURIComponent(String(name))) .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))) .replace('{' + 'path' + '}', encodeURIComponent(String(path))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling connectPostNamespacedPodProxyWithPath.'); } // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling connectPostNamespacedPodProxyWithPath.'); } // verify required parameter 'path' is not null or undefined if (path === null || path === undefined) { throw new Error('Required parameter path was null or undefined when calling connectPostNamespacedPodProxyWithPath.'); } if (path2 !== undefined) { localVarQueryParameters['path'] = ObjectSerializer.serialize(path2, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'POST', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "string"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * connect POST requests to proxy of Service * @param name name of the ServiceProxyOptions * @param namespace object name and auth scope, such as for teams and projects * @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. * @param {*} [options] Override http request options. */ connectPostNamespacedServiceProxy(name, namespace, path, options = {}) { const localVarPath = this.basePath + '/api/v1/namespaces/{namespace}/services/{name}/proxy' .replace('{' + 'name' + '}', encodeURIComponent(String(name))) .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling connectPostNamespacedServiceProxy.'); } // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling connectPostNamespacedServiceProxy.'); } if (path !== undefined) { localVarQueryParameters['path'] = ObjectSerializer.serialize(path, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'POST', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "string"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * connect POST requests to proxy of Service * @param name name of the ServiceProxyOptions * @param namespace object name and auth scope, such as for teams and projects * @param path path to the resource * @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. * @param {*} [options] Override http request options. */ connectPostNamespacedServiceProxyWithPath(name, namespace, path, path2, options = {}) { const localVarPath = this.basePath + '/api/v1/namespaces/{namespace}/services/{name}/proxy/{path}' .replace('{' + 'name' + '}', encodeURIComponent(String(name))) .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))) .replace('{' + 'path' + '}', encodeURIComponent(String(path))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling connectPostNamespacedServiceProxyWithPath.'); } // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling connectPostNamespacedServiceProxyWithPath.'); } // verify required parameter 'path' is not null or undefined if (path === null || path === undefined) { throw new Error('Required parameter path was null or undefined when calling connectPostNamespacedServiceProxyWithPath.'); } if (path2 !== undefined) { localVarQueryParameters['path'] = ObjectSerializer.serialize(path2, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'POST', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "string"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * connect POST requests to proxy of Node * @param name name of the NodeProxyOptions * @param path Path is the URL path to use for the current proxy request to node. * @param {*} [options] Override http request options. */ connectPostNodeProxy(name, path, options = {}) { const localVarPath = this.basePath + '/api/v1/nodes/{name}/proxy' .replace('{' + 'name' + '}', encodeURIComponent(String(name))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling connectPostNodeProxy.'); } if (path !== undefined) { localVarQueryParameters['path'] = ObjectSerializer.serialize(path, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'POST', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "string"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * connect POST requests to proxy of Node * @param name name of the NodeProxyOptions * @param path path to the resource * @param path2 Path is the URL path to use for the current proxy request to node. * @param {*} [options] Override http request options. */ connectPostNodeProxyWithPath(name, path, path2, options = {}) { const localVarPath = this.basePath + '/api/v1/nodes/{name}/proxy/{path}' .replace('{' + 'name' + '}', encodeURIComponent(String(name))) .replace('{' + 'path' + '}', encodeURIComponent(String(path))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling connectPostNodeProxyWithPath.'); } // verify required parameter 'path' is not null or undefined if (path === null || path === undefined) { throw new Error('Required parameter path was null or undefined when calling connectPostNodeProxyWithPath.'); } if (path2 !== undefined) { localVarQueryParameters['path'] = ObjectSerializer.serialize(path2, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'POST', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "string"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * connect PUT requests to proxy of Pod * @param name name of the PodProxyOptions * @param namespace object name and auth scope, such as for teams and projects * @param path Path is the URL path to use for the current proxy request to pod. * @param {*} [options] Override http request options. */ connectPutNamespacedPodProxy(name, namespace, path, options = {}) { const localVarPath = this.basePath + '/api/v1/namespaces/{namespace}/pods/{name}/proxy' .replace('{' + 'name' + '}', encodeURIComponent(String(name))) .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling connectPutNamespacedPodProxy.'); } // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling connectPutNamespacedPodProxy.'); } if (path !== undefined) { localVarQueryParameters['path'] = ObjectSerializer.serialize(path, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'PUT', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "string"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * connect PUT requests to proxy of Pod * @param name name of the PodProxyOptions * @param namespace object name and auth scope, such as for teams and projects * @param path path to the resource * @param path2 Path is the URL path to use for the current proxy request to pod. * @param {*} [options] Override http request options. */ connectPutNamespacedPodProxyWithPath(name, namespace, path, path2, options = {}) { const localVarPath = this.basePath + '/api/v1/namespaces/{namespace}/pods/{name}/proxy/{path}' .replace('{' + 'name' + '}', encodeURIComponent(String(name))) .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))) .replace('{' + 'path' + '}', encodeURIComponent(String(path))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling connectPutNamespacedPodProxyWithPath.'); } // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling connectPutNamespacedPodProxyWithPath.'); } // verify required parameter 'path' is not null or undefined if (path === null || path === undefined) { throw new Error('Required parameter path was null or undefined when calling connectPutNamespacedPodProxyWithPath.'); } if (path2 !== undefined) { localVarQueryParameters['path'] = ObjectSerializer.serialize(path2, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'PUT', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "string"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * connect PUT requests to proxy of Service * @param name name of the ServiceProxyOptions * @param namespace object name and auth scope, such as for teams and projects * @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. * @param {*} [options] Override http request options. */ connectPutNamespacedServiceProxy(name, namespace, path, options = {}) { const localVarPath = this.basePath + '/api/v1/namespaces/{namespace}/services/{name}/proxy' .replace('{' + 'name' + '}', encodeURIComponent(String(name))) .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling connectPutNamespacedServiceProxy.'); } // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling connectPutNamespacedServiceProxy.'); } if (path !== undefined) { localVarQueryParameters['path'] = ObjectSerializer.serialize(path, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'PUT', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "string"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * connect PUT requests to proxy of Service * @param name name of the ServiceProxyOptions * @param namespace object name and auth scope, such as for teams and projects * @param path path to the resource * @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. * @param {*} [options] Override http request options. */ connectPutNamespacedServiceProxyWithPath(name, namespace, path, path2, options = {}) { const localVarPath = this.basePath + '/api/v1/namespaces/{namespace}/services/{name}/proxy/{path}' .replace('{' + 'name' + '}', encodeURIComponent(String(name))) .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))) .replace('{' + 'path' + '}', encodeURIComponent(String(path))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling connectPutNamespacedServiceProxyWithPath.'); } // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling connectPutNamespacedServiceProxyWithPath.'); } // verify required parameter 'path' is not null or undefined if (path === null || path === undefined) { throw new Error('Required parameter path was null or undefined when calling connectPutNamespacedServiceProxyWithPath.'); } if (path2 !== undefined) { localVarQueryParameters['path'] = ObjectSerializer.serialize(path2, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'PUT', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "string"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * connect PUT requests to proxy of Node * @param name name of the NodeProxyOptions * @param path Path is the URL path to use for the current proxy request to node. * @param {*} [options] Override http request options. */ connectPutNodeProxy(name, path, options = {}) { const localVarPath = this.basePath + '/api/v1/nodes/{name}/proxy' .replace('{' + 'name' + '}', encodeURIComponent(String(name))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling connectPutNodeProxy.'); } if (path !== undefined) { localVarQueryParameters['path'] = ObjectSerializer.serialize(path, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'PUT', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "string"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * connect PUT requests to proxy of Node * @param name name of the NodeProxyOptions * @param path path to the resource * @param path2 Path is the URL path to use for the current proxy request to node. * @param {*} [options] Override http request options. */ connectPutNodeProxyWithPath(name, path, path2, options = {}) { const localVarPath = this.basePath + '/api/v1/nodes/{name}/proxy/{path}' .replace('{' + 'name' + '}', encodeURIComponent(String(name))) .replace('{' + 'path' + '}', encodeURIComponent(String(path))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling connectPutNodeProxyWithPath.'); } // verify required parameter 'path' is not null or undefined if (path === null || path === undefined) { throw new Error('Required parameter path was null or undefined when calling connectPutNodeProxyWithPath.'); } if (path2 !== undefined) { localVarQueryParameters['path'] = ObjectSerializer.serialize(path2, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'PUT', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "string"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * create a Namespace * @param body * @param includeUninitialized If IncludeUninitialized is specified, the object may be returned without completing initialization. * @param pretty If 'true', then the output is pretty printed. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param {*} [options] Override http request options. */ createNamespace(body, includeUninitialized, pretty, dryRun, options = {}) { const localVarPath = this.basePath + '/api/v1/namespaces'; let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling createNamespace.'); } if (includeUninitialized !== undefined) { localVarQueryParameters['includeUninitialized'] = ObjectSerializer.serialize(includeUninitialized, "boolean"); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'POST', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: ObjectSerializer.serialize(body, "V1Namespace") }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "V1Namespace"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * create a Binding * @param namespace object name and auth scope, such as for teams and projects * @param body * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param includeUninitialized If IncludeUninitialized is specified, the object may be returned without completing initialization. * @param pretty If 'true', then the output is pretty printed. * @param {*} [options] Override http request options. */ createNamespacedBinding(namespace, body, dryRun, includeUninitialized, pretty, options = {}) { const localVarPath = this.basePath + '/api/v1/namespaces/{namespace}/bindings' .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling createNamespacedBinding.'); } // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling createNamespacedBinding.'); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, "string"); } if (includeUninitialized !== undefined) { localVarQueryParameters['includeUninitialized'] = ObjectSerializer.serialize(includeUninitialized, "boolean"); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'POST', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: ObjectSerializer.serialize(body, "V1Binding") }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "V1Binding"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * create a ConfigMap * @param namespace object name and auth scope, such as for teams and projects * @param body * @param includeUninitialized If true, partially initialized resources are included in the response. * @param pretty If 'true', then the output is pretty printed. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param {*} [options] Override http request options. */ createNamespacedConfigMap(namespace, body, includeUninitialized, pretty, dryRun, options = {}) { const localVarPath = this.basePath + '/api/v1/namespaces/{namespace}/configmaps' .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling createNamespacedConfigMap.'); } // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling createNamespacedConfigMap.'); } if (includeUninitialized !== undefined) { localVarQueryParameters['includeUninitialized'] = ObjectSerializer.serialize(includeUninitialized, "boolean"); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'POST', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: ObjectSerializer.serialize(body, "V1ConfigMap") }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "V1ConfigMap"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * create Endpoints * @param namespace object name and auth scope, such as for teams and projects * @param body * @param includeUninitialized If true, partially initialized resources are included in the response. * @param pretty If 'true', then the output is pretty printed. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param {*} [options] Override http request options. */ createNamespacedEndpoints(namespace, body, includeUninitialized, pretty, dryRun, options = {}) { const localVarPath = this.basePath + '/api/v1/namespaces/{namespace}/endpoints' .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling createNamespacedEndpoints.'); } // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling createNamespacedEndpoints.'); } if (includeUninitialized !== undefined) { localVarQueryParameters['includeUninitialized'] = ObjectSerializer.serialize(includeUninitialized, "boolean"); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'POST', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: ObjectSerializer.serialize(body, "V1Endpoints") }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "V1Endpoints"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * create an Event * @param namespace object name and auth scope, such as for teams and projects * @param body * @param includeUninitialized If true, partially initialized resources are included in the response. * @param pretty If 'true', then the output is pretty printed. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param {*} [options] Override http request options. */ createNamespacedEvent(namespace, body, includeUninitialized, pretty, dryRun, options = {}) { const localVarPath = this.basePath + '/api/v1/namespaces/{namespace}/events' .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling createNamespacedEvent.'); } // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling createNamespacedEvent.'); } if (includeUninitialized !== undefined) { localVarQueryParameters['includeUninitialized'] = ObjectSerializer.serialize(includeUninitialized, "boolean"); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'POST', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: ObjectSerializer.serialize(body, "V1Event") }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "V1Event"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * create a LimitRange * @param namespace object name and auth scope, such as for teams and projects * @param body * @param includeUninitialized If true, partially initialized resources are included in the response. * @param pretty If 'true', then the output is pretty printed. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param {*} [options] Override http request options. */ createNamespacedLimitRange(namespace, body, includeUninitialized, pretty, dryRun, options = {}) { const localVarPath = this.basePath + '/api/v1/namespaces/{namespace}/limitranges' .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling createNamespacedLimitRange.'); } // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling createNamespacedLimitRange.'); } if (includeUninitialized !== undefined) { localVarQueryParameters['includeUninitialized'] = ObjectSerializer.serialize(includeUninitialized, "boolean"); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'POST', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: ObjectSerializer.serialize(body, "V1LimitRange") }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "V1LimitRange"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * create a PersistentVolumeClaim * @param namespace object name and auth scope, such as for teams and projects * @param body * @param includeUninitialized If true, partially initialized resources are included in the response. * @param pretty If 'true', then the output is pretty printed. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param {*} [options] Override http request options. */ createNamespacedPersistentVolumeClaim(namespace, body, includeUninitialized, pretty, dryRun, options = {}) { const localVarPath = this.basePath + '/api/v1/namespaces/{namespace}/persistentvolumeclaims' .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling createNamespacedPersistentVolumeClaim.'); } // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling createNamespacedPersistentVolumeClaim.'); } if (includeUninitialized !== undefined) { localVarQueryParameters['includeUninitialized'] = ObjectSerializer.serialize(includeUninitialized, "boolean"); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'POST', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: ObjectSerializer.serialize(body, "V1PersistentVolumeClaim") }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "V1PersistentVolumeClaim"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * create a Pod * @param namespace object name and auth scope, such as for teams and projects * @param body * @param includeUninitialized If true, partially initialized resources are included in the response. * @param pretty If 'true', then the output is pretty printed. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param {*} [options] Override http request options. */ createNamespacedPod(namespace, body, includeUninitialized, pretty, dryRun, options = {}) { const localVarPath = this.basePath + '/api/v1/namespaces/{namespace}/pods' .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling createNamespacedPod.'); } // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling createNamespacedPod.'); } if (includeUninitialized !== undefined) { localVarQueryParameters['includeUninitialized'] = ObjectSerializer.serialize(includeUninitialized, "boolean"); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'POST', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: ObjectSerializer.serialize(body, "V1Pod") }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "V1Pod"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * create binding of a Pod * @param name name of the Binding * @param namespace object name and auth scope, such as for teams and projects * @param body * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param includeUninitialized If IncludeUninitialized is specified, the object may be returned without completing initialization. * @param pretty If 'true', then the output is pretty printed. * @param {*} [options] Override http request options. */ createNamespacedPodBinding(name, namespace, body, dryRun, includeUninitialized, pretty, options = {}) { const localVarPath = this.basePath + '/api/v1/namespaces/{namespace}/pods/{name}/binding' .replace('{' + 'name' + '}', encodeURIComponent(String(name))) .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling createNamespacedPodBinding.'); } // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling createNamespacedPodBinding.'); } // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling createNamespacedPodBinding.'); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, "string"); } if (includeUninitialized !== undefined) { localVarQueryParameters['includeUninitialized'] = ObjectSerializer.serialize(includeUninitialized, "boolean"); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'POST', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: ObjectSerializer.serialize(body, "V1Binding") }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "V1Binding"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * create eviction of a Pod * @param name name of the Eviction * @param namespace object name and auth scope, such as for teams and projects * @param body * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param includeUninitialized If IncludeUninitialized is specified, the object may be returned without completing initialization. * @param pretty If 'true', then the output is pretty printed. * @param {*} [options] Override http request options. */ createNamespacedPodEviction(name, namespace, body, dryRun, includeUninitialized, pretty, options = {}) { const localVarPath = this.basePath + '/api/v1/namespaces/{namespace}/pods/{name}/eviction' .replace('{' + 'name' + '}', encodeURIComponent(String(name))) .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling createNamespacedPodEviction.'); } // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling createNamespacedPodEviction.'); } // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling createNamespacedPodEviction.'); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, "string"); } if (includeUninitialized !== undefined) { localVarQueryParameters['includeUninitialized'] = ObjectSerializer.serialize(includeUninitialized, "boolean"); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'POST', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: ObjectSerializer.serialize(body, "V1beta1Eviction") }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "V1beta1Eviction"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * create a PodTemplate * @param namespace object name and auth scope, such as for teams and projects * @param body * @param includeUninitialized If true, partially initialized resources are included in the response. * @param pretty If 'true', then the output is pretty printed. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param {*} [options] Override http request options. */ createNamespacedPodTemplate(namespace, body, includeUninitialized, pretty, dryRun, options = {}) { const localVarPath = this.basePath + '/api/v1/namespaces/{namespace}/podtemplates' .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling createNamespacedPodTemplate.'); } // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling createNamespacedPodTemplate.'); } if (includeUninitialized !== undefined) { localVarQueryParameters['includeUninitialized'] = ObjectSerializer.serialize(includeUninitialized, "boolean"); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'POST', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: ObjectSerializer.serialize(body, "V1PodTemplate") }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "V1PodTemplate"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * create a ReplicationController * @param namespace object name and auth scope, such as for teams and projects * @param body * @param includeUninitialized If true, partially initialized resources are included in the response. * @param pretty If 'true', then the output is pretty printed. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param {*} [options] Override http request options. */ createNamespacedReplicationController(namespace, body, includeUninitialized, pretty, dryRun, options = {}) { const localVarPath = this.basePath + '/api/v1/namespaces/{namespace}/replicationcontrollers' .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling createNamespacedReplicationController.'); } // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling createNamespacedReplicationController.'); } if (includeUninitialized !== undefined) { localVarQueryParameters['includeUninitialized'] = ObjectSerializer.serialize(includeUninitialized, "boolean"); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'POST', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: ObjectSerializer.serialize(body, "V1ReplicationController") }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "V1ReplicationController"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * create a ResourceQuota * @param namespace object name and auth scope, such as for teams and projects * @param body * @param includeUninitialized If true, partially initialized resources are included in the response. * @param pretty If 'true', then the output is pretty printed. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param {*} [options] Override http request options. */ createNamespacedResourceQuota(namespace, body, includeUninitialized, pretty, dryRun, options = {}) { const localVarPath = this.basePath + '/api/v1/namespaces/{namespace}/resourcequotas' .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling createNamespacedResourceQuota.'); } // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling createNamespacedResourceQuota.'); } if (includeUninitialized !== undefined) { localVarQueryParameters['includeUninitialized'] = ObjectSerializer.serialize(includeUninitialized, "boolean"); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'POST', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: ObjectSerializer.serialize(body, "V1ResourceQuota") }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "V1ResourceQuota"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * create a Secret * @param namespace object name and auth scope, such as for teams and projects * @param body * @param includeUninitialized If true, partially initialized resources are included in the response. * @param pretty If 'true', then the output is pretty printed. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param {*} [options] Override http request options. */ createNamespacedSecret(namespace, body, includeUninitialized, pretty, dryRun, options = {}) { const localVarPath = this.basePath + '/api/v1/namespaces/{namespace}/secrets' .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling createNamespacedSecret.'); } // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling createNamespacedSecret.'); } if (includeUninitialized !== undefined) { localVarQueryParameters['includeUninitialized'] = ObjectSerializer.serialize(includeUninitialized, "boolean"); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'POST', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: ObjectSerializer.serialize(body, "V1Secret") }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "V1Secret"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * create a Service * @param namespace object name and auth scope, such as for teams and projects * @param body * @param includeUninitialized If IncludeUninitialized is specified, the object may be returned without completing initialization. * @param pretty If 'true', then the output is pretty printed. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param {*} [options] Override http request options. */ createNamespacedService(namespace, body, includeUninitialized, pretty, dryRun, options = {}) { const localVarPath = this.basePath + '/api/v1/namespaces/{namespace}/services' .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling createNamespacedService.'); } // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling createNamespacedService.'); } if (includeUninitialized !== undefined) { localVarQueryParameters['includeUninitialized'] = ObjectSerializer.serialize(includeUninitialized, "boolean"); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'POST', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: ObjectSerializer.serialize(body, "V1Service") }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "V1Service"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * create a ServiceAccount * @param namespace object name and auth scope, such as for teams and projects * @param body * @param includeUninitialized If true, partially initialized resources are included in the response. * @param pretty If 'true', then the output is pretty printed. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param {*} [options] Override http request options. */ createNamespacedServiceAccount(namespace, body, includeUninitialized, pretty, dryRun, options = {}) { const localVarPath = this.basePath + '/api/v1/namespaces/{namespace}/serviceaccounts' .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling createNamespacedServiceAccount.'); } // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling createNamespacedServiceAccount.'); } if (includeUninitialized !== undefined) { localVarQueryParameters['includeUninitialized'] = ObjectSerializer.serialize(includeUninitialized, "boolean"); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'POST', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: ObjectSerializer.serialize(body, "V1ServiceAccount") }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "V1ServiceAccount"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * create a Node * @param body * @param includeUninitialized If true, partially initialized resources are included in the response. * @param pretty If 'true', then the output is pretty printed. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param {*} [options] Override http request options. */ createNode(body, includeUninitialized, pretty, dryRun, options = {}) { const localVarPath = this.basePath + '/api/v1/nodes'; let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling createNode.'); } if (includeUninitialized !== undefined) { localVarQueryParameters['includeUninitialized'] = ObjectSerializer.serialize(includeUninitialized, "boolean"); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'POST', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: ObjectSerializer.serialize(body, "V1Node") }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "V1Node"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * create a PersistentVolume * @param body * @param includeUninitialized If true, partially initialized resources are included in the response. * @param pretty If 'true', then the output is pretty printed. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param {*} [options] Override http request options. */ createPersistentVolume(body, includeUninitialized, pretty, dryRun, options = {}) { const localVarPath = this.basePath + '/api/v1/persistentvolumes'; let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling createPersistentVolume.'); } if (includeUninitialized !== undefined) { localVarQueryParameters['includeUninitialized'] = ObjectSerializer.serialize(includeUninitialized, "boolean"); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'POST', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: ObjectSerializer.serialize(body, "V1PersistentVolume") }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "V1PersistentVolume"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * delete collection of ConfigMap * @param namespace object name and auth scope, such as for teams and projects * @param includeUninitialized If true, partially initialized resources are included in the response. * @param pretty If 'true', then the output is pretty printed. * @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. * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything. * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything. * @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. * @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. * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. * @param watch Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion. * @param {*} [options] Override http request options. */ deleteCollectionNamespacedConfigMap(namespace, includeUninitialized, pretty, _continue, fieldSelector, labelSelector, limit, resourceVersion, timeoutSeconds, watch, options = {}) { const localVarPath = this.basePath + '/api/v1/namespaces/{namespace}/configmaps' .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling deleteCollectionNamespacedConfigMap.'); } if (includeUninitialized !== undefined) { localVarQueryParameters['includeUninitialized'] = ObjectSerializer.serialize(includeUninitialized, "boolean"); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, "string"); } if (_continue !== undefined) { localVarQueryParameters['continue'] = ObjectSerializer.serialize(_continue, "string"); } if (fieldSelector !== undefined) { localVarQueryParameters['fieldSelector'] = ObjectSerializer.serialize(fieldSelector, "string"); } if (labelSelector !== undefined) { localVarQueryParameters['labelSelector'] = ObjectSerializer.serialize(labelSelector, "string"); } if (limit !== undefined) { localVarQueryParameters['limit'] = ObjectSerializer.serialize(limit, "number"); } if (resourceVersion !== undefined) { localVarQueryParameters['resourceVersion'] = ObjectSerializer.serialize(resourceVersion, "string"); } if (timeoutSeconds !== undefined) { localVarQueryParameters['timeoutSeconds'] = ObjectSerializer.serialize(timeoutSeconds, "number"); } if (watch !== undefined) { localVarQueryParameters['watch'] = ObjectSerializer.serialize(watch, "boolean"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'DELETE', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "V1Status"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * delete collection of Endpoints * @param namespace object name and auth scope, such as for teams and projects * @param includeUninitialized If true, partially initialized resources are included in the response. * @param pretty If 'true', then the output is pretty printed. * @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. * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything. * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything. * @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. * @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. * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. * @param watch Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion. * @param {*} [options] Override http request options. */ deleteCollectionNamespacedEndpoints(namespace, includeUninitialized, pretty, _continue, fieldSelector, labelSelector, limit, resourceVersion, timeoutSeconds, watch, options = {}) { const localVarPath = this.basePath + '/api/v1/namespaces/{namespace}/endpoints' .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling deleteCollectionNamespacedEndpoints.'); } if (includeUninitialized !== undefined) { localVarQueryParameters['includeUninitialized'] = ObjectSerializer.serialize(includeUninitialized, "boolean"); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, "string"); } if (_continue !== undefined) { localVarQueryParameters['continue'] = ObjectSerializer.serialize(_continue, "string"); } if (fieldSelector !== undefined) { localVarQueryParameters['fieldSelector'] = ObjectSerializer.serialize(fieldSelector, "string"); } if (labelSelector !== undefined) { localVarQueryParameters['labelSelector'] = ObjectSerializer.serialize(labelSelector, "string"); } if (limit !== undefined) { localVarQueryParameters['limit'] = ObjectSerializer.serialize(limit, "number"); } if (resourceVersion !== undefined) { localVarQueryParameters['resourceVersion'] = ObjectSerializer.serialize(resourceVersion, "string"); } if (timeoutSeconds !== undefined) { localVarQueryParameters['timeoutSeconds'] = ObjectSerializer.serialize(timeoutSeconds, "number"); } if (watch !== undefined) { localVarQueryParameters['watch'] = ObjectSerializer.serialize(watch, "boolean"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'DELETE', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "V1Status"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * delete collection of Event * @param namespace object name and auth scope, such as for teams and projects * @param includeUninitialized If true, partially initialized resources are included in the response. * @param pretty If 'true', then the output is pretty printed. * @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. * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything. * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything. * @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. * @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. * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. * @param watch Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion. * @param {*} [options] Override http request options. */ deleteCollectionNamespacedEvent(namespace, includeUninitialized, pretty, _continue, fieldSelector, labelSelector, limit, resourceVersion, timeoutSeconds, watch, options = {}) { const localVarPath = this.basePath + '/api/v1/namespaces/{namespace}/events' .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling deleteCollectionNamespacedEvent.'); } if (includeUninitialized !== undefined) { localVarQueryParameters['includeUninitialized'] = ObjectSerializer.serialize(includeUninitialized, "boolean"); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, "string"); } if (_continue !== undefined) { localVarQueryParameters['continue'] = ObjectSerializer.serialize(_continue, "string"); } if (fieldSelector !== undefined) { localVarQueryParameters['fieldSelector'] = ObjectSerializer.serialize(fieldSelector, "string"); } if (labelSelector !== undefined) { localVarQueryParameters['labelSelector'] = ObjectSerializer.serialize(labelSelector, "string"); } if (limit !== undefined) { localVarQueryParameters['limit'] = ObjectSerializer.serialize(limit, "number"); } if (resourceVersion !== undefined) { localVarQueryParameters['resourceVersion'] = ObjectSerializer.serialize(resourceVersion, "string"); } if (timeoutSeconds !== undefined) { localVarQueryParameters['timeoutSeconds'] = ObjectSerializer.serialize(timeoutSeconds, "number"); } if (watch !== undefined) { localVarQueryParameters['watch'] = ObjectSerializer.serialize(watch, "boolean"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'DELETE', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "V1Status"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * delete collection of LimitRange * @param namespace object name and auth scope, such as for teams and projects * @param includeUninitialized If true, partially initialized resources are included in the response. * @param pretty If 'true', then the output is pretty printed. * @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. * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything. * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything. * @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. * @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. * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. * @param watch Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion. * @param {*} [options] Override http request options. */ deleteCollectionNamespacedLimitRange(namespace, includeUninitialized, pretty, _continue, fieldSelector, labelSelector, limit, resourceVersion, timeoutSeconds, watch, options = {}) { const localVarPath = this.basePath + '/api/v1/namespaces/{namespace}/limitranges' .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling deleteCollectionNamespacedLimitRange.'); } if (includeUninitialized !== undefined) { localVarQueryParameters['includeUninitialized'] = ObjectSerializer.serialize(includeUninitialized, "boolean"); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, "string"); } if (_continue !== undefined) { localVarQueryParameters['continue'] = ObjectSerializer.serialize(_continue, "string"); } if (fieldSelector !== undefined) { localVarQueryParameters['fieldSelector'] = ObjectSerializer.serialize(fieldSelector, "string"); } if (labelSelector !== undefined) { localVarQueryParameters['labelSelector'] = ObjectSerializer.serialize(labelSelector, "string"); } if (limit !== undefined) { localVarQueryParameters['limit'] = ObjectSerializer.serialize(limit, "number"); } if (resourceVersion !== undefined) { localVarQueryParameters['resourceVersion'] = ObjectSerializer.serialize(resourceVersion, "string"); } if (timeoutSeconds !== undefined) { localVarQueryParameters['timeoutSeconds'] = ObjectSerializer.serialize(timeoutSeconds, "number"); } if (watch !== undefined) { localVarQueryParameters['watch'] = ObjectSerializer.serialize(watch, "boolean"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'DELETE', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "V1Status"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * delete collection of PersistentVolumeClaim * @param namespace object name and auth scope, such as for teams and projects * @param includeUninitialized If true, partially initialized resources are included in the response. * @param pretty If 'true', then the output is pretty printed. * @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. * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything. * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything. * @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. * @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. * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. * @param watch Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion. * @param {*} [options] Override http request options. */ deleteCollectionNamespacedPersistentVolumeClaim(namespace, includeUninitialized, pretty, _continue, fieldSelector, labelSelector, limit, resourceVersion, timeoutSeconds, watch, options = {}) { const localVarPath = this.basePath + '/api/v1/namespaces/{namespace}/persistentvolumeclaims' .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling deleteCollectionNamespacedPersistentVolumeClaim.'); } if (includeUninitialized !== undefined) { localVarQueryParameters['includeUninitialized'] = ObjectSerializer.serialize(includeUninitialized, "boolean"); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, "string"); } if (_continue !== undefined) { localVarQueryParameters['continue'] = ObjectSerializer.serialize(_continue, "string"); } if (fieldSelector !== undefined) { localVarQueryParameters['fieldSelector'] = ObjectSerializer.serialize(fieldSelector, "string"); } if (labelSelector !== undefined) { localVarQueryParameters['labelSelector'] = ObjectSerializer.serialize(labelSelector, "string"); } if (limit !== undefined) { localVarQueryParameters['limit'] = ObjectSerializer.serialize(limit, "number"); } if (resourceVersion !== undefined) { localVarQueryParameters['resourceVersion'] = ObjectSerializer.serialize(resourceVersion, "string"); } if (timeoutSeconds !== undefined) { localVarQueryParameters['timeoutSeconds'] = ObjectSerializer.serialize(timeoutSeconds, "number"); } if (watch !== undefined) { localVarQueryParameters['watch'] = ObjectSerializer.serialize(watch, "boolean"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'DELETE', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "V1Status"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * delete collection of Pod * @param namespace object name and auth scope, such as for teams and projects * @param includeUninitialized If true, partially initialized resources are included in the response. * @param pretty If 'true', then the output is pretty printed. * @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. * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything. * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything. * @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. * @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. * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. * @param watch Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion. * @param {*} [options] Override http request options. */ deleteCollectionNamespacedPod(namespace, includeUninitialized, pretty, _continue, fieldSelector, labelSelector, limit, resourceVersion, timeoutSeconds, watch, options = {}) { const localVarPath = this.basePath + '/api/v1/namespaces/{namespace}/pods' .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling deleteCollectionNamespacedPod.'); } if (includeUninitialized !== undefined) { localVarQueryParameters['includeUninitialized'] = ObjectSerializer.serialize(includeUninitialized, "boolean"); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, "string"); } if (_continue !== undefined) { localVarQueryParameters['continue'] = ObjectSerializer.serialize(_continue, "string"); } if (fieldSelector !== undefined) { localVarQueryParameters['fieldSelector'] = ObjectSerializer.serialize(fieldSelector, "string"); } if (labelSelector !== undefined) { localVarQueryParameters['labelSelector'] = ObjectSerializer.serialize(labelSelector, "string"); } if (limit !== undefined) { localVarQueryParameters['limit'] = ObjectSerializer.serialize(limit, "number"); } if (resourceVersion !== undefined) { localVarQueryParameters['resourceVersion'] = ObjectSerializer.serialize(resourceVersion, "string"); } if (timeoutSeconds !== undefined) { localVarQueryParameters['timeoutSeconds'] = ObjectSerializer.serialize(timeoutSeconds, "number"); } if (watch !== undefined) { localVarQueryParameters['watch'] = ObjectSerializer.serialize(watch, "boolean"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'DELETE', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "V1Status"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * delete collection of PodTemplate * @param namespace object name and auth scope, such as for teams and projects * @param includeUninitialized If true, partially initialized resources are included in the response. * @param pretty If 'true', then the output is pretty printed. * @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. * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything. * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything. * @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. * @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. * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. * @param watch Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion. * @param {*} [options] Override http request options. */ deleteCollectionNamespacedPodTemplate(namespace, includeUninitialized, pretty, _continue, fieldSelector, labelSelector, limit, resourceVersion, timeoutSeconds, watch, options = {}) { const localVarPath = this.basePath + '/api/v1/namespaces/{namespace}/podtemplates' .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling deleteCollectionNamespacedPodTemplate.'); } if (includeUninitialized !== undefined) { localVarQueryParameters['includeUninitialized'] = ObjectSerializer.serialize(includeUninitialized, "boolean"); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, "string"); } if (_continue !== undefined) { localVarQueryParameters['continue'] = ObjectSerializer.serialize(_continue, "string"); } if (fieldSelector !== undefined) { localVarQueryParameters['fieldSelector'] = ObjectSerializer.serialize(fieldSelector, "string"); } if (labelSelector !== undefined) { localVarQueryParameters['labelSelector'] = ObjectSerializer.serialize(labelSelector, "string"); } if (limit !== undefined) { localVarQueryParameters['limit'] = ObjectSerializer.serialize(limit, "number"); } if (resourceVersion !== undefined) { localVarQueryParameters['resourceVersion'] = ObjectSerializer.serialize(resourceVersion, "string"); } if (timeoutSeconds !== undefined) { localVarQueryParameters['timeoutSeconds'] = ObjectSerializer.serialize(timeoutSeconds, "number"); } if (watch !== undefined) { localVarQueryParameters['watch'] = ObjectSerializer.serialize(watch, "boolean"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'DELETE', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "V1Status"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * delete collection of ReplicationController * @param namespace object name and auth scope, such as for teams and projects * @param includeUninitialized If true, partially initialized resources are included in the response. * @param pretty If 'true', then the output is pretty printed. * @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. * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything. * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything. * @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. * @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. * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. * @param watch Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion. * @param {*} [options] Override http request options. */ deleteCollectionNamespacedReplicationController(namespace, includeUninitialized, pretty, _continue, fieldSelector, labelSelector, limit, resourceVersion, timeoutSeconds, watch, options = {}) { const localVarPath = this.basePath + '/api/v1/namespaces/{namespace}/replicationcontrollers' .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling deleteCollectionNamespacedReplicationController.'); } if (includeUninitialized !== undefined) { localVarQueryParameters['includeUninitialized'] = ObjectSerializer.serialize(includeUninitialized, "boolean"); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, "string"); } if (_continue !== undefined) { localVarQueryParameters['continue'] = ObjectSerializer.serialize(_continue, "string"); } if (fieldSelector !== undefined) { localVarQueryParameters['fieldSelector'] = ObjectSerializer.serialize(fieldSelector, "string"); } if (labelSelector !== undefined) { localVarQueryParameters['labelSelector'] = ObjectSerializer.serialize(labelSelector, "string"); } if (limit !== undefined) { localVarQueryParameters['limit'] = ObjectSerializer.serialize(limit, "number"); } if (resourceVersion !== undefined) { localVarQueryParameters['resourceVersion'] = ObjectSerializer.serialize(resourceVersion, "string"); } if (timeoutSeconds !== undefined) { localVarQueryParameters['timeoutSeconds'] = ObjectSerializer.serialize(timeoutSeconds, "number"); } if (watch !== undefined) { localVarQueryParameters['watch'] = ObjectSerializer.serialize(watch, "boolean"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'DELETE', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "V1Status"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * delete collection of ResourceQuota * @param namespace object name and auth scope, such as for teams and projects * @param includeUninitialized If true, partially initialized resources are included in the response. * @param pretty If 'true', then the output is pretty printed. * @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. * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything. * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything. * @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. * @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. * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. * @param watch Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion. * @param {*} [options] Override http request options. */ deleteCollectionNamespacedResourceQuota(namespace, includeUninitialized, pretty, _continue, fieldSelector, labelSelector, limit, resourceVersion, timeoutSeconds, watch, options = {}) { const localVarPath = this.basePath + '/api/v1/namespaces/{namespace}/resourcequotas' .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling deleteCollectionNamespacedResourceQuota.'); } if (includeUninitialized !== undefined) { localVarQueryParameters['includeUninitialized'] = ObjectSerializer.serialize(includeUninitialized, "boolean"); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, "string"); } if (_continue !== undefined) { localVarQueryParameters['continue'] = ObjectSerializer.serialize(_continue, "string"); } if (fieldSelector !== undefined) { localVarQueryParameters['fieldSelector'] = ObjectSerializer.serialize(fieldSelector, "string"); } if (labelSelector !== undefined) { localVarQueryParameters['labelSelector'] = ObjectSerializer.serialize(labelSelector, "string"); } if (limit !== undefined) { localVarQueryParameters['limit'] = ObjectSerializer.serialize(limit, "number"); } if (resourceVersion !== undefined) { localVarQueryParameters['resourceVersion'] = ObjectSerializer.serialize(resourceVersion, "string"); } if (timeoutSeconds !== undefined) { localVarQueryParameters['timeoutSeconds'] = ObjectSerializer.serialize(timeoutSeconds, "number"); } if (watch !== undefined) { localVarQueryParameters['watch'] = ObjectSerializer.serialize(watch, "boolean"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'DELETE', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "V1Status"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * delete collection of Secret * @param namespace object name and auth scope, such as for teams and projects * @param includeUninitialized If true, partially initialized resources are included in the response. * @param pretty If 'true', then the output is pretty printed. * @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. * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything. * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything. * @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. * @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. * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. * @param watch Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion. * @param {*} [options] Override http request options. */ deleteCollectionNamespacedSecret(namespace, includeUninitialized, pretty, _continue, fieldSelector, labelSelector, limit, resourceVersion, timeoutSeconds, watch, options = {}) { const localVarPath = this.basePath + '/api/v1/namespaces/{namespace}/secrets' .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling deleteCollectionNamespacedSecret.'); } if (includeUninitialized !== undefined) { localVarQueryParameters['includeUninitialized'] = ObjectSerializer.serialize(includeUninitialized, "boolean"); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, "string"); } if (_continue !== undefined) { localVarQueryParameters['continue'] = ObjectSerializer.serialize(_continue, "string"); } if (fieldSelector !== undefined) { localVarQueryParameters['fieldSelector'] = ObjectSerializer.serialize(fieldSelector, "string"); } if (labelSelector !== undefined) { localVarQueryParameters['labelSelector'] = ObjectSerializer.serialize(labelSelector, "string"); } if (limit !== undefined) { localVarQueryParameters['limit'] = ObjectSerializer.serialize(limit, "number"); } if (resourceVersion !== undefined) { localVarQueryParameters['resourceVersion'] = ObjectSerializer.serialize(resourceVersion, "string"); } if (timeoutSeconds !== undefined) { localVarQueryParameters['timeoutSeconds'] = ObjectSerializer.serialize(timeoutSeconds, "number"); } if (watch !== undefined) { localVarQueryParameters['watch'] = ObjectSerializer.serialize(watch, "boolean"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'DELETE', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "V1Status"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * delete collection of ServiceAccount * @param namespace object name and auth scope, such as for teams and projects * @param includeUninitialized If true, partially initialized resources are included in the response. * @param pretty If 'true', then the output is pretty printed. * @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. * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything. * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything. * @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. * @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. * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. * @param watch Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion. * @param {*} [options] Override http request options. */ deleteCollectionNamespacedServiceAccount(namespace, includeUninitialized, pretty, _continue, fieldSelector, labelSelector, limit, resourceVersion, timeoutSeconds, watch, options = {}) { const localVarPath = this.basePath + '/api/v1/namespaces/{namespace}/serviceaccounts' .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling deleteCollectionNamespacedServiceAccount.'); } if (includeUninitialized !== undefined) { localVarQueryParameters['includeUninitialized'] = ObjectSerializer.serialize(includeUninitialized, "boolean"); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, "string"); } if (_continue !== undefined) { localVarQueryParameters['continue'] = ObjectSerializer.serialize(_continue, "string"); } if (fieldSelector !== undefined) { localVarQueryParameters['fieldSelector'] = ObjectSerializer.serialize(fieldSelector, "string"); } if (labelSelector !== undefined) { localVarQueryParameters['labelSelector'] = ObjectSerializer.serialize(labelSelector, "string"); } if (limit !== undefined) { localVarQueryParameters['limit'] = ObjectSerializer.serialize(limit, "number"); } if (resourceVersion !== undefined) { localVarQueryParameters['resourceVersion'] = ObjectSerializer.serialize(resourceVersion, "string"); } if (timeoutSeconds !== undefined) { localVarQueryParameters['timeoutSeconds'] = ObjectSerializer.serialize(timeoutSeconds, "number"); } if (watch !== undefined) { localVarQueryParameters['watch'] = ObjectSerializer.serialize(watch, "boolean"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'DELETE', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "V1Status"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * delete collection of Node * @param includeUninitialized If true, partially initialized resources are included in the response. * @param pretty If 'true', then the output is pretty printed. * @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. * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything. * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything. * @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. * @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. * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. * @param watch Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion. * @param {*} [options] Override http request options. */ deleteCollectionNode(includeUninitialized, pretty, _continue, fieldSelector, labelSelector, limit, resourceVersion, timeoutSeconds, watch, options = {}) { const localVarPath = this.basePath + '/api/v1/nodes'; let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; if (includeUninitialized !== undefined) { localVarQueryParameters['includeUninitialized'] = ObjectSerializer.serialize(includeUninitialized, "boolean"); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, "string"); } if (_continue !== undefined) { localVarQueryParameters['continue'] = ObjectSerializer.serialize(_continue, "string"); } if (fieldSelector !== undefined) { localVarQueryParameters['fieldSelector'] = ObjectSerializer.serialize(fieldSelector, "string"); } if (labelSelector !== undefined) { localVarQueryParameters['labelSelector'] = ObjectSerializer.serialize(labelSelector, "string"); } if (limit !== undefined) { localVarQueryParameters['limit'] = ObjectSerializer.serialize(limit, "number"); } if (resourceVersion !== undefined) { localVarQueryParameters['resourceVersion'] = ObjectSerializer.serialize(resourceVersion, "string"); } if (timeoutSeconds !== undefined) { localVarQueryParameters['timeoutSeconds'] = ObjectSerializer.serialize(timeoutSeconds, "number"); } if (watch !== undefined) { localVarQueryParameters['watch'] = ObjectSerializer.serialize(watch, "boolean"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'DELETE', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "V1Status"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * delete collection of PersistentVolume * @param includeUninitialized If true, partially initialized resources are included in the response. * @param pretty If 'true', then the output is pretty printed. * @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. * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything. * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything. * @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. * @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. * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. * @param watch Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion. * @param {*} [options] Override http request options. */ deleteCollectionPersistentVolume(includeUninitialized, pretty, _continue, fieldSelector, labelSelector, limit, resourceVersion, timeoutSeconds, watch, options = {}) { const localVarPath = this.basePath + '/api/v1/persistentvolumes'; let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; if (includeUninitialized !== undefined) { localVarQueryParameters['includeUninitialized'] = ObjectSerializer.serialize(includeUninitialized, "boolean"); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, "string"); } if (_continue !== undefined) { localVarQueryParameters['continue'] = ObjectSerializer.serialize(_continue, "string"); } if (fieldSelector !== undefined) { localVarQueryParameters['fieldSelector'] = ObjectSerializer.serialize(fieldSelector, "string"); } if (labelSelector !== undefined) { localVarQueryParameters['labelSelector'] = ObjectSerializer.serialize(labelSelector, "string"); } if (limit !== undefined) { localVarQueryParameters['limit'] = ObjectSerializer.serialize(limit, "number"); } if (resourceVersion !== undefined) { localVarQueryParameters['resourceVersion'] = ObjectSerializer.serialize(resourceVersion, "string"); } if (timeoutSeconds !== undefined) { localVarQueryParameters['timeoutSeconds'] = ObjectSerializer.serialize(timeoutSeconds, "number"); } if (watch !== undefined) { localVarQueryParameters['watch'] = ObjectSerializer.serialize(watch, "boolean"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'DELETE', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "V1Status"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * delete a Namespace * @param name name of the Namespace * @param pretty If 'true', then the output is pretty printed. * @param body * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @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. * @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. * @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. * @param {*} [options] Override http request options. */ deleteNamespace(name, pretty, body, dryRun, gracePeriodSeconds, orphanDependents, propagationPolicy, options = {}) { const localVarPath = this.basePath + '/api/v1/namespaces/{name}' .replace('{' + 'name' + '}', encodeURIComponent(String(name))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling deleteNamespace.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, "string"); } if (gracePeriodSeconds !== undefined) { localVarQueryParameters['gracePeriodSeconds'] = ObjectSerializer.serialize(gracePeriodSeconds, "number"); } if (orphanDependents !== undefined) { localVarQueryParameters['orphanDependents'] = ObjectSerializer.serialize(orphanDependents, "boolean"); } if (propagationPolicy !== undefined) { localVarQueryParameters['propagationPolicy'] = ObjectSerializer.serialize(propagationPolicy, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'DELETE', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: ObjectSerializer.serialize(body, "V1DeleteOptions") }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "V1Status"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * delete a ConfigMap * @param name name of the ConfigMap * @param namespace object name and auth scope, such as for teams and projects * @param pretty If 'true', then the output is pretty printed. * @param body * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @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. * @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. * @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. * @param {*} [options] Override http request options. */ deleteNamespacedConfigMap(name, namespace, pretty, body, dryRun, gracePeriodSeconds, orphanDependents, propagationPolicy, options = {}) { const localVarPath = this.basePath + '/api/v1/namespaces/{namespace}/configmaps/{name}' .replace('{' + 'name' + '}', encodeURIComponent(String(name))) .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling deleteNamespacedConfigMap.'); } // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling deleteNamespacedConfigMap.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, "string"); } if (gracePeriodSeconds !== undefined) { localVarQueryParameters['gracePeriodSeconds'] = ObjectSerializer.serialize(gracePeriodSeconds, "number"); } if (orphanDependents !== undefined) { localVarQueryParameters['orphanDependents'] = ObjectSerializer.serialize(orphanDependents, "boolean"); } if (propagationPolicy !== undefined) { localVarQueryParameters['propagationPolicy'] = ObjectSerializer.serialize(propagationPolicy, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'DELETE', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: ObjectSerializer.serialize(body, "V1DeleteOptions") }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "V1Status"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * delete Endpoints * @param name name of the Endpoints * @param namespace object name and auth scope, such as for teams and projects * @param pretty If 'true', then the output is pretty printed. * @param body * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @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. * @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. * @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. * @param {*} [options] Override http request options. */ deleteNamespacedEndpoints(name, namespace, pretty, body, dryRun, gracePeriodSeconds, orphanDependents, propagationPolicy, options = {}) { const localVarPath = this.basePath + '/api/v1/namespaces/{namespace}/endpoints/{name}' .replace('{' + 'name' + '}', encodeURIComponent(String(name))) .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling deleteNamespacedEndpoints.'); } // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling deleteNamespacedEndpoints.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, "string"); } if (gracePeriodSeconds !== undefined) { localVarQueryParameters['gracePeriodSeconds'] = ObjectSerializer.serialize(gracePeriodSeconds, "number"); } if (orphanDependents !== undefined) { localVarQueryParameters['orphanDependents'] = ObjectSerializer.serialize(orphanDependents, "boolean"); } if (propagationPolicy !== undefined) { localVarQueryParameters['propagationPolicy'] = ObjectSerializer.serialize(propagationPolicy, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'DELETE', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: ObjectSerializer.serialize(body, "V1DeleteOptions") }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "V1Status"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * delete an Event * @param name name of the Event * @param namespace object name and auth scope, such as for teams and projects * @param pretty If 'true', then the output is pretty printed. * @param body * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @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. * @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. * @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. * @param {*} [options] Override http request options. */ deleteNamespacedEvent(name, namespace, pretty, body, dryRun, gracePeriodSeconds, orphanDependents, propagationPolicy, options = {}) { const localVarPath = this.basePath + '/api/v1/namespaces/{namespace}/events/{name}' .replace('{' + 'name' + '}', encodeURIComponent(String(name))) .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling deleteNamespacedEvent.'); } // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling deleteNamespacedEvent.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, "string"); } if (gracePeriodSeconds !== undefined) { localVarQueryParameters['gracePeriodSeconds'] = ObjectSerializer.serialize(gracePeriodSeconds, "number"); } if (orphanDependents !== undefined) { localVarQueryParameters['orphanDependents'] = ObjectSerializer.serialize(orphanDependents, "boolean"); } if (propagationPolicy !== undefined) { localVarQueryParameters['propagationPolicy'] = ObjectSerializer.serialize(propagationPolicy, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'DELETE', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: ObjectSerializer.serialize(body, "V1DeleteOptions") }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "V1Status"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * delete a LimitRange * @param name name of the LimitRange * @param namespace object name and auth scope, such as for teams and projects * @param pretty If 'true', then the output is pretty printed. * @param body * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @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. * @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. * @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. * @param {*} [options] Override http request options. */ deleteNamespacedLimitRange(name, namespace, pretty, body, dryRun, gracePeriodSeconds, orphanDependents, propagationPolicy, options = {}) { const localVarPath = this.basePath + '/api/v1/namespaces/{namespace}/limitranges/{name}' .replace('{' + 'name' + '}', encodeURIComponent(String(name))) .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling deleteNamespacedLimitRange.'); } // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling deleteNamespacedLimitRange.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, "string"); } if (gracePeriodSeconds !== undefined) { localVarQueryParameters['gracePeriodSeconds'] = ObjectSerializer.serialize(gracePeriodSeconds, "number"); } if (orphanDependents !== undefined) { localVarQueryParameters['orphanDependents'] = ObjectSerializer.serialize(orphanDependents, "boolean"); } if (propagationPolicy !== undefined) { localVarQueryParameters['propagationPolicy'] = ObjectSerializer.serialize(propagationPolicy, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'DELETE', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: ObjectSerializer.serialize(body, "V1DeleteOptions") }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "V1Status"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * delete a PersistentVolumeClaim * @param name name of the PersistentVolumeClaim * @param namespace object name and auth scope, such as for teams and projects * @param pretty If 'true', then the output is pretty printed. * @param body * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @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. * @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. * @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. * @param {*} [options] Override http request options. */ deleteNamespacedPersistentVolumeClaim(name, namespace, pretty, body, dryRun, gracePeriodSeconds, orphanDependents, propagationPolicy, options = {}) { const localVarPath = this.basePath + '/api/v1/namespaces/{namespace}/persistentvolumeclaims/{name}' .replace('{' + 'name' + '}', encodeURIComponent(String(name))) .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling deleteNamespacedPersistentVolumeClaim.'); } // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling deleteNamespacedPersistentVolumeClaim.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, "string"); } if (gracePeriodSeconds !== undefined) { localVarQueryParameters['gracePeriodSeconds'] = ObjectSerializer.serialize(gracePeriodSeconds, "number"); } if (orphanDependents !== undefined) { localVarQueryParameters['orphanDependents'] = ObjectSerializer.serialize(orphanDependents, "boolean"); } if (propagationPolicy !== undefined) { localVarQueryParameters['propagationPolicy'] = ObjectSerializer.serialize(propagationPolicy, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'DELETE', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: ObjectSerializer.serialize(body, "V1DeleteOptions") }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "V1Status"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * delete a Pod * @param name name of the Pod * @param namespace object name and auth scope, such as for teams and projects * @param pretty If 'true', then the output is pretty printed. * @param body * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @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. * @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. * @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. * @param {*} [options] Override http request options. */ deleteNamespacedPod(name, namespace, pretty, body, dryRun, gracePeriodSeconds, orphanDependents, propagationPolicy, options = {}) { const localVarPath = this.basePath + '/api/v1/namespaces/{namespace}/pods/{name}' .replace('{' + 'name' + '}', encodeURIComponent(String(name))) .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling deleteNamespacedPod.'); } // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling deleteNamespacedPod.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, "string"); } if (gracePeriodSeconds !== undefined) { localVarQueryParameters['gracePeriodSeconds'] = ObjectSerializer.serialize(gracePeriodSeconds, "number"); } if (orphanDependents !== undefined) { localVarQueryParameters['orphanDependents'] = ObjectSerializer.serialize(orphanDependents, "boolean"); } if (propagationPolicy !== undefined) { localVarQueryParameters['propagationPolicy'] = ObjectSerializer.serialize(propagationPolicy, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'DELETE', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: ObjectSerializer.serialize(body, "V1DeleteOptions") }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "V1Status"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * delete a PodTemplate * @param name name of the PodTemplate * @param namespace object name and auth scope, such as for teams and projects * @param pretty If 'true', then the output is pretty printed. * @param body * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @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. * @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. * @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. * @param {*} [options] Override http request options. */ deleteNamespacedPodTemplate(name, namespace, pretty, body, dryRun, gracePeriodSeconds, orphanDependents, propagationPolicy, options = {}) { const localVarPath = this.basePath + '/api/v1/namespaces/{namespace}/podtemplates/{name}' .replace('{' + 'name' + '}', encodeURIComponent(String(name))) .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling deleteNamespacedPodTemplate.'); } // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling deleteNamespacedPodTemplate.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, "string"); } if (gracePeriodSeconds !== undefined) { localVarQueryParameters['gracePeriodSeconds'] = ObjectSerializer.serialize(gracePeriodSeconds, "number"); } if (orphanDependents !== undefined) { localVarQueryParameters['orphanDependents'] = ObjectSerializer.serialize(orphanDependents, "boolean"); } if (propagationPolicy !== undefined) { localVarQueryParameters['propagationPolicy'] = ObjectSerializer.serialize(propagationPolicy, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'DELETE', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: ObjectSerializer.serialize(body, "V1DeleteOptions") }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "V1Status"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * delete a ReplicationController * @param name name of the ReplicationController * @param namespace object name and auth scope, such as for teams and projects * @param pretty If 'true', then the output is pretty printed. * @param body * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @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. * @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. * @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. * @param {*} [options] Override http request options. */ deleteNamespacedReplicationController(name, namespace, pretty, body, dryRun, gracePeriodSeconds, orphanDependents, propagationPolicy, options = {}) { const localVarPath = this.basePath + '/api/v1/namespaces/{namespace}/replicationcontrollers/{name}' .replace('{' + 'name' + '}', encodeURIComponent(String(name))) .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling deleteNamespacedReplicationController.'); } // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling deleteNamespacedReplicationController.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, "string"); } if (gracePeriodSeconds !== undefined) { localVarQueryParameters['gracePeriodSeconds'] = ObjectSerializer.serialize(gracePeriodSeconds, "number"); } if (orphanDependents !== undefined) { localVarQueryParameters['orphanDependents'] = ObjectSerializer.serialize(orphanDependents, "boolean"); } if (propagationPolicy !== undefined) { localVarQueryParameters['propagationPolicy'] = ObjectSerializer.serialize(propagationPolicy, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'DELETE', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: ObjectSerializer.serialize(body, "V1DeleteOptions") }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "V1Status"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * delete a ResourceQuota * @param name name of the ResourceQuota * @param namespace object name and auth scope, such as for teams and projects * @param pretty If 'true', then the output is pretty printed. * @param body * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @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. * @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. * @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. * @param {*} [options] Override http request options. */ deleteNamespacedResourceQuota(name, namespace, pretty, body, dryRun, gracePeriodSeconds, orphanDependents, propagationPolicy, options = {}) { const localVarPath = this.basePath + '/api/v1/namespaces/{namespace}/resourcequotas/{name}' .replace('{' + 'name' + '}', encodeURIComponent(String(name))) .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling deleteNamespacedResourceQuota.'); } // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling deleteNamespacedResourceQuota.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, "string"); } if (gracePeriodSeconds !== undefined) { localVarQueryParameters['gracePeriodSeconds'] = ObjectSerializer.serialize(gracePeriodSeconds, "number"); } if (orphanDependents !== undefined) { localVarQueryParameters['orphanDependents'] = ObjectSerializer.serialize(orphanDependents, "boolean"); } if (propagationPolicy !== undefined) { localVarQueryParameters['propagationPolicy'] = ObjectSerializer.serialize(propagationPolicy, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'DELETE', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: ObjectSerializer.serialize(body, "V1DeleteOptions") }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "V1Status"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * delete a Secret * @param name name of the Secret * @param namespace object name and auth scope, such as for teams and projects * @param pretty If 'true', then the output is pretty printed. * @param body * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @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. * @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. * @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. * @param {*} [options] Override http request options. */ deleteNamespacedSecret(name, namespace, pretty, body, dryRun, gracePeriodSeconds, orphanDependents, propagationPolicy, options = {}) { const localVarPath = this.basePath + '/api/v1/namespaces/{namespace}/secrets/{name}' .replace('{' + 'name' + '}', encodeURIComponent(String(name))) .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling deleteNamespacedSecret.'); } // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling deleteNamespacedSecret.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, "string"); } if (gracePeriodSeconds !== undefined) { localVarQueryParameters['gracePeriodSeconds'] = ObjectSerializer.serialize(gracePeriodSeconds, "number"); } if (orphanDependents !== undefined) { localVarQueryParameters['orphanDependents'] = ObjectSerializer.serialize(orphanDependents, "boolean"); } if (propagationPolicy !== undefined) { localVarQueryParameters['propagationPolicy'] = ObjectSerializer.serialize(propagationPolicy, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'DELETE', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: ObjectSerializer.serialize(body, "V1DeleteOptions") }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "V1Status"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * delete a Service * @param name name of the Service * @param namespace object name and auth scope, such as for teams and projects * @param pretty If 'true', then the output is pretty printed. * @param body * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @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. * @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. * @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. * @param {*} [options] Override http request options. */ deleteNamespacedService(name, namespace, pretty, body, dryRun, gracePeriodSeconds, orphanDependents, propagationPolicy, options = {}) { const localVarPath = this.basePath + '/api/v1/namespaces/{namespace}/services/{name}' .replace('{' + 'name' + '}', encodeURIComponent(String(name))) .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling deleteNamespacedService.'); } // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling deleteNamespacedService.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, "string"); } if (gracePeriodSeconds !== undefined) { localVarQueryParameters['gracePeriodSeconds'] = ObjectSerializer.serialize(gracePeriodSeconds, "number"); } if (orphanDependents !== undefined) { localVarQueryParameters['orphanDependents'] = ObjectSerializer.serialize(orphanDependents, "boolean"); } if (propagationPolicy !== undefined) { localVarQueryParameters['propagationPolicy'] = ObjectSerializer.serialize(propagationPolicy, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'DELETE', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: ObjectSerializer.serialize(body, "V1DeleteOptions") }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "V1Status"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * delete a ServiceAccount * @param name name of the ServiceAccount * @param namespace object name and auth scope, such as for teams and projects * @param pretty If 'true', then the output is pretty printed. * @param body * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @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. * @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. * @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. * @param {*} [options] Override http request options. */ deleteNamespacedServiceAccount(name, namespace, pretty, body, dryRun, gracePeriodSeconds, orphanDependents, propagationPolicy, options = {}) { const localVarPath = this.basePath + '/api/v1/namespaces/{namespace}/serviceaccounts/{name}' .replace('{' + 'name' + '}', encodeURIComponent(String(name))) .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling deleteNamespacedServiceAccount.'); } // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling deleteNamespacedServiceAccount.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, "string"); } if (gracePeriodSeconds !== undefined) { localVarQueryParameters['gracePeriodSeconds'] = ObjectSerializer.serialize(gracePeriodSeconds, "number"); } if (orphanDependents !== undefined) { localVarQueryParameters['orphanDependents'] = ObjectSerializer.serialize(orphanDependents, "boolean"); } if (propagationPolicy !== undefined) { localVarQueryParameters['propagationPolicy'] = ObjectSerializer.serialize(propagationPolicy, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'DELETE', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: ObjectSerializer.serialize(body, "V1DeleteOptions") }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "V1Status"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * delete a Node * @param name name of the Node * @param pretty If 'true', then the output is pretty printed. * @param body * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @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. * @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. * @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. * @param {*} [options] Override http request options. */ deleteNode(name, pretty, body, dryRun, gracePeriodSeconds, orphanDependents, propagationPolicy, options = {}) { const localVarPath = this.basePath + '/api/v1/nodes/{name}' .replace('{' + 'name' + '}', encodeURIComponent(String(name))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling deleteNode.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, "string"); } if (gracePeriodSeconds !== undefined) { localVarQueryParameters['gracePeriodSeconds'] = ObjectSerializer.serialize(gracePeriodSeconds, "number"); } if (orphanDependents !== undefined) { localVarQueryParameters['orphanDependents'] = ObjectSerializer.serialize(orphanDependents, "boolean"); } if (propagationPolicy !== undefined) { localVarQueryParameters['propagationPolicy'] = ObjectSerializer.serialize(propagationPolicy, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'DELETE', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: ObjectSerializer.serialize(body, "V1DeleteOptions") }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "V1Status"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * delete a PersistentVolume * @param name name of the PersistentVolume * @param pretty If 'true', then the output is pretty printed. * @param body * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @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. * @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. * @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. * @param {*} [options] Override http request options. */ deletePersistentVolume(name, pretty, body, dryRun, gracePeriodSeconds, orphanDependents, propagationPolicy, options = {}) { const localVarPath = this.basePath + '/api/v1/persistentvolumes/{name}' .replace('{' + 'name' + '}', encodeURIComponent(String(name))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling deletePersistentVolume.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, "string"); } if (gracePeriodSeconds !== undefined) { localVarQueryParameters['gracePeriodSeconds'] = ObjectSerializer.serialize(gracePeriodSeconds, "number"); } if (orphanDependents !== undefined) { localVarQueryParameters['orphanDependents'] = ObjectSerializer.serialize(orphanDependents, "boolean"); } if (propagationPolicy !== undefined) { localVarQueryParameters['propagationPolicy'] = ObjectSerializer.serialize(propagationPolicy, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'DELETE', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: ObjectSerializer.serialize(body, "V1DeleteOptions") }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "V1Status"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * get available resources * @param {*} [options] Override http request options. */ getAPIResources(options = {}) { const localVarPath = this.basePath + '/api/v1/'; let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'GET', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "V1APIResourceList"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * list objects of kind ComponentStatus * @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. * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything. * @param includeUninitialized If true, partially initialized resources are included in the response. * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything. * @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. * @param pretty If 'true', then the output is pretty printed. * @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. * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. * @param watch Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion. * @param {*} [options] Override http request options. */ listComponentStatus(_continue, fieldSelector, includeUninitialized, labelSelector, limit, pretty, resourceVersion, timeoutSeconds, watch, options = {}) { const localVarPath = this.basePath + '/api/v1/componentstatuses'; let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; if (_continue !== undefined) { localVarQueryParameters['continue'] = ObjectSerializer.serialize(_continue, "string"); } if (fieldSelector !== undefined) { localVarQueryParameters['fieldSelector'] = ObjectSerializer.serialize(fieldSelector, "string"); } if (includeUninitialized !== undefined) { localVarQueryParameters['includeUninitialized'] = ObjectSerializer.serialize(includeUninitialized, "boolean"); } if (labelSelector !== undefined) { localVarQueryParameters['labelSelector'] = ObjectSerializer.serialize(labelSelector, "string"); } if (limit !== undefined) { localVarQueryParameters['limit'] = ObjectSerializer.serialize(limit, "number"); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, "string"); } if (resourceVersion !== undefined) { localVarQueryParameters['resourceVersion'] = ObjectSerializer.serialize(resourceVersion, "string"); } if (timeoutSeconds !== undefined) { localVarQueryParameters['timeoutSeconds'] = ObjectSerializer.serialize(timeoutSeconds, "number"); } if (watch !== undefined) { localVarQueryParameters['watch'] = ObjectSerializer.serialize(watch, "boolean"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'GET', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "V1ComponentStatusList"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * list or watch objects of kind ConfigMap * @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. * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything. * @param includeUninitialized If true, partially initialized resources are included in the response. * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything. * @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. * @param pretty If 'true', then the output is pretty printed. * @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. * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. * @param watch Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion. * @param {*} [options] Override http request options. */ listConfigMapForAllNamespaces(_continue, fieldSelector, includeUninitialized, labelSelector, limit, pretty, resourceVersion, timeoutSeconds, watch, options = {}) { const localVarPath = this.basePath + '/api/v1/configmaps'; let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; if (_continue !== undefined) { localVarQueryParameters['continue'] = ObjectSerializer.serialize(_continue, "string"); } if (fieldSelector !== undefined) { localVarQueryParameters['fieldSelector'] = ObjectSerializer.serialize(fieldSelector, "string"); } if (includeUninitialized !== undefined) { localVarQueryParameters['includeUninitialized'] = ObjectSerializer.serialize(includeUninitialized, "boolean"); } if (labelSelector !== undefined) { localVarQueryParameters['labelSelector'] = ObjectSerializer.serialize(labelSelector, "string"); } if (limit !== undefined) { localVarQueryParameters['limit'] = ObjectSerializer.serialize(limit, "number"); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, "string"); } if (resourceVersion !== undefined) { localVarQueryParameters['resourceVersion'] = ObjectSerializer.serialize(resourceVersion, "string"); } if (timeoutSeconds !== undefined) { localVarQueryParameters['timeoutSeconds'] = ObjectSerializer.serialize(timeoutSeconds, "number"); } if (watch !== undefined) { localVarQueryParameters['watch'] = ObjectSerializer.serialize(watch, "boolean"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'GET', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "V1ConfigMapList"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * list or watch objects of kind Endpoints * @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. * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything. * @param includeUninitialized If true, partially initialized resources are included in the response. * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything. * @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. * @param pretty If 'true', then the output is pretty printed. * @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. * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. * @param watch Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion. * @param {*} [options] Override http request options. */ listEndpointsForAllNamespaces(_continue, fieldSelector, includeUninitialized, labelSelector, limit, pretty, resourceVersion, timeoutSeconds, watch, options = {}) { const localVarPath = this.basePath + '/api/v1/endpoints'; let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; if (_continue !== undefined) { localVarQueryParameters['continue'] = ObjectSerializer.serialize(_continue, "string"); } if (fieldSelector !== undefined) { localVarQueryParameters['fieldSelector'] = ObjectSerializer.serialize(fieldSelector, "string"); } if (includeUninitialized !== undefined) { localVarQueryParameters['includeUninitialized'] = ObjectSerializer.serialize(includeUninitialized, "boolean"); } if (labelSelector !== undefined) { localVarQueryParameters['labelSelector'] = ObjectSerializer.serialize(labelSelector, "string"); } if (limit !== undefined) { localVarQueryParameters['limit'] = ObjectSerializer.serialize(limit, "number"); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, "string"); } if (resourceVersion !== undefined) { localVarQueryParameters['resourceVersion'] = ObjectSerializer.serialize(resourceVersion, "string"); } if (timeoutSeconds !== undefined) { localVarQueryParameters['timeoutSeconds'] = ObjectSerializer.serialize(timeoutSeconds, "number"); } if (watch !== undefined) { localVarQueryParameters['watch'] = ObjectSerializer.serialize(watch, "boolean"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'GET', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "V1EndpointsList"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * list or watch objects of kind Event * @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. * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything. * @param includeUninitialized If true, partially initialized resources are included in the response. * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything. * @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. * @param pretty If 'true', then the output is pretty printed. * @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. * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. * @param watch Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion. * @param {*} [options] Override http request options. */ listEventForAllNamespaces(_continue, fieldSelector, includeUninitialized, labelSelector, limit, pretty, resourceVersion, timeoutSeconds, watch, options = {}) { const localVarPath = this.basePath + '/api/v1/events'; let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; if (_continue !== undefined) { localVarQueryParameters['continue'] = ObjectSerializer.serialize(_continue, "string"); } if (fieldSelector !== undefined) { localVarQueryParameters['fieldSelector'] = ObjectSerializer.serialize(fieldSelector, "string"); } if (includeUninitialized !== undefined) { localVarQueryParameters['includeUninitialized'] = ObjectSerializer.serialize(includeUninitialized, "boolean"); } if (labelSelector !== undefined) { localVarQueryParameters['labelSelector'] = ObjectSerializer.serialize(labelSelector, "string"); } if (limit !== undefined) { localVarQueryParameters['limit'] = ObjectSerializer.serialize(limit, "number"); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, "string"); } if (resourceVersion !== undefined) { localVarQueryParameters['resourceVersion'] = ObjectSerializer.serialize(resourceVersion, "string"); } if (timeoutSeconds !== undefined) { localVarQueryParameters['timeoutSeconds'] = ObjectSerializer.serialize(timeoutSeconds, "number"); } if (watch !== undefined) { localVarQueryParameters['watch'] = ObjectSerializer.serialize(watch, "boolean"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'GET', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "V1EventList"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * list or watch objects of kind LimitRange * @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. * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything. * @param includeUninitialized If true, partially initialized resources are included in the response. * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything. * @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. * @param pretty If 'true', then the output is pretty printed. * @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. * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. * @param watch Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion. * @param {*} [options] Override http request options. */ listLimitRangeForAllNamespaces(_continue, fieldSelector, includeUninitialized, labelSelector, limit, pretty, resourceVersion, timeoutSeconds, watch, options = {}) { const localVarPath = this.basePath + '/api/v1/limitranges'; let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; if (_continue !== undefined) { localVarQueryParameters['continue'] = ObjectSerializer.serialize(_continue, "string"); } if (fieldSelector !== undefined) { localVarQueryParameters['fieldSelector'] = ObjectSerializer.serialize(fieldSelector, "string"); } if (includeUninitialized !== undefined) { localVarQueryParameters['includeUninitialized'] = ObjectSerializer.serialize(includeUninitialized, "boolean"); } if (labelSelector !== undefined) { localVarQueryParameters['labelSelector'] = ObjectSerializer.serialize(labelSelector, "string"); } if (limit !== undefined) { localVarQueryParameters['limit'] = ObjectSerializer.serialize(limit, "number"); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, "string"); } if (resourceVersion !== undefined) { localVarQueryParameters['resourceVersion'] = ObjectSerializer.serialize(resourceVersion, "string"); } if (timeoutSeconds !== undefined) { localVarQueryParameters['timeoutSeconds'] = ObjectSerializer.serialize(timeoutSeconds, "number"); } if (watch !== undefined) { localVarQueryParameters['watch'] = ObjectSerializer.serialize(watch, "boolean"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'GET', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "V1LimitRangeList"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * list or watch objects of kind Namespace * @param includeUninitialized If IncludeUninitialized is specified, the object may be returned without completing initialization. * @param pretty If 'true', then the output is pretty printed. * @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. * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything. * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything. * @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. * @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. * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. * @param watch Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion. * @param {*} [options] Override http request options. */ listNamespace(includeUninitialized, pretty, _continue, fieldSelector, labelSelector, limit, resourceVersion, timeoutSeconds, watch, options = {}) { const localVarPath = this.basePath + '/api/v1/namespaces'; let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; if (includeUninitialized !== undefined) { localVarQueryParameters['includeUninitialized'] = ObjectSerializer.serialize(includeUninitialized, "boolean"); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, "string"); } if (_continue !== undefined) { localVarQueryParameters['continue'] = ObjectSerializer.serialize(_continue, "string"); } if (fieldSelector !== undefined) { localVarQueryParameters['fieldSelector'] = ObjectSerializer.serialize(fieldSelector, "string"); } if (labelSelector !== undefined) { localVarQueryParameters['labelSelector'] = ObjectSerializer.serialize(labelSelector, "string"); } if (limit !== undefined) { localVarQueryParameters['limit'] = ObjectSerializer.serialize(limit, "number"); } if (resourceVersion !== undefined) { localVarQueryParameters['resourceVersion'] = ObjectSerializer.serialize(resourceVersion, "string"); } if (timeoutSeconds !== undefined) { localVarQueryParameters['timeoutSeconds'] = ObjectSerializer.serialize(timeoutSeconds, "number"); } if (watch !== undefined) { localVarQueryParameters['watch'] = ObjectSerializer.serialize(watch, "boolean"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'GET', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "V1NamespaceList"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * list or watch objects of kind ConfigMap * @param namespace object name and auth scope, such as for teams and projects * @param includeUninitialized If true, partially initialized resources are included in the response. * @param pretty If 'true', then the output is pretty printed. * @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. * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything. * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything. * @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. * @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. * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. * @param watch Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion. * @param {*} [options] Override http request options. */ listNamespacedConfigMap(namespace, includeUninitialized, pretty, _continue, fieldSelector, labelSelector, limit, resourceVersion, timeoutSeconds, watch, options = {}) { const localVarPath = this.basePath + '/api/v1/namespaces/{namespace}/configmaps' .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling listNamespacedConfigMap.'); } if (includeUninitialized !== undefined) { localVarQueryParameters['includeUninitialized'] = ObjectSerializer.serialize(includeUninitialized, "boolean"); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, "string"); } if (_continue !== undefined) { localVarQueryParameters['continue'] = ObjectSerializer.serialize(_continue, "string"); } if (fieldSelector !== undefined) { localVarQueryParameters['fieldSelector'] = ObjectSerializer.serialize(fieldSelector, "string"); } if (labelSelector !== undefined) { localVarQueryParameters['labelSelector'] = ObjectSerializer.serialize(labelSelector, "string"); } if (limit !== undefined) { localVarQueryParameters['limit'] = ObjectSerializer.serialize(limit, "number"); } if (resourceVersion !== undefined) { localVarQueryParameters['resourceVersion'] = ObjectSerializer.serialize(resourceVersion, "string"); } if (timeoutSeconds !== undefined) { localVarQueryParameters['timeoutSeconds'] = ObjectSerializer.serialize(timeoutSeconds, "number"); } if (watch !== undefined) { localVarQueryParameters['watch'] = ObjectSerializer.serialize(watch, "boolean"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'GET', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "V1ConfigMapList"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * list or watch objects of kind Endpoints * @param namespace object name and auth scope, such as for teams and projects * @param includeUninitialized If true, partially initialized resources are included in the response. * @param pretty If 'true', then the output is pretty printed. * @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. * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything. * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything. * @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. * @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. * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. * @param watch Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion. * @param {*} [options] Override http request options. */ listNamespacedEndpoints(namespace, includeUninitialized, pretty, _continue, fieldSelector, labelSelector, limit, resourceVersion, timeoutSeconds, watch, options = {}) { const localVarPath = this.basePath + '/api/v1/namespaces/{namespace}/endpoints' .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling listNamespacedEndpoints.'); } if (includeUninitialized !== undefined) { localVarQueryParameters['includeUninitialized'] = ObjectSerializer.serialize(includeUninitialized, "boolean"); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, "string"); } if (_continue !== undefined) { localVarQueryParameters['continue'] = ObjectSerializer.serialize(_continue, "string"); } if (fieldSelector !== undefined) { localVarQueryParameters['fieldSelector'] = ObjectSerializer.serialize(fieldSelector, "string"); } if (labelSelector !== undefined) { localVarQueryParameters['labelSelector'] = ObjectSerializer.serialize(labelSelector, "string"); } if (limit !== undefined) { localVarQueryParameters['limit'] = ObjectSerializer.serialize(limit, "number"); } if (resourceVersion !== undefined) { localVarQueryParameters['resourceVersion'] = ObjectSerializer.serialize(resourceVersion, "string"); } if (timeoutSeconds !== undefined) { localVarQueryParameters['timeoutSeconds'] = ObjectSerializer.serialize(timeoutSeconds, "number"); } if (watch !== undefined) { localVarQueryParameters['watch'] = ObjectSerializer.serialize(watch, "boolean"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'GET', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "V1EndpointsList"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * list or watch objects of kind Event * @param namespace object name and auth scope, such as for teams and projects * @param includeUninitialized If true, partially initialized resources are included in the response. * @param pretty If 'true', then the output is pretty printed. * @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. * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything. * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything. * @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. * @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. * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. * @param watch Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion. * @param {*} [options] Override http request options. */ listNamespacedEvent(namespace, includeUninitialized, pretty, _continue, fieldSelector, labelSelector, limit, resourceVersion, timeoutSeconds, watch, options = {}) { const localVarPath = this.basePath + '/api/v1/namespaces/{namespace}/events' .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling listNamespacedEvent.'); } if (includeUninitialized !== undefined) { localVarQueryParameters['includeUninitialized'] = ObjectSerializer.serialize(includeUninitialized, "boolean"); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, "string"); } if (_continue !== undefined) { localVarQueryParameters['continue'] = ObjectSerializer.serialize(_continue, "string"); } if (fieldSelector !== undefined) { localVarQueryParameters['fieldSelector'] = ObjectSerializer.serialize(fieldSelector, "string"); } if (labelSelector !== undefined) { localVarQueryParameters['labelSelector'] = ObjectSerializer.serialize(labelSelector, "string"); } if (limit !== undefined) { localVarQueryParameters['limit'] = ObjectSerializer.serialize(limit, "number"); } if (resourceVersion !== undefined) { localVarQueryParameters['resourceVersion'] = ObjectSerializer.serialize(resourceVersion, "string"); } if (timeoutSeconds !== undefined) { localVarQueryParameters['timeoutSeconds'] = ObjectSerializer.serialize(timeoutSeconds, "number"); } if (watch !== undefined) { localVarQueryParameters['watch'] = ObjectSerializer.serialize(watch, "boolean"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'GET', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "V1EventList"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * list or watch objects of kind LimitRange * @param namespace object name and auth scope, such as for teams and projects * @param includeUninitialized If true, partially initialized resources are included in the response. * @param pretty If 'true', then the output is pretty printed. * @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. * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything. * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything. * @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. * @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. * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. * @param watch Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion. * @param {*} [options] Override http request options. */ listNamespacedLimitRange(namespace, includeUninitialized, pretty, _continue, fieldSelector, labelSelector, limit, resourceVersion, timeoutSeconds, watch, options = {}) { const localVarPath = this.basePath + '/api/v1/namespaces/{namespace}/limitranges' .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling listNamespacedLimitRange.'); } if (includeUninitialized !== undefined) { localVarQueryParameters['includeUninitialized'] = ObjectSerializer.serialize(includeUninitialized, "boolean"); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, "string"); } if (_continue !== undefined) { localVarQueryParameters['continue'] = ObjectSerializer.serialize(_continue, "string"); } if (fieldSelector !== undefined) { localVarQueryParameters['fieldSelector'] = ObjectSerializer.serialize(fieldSelector, "string"); } if (labelSelector !== undefined) { localVarQueryParameters['labelSelector'] = ObjectSerializer.serialize(labelSelector, "string"); } if (limit !== undefined) { localVarQueryParameters['limit'] = ObjectSerializer.serialize(limit, "number"); } if (resourceVersion !== undefined) { localVarQueryParameters['resourceVersion'] = ObjectSerializer.serialize(resourceVersion, "string"); } if (timeoutSeconds !== undefined) { localVarQueryParameters['timeoutSeconds'] = ObjectSerializer.serialize(timeoutSeconds, "number"); } if (watch !== undefined) { localVarQueryParameters['watch'] = ObjectSerializer.serialize(watch, "boolean"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'GET', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "V1LimitRangeList"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * list or watch objects of kind PersistentVolumeClaim * @param namespace object name and auth scope, such as for teams and projects * @param includeUninitialized If true, partially initialized resources are included in the response. * @param pretty If 'true', then the output is pretty printed. * @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. * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything. * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything. * @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. * @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. * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. * @param watch Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion. * @param {*} [options] Override http request options. */ listNamespacedPersistentVolumeClaim(namespace, includeUninitialized, pretty, _continue, fieldSelector, labelSelector, limit, resourceVersion, timeoutSeconds, watch, options = {}) { const localVarPath = this.basePath + '/api/v1/namespaces/{namespace}/persistentvolumeclaims' .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling listNamespacedPersistentVolumeClaim.'); } if (includeUninitialized !== undefined) { localVarQueryParameters['includeUninitialized'] = ObjectSerializer.serialize(includeUninitialized, "boolean"); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, "string"); } if (_continue !== undefined) { localVarQueryParameters['continue'] = ObjectSerializer.serialize(_continue, "string"); } if (fieldSelector !== undefined) { localVarQueryParameters['fieldSelector'] = ObjectSerializer.serialize(fieldSelector, "string"); } if (labelSelector !== undefined) { localVarQueryParameters['labelSelector'] = ObjectSerializer.serialize(labelSelector, "string"); } if (limit !== undefined) { localVarQueryParameters['limit'] = ObjectSerializer.serialize(limit, "number"); } if (resourceVersion !== undefined) { localVarQueryParameters['resourceVersion'] = ObjectSerializer.serialize(resourceVersion, "string"); } if (timeoutSeconds !== undefined) { localVarQueryParameters['timeoutSeconds'] = ObjectSerializer.serialize(timeoutSeconds, "number"); } if (watch !== undefined) { localVarQueryParameters['watch'] = ObjectSerializer.serialize(watch, "boolean"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'GET', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "V1PersistentVolumeClaimList"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * list or watch objects of kind Pod * @param namespace object name and auth scope, such as for teams and projects * @param includeUninitialized If true, partially initialized resources are included in the response. * @param pretty If 'true', then the output is pretty printed. * @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. * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything. * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything. * @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. * @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. * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. * @param watch Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion. * @param {*} [options] Override http request options. */ listNamespacedPod(namespace, includeUninitialized, pretty, _continue, fieldSelector, labelSelector, limit, resourceVersion, timeoutSeconds, watch, options = {}) { const localVarPath = this.basePath + '/api/v1/namespaces/{namespace}/pods' .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling listNamespacedPod.'); } if (includeUninitialized !== undefined) { localVarQueryParameters['includeUninitialized'] = ObjectSerializer.serialize(includeUninitialized, "boolean"); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, "string"); } if (_continue !== undefined) { localVarQueryParameters['continue'] = ObjectSerializer.serialize(_continue, "string"); } if (fieldSelector !== undefined) { localVarQueryParameters['fieldSelector'] = ObjectSerializer.serialize(fieldSelector, "string"); } if (labelSelector !== undefined) { localVarQueryParameters['labelSelector'] = ObjectSerializer.serialize(labelSelector, "string"); } if (limit !== undefined) { localVarQueryParameters['limit'] = ObjectSerializer.serialize(limit, "number"); } if (resourceVersion !== undefined) { localVarQueryParameters['resourceVersion'] = ObjectSerializer.serialize(resourceVersion, "string"); } if (timeoutSeconds !== undefined) { localVarQueryParameters['timeoutSeconds'] = ObjectSerializer.serialize(timeoutSeconds, "number"); } if (watch !== undefined) { localVarQueryParameters['watch'] = ObjectSerializer.serialize(watch, "boolean"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'GET', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "V1PodList"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * list or watch objects of kind PodTemplate * @param namespace object name and auth scope, such as for teams and projects * @param includeUninitialized If true, partially initialized resources are included in the response. * @param pretty If 'true', then the output is pretty printed. * @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. * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything. * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything. * @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. * @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. * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. * @param watch Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion. * @param {*} [options] Override http request options. */ listNamespacedPodTemplate(namespace, includeUninitialized, pretty, _continue, fieldSelector, labelSelector, limit, resourceVersion, timeoutSeconds, watch, options = {}) { const localVarPath = this.basePath + '/api/v1/namespaces/{namespace}/podtemplates' .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling listNamespacedPodTemplate.'); } if (includeUninitialized !== undefined) { localVarQueryParameters['includeUninitialized'] = ObjectSerializer.serialize(includeUninitialized, "boolean"); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, "string"); } if (_continue !== undefined) { localVarQueryParameters['continue'] = ObjectSerializer.serialize(_continue, "string"); } if (fieldSelector !== undefined) { localVarQueryParameters['fieldSelector'] = ObjectSerializer.serialize(fieldSelector, "string"); } if (labelSelector !== undefined) { localVarQueryParameters['labelSelector'] = ObjectSerializer.serialize(labelSelector, "string"); } if (limit !== undefined) { localVarQueryParameters['limit'] = ObjectSerializer.serialize(limit, "number"); } if (resourceVersion !== undefined) { localVarQueryParameters['resourceVersion'] = ObjectSerializer.serialize(resourceVersion, "string"); } if (timeoutSeconds !== undefined) { localVarQueryParameters['timeoutSeconds'] = ObjectSerializer.serialize(timeoutSeconds, "number"); } if (watch !== undefined) { localVarQueryParameters['watch'] = ObjectSerializer.serialize(watch, "boolean"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'GET', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "V1PodTemplateList"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * list or watch objects of kind ReplicationController * @param namespace object name and auth scope, such as for teams and projects * @param includeUninitialized If true, partially initialized resources are included in the response. * @param pretty If 'true', then the output is pretty printed. * @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. * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything. * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything. * @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. * @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. * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. * @param watch Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion. * @param {*} [options] Override http request options. */ listNamespacedReplicationController(namespace, includeUninitialized, pretty, _continue, fieldSelector, labelSelector, limit, resourceVersion, timeoutSeconds, watch, options = {}) { const localVarPath = this.basePath + '/api/v1/namespaces/{namespace}/replicationcontrollers' .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling listNamespacedReplicationController.'); } if (includeUninitialized !== undefined) { localVarQueryParameters['includeUninitialized'] = ObjectSerializer.serialize(includeUninitialized, "boolean"); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, "string"); } if (_continue !== undefined) { localVarQueryParameters['continue'] = ObjectSerializer.serialize(_continue, "string"); } if (fieldSelector !== undefined) { localVarQueryParameters['fieldSelector'] = ObjectSerializer.serialize(fieldSelector, "string"); } if (labelSelector !== undefined) { localVarQueryParameters['labelSelector'] = ObjectSerializer.serialize(labelSelector, "string"); } if (limit !== undefined) { localVarQueryParameters['limit'] = ObjectSerializer.serialize(limit, "number"); } if (resourceVersion !== undefined) { localVarQueryParameters['resourceVersion'] = ObjectSerializer.serialize(resourceVersion, "string"); } if (timeoutSeconds !== undefined) { localVarQueryParameters['timeoutSeconds'] = ObjectSerializer.serialize(timeoutSeconds, "number"); } if (watch !== undefined) { localVarQueryParameters['watch'] = ObjectSerializer.serialize(watch, "boolean"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'GET', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "V1ReplicationControllerList"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * list or watch objects of kind ResourceQuota * @param namespace object name and auth scope, such as for teams and projects * @param includeUninitialized If true, partially initialized resources are included in the response. * @param pretty If 'true', then the output is pretty printed. * @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. * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything. * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything. * @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. * @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. * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. * @param watch Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion. * @param {*} [options] Override http request options. */ listNamespacedResourceQuota(namespace, includeUninitialized, pretty, _continue, fieldSelector, labelSelector, limit, resourceVersion, timeoutSeconds, watch, options = {}) { const localVarPath = this.basePath + '/api/v1/namespaces/{namespace}/resourcequotas' .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling listNamespacedResourceQuota.'); } if (includeUninitialized !== undefined) { localVarQueryParameters['includeUninitialized'] = ObjectSerializer.serialize(includeUninitialized, "boolean"); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, "string"); } if (_continue !== undefined) { localVarQueryParameters['continue'] = ObjectSerializer.serialize(_continue, "string"); } if (fieldSelector !== undefined) { localVarQueryParameters['fieldSelector'] = ObjectSerializer.serialize(fieldSelector, "string"); } if (labelSelector !== undefined) { localVarQueryParameters['labelSelector'] = ObjectSerializer.serialize(labelSelector, "string"); } if (limit !== undefined) { localVarQueryParameters['limit'] = ObjectSerializer.serialize(limit, "number"); } if (resourceVersion !== undefined) { localVarQueryParameters['resourceVersion'] = ObjectSerializer.serialize(resourceVersion, "string"); } if (timeoutSeconds !== undefined) { localVarQueryParameters['timeoutSeconds'] = ObjectSerializer.serialize(timeoutSeconds, "number"); } if (watch !== undefined) { localVarQueryParameters['watch'] = ObjectSerializer.serialize(watch, "boolean"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'GET', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "V1ResourceQuotaList"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * list or watch objects of kind Secret * @param namespace object name and auth scope, such as for teams and projects * @param includeUninitialized If true, partially initialized resources are included in the response. * @param pretty If 'true', then the output is pretty printed. * @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. * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything. * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything. * @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. * @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. * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. * @param watch Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion. * @param {*} [options] Override http request options. */ listNamespacedSecret(namespace, includeUninitialized, pretty, _continue, fieldSelector, labelSelector, limit, resourceVersion, timeoutSeconds, watch, options = {}) { const localVarPath = this.basePath + '/api/v1/namespaces/{namespace}/secrets' .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling listNamespacedSecret.'); } if (includeUninitialized !== undefined) { localVarQueryParameters['includeUninitialized'] = ObjectSerializer.serialize(includeUninitialized, "boolean"); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, "string"); } if (_continue !== undefined) { localVarQueryParameters['continue'] = ObjectSerializer.serialize(_continue, "string"); } if (fieldSelector !== undefined) { localVarQueryParameters['fieldSelector'] = ObjectSerializer.serialize(fieldSelector, "string"); } if (labelSelector !== undefined) { localVarQueryParameters['labelSelector'] = ObjectSerializer.serialize(labelSelector, "string"); } if (limit !== undefined) { localVarQueryParameters['limit'] = ObjectSerializer.serialize(limit, "number"); } if (resourceVersion !== undefined) { localVarQueryParameters['resourceVersion'] = ObjectSerializer.serialize(resourceVersion, "string"); } if (timeoutSeconds !== undefined) { localVarQueryParameters['timeoutSeconds'] = ObjectSerializer.serialize(timeoutSeconds, "number"); } if (watch !== undefined) { localVarQueryParameters['watch'] = ObjectSerializer.serialize(watch, "boolean"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'GET', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "V1SecretList"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * list or watch objects of kind Service * @param namespace object name and auth scope, such as for teams and projects * @param includeUninitialized If IncludeUninitialized is specified, the object may be returned without completing initialization. * @param pretty If 'true', then the output is pretty printed. * @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. * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything. * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything. * @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. * @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. * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. * @param watch Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion. * @param {*} [options] Override http request options. */ listNamespacedService(namespace, includeUninitialized, pretty, _continue, fieldSelector, labelSelector, limit, resourceVersion, timeoutSeconds, watch, options = {}) { const localVarPath = this.basePath + '/api/v1/namespaces/{namespace}/services' .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling listNamespacedService.'); } if (includeUninitialized !== undefined) { localVarQueryParameters['includeUninitialized'] = ObjectSerializer.serialize(includeUninitialized, "boolean"); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, "string"); } if (_continue !== undefined) { localVarQueryParameters['continue'] = ObjectSerializer.serialize(_continue, "string"); } if (fieldSelector !== undefined) { localVarQueryParameters['fieldSelector'] = ObjectSerializer.serialize(fieldSelector, "string"); } if (labelSelector !== undefined) { localVarQueryParameters['labelSelector'] = ObjectSerializer.serialize(labelSelector, "string"); } if (limit !== undefined) { localVarQueryParameters['limit'] = ObjectSerializer.serialize(limit, "number"); } if (resourceVersion !== undefined) { localVarQueryParameters['resourceVersion'] = ObjectSerializer.serialize(resourceVersion, "string"); } if (timeoutSeconds !== undefined) { localVarQueryParameters['timeoutSeconds'] = ObjectSerializer.serialize(timeoutSeconds, "number"); } if (watch !== undefined) { localVarQueryParameters['watch'] = ObjectSerializer.serialize(watch, "boolean"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'GET', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "V1ServiceList"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * list or watch objects of kind ServiceAccount * @param namespace object name and auth scope, such as for teams and projects * @param includeUninitialized If true, partially initialized resources are included in the response. * @param pretty If 'true', then the output is pretty printed. * @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. * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything. * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything. * @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. * @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. * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. * @param watch Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion. * @param {*} [options] Override http request options. */ listNamespacedServiceAccount(namespace, includeUninitialized, pretty, _continue, fieldSelector, labelSelector, limit, resourceVersion, timeoutSeconds, watch, options = {}) { const localVarPath = this.basePath + '/api/v1/namespaces/{namespace}/serviceaccounts' .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling listNamespacedServiceAccount.'); } if (includeUninitialized !== undefined) { localVarQueryParameters['includeUninitialized'] = ObjectSerializer.serialize(includeUninitialized, "boolean"); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, "string"); } if (_continue !== undefined) { localVarQueryParameters['continue'] = ObjectSerializer.serialize(_continue, "string"); } if (fieldSelector !== undefined) { localVarQueryParameters['fieldSelector'] = ObjectSerializer.serialize(fieldSelector, "string"); } if (labelSelector !== undefined) { localVarQueryParameters['labelSelector'] = ObjectSerializer.serialize(labelSelector, "string"); } if (limit !== undefined) { localVarQueryParameters['limit'] = ObjectSerializer.serialize(limit, "number"); } if (resourceVersion !== undefined) { localVarQueryParameters['resourceVersion'] = ObjectSerializer.serialize(resourceVersion, "string"); } if (timeoutSeconds !== undefined) { localVarQueryParameters['timeoutSeconds'] = ObjectSerializer.serialize(timeoutSeconds, "number"); } if (watch !== undefined) { localVarQueryParameters['watch'] = ObjectSerializer.serialize(watch, "boolean"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'GET', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "V1ServiceAccountList"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * list or watch objects of kind Node * @param includeUninitialized If true, partially initialized resources are included in the response. * @param pretty If 'true', then the output is pretty printed. * @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. * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything. * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything. * @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. * @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. * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. * @param watch Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion. * @param {*} [options] Override http request options. */ listNode(includeUninitialized, pretty, _continue, fieldSelector, labelSelector, limit, resourceVersion, timeoutSeconds, watch, options = {}) { const localVarPath = this.basePath + '/api/v1/nodes'; let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; if (includeUninitialized !== undefined) { localVarQueryParameters['includeUninitialized'] = ObjectSerializer.serialize(includeUninitialized, "boolean"); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, "string"); } if (_continue !== undefined) { localVarQueryParameters['continue'] = ObjectSerializer.serialize(_continue, "string"); } if (fieldSelector !== undefined) { localVarQueryParameters['fieldSelector'] = ObjectSerializer.serialize(fieldSelector, "string"); } if (labelSelector !== undefined) { localVarQueryParameters['labelSelector'] = ObjectSerializer.serialize(labelSelector, "string"); } if (limit !== undefined) { localVarQueryParameters['limit'] = ObjectSerializer.serialize(limit, "number"); } if (resourceVersion !== undefined) { localVarQueryParameters['resourceVersion'] = ObjectSerializer.serialize(resourceVersion, "string"); } if (timeoutSeconds !== undefined) { localVarQueryParameters['timeoutSeconds'] = ObjectSerializer.serialize(timeoutSeconds, "number"); } if (watch !== undefined) { localVarQueryParameters['watch'] = ObjectSerializer.serialize(watch, "boolean"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'GET', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "V1NodeList"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * list or watch objects of kind PersistentVolume * @param includeUninitialized If true, partially initialized resources are included in the response. * @param pretty If 'true', then the output is pretty printed. * @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. * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything. * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything. * @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. * @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. * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. * @param watch Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion. * @param {*} [options] Override http request options. */ listPersistentVolume(includeUninitialized, pretty, _continue, fieldSelector, labelSelector, limit, resourceVersion, timeoutSeconds, watch, options = {}) { const localVarPath = this.basePath + '/api/v1/persistentvolumes'; let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; if (includeUninitialized !== undefined) { localVarQueryParameters['includeUninitialized'] = ObjectSerializer.serialize(includeUninitialized, "boolean"); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, "string"); } if (_continue !== undefined) { localVarQueryParameters['continue'] = ObjectSerializer.serialize(_continue, "string"); } if (fieldSelector !== undefined) { localVarQueryParameters['fieldSelector'] = ObjectSerializer.serialize(fieldSelector, "string"); } if (labelSelector !== undefined) { localVarQueryParameters['labelSelector'] = ObjectSerializer.serialize(labelSelector, "string"); } if (limit !== undefined) { localVarQueryParameters['limit'] = ObjectSerializer.serialize(limit, "number"); } if (resourceVersion !== undefined) { localVarQueryParameters['resourceVersion'] = ObjectSerializer.serialize(resourceVersion, "string"); } if (timeoutSeconds !== undefined) { localVarQueryParameters['timeoutSeconds'] = ObjectSerializer.serialize(timeoutSeconds, "number"); } if (watch !== undefined) { localVarQueryParameters['watch'] = ObjectSerializer.serialize(watch, "boolean"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'GET', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "V1PersistentVolumeList"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * list or watch objects of kind PersistentVolumeClaim * @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. * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything. * @param includeUninitialized If true, partially initialized resources are included in the response. * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything. * @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. * @param pretty If 'true', then the output is pretty printed. * @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. * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. * @param watch Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion. * @param {*} [options] Override http request options. */ listPersistentVolumeClaimForAllNamespaces(_continue, fieldSelector, includeUninitialized, labelSelector, limit, pretty, resourceVersion, timeoutSeconds, watch, options = {}) { const localVarPath = this.basePath + '/api/v1/persistentvolumeclaims'; let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; if (_continue !== undefined) { localVarQueryParameters['continue'] = ObjectSerializer.serialize(_continue, "string"); } if (fieldSelector !== undefined) { localVarQueryParameters['fieldSelector'] = ObjectSerializer.serialize(fieldSelector, "string"); } if (includeUninitialized !== undefined) { localVarQueryParameters['includeUninitialized'] = ObjectSerializer.serialize(includeUninitialized, "boolean"); } if (labelSelector !== undefined) { localVarQueryParameters['labelSelector'] = ObjectSerializer.serialize(labelSelector, "string"); } if (limit !== undefined) { localVarQueryParameters['limit'] = ObjectSerializer.serialize(limit, "number"); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, "string"); } if (resourceVersion !== undefined) { localVarQueryParameters['resourceVersion'] = ObjectSerializer.serialize(resourceVersion, "string"); } if (timeoutSeconds !== undefined) { localVarQueryParameters['timeoutSeconds'] = ObjectSerializer.serialize(timeoutSeconds, "number"); } if (watch !== undefined) { localVarQueryParameters['watch'] = ObjectSerializer.serialize(watch, "boolean"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'GET', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "V1PersistentVolumeClaimList"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * list or watch objects of kind Pod * @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. * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything. * @param includeUninitialized If true, partially initialized resources are included in the response. * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything. * @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. * @param pretty If 'true', then the output is pretty printed. * @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. * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. * @param watch Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion. * @param {*} [options] Override http request options. */ listPodForAllNamespaces(_continue, fieldSelector, includeUninitialized, labelSelector, limit, pretty, resourceVersion, timeoutSeconds, watch, options = {}) { const localVarPath = this.basePath + '/api/v1/pods'; let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; if (_continue !== undefined) { localVarQueryParameters['continue'] = ObjectSerializer.serialize(_continue, "string"); } if (fieldSelector !== undefined) { localVarQueryParameters['fieldSelector'] = ObjectSerializer.serialize(fieldSelector, "string"); } if (includeUninitialized !== undefined) { localVarQueryParameters['includeUninitialized'] = ObjectSerializer.serialize(includeUninitialized, "boolean"); } if (labelSelector !== undefined) { localVarQueryParameters['labelSelector'] = ObjectSerializer.serialize(labelSelector, "string"); } if (limit !== undefined) { localVarQueryParameters['limit'] = ObjectSerializer.serialize(limit, "number"); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, "string"); } if (resourceVersion !== undefined) { localVarQueryParameters['resourceVersion'] = ObjectSerializer.serialize(resourceVersion, "string"); } if (timeoutSeconds !== undefined) { localVarQueryParameters['timeoutSeconds'] = ObjectSerializer.serialize(timeoutSeconds, "number"); } if (watch !== undefined) { localVarQueryParameters['watch'] = ObjectSerializer.serialize(watch, "boolean"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'GET', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "V1PodList"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * list or watch objects of kind PodTemplate * @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. * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything. * @param includeUninitialized If true, partially initialized resources are included in the response. * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything. * @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. * @param pretty If 'true', then the output is pretty printed. * @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. * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. * @param watch Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion. * @param {*} [options] Override http request options. */ listPodTemplateForAllNamespaces(_continue, fieldSelector, includeUninitialized, labelSelector, limit, pretty, resourceVersion, timeoutSeconds, watch, options = {}) { const localVarPath = this.basePath + '/api/v1/podtemplates'; let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; if (_continue !== undefined) { localVarQueryParameters['continue'] = ObjectSerializer.serialize(_continue, "string"); } if (fieldSelector !== undefined) { localVarQueryParameters['fieldSelector'] = ObjectSerializer.serialize(fieldSelector, "string"); } if (includeUninitialized !== undefined) { localVarQueryParameters['includeUninitialized'] = ObjectSerializer.serialize(includeUninitialized, "boolean"); } if (labelSelector !== undefined) { localVarQueryParameters['labelSelector'] = ObjectSerializer.serialize(labelSelector, "string"); } if (limit !== undefined) { localVarQueryParameters['limit'] = ObjectSerializer.serialize(limit, "number"); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, "string"); } if (resourceVersion !== undefined) { localVarQueryParameters['resourceVersion'] = ObjectSerializer.serialize(resourceVersion, "string"); } if (timeoutSeconds !== undefined) { localVarQueryParameters['timeoutSeconds'] = ObjectSerializer.serialize(timeoutSeconds, "number"); } if (watch !== undefined) { localVarQueryParameters['watch'] = ObjectSerializer.serialize(watch, "boolean"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'GET', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "V1PodTemplateList"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * list or watch objects of kind ReplicationController * @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. * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything. * @param includeUninitialized If true, partially initialized resources are included in the response. * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything. * @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. * @param pretty If 'true', then the output is pretty printed. * @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. * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. * @param watch Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion. * @param {*} [options] Override http request options. */ listReplicationControllerForAllNamespaces(_continue, fieldSelector, includeUninitialized, labelSelector, limit, pretty, resourceVersion, timeoutSeconds, watch, options = {}) { const localVarPath = this.basePath + '/api/v1/replicationcontrollers'; let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; if (_continue !== undefined) { localVarQueryParameters['continue'] = ObjectSerializer.serialize(_continue, "string"); } if (fieldSelector !== undefined) { localVarQueryParameters['fieldSelector'] = ObjectSerializer.serialize(fieldSelector, "string"); } if (includeUninitialized !== undefined) { localVarQueryParameters['includeUninitialized'] = ObjectSerializer.serialize(includeUninitialized, "boolean"); } if (labelSelector !== undefined) { localVarQueryParameters['labelSelector'] = ObjectSerializer.serialize(labelSelector, "string"); } if (limit !== undefined) { localVarQueryParameters['limit'] = ObjectSerializer.serialize(limit, "number"); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, "string"); } if (resourceVersion !== undefined) { localVarQueryParameters['resourceVersion'] = ObjectSerializer.serialize(resourceVersion, "string"); } if (timeoutSeconds !== undefined) { localVarQueryParameters['timeoutSeconds'] = ObjectSerializer.serialize(timeoutSeconds, "number"); } if (watch !== undefined) { localVarQueryParameters['watch'] = ObjectSerializer.serialize(watch, "boolean"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'GET', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "V1ReplicationControllerList"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * list or watch objects of kind ResourceQuota * @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. * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything. * @param includeUninitialized If true, partially initialized resources are included in the response. * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything. * @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. * @param pretty If 'true', then the output is pretty printed. * @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. * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. * @param watch Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion. * @param {*} [options] Override http request options. */ listResourceQuotaForAllNamespaces(_continue, fieldSelector, includeUninitialized, labelSelector, limit, pretty, resourceVersion, timeoutSeconds, watch, options = {}) { const localVarPath = this.basePath + '/api/v1/resourcequotas'; let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; if (_continue !== undefined) { localVarQueryParameters['continue'] = ObjectSerializer.serialize(_continue, "string"); } if (fieldSelector !== undefined) { localVarQueryParameters['fieldSelector'] = ObjectSerializer.serialize(fieldSelector, "string"); } if (includeUninitialized !== undefined) { localVarQueryParameters['includeUninitialized'] = ObjectSerializer.serialize(includeUninitialized, "boolean"); } if (labelSelector !== undefined) { localVarQueryParameters['labelSelector'] = ObjectSerializer.serialize(labelSelector, "string"); } if (limit !== undefined) { localVarQueryParameters['limit'] = ObjectSerializer.serialize(limit, "number"); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, "string"); } if (resourceVersion !== undefined) { localVarQueryParameters['resourceVersion'] = ObjectSerializer.serialize(resourceVersion, "string"); } if (timeoutSeconds !== undefined) { localVarQueryParameters['timeoutSeconds'] = ObjectSerializer.serialize(timeoutSeconds, "number"); } if (watch !== undefined) { localVarQueryParameters['watch'] = ObjectSerializer.serialize(watch, "boolean"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'GET', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "V1ResourceQuotaList"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * list or watch objects of kind Secret * @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. * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything. * @param includeUninitialized If true, partially initialized resources are included in the response. * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything. * @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. * @param pretty If 'true', then the output is pretty printed. * @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. * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. * @param watch Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion. * @param {*} [options] Override http request options. */ listSecretForAllNamespaces(_continue, fieldSelector, includeUninitialized, labelSelector, limit, pretty, resourceVersion, timeoutSeconds, watch, options = {}) { const localVarPath = this.basePath + '/api/v1/secrets'; let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; if (_continue !== undefined) { localVarQueryParameters['continue'] = ObjectSerializer.serialize(_continue, "string"); } if (fieldSelector !== undefined) { localVarQueryParameters['fieldSelector'] = ObjectSerializer.serialize(fieldSelector, "string"); } if (includeUninitialized !== undefined) { localVarQueryParameters['includeUninitialized'] = ObjectSerializer.serialize(includeUninitialized, "boolean"); } if (labelSelector !== undefined) { localVarQueryParameters['labelSelector'] = ObjectSerializer.serialize(labelSelector, "string"); } if (limit !== undefined) { localVarQueryParameters['limit'] = ObjectSerializer.serialize(limit, "number"); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, "string"); } if (resourceVersion !== undefined) { localVarQueryParameters['resourceVersion'] = ObjectSerializer.serialize(resourceVersion, "string"); } if (timeoutSeconds !== undefined) { localVarQueryParameters['timeoutSeconds'] = ObjectSerializer.serialize(timeoutSeconds, "number"); } if (watch !== undefined) { localVarQueryParameters['watch'] = ObjectSerializer.serialize(watch, "boolean"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'GET', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "V1SecretList"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * list or watch objects of kind ServiceAccount * @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. * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything. * @param includeUninitialized If true, partially initialized resources are included in the response. * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything. * @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. * @param pretty If 'true', then the output is pretty printed. * @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. * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. * @param watch Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion. * @param {*} [options] Override http request options. */ listServiceAccountForAllNamespaces(_continue, fieldSelector, includeUninitialized, labelSelector, limit, pretty, resourceVersion, timeoutSeconds, watch, options = {}) { const localVarPath = this.basePath + '/api/v1/serviceaccounts'; let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; if (_continue !== undefined) { localVarQueryParameters['continue'] = ObjectSerializer.serialize(_continue, "string"); } if (fieldSelector !== undefined) { localVarQueryParameters['fieldSelector'] = ObjectSerializer.serialize(fieldSelector, "string"); } if (includeUninitialized !== undefined) { localVarQueryParameters['includeUninitialized'] = ObjectSerializer.serialize(includeUninitialized, "boolean"); } if (labelSelector !== undefined) { localVarQueryParameters['labelSelector'] = ObjectSerializer.serialize(labelSelector, "string"); } if (limit !== undefined) { localVarQueryParameters['limit'] = ObjectSerializer.serialize(limit, "number"); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, "string"); } if (resourceVersion !== undefined) { localVarQueryParameters['resourceVersion'] = ObjectSerializer.serialize(resourceVersion, "string"); } if (timeoutSeconds !== undefined) { localVarQueryParameters['timeoutSeconds'] = ObjectSerializer.serialize(timeoutSeconds, "number"); } if (watch !== undefined) { localVarQueryParameters['watch'] = ObjectSerializer.serialize(watch, "boolean"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'GET', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "V1ServiceAccountList"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * list or watch objects of kind Service * @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. * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything. * @param includeUninitialized If true, partially initialized resources are included in the response. * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything. * @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. * @param pretty If 'true', then the output is pretty printed. * @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. * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. * @param watch Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion. * @param {*} [options] Override http request options. */ listServiceForAllNamespaces(_continue, fieldSelector, includeUninitialized, labelSelector, limit, pretty, resourceVersion, timeoutSeconds, watch, options = {}) { const localVarPath = this.basePath + '/api/v1/services'; let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; if (_continue !== undefined) { localVarQueryParameters['continue'] = ObjectSerializer.serialize(_continue, "string"); } if (fieldSelector !== undefined) { localVarQueryParameters['fieldSelector'] = ObjectSerializer.serialize(fieldSelector, "string"); } if (includeUninitialized !== undefined) { localVarQueryParameters['includeUninitialized'] = ObjectSerializer.serialize(includeUninitialized, "boolean"); } if (labelSelector !== undefined) { localVarQueryParameters['labelSelector'] = ObjectSerializer.serialize(labelSelector, "string"); } if (limit !== undefined) { localVarQueryParameters['limit'] = ObjectSerializer.serialize(limit, "number"); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, "string"); } if (resourceVersion !== undefined) { localVarQueryParameters['resourceVersion'] = ObjectSerializer.serialize(resourceVersion, "string"); } if (timeoutSeconds !== undefined) { localVarQueryParameters['timeoutSeconds'] = ObjectSerializer.serialize(timeoutSeconds, "number"); } if (watch !== undefined) { localVarQueryParameters['watch'] = ObjectSerializer.serialize(watch, "boolean"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'GET', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "V1ServiceList"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * partially update the specified Namespace * @param name name of the Namespace * @param body * @param pretty If 'true', then the output is pretty printed. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param {*} [options] Override http request options. */ patchNamespace(name, body, pretty, dryRun, options = {}) { const localVarPath = this.basePath + '/api/v1/namespaces/{name}' .replace('{' + 'name' + '}', encodeURIComponent(String(name))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling patchNamespace.'); } // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling patchNamespace.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'PATCH', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: ObjectSerializer.serialize(body, "any") }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "V1Namespace"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * partially update status of the specified Namespace * @param name name of the Namespace * @param body * @param pretty If 'true', then the output is pretty printed. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param {*} [options] Override http request options. */ patchNamespaceStatus(name, body, pretty, dryRun, options = {}) { const localVarPath = this.basePath + '/api/v1/namespaces/{name}/status' .replace('{' + 'name' + '}', encodeURIComponent(String(name))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling patchNamespaceStatus.'); } // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling patchNamespaceStatus.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'PATCH', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: ObjectSerializer.serialize(body, "any") }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "V1Namespace"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * partially update the specified ConfigMap * @param name name of the ConfigMap * @param namespace object name and auth scope, such as for teams and projects * @param body * @param pretty If 'true', then the output is pretty printed. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param {*} [options] Override http request options. */ patchNamespacedConfigMap(name, namespace, body, pretty, dryRun, options = {}) { const localVarPath = this.basePath + '/api/v1/namespaces/{namespace}/configmaps/{name}' .replace('{' + 'name' + '}', encodeURIComponent(String(name))) .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling patchNamespacedConfigMap.'); } // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling patchNamespacedConfigMap.'); } // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling patchNamespacedConfigMap.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'PATCH', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: ObjectSerializer.serialize(body, "any") }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "V1ConfigMap"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * partially update the specified Endpoints * @param name name of the Endpoints * @param namespace object name and auth scope, such as for teams and projects * @param body * @param pretty If 'true', then the output is pretty printed. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param {*} [options] Override http request options. */ patchNamespacedEndpoints(name, namespace, body, pretty, dryRun, options = {}) { const localVarPath = this.basePath + '/api/v1/namespaces/{namespace}/endpoints/{name}' .replace('{' + 'name' + '}', encodeURIComponent(String(name))) .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling patchNamespacedEndpoints.'); } // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling patchNamespacedEndpoints.'); } // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling patchNamespacedEndpoints.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'PATCH', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: ObjectSerializer.serialize(body, "any") }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "V1Endpoints"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * partially update the specified Event * @param name name of the Event * @param namespace object name and auth scope, such as for teams and projects * @param body * @param pretty If 'true', then the output is pretty printed. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param {*} [options] Override http request options. */ patchNamespacedEvent(name, namespace, body, pretty, dryRun, options = {}) { const localVarPath = this.basePath + '/api/v1/namespaces/{namespace}/events/{name}' .replace('{' + 'name' + '}', encodeURIComponent(String(name))) .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling patchNamespacedEvent.'); } // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling patchNamespacedEvent.'); } // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling patchNamespacedEvent.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'PATCH', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: ObjectSerializer.serialize(body, "any") }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "V1Event"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * partially update the specified LimitRange * @param name name of the LimitRange * @param namespace object name and auth scope, such as for teams and projects * @param body * @param pretty If 'true', then the output is pretty printed. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param {*} [options] Override http request options. */ patchNamespacedLimitRange(name, namespace, body, pretty, dryRun, options = {}) { const localVarPath = this.basePath + '/api/v1/namespaces/{namespace}/limitranges/{name}' .replace('{' + 'name' + '}', encodeURIComponent(String(name))) .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling patchNamespacedLimitRange.'); } // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling patchNamespacedLimitRange.'); } // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling patchNamespacedLimitRange.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'PATCH', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: ObjectSerializer.serialize(body, "any") }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "V1LimitRange"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * partially update the specified PersistentVolumeClaim * @param name name of the PersistentVolumeClaim * @param namespace object name and auth scope, such as for teams and projects * @param body * @param pretty If 'true', then the output is pretty printed. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param {*} [options] Override http request options. */ patchNamespacedPersistentVolumeClaim(name, namespace, body, pretty, dryRun, options = {}) { const localVarPath = this.basePath + '/api/v1/namespaces/{namespace}/persistentvolumeclaims/{name}' .replace('{' + 'name' + '}', encodeURIComponent(String(name))) .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling patchNamespacedPersistentVolumeClaim.'); } // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling patchNamespacedPersistentVolumeClaim.'); } // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling patchNamespacedPersistentVolumeClaim.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'PATCH', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: ObjectSerializer.serialize(body, "any") }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "V1PersistentVolumeClaim"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * partially update status of the specified PersistentVolumeClaim * @param name name of the PersistentVolumeClaim * @param namespace object name and auth scope, such as for teams and projects * @param body * @param pretty If 'true', then the output is pretty printed. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param {*} [options] Override http request options. */ patchNamespacedPersistentVolumeClaimStatus(name, namespace, body, pretty, dryRun, options = {}) { const localVarPath = this.basePath + '/api/v1/namespaces/{namespace}/persistentvolumeclaims/{name}/status' .replace('{' + 'name' + '}', encodeURIComponent(String(name))) .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling patchNamespacedPersistentVolumeClaimStatus.'); } // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling patchNamespacedPersistentVolumeClaimStatus.'); } // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling patchNamespacedPersistentVolumeClaimStatus.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'PATCH', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: ObjectSerializer.serialize(body, "any") }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "V1PersistentVolumeClaim"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * partially update the specified Pod * @param name name of the Pod * @param namespace object name and auth scope, such as for teams and projects * @param body * @param pretty If 'true', then the output is pretty printed. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param {*} [options] Override http request options. */ patchNamespacedPod(name, namespace, body, pretty, dryRun, options = {}) { const localVarPath = this.basePath + '/api/v1/namespaces/{namespace}/pods/{name}' .replace('{' + 'name' + '}', encodeURIComponent(String(name))) .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling patchNamespacedPod.'); } // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling patchNamespacedPod.'); } // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling patchNamespacedPod.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'PATCH', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: ObjectSerializer.serialize(body, "any") }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "V1Pod"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * partially update status of the specified Pod * @param name name of the Pod * @param namespace object name and auth scope, such as for teams and projects * @param body * @param pretty If 'true', then the output is pretty printed. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param {*} [options] Override http request options. */ patchNamespacedPodStatus(name, namespace, body, pretty, dryRun, options = {}) { const localVarPath = this.basePath + '/api/v1/namespaces/{namespace}/pods/{name}/status' .replace('{' + 'name' + '}', encodeURIComponent(String(name))) .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling patchNamespacedPodStatus.'); } // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling patchNamespacedPodStatus.'); } // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling patchNamespacedPodStatus.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'PATCH', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: ObjectSerializer.serialize(body, "any") }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "V1Pod"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * partially update the specified PodTemplate * @param name name of the PodTemplate * @param namespace object name and auth scope, such as for teams and projects * @param body * @param pretty If 'true', then the output is pretty printed. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param {*} [options] Override http request options. */ patchNamespacedPodTemplate(name, namespace, body, pretty, dryRun, options = {}) { const localVarPath = this.basePath + '/api/v1/namespaces/{namespace}/podtemplates/{name}' .replace('{' + 'name' + '}', encodeURIComponent(String(name))) .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling patchNamespacedPodTemplate.'); } // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling patchNamespacedPodTemplate.'); } // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling patchNamespacedPodTemplate.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'PATCH', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: ObjectSerializer.serialize(body, "any") }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "V1PodTemplate"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * partially update the specified ReplicationController * @param name name of the ReplicationController * @param namespace object name and auth scope, such as for teams and projects * @param body * @param pretty If 'true', then the output is pretty printed. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param {*} [options] Override http request options. */ patchNamespacedReplicationController(name, namespace, body, pretty, dryRun, options = {}) { const localVarPath = this.basePath + '/api/v1/namespaces/{namespace}/replicationcontrollers/{name}' .replace('{' + 'name' + '}', encodeURIComponent(String(name))) .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling patchNamespacedReplicationController.'); } // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling patchNamespacedReplicationController.'); } // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling patchNamespacedReplicationController.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'PATCH', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: ObjectSerializer.serialize(body, "any") }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "V1ReplicationController"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * partially update scale of the specified ReplicationController * @param name name of the Scale * @param namespace object name and auth scope, such as for teams and projects * @param body * @param pretty If 'true', then the output is pretty printed. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param {*} [options] Override http request options. */ patchNamespacedReplicationControllerScale(name, namespace, body, pretty, dryRun, options = {}) { const localVarPath = this.basePath + '/api/v1/namespaces/{namespace}/replicationcontrollers/{name}/scale' .replace('{' + 'name' + '}', encodeURIComponent(String(name))) .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling patchNamespacedReplicationControllerScale.'); } // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling patchNamespacedReplicationControllerScale.'); } // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling patchNamespacedReplicationControllerScale.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'PATCH', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: ObjectSerializer.serialize(body, "any") }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "V1Scale"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * partially update status of the specified ReplicationController * @param name name of the ReplicationController * @param namespace object name and auth scope, such as for teams and projects * @param body * @param pretty If 'true', then the output is pretty printed. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param {*} [options] Override http request options. */ patchNamespacedReplicationControllerStatus(name, namespace, body, pretty, dryRun, options = {}) { const localVarPath = this.basePath + '/api/v1/namespaces/{namespace}/replicationcontrollers/{name}/status' .replace('{' + 'name' + '}', encodeURIComponent(String(name))) .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling patchNamespacedReplicationControllerStatus.'); } // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling patchNamespacedReplicationControllerStatus.'); } // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling patchNamespacedReplicationControllerStatus.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'PATCH', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: ObjectSerializer.serialize(body, "any") }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "V1ReplicationController"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * partially update the specified ResourceQuota * @param name name of the ResourceQuota * @param namespace object name and auth scope, such as for teams and projects * @param body * @param pretty If 'true', then the output is pretty printed. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param {*} [options] Override http request options. */ patchNamespacedResourceQuota(name, namespace, body, pretty, dryRun, options = {}) { const localVarPath = this.basePath + '/api/v1/namespaces/{namespace}/resourcequotas/{name}' .replace('{' + 'name' + '}', encodeURIComponent(String(name))) .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling patchNamespacedResourceQuota.'); } // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling patchNamespacedResourceQuota.'); } // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling patchNamespacedResourceQuota.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'PATCH', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: ObjectSerializer.serialize(body, "any") }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "V1ResourceQuota"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * partially update status of the specified ResourceQuota * @param name name of the ResourceQuota * @param namespace object name and auth scope, such as for teams and projects * @param body * @param pretty If 'true', then the output is pretty printed. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param {*} [options] Override http request options. */ patchNamespacedResourceQuotaStatus(name, namespace, body, pretty, dryRun, options = {}) { const localVarPath = this.basePath + '/api/v1/namespaces/{namespace}/resourcequotas/{name}/status' .replace('{' + 'name' + '}', encodeURIComponent(String(name))) .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling patchNamespacedResourceQuotaStatus.'); } // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling patchNamespacedResourceQuotaStatus.'); } // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling patchNamespacedResourceQuotaStatus.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'PATCH', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: ObjectSerializer.serialize(body, "any") }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "V1ResourceQuota"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * partially update the specified Secret * @param name name of the Secret * @param namespace object name and auth scope, such as for teams and projects * @param body * @param pretty If 'true', then the output is pretty printed. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param {*} [options] Override http request options. */ patchNamespacedSecret(name, namespace, body, pretty, dryRun, options = {}) { const localVarPath = this.basePath + '/api/v1/namespaces/{namespace}/secrets/{name}' .replace('{' + 'name' + '}', encodeURIComponent(String(name))) .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling patchNamespacedSecret.'); } // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling patchNamespacedSecret.'); } // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling patchNamespacedSecret.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'PATCH', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: ObjectSerializer.serialize(body, "any") }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "V1Secret"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * partially update the specified Service * @param name name of the Service * @param namespace object name and auth scope, such as for teams and projects * @param body * @param pretty If 'true', then the output is pretty printed. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param {*} [options] Override http request options. */ patchNamespacedService(name, namespace, body, pretty, dryRun, options = {}) { const localVarPath = this.basePath + '/api/v1/namespaces/{namespace}/services/{name}' .replace('{' + 'name' + '}', encodeURIComponent(String(name))) .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling patchNamespacedService.'); } // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling patchNamespacedService.'); } // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling patchNamespacedService.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'PATCH', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: ObjectSerializer.serialize(body, "any") }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "V1Service"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * partially update the specified ServiceAccount * @param name name of the ServiceAccount * @param namespace object name and auth scope, such as for teams and projects * @param body * @param pretty If 'true', then the output is pretty printed. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param {*} [options] Override http request options. */ patchNamespacedServiceAccount(name, namespace, body, pretty, dryRun, options = {}) { const localVarPath = this.basePath + '/api/v1/namespaces/{namespace}/serviceaccounts/{name}' .replace('{' + 'name' + '}', encodeURIComponent(String(name))) .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling patchNamespacedServiceAccount.'); } // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling patchNamespacedServiceAccount.'); } // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling patchNamespacedServiceAccount.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'PATCH', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: ObjectSerializer.serialize(body, "any") }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "V1ServiceAccount"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * partially update status of the specified Service * @param name name of the Service * @param namespace object name and auth scope, such as for teams and projects * @param body * @param pretty If 'true', then the output is pretty printed. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param {*} [options] Override http request options. */ patchNamespacedServiceStatus(name, namespace, body, pretty, dryRun, options = {}) { const localVarPath = this.basePath + '/api/v1/namespaces/{namespace}/services/{name}/status' .replace('{' + 'name' + '}', encodeURIComponent(String(name))) .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling patchNamespacedServiceStatus.'); } // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling patchNamespacedServiceStatus.'); } // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling patchNamespacedServiceStatus.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'PATCH', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: ObjectSerializer.serialize(body, "any") }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "V1Service"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * partially update the specified Node * @param name name of the Node * @param body * @param pretty If 'true', then the output is pretty printed. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param {*} [options] Override http request options. */ patchNode(name, body, pretty, dryRun, options = {}) { const localVarPath = this.basePath + '/api/v1/nodes/{name}' .replace('{' + 'name' + '}', encodeURIComponent(String(name))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling patchNode.'); } // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling patchNode.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'PATCH', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: ObjectSerializer.serialize(body, "any") }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "V1Node"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * partially update status of the specified Node * @param name name of the Node * @param body * @param pretty If 'true', then the output is pretty printed. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param {*} [options] Override http request options. */ patchNodeStatus(name, body, pretty, dryRun, options = {}) { const localVarPath = this.basePath + '/api/v1/nodes/{name}/status' .replace('{' + 'name' + '}', encodeURIComponent(String(name))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling patchNodeStatus.'); } // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling patchNodeStatus.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'PATCH', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: ObjectSerializer.serialize(body, "any") }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "V1Node"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * partially update the specified PersistentVolume * @param name name of the PersistentVolume * @param body * @param pretty If 'true', then the output is pretty printed. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param {*} [options] Override http request options. */ patchPersistentVolume(name, body, pretty, dryRun, options = {}) { const localVarPath = this.basePath + '/api/v1/persistentvolumes/{name}' .replace('{' + 'name' + '}', encodeURIComponent(String(name))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling patchPersistentVolume.'); } // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling patchPersistentVolume.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'PATCH', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: ObjectSerializer.serialize(body, "any") }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "V1PersistentVolume"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * partially update status of the specified PersistentVolume * @param name name of the PersistentVolume * @param body * @param pretty If 'true', then the output is pretty printed. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param {*} [options] Override http request options. */ patchPersistentVolumeStatus(name, body, pretty, dryRun, options = {}) { const localVarPath = this.basePath + '/api/v1/persistentvolumes/{name}/status' .replace('{' + 'name' + '}', encodeURIComponent(String(name))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling patchPersistentVolumeStatus.'); } // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling patchPersistentVolumeStatus.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'PATCH', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: ObjectSerializer.serialize(body, "any") }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "V1PersistentVolume"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * read the specified ComponentStatus * @param name name of the ComponentStatus * @param pretty If 'true', then the output is pretty printed. * @param {*} [options] Override http request options. */ readComponentStatus(name, pretty, options = {}) { const localVarPath = this.basePath + '/api/v1/componentstatuses/{name}' .replace('{' + 'name' + '}', encodeURIComponent(String(name))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling readComponentStatus.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'GET', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "V1ComponentStatus"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * read the specified Namespace * @param name name of the Namespace * @param pretty If 'true', then the output is pretty printed. * @param exact Should the export be exact. Exact export maintains cluster-specific fields like 'Namespace'. * @param _export Should this value be exported. Export strips fields that a user can not specify. * @param {*} [options] Override http request options. */ readNamespace(name, pretty, exact, _export, options = {}) { const localVarPath = this.basePath + '/api/v1/namespaces/{name}' .replace('{' + 'name' + '}', encodeURIComponent(String(name))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling readNamespace.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, "string"); } if (exact !== undefined) { localVarQueryParameters['exact'] = ObjectSerializer.serialize(exact, "boolean"); } if (_export !== undefined) { localVarQueryParameters['export'] = ObjectSerializer.serialize(_export, "boolean"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'GET', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "V1Namespace"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * read status of the specified Namespace * @param name name of the Namespace * @param pretty If 'true', then the output is pretty printed. * @param {*} [options] Override http request options. */ readNamespaceStatus(name, pretty, options = {}) { const localVarPath = this.basePath + '/api/v1/namespaces/{name}/status' .replace('{' + 'name' + '}', encodeURIComponent(String(name))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling readNamespaceStatus.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'GET', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "V1Namespace"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * read the specified ConfigMap * @param name name of the ConfigMap * @param namespace object name and auth scope, such as for teams and projects * @param pretty If 'true', then the output is pretty printed. * @param exact Should the export be exact. Exact export maintains cluster-specific fields like 'Namespace'. * @param _export Should this value be exported. Export strips fields that a user can not specify. * @param {*} [options] Override http request options. */ readNamespacedConfigMap(name, namespace, pretty, exact, _export, options = {}) { const localVarPath = this.basePath + '/api/v1/namespaces/{namespace}/configmaps/{name}' .replace('{' + 'name' + '}', encodeURIComponent(String(name))) .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling readNamespacedConfigMap.'); } // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling readNamespacedConfigMap.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, "string"); } if (exact !== undefined) { localVarQueryParameters['exact'] = ObjectSerializer.serialize(exact, "boolean"); } if (_export !== undefined) { localVarQueryParameters['export'] = ObjectSerializer.serialize(_export, "boolean"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'GET', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "V1ConfigMap"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * read the specified Endpoints * @param name name of the Endpoints * @param namespace object name and auth scope, such as for teams and projects * @param pretty If 'true', then the output is pretty printed. * @param exact Should the export be exact. Exact export maintains cluster-specific fields like 'Namespace'. * @param _export Should this value be exported. Export strips fields that a user can not specify. * @param {*} [options] Override http request options. */ readNamespacedEndpoints(name, namespace, pretty, exact, _export, options = {}) { const localVarPath = this.basePath + '/api/v1/namespaces/{namespace}/endpoints/{name}' .replace('{' + 'name' + '}', encodeURIComponent(String(name))) .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling readNamespacedEndpoints.'); } // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling readNamespacedEndpoints.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, "string"); } if (exact !== undefined) { localVarQueryParameters['exact'] = ObjectSerializer.serialize(exact, "boolean"); } if (_export !== undefined) { localVarQueryParameters['export'] = ObjectSerializer.serialize(_export, "boolean"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'GET', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "V1Endpoints"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * read the specified Event * @param name name of the Event * @param namespace object name and auth scope, such as for teams and projects * @param pretty If 'true', then the output is pretty printed. * @param exact Should the export be exact. Exact export maintains cluster-specific fields like 'Namespace'. * @param _export Should this value be exported. Export strips fields that a user can not specify. * @param {*} [options] Override http request options. */ readNamespacedEvent(name, namespace, pretty, exact, _export, options = {}) { const localVarPath = this.basePath + '/api/v1/namespaces/{namespace}/events/{name}' .replace('{' + 'name' + '}', encodeURIComponent(String(name))) .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling readNamespacedEvent.'); } // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling readNamespacedEvent.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, "string"); } if (exact !== undefined) { localVarQueryParameters['exact'] = ObjectSerializer.serialize(exact, "boolean"); } if (_export !== undefined) { localVarQueryParameters['export'] = ObjectSerializer.serialize(_export, "boolean"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'GET', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "V1Event"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * read the specified LimitRange * @param name name of the LimitRange * @param namespace object name and auth scope, such as for teams and projects * @param pretty If 'true', then the output is pretty printed. * @param exact Should the export be exact. Exact export maintains cluster-specific fields like 'Namespace'. * @param _export Should this value be exported. Export strips fields that a user can not specify. * @param {*} [options] Override http request options. */ readNamespacedLimitRange(name, namespace, pretty, exact, _export, options = {}) { const localVarPath = this.basePath + '/api/v1/namespaces/{namespace}/limitranges/{name}' .replace('{' + 'name' + '}', encodeURIComponent(String(name))) .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling readNamespacedLimitRange.'); } // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling readNamespacedLimitRange.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, "string"); } if (exact !== undefined) { localVarQueryParameters['exact'] = ObjectSerializer.serialize(exact, "boolean"); } if (_export !== undefined) { localVarQueryParameters['export'] = ObjectSerializer.serialize(_export, "boolean"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'GET', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "V1LimitRange"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * read the specified PersistentVolumeClaim * @param name name of the PersistentVolumeClaim * @param namespace object name and auth scope, such as for teams and projects * @param pretty If 'true', then the output is pretty printed. * @param exact Should the export be exact. Exact export maintains cluster-specific fields like 'Namespace'. * @param _export Should this value be exported. Export strips fields that a user can not specify. * @param {*} [options] Override http request options. */ readNamespacedPersistentVolumeClaim(name, namespace, pretty, exact, _export, options = {}) { const localVarPath = this.basePath + '/api/v1/namespaces/{namespace}/persistentvolumeclaims/{name}' .replace('{' + 'name' + '}', encodeURIComponent(String(name))) .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling readNamespacedPersistentVolumeClaim.'); } // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling readNamespacedPersistentVolumeClaim.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, "string"); } if (exact !== undefined) { localVarQueryParameters['exact'] = ObjectSerializer.serialize(exact, "boolean"); } if (_export !== undefined) { localVarQueryParameters['export'] = ObjectSerializer.serialize(_export, "boolean"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'GET', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "V1PersistentVolumeClaim"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * read status of the specified PersistentVolumeClaim * @param name name of the PersistentVolumeClaim * @param namespace object name and auth scope, such as for teams and projects * @param pretty If 'true', then the output is pretty printed. * @param {*} [options] Override http request options. */ readNamespacedPersistentVolumeClaimStatus(name, namespace, pretty, options = {}) { const localVarPath = this.basePath + '/api/v1/namespaces/{namespace}/persistentvolumeclaims/{name}/status' .replace('{' + 'name' + '}', encodeURIComponent(String(name))) .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling readNamespacedPersistentVolumeClaimStatus.'); } // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling readNamespacedPersistentVolumeClaimStatus.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'GET', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "V1PersistentVolumeClaim"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * read the specified Pod * @param name name of the Pod * @param namespace object name and auth scope, such as for teams and projects * @param pretty If 'true', then the output is pretty printed. * @param exact Should the export be exact. Exact export maintains cluster-specific fields like 'Namespace'. * @param _export Should this value be exported. Export strips fields that a user can not specify. * @param {*} [options] Override http request options. */ readNamespacedPod(name, namespace, pretty, exact, _export, options = {}) { const localVarPath = this.basePath + '/api/v1/namespaces/{namespace}/pods/{name}' .replace('{' + 'name' + '}', encodeURIComponent(String(name))) .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling readNamespacedPod.'); } // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling readNamespacedPod.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, "string"); } if (exact !== undefined) { localVarQueryParameters['exact'] = ObjectSerializer.serialize(exact, "boolean"); } if (_export !== undefined) { localVarQueryParameters['export'] = ObjectSerializer.serialize(_export, "boolean"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'GET', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "V1Pod"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * read log of the specified Pod * @param name name of the Pod * @param namespace object name and auth scope, such as for teams and projects * @param container The container for which to stream logs. Defaults to only container if there is one container in the pod. * @param follow Follow the log stream of the pod. Defaults to false. * @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. * @param pretty If 'true', then the output is pretty printed. * @param previous Return previous terminated container logs. Defaults to false. * @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. * @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 * @param timestamps If true, add an RFC3339 or RFC3339Nano timestamp at the beginning of every line of log output. Defaults to false. * @param {*} [options] Override http request options. */ readNamespacedPodLog(name, namespace, container, follow, limitBytes, pretty, previous, sinceSeconds, tailLines, timestamps, options = {}) { const localVarPath = this.basePath + '/api/v1/namespaces/{namespace}/pods/{name}/log' .replace('{' + 'name' + '}', encodeURIComponent(String(name))) .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling readNamespacedPodLog.'); } // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling readNamespacedPodLog.'); } if (container !== undefined) { localVarQueryParameters['container'] = ObjectSerializer.serialize(container, "string"); } if (follow !== undefined) { localVarQueryParameters['follow'] = ObjectSerializer.serialize(follow, "boolean"); } if (limitBytes !== undefined) { localVarQueryParameters['limitBytes'] = ObjectSerializer.serialize(limitBytes, "number"); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, "string"); } if (previous !== undefined) { localVarQueryParameters['previous'] = ObjectSerializer.serialize(previous, "boolean"); } if (sinceSeconds !== undefined) { localVarQueryParameters['sinceSeconds'] = ObjectSerializer.serialize(sinceSeconds, "number"); } if (tailLines !== undefined) { localVarQueryParameters['tailLines'] = ObjectSerializer.serialize(tailLines, "number"); } if (timestamps !== undefined) { localVarQueryParameters['timestamps'] = ObjectSerializer.serialize(timestamps, "boolean"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'GET', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "string"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * read status of the specified Pod * @param name name of the Pod * @param namespace object name and auth scope, such as for teams and projects * @param pretty If 'true', then the output is pretty printed. * @param {*} [options] Override http request options. */ readNamespacedPodStatus(name, namespace, pretty, options = {}) { const localVarPath = this.basePath + '/api/v1/namespaces/{namespace}/pods/{name}/status' .replace('{' + 'name' + '}', encodeURIComponent(String(name))) .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling readNamespacedPodStatus.'); } // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling readNamespacedPodStatus.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'GET', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "V1Pod"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * read the specified PodTemplate * @param name name of the PodTemplate * @param namespace object name and auth scope, such as for teams and projects * @param pretty If 'true', then the output is pretty printed. * @param exact Should the export be exact. Exact export maintains cluster-specific fields like 'Namespace'. * @param _export Should this value be exported. Export strips fields that a user can not specify. * @param {*} [options] Override http request options. */ readNamespacedPodTemplate(name, namespace, pretty, exact, _export, options = {}) { const localVarPath = this.basePath + '/api/v1/namespaces/{namespace}/podtemplates/{name}' .replace('{' + 'name' + '}', encodeURIComponent(String(name))) .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling readNamespacedPodTemplate.'); } // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling readNamespacedPodTemplate.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, "string"); } if (exact !== undefined) { localVarQueryParameters['exact'] = ObjectSerializer.serialize(exact, "boolean"); } if (_export !== undefined) { localVarQueryParameters['export'] = ObjectSerializer.serialize(_export, "boolean"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'GET', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "V1PodTemplate"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * read the specified ReplicationController * @param name name of the ReplicationController * @param namespace object name and auth scope, such as for teams and projects * @param pretty If 'true', then the output is pretty printed. * @param exact Should the export be exact. Exact export maintains cluster-specific fields like 'Namespace'. * @param _export Should this value be exported. Export strips fields that a user can not specify. * @param {*} [options] Override http request options. */ readNamespacedReplicationController(name, namespace, pretty, exact, _export, options = {}) { const localVarPath = this.basePath + '/api/v1/namespaces/{namespace}/replicationcontrollers/{name}' .replace('{' + 'name' + '}', encodeURIComponent(String(name))) .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling readNamespacedReplicationController.'); } // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling readNamespacedReplicationController.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, "string"); } if (exact !== undefined) { localVarQueryParameters['exact'] = ObjectSerializer.serialize(exact, "boolean"); } if (_export !== undefined) { localVarQueryParameters['export'] = ObjectSerializer.serialize(_export, "boolean"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'GET', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "V1ReplicationController"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * read scale of the specified ReplicationController * @param name name of the Scale * @param namespace object name and auth scope, such as for teams and projects * @param pretty If 'true', then the output is pretty printed. * @param {*} [options] Override http request options. */ readNamespacedReplicationControllerScale(name, namespace, pretty, options = {}) { const localVarPath = this.basePath + '/api/v1/namespaces/{namespace}/replicationcontrollers/{name}/scale' .replace('{' + 'name' + '}', encodeURIComponent(String(name))) .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling readNamespacedReplicationControllerScale.'); } // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling readNamespacedReplicationControllerScale.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'GET', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "V1Scale"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * read status of the specified ReplicationController * @param name name of the ReplicationController * @param namespace object name and auth scope, such as for teams and projects * @param pretty If 'true', then the output is pretty printed. * @param {*} [options] Override http request options. */ readNamespacedReplicationControllerStatus(name, namespace, pretty, options = {}) { const localVarPath = this.basePath + '/api/v1/namespaces/{namespace}/replicationcontrollers/{name}/status' .replace('{' + 'name' + '}', encodeURIComponent(String(name))) .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling readNamespacedReplicationControllerStatus.'); } // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling readNamespacedReplicationControllerStatus.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'GET', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "V1ReplicationController"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * read the specified ResourceQuota * @param name name of the ResourceQuota * @param namespace object name and auth scope, such as for teams and projects * @param pretty If 'true', then the output is pretty printed. * @param exact Should the export be exact. Exact export maintains cluster-specific fields like 'Namespace'. * @param _export Should this value be exported. Export strips fields that a user can not specify. * @param {*} [options] Override http request options. */ readNamespacedResourceQuota(name, namespace, pretty, exact, _export, options = {}) { const localVarPath = this.basePath + '/api/v1/namespaces/{namespace}/resourcequotas/{name}' .replace('{' + 'name' + '}', encodeURIComponent(String(name))) .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling readNamespacedResourceQuota.'); } // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling readNamespacedResourceQuota.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, "string"); } if (exact !== undefined) { localVarQueryParameters['exact'] = ObjectSerializer.serialize(exact, "boolean"); } if (_export !== undefined) { localVarQueryParameters['export'] = ObjectSerializer.serialize(_export, "boolean"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'GET', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "V1ResourceQuota"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * read status of the specified ResourceQuota * @param name name of the ResourceQuota * @param namespace object name and auth scope, such as for teams and projects * @param pretty If 'true', then the output is pretty printed. * @param {*} [options] Override http request options. */ readNamespacedResourceQuotaStatus(name, namespace, pretty, options = {}) { const localVarPath = this.basePath + '/api/v1/namespaces/{namespace}/resourcequotas/{name}/status' .replace('{' + 'name' + '}', encodeURIComponent(String(name))) .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling readNamespacedResourceQuotaStatus.'); } // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling readNamespacedResourceQuotaStatus.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'GET', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "V1ResourceQuota"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * read the specified Secret * @param name name of the Secret * @param namespace object name and auth scope, such as for teams and projects * @param pretty If 'true', then the output is pretty printed. * @param exact Should the export be exact. Exact export maintains cluster-specific fields like 'Namespace'. * @param _export Should this value be exported. Export strips fields that a user can not specify. * @param {*} [options] Override http request options. */ readNamespacedSecret(name, namespace, pretty, exact, _export, options = {}) { const localVarPath = this.basePath + '/api/v1/namespaces/{namespace}/secrets/{name}' .replace('{' + 'name' + '}', encodeURIComponent(String(name))) .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling readNamespacedSecret.'); } // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling readNamespacedSecret.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, "string"); } if (exact !== undefined) { localVarQueryParameters['exact'] = ObjectSerializer.serialize(exact, "boolean"); } if (_export !== undefined) { localVarQueryParameters['export'] = ObjectSerializer.serialize(_export, "boolean"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'GET', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "V1Secret"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * read the specified Service * @param name name of the Service * @param namespace object name and auth scope, such as for teams and projects * @param pretty If 'true', then the output is pretty printed. * @param exact Should the export be exact. Exact export maintains cluster-specific fields like 'Namespace'. * @param _export Should this value be exported. Export strips fields that a user can not specify. * @param {*} [options] Override http request options. */ readNamespacedService(name, namespace, pretty, exact, _export, options = {}) { const localVarPath = this.basePath + '/api/v1/namespaces/{namespace}/services/{name}' .replace('{' + 'name' + '}', encodeURIComponent(String(name))) .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling readNamespacedService.'); } // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling readNamespacedService.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, "string"); } if (exact !== undefined) { localVarQueryParameters['exact'] = ObjectSerializer.serialize(exact, "boolean"); } if (_export !== undefined) { localVarQueryParameters['export'] = ObjectSerializer.serialize(_export, "boolean"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'GET', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "V1Service"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * read the specified ServiceAccount * @param name name of the ServiceAccount * @param namespace object name and auth scope, such as for teams and projects * @param pretty If 'true', then the output is pretty printed. * @param exact Should the export be exact. Exact export maintains cluster-specific fields like 'Namespace'. * @param _export Should this value be exported. Export strips fields that a user can not specify. * @param {*} [options] Override http request options. */ readNamespacedServiceAccount(name, namespace, pretty, exact, _export, options = {}) { const localVarPath = this.basePath + '/api/v1/namespaces/{namespace}/serviceaccounts/{name}' .replace('{' + 'name' + '}', encodeURIComponent(String(name))) .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling readNamespacedServiceAccount.'); } // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling readNamespacedServiceAccount.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, "string"); } if (exact !== undefined) { localVarQueryParameters['exact'] = ObjectSerializer.serialize(exact, "boolean"); } if (_export !== undefined) { localVarQueryParameters['export'] = ObjectSerializer.serialize(_export, "boolean"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'GET', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "V1ServiceAccount"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * read status of the specified Service * @param name name of the Service * @param namespace object name and auth scope, such as for teams and projects * @param pretty If 'true', then the output is pretty printed. * @param {*} [options] Override http request options. */ readNamespacedServiceStatus(name, namespace, pretty, options = {}) { const localVarPath = this.basePath + '/api/v1/namespaces/{namespace}/services/{name}/status' .replace('{' + 'name' + '}', encodeURIComponent(String(name))) .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling readNamespacedServiceStatus.'); } // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling readNamespacedServiceStatus.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'GET', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "V1Service"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * read the specified Node * @param name name of the Node * @param pretty If 'true', then the output is pretty printed. * @param exact Should the export be exact. Exact export maintains cluster-specific fields like 'Namespace'. * @param _export Should this value be exported. Export strips fields that a user can not specify. * @param {*} [options] Override http request options. */ readNode(name, pretty, exact, _export, options = {}) { const localVarPath = this.basePath + '/api/v1/nodes/{name}' .replace('{' + 'name' + '}', encodeURIComponent(String(name))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling readNode.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, "string"); } if (exact !== undefined) { localVarQueryParameters['exact'] = ObjectSerializer.serialize(exact, "boolean"); } if (_export !== undefined) { localVarQueryParameters['export'] = ObjectSerializer.serialize(_export, "boolean"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'GET', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "V1Node"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * read status of the specified Node * @param name name of the Node * @param pretty If 'true', then the output is pretty printed. * @param {*} [options] Override http request options. */ readNodeStatus(name, pretty, options = {}) { const localVarPath = this.basePath + '/api/v1/nodes/{name}/status' .replace('{' + 'name' + '}', encodeURIComponent(String(name))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling readNodeStatus.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'GET', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "V1Node"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * read the specified PersistentVolume * @param name name of the PersistentVolume * @param pretty If 'true', then the output is pretty printed. * @param exact Should the export be exact. Exact export maintains cluster-specific fields like 'Namespace'. * @param _export Should this value be exported. Export strips fields that a user can not specify. * @param {*} [options] Override http request options. */ readPersistentVolume(name, pretty, exact, _export, options = {}) { const localVarPath = this.basePath + '/api/v1/persistentvolumes/{name}' .replace('{' + 'name' + '}', encodeURIComponent(String(name))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling readPersistentVolume.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, "string"); } if (exact !== undefined) { localVarQueryParameters['exact'] = ObjectSerializer.serialize(exact, "boolean"); } if (_export !== undefined) { localVarQueryParameters['export'] = ObjectSerializer.serialize(_export, "boolean"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'GET', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "V1PersistentVolume"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * read status of the specified PersistentVolume * @param name name of the PersistentVolume * @param pretty If 'true', then the output is pretty printed. * @param {*} [options] Override http request options. */ readPersistentVolumeStatus(name, pretty, options = {}) { const localVarPath = this.basePath + '/api/v1/persistentvolumes/{name}/status' .replace('{' + 'name' + '}', encodeURIComponent(String(name))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling readPersistentVolumeStatus.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'GET', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "V1PersistentVolume"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * replace the specified Namespace * @param name name of the Namespace * @param body * @param pretty If 'true', then the output is pretty printed. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param {*} [options] Override http request options. */ replaceNamespace(name, body, pretty, dryRun, options = {}) { const localVarPath = this.basePath + '/api/v1/namespaces/{name}' .replace('{' + 'name' + '}', encodeURIComponent(String(name))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling replaceNamespace.'); } // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling replaceNamespace.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'PUT', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: ObjectSerializer.serialize(body, "V1Namespace") }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "V1Namespace"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * replace finalize of the specified Namespace * @param name name of the Namespace * @param body * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param pretty If 'true', then the output is pretty printed. * @param {*} [options] Override http request options. */ replaceNamespaceFinalize(name, body, dryRun, pretty, options = {}) { const localVarPath = this.basePath + '/api/v1/namespaces/{name}/finalize' .replace('{' + 'name' + '}', encodeURIComponent(String(name))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling replaceNamespaceFinalize.'); } // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling replaceNamespaceFinalize.'); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, "string"); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'PUT', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: ObjectSerializer.serialize(body, "V1Namespace") }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "V1Namespace"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * replace status of the specified Namespace * @param name name of the Namespace * @param body * @param pretty If 'true', then the output is pretty printed. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param {*} [options] Override http request options. */ replaceNamespaceStatus(name, body, pretty, dryRun, options = {}) { const localVarPath = this.basePath + '/api/v1/namespaces/{name}/status' .replace('{' + 'name' + '}', encodeURIComponent(String(name))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling replaceNamespaceStatus.'); } // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling replaceNamespaceStatus.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'PUT', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: ObjectSerializer.serialize(body, "V1Namespace") }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "V1Namespace"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * replace the specified ConfigMap * @param name name of the ConfigMap * @param namespace object name and auth scope, such as for teams and projects * @param body * @param pretty If 'true', then the output is pretty printed. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param {*} [options] Override http request options. */ replaceNamespacedConfigMap(name, namespace, body, pretty, dryRun, options = {}) { const localVarPath = this.basePath + '/api/v1/namespaces/{namespace}/configmaps/{name}' .replace('{' + 'name' + '}', encodeURIComponent(String(name))) .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling replaceNamespacedConfigMap.'); } // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling replaceNamespacedConfigMap.'); } // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling replaceNamespacedConfigMap.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'PUT', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: ObjectSerializer.serialize(body, "V1ConfigMap") }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "V1ConfigMap"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * replace the specified Endpoints * @param name name of the Endpoints * @param namespace object name and auth scope, such as for teams and projects * @param body * @param pretty If 'true', then the output is pretty printed. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param {*} [options] Override http request options. */ replaceNamespacedEndpoints(name, namespace, body, pretty, dryRun, options = {}) { const localVarPath = this.basePath + '/api/v1/namespaces/{namespace}/endpoints/{name}' .replace('{' + 'name' + '}', encodeURIComponent(String(name))) .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling replaceNamespacedEndpoints.'); } // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling replaceNamespacedEndpoints.'); } // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling replaceNamespacedEndpoints.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'PUT', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: ObjectSerializer.serialize(body, "V1Endpoints") }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "V1Endpoints"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * replace the specified Event * @param name name of the Event * @param namespace object name and auth scope, such as for teams and projects * @param body * @param pretty If 'true', then the output is pretty printed. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param {*} [options] Override http request options. */ replaceNamespacedEvent(name, namespace, body, pretty, dryRun, options = {}) { const localVarPath = this.basePath + '/api/v1/namespaces/{namespace}/events/{name}' .replace('{' + 'name' + '}', encodeURIComponent(String(name))) .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling replaceNamespacedEvent.'); } // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling replaceNamespacedEvent.'); } // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling replaceNamespacedEvent.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'PUT', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: ObjectSerializer.serialize(body, "V1Event") }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "V1Event"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * replace the specified LimitRange * @param name name of the LimitRange * @param namespace object name and auth scope, such as for teams and projects * @param body * @param pretty If 'true', then the output is pretty printed. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param {*} [options] Override http request options. */ replaceNamespacedLimitRange(name, namespace, body, pretty, dryRun, options = {}) { const localVarPath = this.basePath + '/api/v1/namespaces/{namespace}/limitranges/{name}' .replace('{' + 'name' + '}', encodeURIComponent(String(name))) .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling replaceNamespacedLimitRange.'); } // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling replaceNamespacedLimitRange.'); } // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling replaceNamespacedLimitRange.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'PUT', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: ObjectSerializer.serialize(body, "V1LimitRange") }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "V1LimitRange"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * replace the specified PersistentVolumeClaim * @param name name of the PersistentVolumeClaim * @param namespace object name and auth scope, such as for teams and projects * @param body * @param pretty If 'true', then the output is pretty printed. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param {*} [options] Override http request options. */ replaceNamespacedPersistentVolumeClaim(name, namespace, body, pretty, dryRun, options = {}) { const localVarPath = this.basePath + '/api/v1/namespaces/{namespace}/persistentvolumeclaims/{name}' .replace('{' + 'name' + '}', encodeURIComponent(String(name))) .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling replaceNamespacedPersistentVolumeClaim.'); } // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling replaceNamespacedPersistentVolumeClaim.'); } // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling replaceNamespacedPersistentVolumeClaim.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'PUT', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: ObjectSerializer.serialize(body, "V1PersistentVolumeClaim") }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "V1PersistentVolumeClaim"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * replace status of the specified PersistentVolumeClaim * @param name name of the PersistentVolumeClaim * @param namespace object name and auth scope, such as for teams and projects * @param body * @param pretty If 'true', then the output is pretty printed. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param {*} [options] Override http request options. */ replaceNamespacedPersistentVolumeClaimStatus(name, namespace, body, pretty, dryRun, options = {}) { const localVarPath = this.basePath + '/api/v1/namespaces/{namespace}/persistentvolumeclaims/{name}/status' .replace('{' + 'name' + '}', encodeURIComponent(String(name))) .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling replaceNamespacedPersistentVolumeClaimStatus.'); } // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling replaceNamespacedPersistentVolumeClaimStatus.'); } // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling replaceNamespacedPersistentVolumeClaimStatus.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'PUT', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: ObjectSerializer.serialize(body, "V1PersistentVolumeClaim") }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "V1PersistentVolumeClaim"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * replace the specified Pod * @param name name of the Pod * @param namespace object name and auth scope, such as for teams and projects * @param body * @param pretty If 'true', then the output is pretty printed. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param {*} [options] Override http request options. */ replaceNamespacedPod(name, namespace, body, pretty, dryRun, options = {}) { const localVarPath = this.basePath + '/api/v1/namespaces/{namespace}/pods/{name}' .replace('{' + 'name' + '}', encodeURIComponent(String(name))) .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling replaceNamespacedPod.'); } // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling replaceNamespacedPod.'); } // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling replaceNamespacedPod.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'PUT', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: ObjectSerializer.serialize(body, "V1Pod") }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "V1Pod"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * replace status of the specified Pod * @param name name of the Pod * @param namespace object name and auth scope, such as for teams and projects * @param body * @param pretty If 'true', then the output is pretty printed. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param {*} [options] Override http request options. */ replaceNamespacedPodStatus(name, namespace, body, pretty, dryRun, options = {}) { const localVarPath = this.basePath + '/api/v1/namespaces/{namespace}/pods/{name}/status' .replace('{' + 'name' + '}', encodeURIComponent(String(name))) .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling replaceNamespacedPodStatus.'); } // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling replaceNamespacedPodStatus.'); } // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling replaceNamespacedPodStatus.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'PUT', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: ObjectSerializer.serialize(body, "V1Pod") }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "V1Pod"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * replace the specified PodTemplate * @param name name of the PodTemplate * @param namespace object name and auth scope, such as for teams and projects * @param body * @param pretty If 'true', then the output is pretty printed. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param {*} [options] Override http request options. */ replaceNamespacedPodTemplate(name, namespace, body, pretty, dryRun, options = {}) { const localVarPath = this.basePath + '/api/v1/namespaces/{namespace}/podtemplates/{name}' .replace('{' + 'name' + '}', encodeURIComponent(String(name))) .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling replaceNamespacedPodTemplate.'); } // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling replaceNamespacedPodTemplate.'); } // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling replaceNamespacedPodTemplate.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'PUT', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: ObjectSerializer.serialize(body, "V1PodTemplate") }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "V1PodTemplate"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * replace the specified ReplicationController * @param name name of the ReplicationController * @param namespace object name and auth scope, such as for teams and projects * @param body * @param pretty If 'true', then the output is pretty printed. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param {*} [options] Override http request options. */ replaceNamespacedReplicationController(name, namespace, body, pretty, dryRun, options = {}) { const localVarPath = this.basePath + '/api/v1/namespaces/{namespace}/replicationcontrollers/{name}' .replace('{' + 'name' + '}', encodeURIComponent(String(name))) .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling replaceNamespacedReplicationController.'); } // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling replaceNamespacedReplicationController.'); } // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling replaceNamespacedReplicationController.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'PUT', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: ObjectSerializer.serialize(body, "V1ReplicationController") }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "V1ReplicationController"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * replace scale of the specified ReplicationController * @param name name of the Scale * @param namespace object name and auth scope, such as for teams and projects * @param body * @param pretty If 'true', then the output is pretty printed. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param {*} [options] Override http request options. */ replaceNamespacedReplicationControllerScale(name, namespace, body, pretty, dryRun, options = {}) { const localVarPath = this.basePath + '/api/v1/namespaces/{namespace}/replicationcontrollers/{name}/scale' .replace('{' + 'name' + '}', encodeURIComponent(String(name))) .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling replaceNamespacedReplicationControllerScale.'); } // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling replaceNamespacedReplicationControllerScale.'); } // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling replaceNamespacedReplicationControllerScale.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'PUT', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: ObjectSerializer.serialize(body, "V1Scale") }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "V1Scale"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * replace status of the specified ReplicationController * @param name name of the ReplicationController * @param namespace object name and auth scope, such as for teams and projects * @param body * @param pretty If 'true', then the output is pretty printed. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param {*} [options] Override http request options. */ replaceNamespacedReplicationControllerStatus(name, namespace, body, pretty, dryRun, options = {}) { const localVarPath = this.basePath + '/api/v1/namespaces/{namespace}/replicationcontrollers/{name}/status' .replace('{' + 'name' + '}', encodeURIComponent(String(name))) .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling replaceNamespacedReplicationControllerStatus.'); } // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling replaceNamespacedReplicationControllerStatus.'); } // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling replaceNamespacedReplicationControllerStatus.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'PUT', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: ObjectSerializer.serialize(body, "V1ReplicationController") }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "V1ReplicationController"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * replace the specified ResourceQuota * @param name name of the ResourceQuota * @param namespace object name and auth scope, such as for teams and projects * @param body * @param pretty If 'true', then the output is pretty printed. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param {*} [options] Override http request options. */ replaceNamespacedResourceQuota(name, namespace, body, pretty, dryRun, options = {}) { const localVarPath = this.basePath + '/api/v1/namespaces/{namespace}/resourcequotas/{name}' .replace('{' + 'name' + '}', encodeURIComponent(String(name))) .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling replaceNamespacedResourceQuota.'); } // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling replaceNamespacedResourceQuota.'); } // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling replaceNamespacedResourceQuota.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'PUT', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: ObjectSerializer.serialize(body, "V1ResourceQuota") }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "V1ResourceQuota"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * replace status of the specified ResourceQuota * @param name name of the ResourceQuota * @param namespace object name and auth scope, such as for teams and projects * @param body * @param pretty If 'true', then the output is pretty printed. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param {*} [options] Override http request options. */ replaceNamespacedResourceQuotaStatus(name, namespace, body, pretty, dryRun, options = {}) { const localVarPath = this.basePath + '/api/v1/namespaces/{namespace}/resourcequotas/{name}/status' .replace('{' + 'name' + '}', encodeURIComponent(String(name))) .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling replaceNamespacedResourceQuotaStatus.'); } // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling replaceNamespacedResourceQuotaStatus.'); } // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling replaceNamespacedResourceQuotaStatus.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'PUT', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: ObjectSerializer.serialize(body, "V1ResourceQuota") }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "V1ResourceQuota"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * replace the specified Secret * @param name name of the Secret * @param namespace object name and auth scope, such as for teams and projects * @param body * @param pretty If 'true', then the output is pretty printed. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param {*} [options] Override http request options. */ replaceNamespacedSecret(name, namespace, body, pretty, dryRun, options = {}) { const localVarPath = this.basePath + '/api/v1/namespaces/{namespace}/secrets/{name}' .replace('{' + 'name' + '}', encodeURIComponent(String(name))) .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling replaceNamespacedSecret.'); } // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling replaceNamespacedSecret.'); } // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling replaceNamespacedSecret.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'PUT', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: ObjectSerializer.serialize(body, "V1Secret") }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "V1Secret"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * replace the specified Service * @param name name of the Service * @param namespace object name and auth scope, such as for teams and projects * @param body * @param pretty If 'true', then the output is pretty printed. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param {*} [options] Override http request options. */ replaceNamespacedService(name, namespace, body, pretty, dryRun, options = {}) { const localVarPath = this.basePath + '/api/v1/namespaces/{namespace}/services/{name}' .replace('{' + 'name' + '}', encodeURIComponent(String(name))) .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling replaceNamespacedService.'); } // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling replaceNamespacedService.'); } // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling replaceNamespacedService.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'PUT', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: ObjectSerializer.serialize(body, "V1Service") }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "V1Service"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * replace the specified ServiceAccount * @param name name of the ServiceAccount * @param namespace object name and auth scope, such as for teams and projects * @param body * @param pretty If 'true', then the output is pretty printed. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param {*} [options] Override http request options. */ replaceNamespacedServiceAccount(name, namespace, body, pretty, dryRun, options = {}) { const localVarPath = this.basePath + '/api/v1/namespaces/{namespace}/serviceaccounts/{name}' .replace('{' + 'name' + '}', encodeURIComponent(String(name))) .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling replaceNamespacedServiceAccount.'); } // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling replaceNamespacedServiceAccount.'); } // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling replaceNamespacedServiceAccount.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'PUT', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: ObjectSerializer.serialize(body, "V1ServiceAccount") }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "V1ServiceAccount"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * replace status of the specified Service * @param name name of the Service * @param namespace object name and auth scope, such as for teams and projects * @param body * @param pretty If 'true', then the output is pretty printed. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param {*} [options] Override http request options. */ replaceNamespacedServiceStatus(name, namespace, body, pretty, dryRun, options = {}) { const localVarPath = this.basePath + '/api/v1/namespaces/{namespace}/services/{name}/status' .replace('{' + 'name' + '}', encodeURIComponent(String(name))) .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling replaceNamespacedServiceStatus.'); } // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling replaceNamespacedServiceStatus.'); } // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling replaceNamespacedServiceStatus.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'PUT', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: ObjectSerializer.serialize(body, "V1Service") }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "V1Service"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * replace the specified Node * @param name name of the Node * @param body * @param pretty If 'true', then the output is pretty printed. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param {*} [options] Override http request options. */ replaceNode(name, body, pretty, dryRun, options = {}) { const localVarPath = this.basePath + '/api/v1/nodes/{name}' .replace('{' + 'name' + '}', encodeURIComponent(String(name))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling replaceNode.'); } // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling replaceNode.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'PUT', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: ObjectSerializer.serialize(body, "V1Node") }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "V1Node"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * replace status of the specified Node * @param name name of the Node * @param body * @param pretty If 'true', then the output is pretty printed. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param {*} [options] Override http request options. */ replaceNodeStatus(name, body, pretty, dryRun, options = {}) { const localVarPath = this.basePath + '/api/v1/nodes/{name}/status' .replace('{' + 'name' + '}', encodeURIComponent(String(name))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling replaceNodeStatus.'); } // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling replaceNodeStatus.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'PUT', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: ObjectSerializer.serialize(body, "V1Node") }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "V1Node"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * replace the specified PersistentVolume * @param name name of the PersistentVolume * @param body * @param pretty If 'true', then the output is pretty printed. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param {*} [options] Override http request options. */ replacePersistentVolume(name, body, pretty, dryRun, options = {}) { const localVarPath = this.basePath + '/api/v1/persistentvolumes/{name}' .replace('{' + 'name' + '}', encodeURIComponent(String(name))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling replacePersistentVolume.'); } // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling replacePersistentVolume.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'PUT', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: ObjectSerializer.serialize(body, "V1PersistentVolume") }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "V1PersistentVolume"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * replace status of the specified PersistentVolume * @param name name of the PersistentVolume * @param body * @param pretty If 'true', then the output is pretty printed. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param {*} [options] Override http request options. */ replacePersistentVolumeStatus(name, body, pretty, dryRun, options = {}) { const localVarPath = this.basePath + '/api/v1/persistentvolumes/{name}/status' .replace('{' + 'name' + '}', encodeURIComponent(String(name))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling replacePersistentVolumeStatus.'); } // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling replacePersistentVolumeStatus.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'PUT', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: ObjectSerializer.serialize(body, "V1PersistentVolume") }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "V1PersistentVolume"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } } exports.CoreV1Api = CoreV1Api; var CustomObjectsApiApiKeys; (function (CustomObjectsApiApiKeys) { CustomObjectsApiApiKeys[CustomObjectsApiApiKeys["BearerToken"] = 0] = "BearerToken"; })(CustomObjectsApiApiKeys = exports.CustomObjectsApiApiKeys || (exports.CustomObjectsApiApiKeys = {})); class CustomObjectsApi { constructor(basePathOrUsername, password, basePath) { this._basePath = defaultBasePath; this.defaultHeaders = {}; this._useQuerystring = false; this.authentications = { 'default': new VoidAuth(), 'BearerToken': new ApiKeyAuth('header', 'authorization'), }; if (password) { if (basePath) { this.basePath = basePath; } } else { if (basePathOrUsername) { this.basePath = basePathOrUsername; } } } set useQuerystring(value) { this._useQuerystring = value; } set basePath(basePath) { this._basePath = basePath; } get basePath() { return this._basePath; } setDefaultAuthentication(auth) { this.authentications.default = auth; } setApiKey(key, value) { this.authentications[CustomObjectsApiApiKeys[key]].apiKey = value; } /** * Creates a cluster scoped Custom object * @param group The custom resource's group name * @param version The custom resource's version * @param plural The custom resource's plural name. For TPRs this would be lowercase plural kind. * @param body The JSON schema of the Resource to create. * @param pretty If 'true', then the output is pretty printed. * @param {*} [options] Override http request options. */ createClusterCustomObject(group, version, plural, body, pretty, options = {}) { const localVarPath = this.basePath + '/apis/{group}/{version}/{plural}' .replace('{' + 'group' + '}', encodeURIComponent(String(group))) .replace('{' + 'version' + '}', encodeURIComponent(String(version))) .replace('{' + 'plural' + '}', encodeURIComponent(String(plural))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; // verify required parameter 'group' is not null or undefined if (group === null || group === undefined) { throw new Error('Required parameter group was null or undefined when calling createClusterCustomObject.'); } // verify required parameter 'version' is not null or undefined if (version === null || version === undefined) { throw new Error('Required parameter version was null or undefined when calling createClusterCustomObject.'); } // verify required parameter 'plural' is not null or undefined if (plural === null || plural === undefined) { throw new Error('Required parameter plural was null or undefined when calling createClusterCustomObject.'); } // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling createClusterCustomObject.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'POST', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: ObjectSerializer.serialize(body, "any") }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "any"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * Creates a namespace scoped Custom object * @param group The custom resource's group name * @param version The custom resource's version * @param namespace The custom resource's namespace * @param plural The custom resource's plural name. For TPRs this would be lowercase plural kind. * @param body The JSON schema of the Resource to create. * @param pretty If 'true', then the output is pretty printed. * @param {*} [options] Override http request options. */ createNamespacedCustomObject(group, version, namespace, plural, body, pretty, options = {}) { const localVarPath = this.basePath + '/apis/{group}/{version}/namespaces/{namespace}/{plural}' .replace('{' + 'group' + '}', encodeURIComponent(String(group))) .replace('{' + 'version' + '}', encodeURIComponent(String(version))) .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))) .replace('{' + 'plural' + '}', encodeURIComponent(String(plural))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; // verify required parameter 'group' is not null or undefined if (group === null || group === undefined) { throw new Error('Required parameter group was null or undefined when calling createNamespacedCustomObject.'); } // verify required parameter 'version' is not null or undefined if (version === null || version === undefined) { throw new Error('Required parameter version was null or undefined when calling createNamespacedCustomObject.'); } // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling createNamespacedCustomObject.'); } // verify required parameter 'plural' is not null or undefined if (plural === null || plural === undefined) { throw new Error('Required parameter plural was null or undefined when calling createNamespacedCustomObject.'); } // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling createNamespacedCustomObject.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'POST', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: ObjectSerializer.serialize(body, "any") }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "any"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * Deletes the specified cluster scoped custom object * @param group the custom resource's group * @param version the custom resource's version * @param plural the custom object's plural name. For TPRs this would be lowercase plural kind. * @param name the custom object's name * @param body * @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. * @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. * @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. * @param {*} [options] Override http request options. */ deleteClusterCustomObject(group, version, plural, name, body, gracePeriodSeconds, orphanDependents, propagationPolicy, options = {}) { const localVarPath = this.basePath + '/apis/{group}/{version}/{plural}/{name}' .replace('{' + 'group' + '}', encodeURIComponent(String(group))) .replace('{' + 'version' + '}', encodeURIComponent(String(version))) .replace('{' + 'plural' + '}', encodeURIComponent(String(plural))) .replace('{' + 'name' + '}', encodeURIComponent(String(name))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; // verify required parameter 'group' is not null or undefined if (group === null || group === undefined) { throw new Error('Required parameter group was null or undefined when calling deleteClusterCustomObject.'); } // verify required parameter 'version' is not null or undefined if (version === null || version === undefined) { throw new Error('Required parameter version was null or undefined when calling deleteClusterCustomObject.'); } // verify required parameter 'plural' is not null or undefined if (plural === null || plural === undefined) { throw new Error('Required parameter plural was null or undefined when calling deleteClusterCustomObject.'); } // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling deleteClusterCustomObject.'); } // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling deleteClusterCustomObject.'); } if (gracePeriodSeconds !== undefined) { localVarQueryParameters['gracePeriodSeconds'] = ObjectSerializer.serialize(gracePeriodSeconds, "number"); } if (orphanDependents !== undefined) { localVarQueryParameters['orphanDependents'] = ObjectSerializer.serialize(orphanDependents, "boolean"); } if (propagationPolicy !== undefined) { localVarQueryParameters['propagationPolicy'] = ObjectSerializer.serialize(propagationPolicy, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'DELETE', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: ObjectSerializer.serialize(body, "V1DeleteOptions") }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "any"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * Deletes the specified namespace scoped custom object * @param group the custom resource's group * @param version the custom resource's version * @param namespace The custom resource's namespace * @param plural the custom resource's plural name. For TPRs this would be lowercase plural kind. * @param name the custom object's name * @param body * @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. * @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. * @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. * @param {*} [options] Override http request options. */ deleteNamespacedCustomObject(group, version, namespace, plural, name, body, gracePeriodSeconds, orphanDependents, propagationPolicy, options = {}) { const localVarPath = this.basePath + '/apis/{group}/{version}/namespaces/{namespace}/{plural}/{name}' .replace('{' + 'group' + '}', encodeURIComponent(String(group))) .replace('{' + 'version' + '}', encodeURIComponent(String(version))) .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))) .replace('{' + 'plural' + '}', encodeURIComponent(String(plural))) .replace('{' + 'name' + '}', encodeURIComponent(String(name))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; // verify required parameter 'group' is not null or undefined if (group === null || group === undefined) { throw new Error('Required parameter group was null or undefined when calling deleteNamespacedCustomObject.'); } // verify required parameter 'version' is not null or undefined if (version === null || version === undefined) { throw new Error('Required parameter version was null or undefined when calling deleteNamespacedCustomObject.'); } // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling deleteNamespacedCustomObject.'); } // verify required parameter 'plural' is not null or undefined if (plural === null || plural === undefined) { throw new Error('Required parameter plural was null or undefined when calling deleteNamespacedCustomObject.'); } // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling deleteNamespacedCustomObject.'); } // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling deleteNamespacedCustomObject.'); } if (gracePeriodSeconds !== undefined) { localVarQueryParameters['gracePeriodSeconds'] = ObjectSerializer.serialize(gracePeriodSeconds, "number"); } if (orphanDependents !== undefined) { localVarQueryParameters['orphanDependents'] = ObjectSerializer.serialize(orphanDependents, "boolean"); } if (propagationPolicy !== undefined) { localVarQueryParameters['propagationPolicy'] = ObjectSerializer.serialize(propagationPolicy, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'DELETE', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: ObjectSerializer.serialize(body, "V1DeleteOptions") }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "any"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * Returns a cluster scoped custom object * @param group the custom resource's group * @param version the custom resource's version * @param plural the custom object's plural name. For TPRs this would be lowercase plural kind. * @param name the custom object's name * @param {*} [options] Override http request options. */ getClusterCustomObject(group, version, plural, name, options = {}) { const localVarPath = this.basePath + '/apis/{group}/{version}/{plural}/{name}' .replace('{' + 'group' + '}', encodeURIComponent(String(group))) .replace('{' + 'version' + '}', encodeURIComponent(String(version))) .replace('{' + 'plural' + '}', encodeURIComponent(String(plural))) .replace('{' + 'name' + '}', encodeURIComponent(String(name))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; // verify required parameter 'group' is not null or undefined if (group === null || group === undefined) { throw new Error('Required parameter group was null or undefined when calling getClusterCustomObject.'); } // verify required parameter 'version' is not null or undefined if (version === null || version === undefined) { throw new Error('Required parameter version was null or undefined when calling getClusterCustomObject.'); } // verify required parameter 'plural' is not null or undefined if (plural === null || plural === undefined) { throw new Error('Required parameter plural was null or undefined when calling getClusterCustomObject.'); } // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling getClusterCustomObject.'); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'GET', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "any"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * read scale of the specified custom object * @param group the custom resource's group * @param version the custom resource's version * @param plural the custom resource's plural name. For TPRs this would be lowercase plural kind. * @param name the custom object's name * @param {*} [options] Override http request options. */ getClusterCustomObjectScale(group, version, plural, name, options = {}) { const localVarPath = this.basePath + '/apis/{group}/{version}/{plural}/{name}/scale' .replace('{' + 'group' + '}', encodeURIComponent(String(group))) .replace('{' + 'version' + '}', encodeURIComponent(String(version))) .replace('{' + 'plural' + '}', encodeURIComponent(String(plural))) .replace('{' + 'name' + '}', encodeURIComponent(String(name))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; // verify required parameter 'group' is not null or undefined if (group === null || group === undefined) { throw new Error('Required parameter group was null or undefined when calling getClusterCustomObjectScale.'); } // verify required parameter 'version' is not null or undefined if (version === null || version === undefined) { throw new Error('Required parameter version was null or undefined when calling getClusterCustomObjectScale.'); } // verify required parameter 'plural' is not null or undefined if (plural === null || plural === undefined) { throw new Error('Required parameter plural was null or undefined when calling getClusterCustomObjectScale.'); } // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling getClusterCustomObjectScale.'); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'GET', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "any"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * read status of the specified cluster scoped custom object * @param group the custom resource's group * @param version the custom resource's version * @param plural the custom resource's plural name. For TPRs this would be lowercase plural kind. * @param name the custom object's name * @param {*} [options] Override http request options. */ getClusterCustomObjectStatus(group, version, plural, name, options = {}) { const localVarPath = this.basePath + '/apis/{group}/{version}/{plural}/{name}/status' .replace('{' + 'group' + '}', encodeURIComponent(String(group))) .replace('{' + 'version' + '}', encodeURIComponent(String(version))) .replace('{' + 'plural' + '}', encodeURIComponent(String(plural))) .replace('{' + 'name' + '}', encodeURIComponent(String(name))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; // verify required parameter 'group' is not null or undefined if (group === null || group === undefined) { throw new Error('Required parameter group was null or undefined when calling getClusterCustomObjectStatus.'); } // verify required parameter 'version' is not null or undefined if (version === null || version === undefined) { throw new Error('Required parameter version was null or undefined when calling getClusterCustomObjectStatus.'); } // verify required parameter 'plural' is not null or undefined if (plural === null || plural === undefined) { throw new Error('Required parameter plural was null or undefined when calling getClusterCustomObjectStatus.'); } // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling getClusterCustomObjectStatus.'); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'GET', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "any"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * Returns a namespace scoped custom object * @param group the custom resource's group * @param version the custom resource's version * @param namespace The custom resource's namespace * @param plural the custom resource's plural name. For TPRs this would be lowercase plural kind. * @param name the custom object's name * @param {*} [options] Override http request options. */ getNamespacedCustomObject(group, version, namespace, plural, name, options = {}) { const localVarPath = this.basePath + '/apis/{group}/{version}/namespaces/{namespace}/{plural}/{name}' .replace('{' + 'group' + '}', encodeURIComponent(String(group))) .replace('{' + 'version' + '}', encodeURIComponent(String(version))) .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))) .replace('{' + 'plural' + '}', encodeURIComponent(String(plural))) .replace('{' + 'name' + '}', encodeURIComponent(String(name))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; // verify required parameter 'group' is not null or undefined if (group === null || group === undefined) { throw new Error('Required parameter group was null or undefined when calling getNamespacedCustomObject.'); } // verify required parameter 'version' is not null or undefined if (version === null || version === undefined) { throw new Error('Required parameter version was null or undefined when calling getNamespacedCustomObject.'); } // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling getNamespacedCustomObject.'); } // verify required parameter 'plural' is not null or undefined if (plural === null || plural === undefined) { throw new Error('Required parameter plural was null or undefined when calling getNamespacedCustomObject.'); } // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling getNamespacedCustomObject.'); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'GET', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "any"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * read scale of the specified namespace scoped custom object * @param group the custom resource's group * @param version the custom resource's version * @param namespace The custom resource's namespace * @param plural the custom resource's plural name. For TPRs this would be lowercase plural kind. * @param name the custom object's name * @param {*} [options] Override http request options. */ getNamespacedCustomObjectScale(group, version, namespace, plural, name, options = {}) { const localVarPath = this.basePath + '/apis/{group}/{version}/namespaces/{namespace}/{plural}/{name}/scale' .replace('{' + 'group' + '}', encodeURIComponent(String(group))) .replace('{' + 'version' + '}', encodeURIComponent(String(version))) .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))) .replace('{' + 'plural' + '}', encodeURIComponent(String(plural))) .replace('{' + 'name' + '}', encodeURIComponent(String(name))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; // verify required parameter 'group' is not null or undefined if (group === null || group === undefined) { throw new Error('Required parameter group was null or undefined when calling getNamespacedCustomObjectScale.'); } // verify required parameter 'version' is not null or undefined if (version === null || version === undefined) { throw new Error('Required parameter version was null or undefined when calling getNamespacedCustomObjectScale.'); } // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling getNamespacedCustomObjectScale.'); } // verify required parameter 'plural' is not null or undefined if (plural === null || plural === undefined) { throw new Error('Required parameter plural was null or undefined when calling getNamespacedCustomObjectScale.'); } // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling getNamespacedCustomObjectScale.'); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'GET', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "any"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * read status of the specified namespace scoped custom object * @param group the custom resource's group * @param version the custom resource's version * @param namespace The custom resource's namespace * @param plural the custom resource's plural name. For TPRs this would be lowercase plural kind. * @param name the custom object's name * @param {*} [options] Override http request options. */ getNamespacedCustomObjectStatus(group, version, namespace, plural, name, options = {}) { const localVarPath = this.basePath + '/apis/{group}/{version}/namespaces/{namespace}/{plural}/{name}/status' .replace('{' + 'group' + '}', encodeURIComponent(String(group))) .replace('{' + 'version' + '}', encodeURIComponent(String(version))) .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))) .replace('{' + 'plural' + '}', encodeURIComponent(String(plural))) .replace('{' + 'name' + '}', encodeURIComponent(String(name))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; // verify required parameter 'group' is not null or undefined if (group === null || group === undefined) { throw new Error('Required parameter group was null or undefined when calling getNamespacedCustomObjectStatus.'); } // verify required parameter 'version' is not null or undefined if (version === null || version === undefined) { throw new Error('Required parameter version was null or undefined when calling getNamespacedCustomObjectStatus.'); } // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling getNamespacedCustomObjectStatus.'); } // verify required parameter 'plural' is not null or undefined if (plural === null || plural === undefined) { throw new Error('Required parameter plural was null or undefined when calling getNamespacedCustomObjectStatus.'); } // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling getNamespacedCustomObjectStatus.'); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'GET', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "any"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * list or watch cluster scoped custom objects * @param group The custom resource's group name * @param version The custom resource's version * @param plural The custom resource's plural name. For TPRs this would be lowercase plural kind. * @param pretty If 'true', then the output is pretty printed. * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything. * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything. * @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. * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. * @param watch Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. * @param {*} [options] Override http request options. */ listClusterCustomObject(group, version, plural, pretty, fieldSelector, labelSelector, resourceVersion, timeoutSeconds, watch, options = {}) { const localVarPath = this.basePath + '/apis/{group}/{version}/{plural}' .replace('{' + 'group' + '}', encodeURIComponent(String(group))) .replace('{' + 'version' + '}', encodeURIComponent(String(version))) .replace('{' + 'plural' + '}', encodeURIComponent(String(plural))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; // verify required parameter 'group' is not null or undefined if (group === null || group === undefined) { throw new Error('Required parameter group was null or undefined when calling listClusterCustomObject.'); } // verify required parameter 'version' is not null or undefined if (version === null || version === undefined) { throw new Error('Required parameter version was null or undefined when calling listClusterCustomObject.'); } // verify required parameter 'plural' is not null or undefined if (plural === null || plural === undefined) { throw new Error('Required parameter plural was null or undefined when calling listClusterCustomObject.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, "string"); } if (fieldSelector !== undefined) { localVarQueryParameters['fieldSelector'] = ObjectSerializer.serialize(fieldSelector, "string"); } if (labelSelector !== undefined) { localVarQueryParameters['labelSelector'] = ObjectSerializer.serialize(labelSelector, "string"); } if (resourceVersion !== undefined) { localVarQueryParameters['resourceVersion'] = ObjectSerializer.serialize(resourceVersion, "string"); } if (timeoutSeconds !== undefined) { localVarQueryParameters['timeoutSeconds'] = ObjectSerializer.serialize(timeoutSeconds, "number"); } if (watch !== undefined) { localVarQueryParameters['watch'] = ObjectSerializer.serialize(watch, "boolean"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'GET', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "any"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * list or watch namespace scoped custom objects * @param group The custom resource's group name * @param version The custom resource's version * @param namespace The custom resource's namespace * @param plural The custom resource's plural name. For TPRs this would be lowercase plural kind. * @param pretty If 'true', then the output is pretty printed. * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything. * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything. * @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. * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. * @param watch Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. * @param {*} [options] Override http request options. */ listNamespacedCustomObject(group, version, namespace, plural, pretty, fieldSelector, labelSelector, resourceVersion, timeoutSeconds, watch, options = {}) { const localVarPath = this.basePath + '/apis/{group}/{version}/namespaces/{namespace}/{plural}' .replace('{' + 'group' + '}', encodeURIComponent(String(group))) .replace('{' + 'version' + '}', encodeURIComponent(String(version))) .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))) .replace('{' + 'plural' + '}', encodeURIComponent(String(plural))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; // verify required parameter 'group' is not null or undefined if (group === null || group === undefined) { throw new Error('Required parameter group was null or undefined when calling listNamespacedCustomObject.'); } // verify required parameter 'version' is not null or undefined if (version === null || version === undefined) { throw new Error('Required parameter version was null or undefined when calling listNamespacedCustomObject.'); } // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling listNamespacedCustomObject.'); } // verify required parameter 'plural' is not null or undefined if (plural === null || plural === undefined) { throw new Error('Required parameter plural was null or undefined when calling listNamespacedCustomObject.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, "string"); } if (fieldSelector !== undefined) { localVarQueryParameters['fieldSelector'] = ObjectSerializer.serialize(fieldSelector, "string"); } if (labelSelector !== undefined) { localVarQueryParameters['labelSelector'] = ObjectSerializer.serialize(labelSelector, "string"); } if (resourceVersion !== undefined) { localVarQueryParameters['resourceVersion'] = ObjectSerializer.serialize(resourceVersion, "string"); } if (timeoutSeconds !== undefined) { localVarQueryParameters['timeoutSeconds'] = ObjectSerializer.serialize(timeoutSeconds, "number"); } if (watch !== undefined) { localVarQueryParameters['watch'] = ObjectSerializer.serialize(watch, "boolean"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'GET', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "any"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * patch the specified cluster scoped custom object * @param group the custom resource's group * @param version the custom resource's version * @param plural the custom object's plural name. For TPRs this would be lowercase plural kind. * @param name the custom object's name * @param body The JSON schema of the Resource to patch. * @param {*} [options] Override http request options. */ patchClusterCustomObject(group, version, plural, name, body, options = {}) { const localVarPath = this.basePath + '/apis/{group}/{version}/{plural}/{name}' .replace('{' + 'group' + '}', encodeURIComponent(String(group))) .replace('{' + 'version' + '}', encodeURIComponent(String(version))) .replace('{' + 'plural' + '}', encodeURIComponent(String(plural))) .replace('{' + 'name' + '}', encodeURIComponent(String(name))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; // verify required parameter 'group' is not null or undefined if (group === null || group === undefined) { throw new Error('Required parameter group was null or undefined when calling patchClusterCustomObject.'); } // verify required parameter 'version' is not null or undefined if (version === null || version === undefined) { throw new Error('Required parameter version was null or undefined when calling patchClusterCustomObject.'); } // verify required parameter 'plural' is not null or undefined if (plural === null || plural === undefined) { throw new Error('Required parameter plural was null or undefined when calling patchClusterCustomObject.'); } // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling patchClusterCustomObject.'); } // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling patchClusterCustomObject.'); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'PATCH', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: ObjectSerializer.serialize(body, "any") }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "any"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * partially update scale of the specified cluster scoped custom object * @param group the custom resource's group * @param version the custom resource's version * @param plural the custom resource's plural name. For TPRs this would be lowercase plural kind. * @param name the custom object's name * @param body * @param {*} [options] Override http request options. */ patchClusterCustomObjectScale(group, version, plural, name, body, options = {}) { const localVarPath = this.basePath + '/apis/{group}/{version}/{plural}/{name}/scale' .replace('{' + 'group' + '}', encodeURIComponent(String(group))) .replace('{' + 'version' + '}', encodeURIComponent(String(version))) .replace('{' + 'plural' + '}', encodeURIComponent(String(plural))) .replace('{' + 'name' + '}', encodeURIComponent(String(name))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; // verify required parameter 'group' is not null or undefined if (group === null || group === undefined) { throw new Error('Required parameter group was null or undefined when calling patchClusterCustomObjectScale.'); } // verify required parameter 'version' is not null or undefined if (version === null || version === undefined) { throw new Error('Required parameter version was null or undefined when calling patchClusterCustomObjectScale.'); } // verify required parameter 'plural' is not null or undefined if (plural === null || plural === undefined) { throw new Error('Required parameter plural was null or undefined when calling patchClusterCustomObjectScale.'); } // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling patchClusterCustomObjectScale.'); } // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling patchClusterCustomObjectScale.'); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'PATCH', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: ObjectSerializer.serialize(body, "any") }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "any"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * partially update status of the specified cluster scoped custom object * @param group the custom resource's group * @param version the custom resource's version * @param plural the custom resource's plural name. For TPRs this would be lowercase plural kind. * @param name the custom object's name * @param body * @param {*} [options] Override http request options. */ patchClusterCustomObjectStatus(group, version, plural, name, body, options = {}) { const localVarPath = this.basePath + '/apis/{group}/{version}/{plural}/{name}/status' .replace('{' + 'group' + '}', encodeURIComponent(String(group))) .replace('{' + 'version' + '}', encodeURIComponent(String(version))) .replace('{' + 'plural' + '}', encodeURIComponent(String(plural))) .replace('{' + 'name' + '}', encodeURIComponent(String(name))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; // verify required parameter 'group' is not null or undefined if (group === null || group === undefined) { throw new Error('Required parameter group was null or undefined when calling patchClusterCustomObjectStatus.'); } // verify required parameter 'version' is not null or undefined if (version === null || version === undefined) { throw new Error('Required parameter version was null or undefined when calling patchClusterCustomObjectStatus.'); } // verify required parameter 'plural' is not null or undefined if (plural === null || plural === undefined) { throw new Error('Required parameter plural was null or undefined when calling patchClusterCustomObjectStatus.'); } // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling patchClusterCustomObjectStatus.'); } // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling patchClusterCustomObjectStatus.'); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'PATCH', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: ObjectSerializer.serialize(body, "any") }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "any"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * patch the specified namespace scoped custom object * @param group the custom resource's group * @param version the custom resource's version * @param namespace The custom resource's namespace * @param plural the custom resource's plural name. For TPRs this would be lowercase plural kind. * @param name the custom object's name * @param body The JSON schema of the Resource to patch. * @param {*} [options] Override http request options. */ patchNamespacedCustomObject(group, version, namespace, plural, name, body, options = {}) { const localVarPath = this.basePath + '/apis/{group}/{version}/namespaces/{namespace}/{plural}/{name}' .replace('{' + 'group' + '}', encodeURIComponent(String(group))) .replace('{' + 'version' + '}', encodeURIComponent(String(version))) .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))) .replace('{' + 'plural' + '}', encodeURIComponent(String(plural))) .replace('{' + 'name' + '}', encodeURIComponent(String(name))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; // verify required parameter 'group' is not null or undefined if (group === null || group === undefined) { throw new Error('Required parameter group was null or undefined when calling patchNamespacedCustomObject.'); } // verify required parameter 'version' is not null or undefined if (version === null || version === undefined) { throw new Error('Required parameter version was null or undefined when calling patchNamespacedCustomObject.'); } // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling patchNamespacedCustomObject.'); } // verify required parameter 'plural' is not null or undefined if (plural === null || plural === undefined) { throw new Error('Required parameter plural was null or undefined when calling patchNamespacedCustomObject.'); } // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling patchNamespacedCustomObject.'); } // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling patchNamespacedCustomObject.'); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'PATCH', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: ObjectSerializer.serialize(body, "any") }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "any"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * partially update scale of the specified namespace scoped custom object * @param group the custom resource's group * @param version the custom resource's version * @param namespace The custom resource's namespace * @param plural the custom resource's plural name. For TPRs this would be lowercase plural kind. * @param name the custom object's name * @param body * @param {*} [options] Override http request options. */ patchNamespacedCustomObjectScale(group, version, namespace, plural, name, body, options = {}) { const localVarPath = this.basePath + '/apis/{group}/{version}/namespaces/{namespace}/{plural}/{name}/scale' .replace('{' + 'group' + '}', encodeURIComponent(String(group))) .replace('{' + 'version' + '}', encodeURIComponent(String(version))) .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))) .replace('{' + 'plural' + '}', encodeURIComponent(String(plural))) .replace('{' + 'name' + '}', encodeURIComponent(String(name))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; // verify required parameter 'group' is not null or undefined if (group === null || group === undefined) { throw new Error('Required parameter group was null or undefined when calling patchNamespacedCustomObjectScale.'); } // verify required parameter 'version' is not null or undefined if (version === null || version === undefined) { throw new Error('Required parameter version was null or undefined when calling patchNamespacedCustomObjectScale.'); } // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling patchNamespacedCustomObjectScale.'); } // verify required parameter 'plural' is not null or undefined if (plural === null || plural === undefined) { throw new Error('Required parameter plural was null or undefined when calling patchNamespacedCustomObjectScale.'); } // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling patchNamespacedCustomObjectScale.'); } // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling patchNamespacedCustomObjectScale.'); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'PATCH', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: ObjectSerializer.serialize(body, "any") }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "any"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * partially update status of the specified namespace scoped custom object * @param group the custom resource's group * @param version the custom resource's version * @param namespace The custom resource's namespace * @param plural the custom resource's plural name. For TPRs this would be lowercase plural kind. * @param name the custom object's name * @param body * @param {*} [options] Override http request options. */ patchNamespacedCustomObjectStatus(group, version, namespace, plural, name, body, options = {}) { const localVarPath = this.basePath + '/apis/{group}/{version}/namespaces/{namespace}/{plural}/{name}/status' .replace('{' + 'group' + '}', encodeURIComponent(String(group))) .replace('{' + 'version' + '}', encodeURIComponent(String(version))) .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))) .replace('{' + 'plural' + '}', encodeURIComponent(String(plural))) .replace('{' + 'name' + '}', encodeURIComponent(String(name))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; // verify required parameter 'group' is not null or undefined if (group === null || group === undefined) { throw new Error('Required parameter group was null or undefined when calling patchNamespacedCustomObjectStatus.'); } // verify required parameter 'version' is not null or undefined if (version === null || version === undefined) { throw new Error('Required parameter version was null or undefined when calling patchNamespacedCustomObjectStatus.'); } // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling patchNamespacedCustomObjectStatus.'); } // verify required parameter 'plural' is not null or undefined if (plural === null || plural === undefined) { throw new Error('Required parameter plural was null or undefined when calling patchNamespacedCustomObjectStatus.'); } // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling patchNamespacedCustomObjectStatus.'); } // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling patchNamespacedCustomObjectStatus.'); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'PATCH', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: ObjectSerializer.serialize(body, "any") }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "any"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * replace the specified cluster scoped custom object * @param group the custom resource's group * @param version the custom resource's version * @param plural the custom object's plural name. For TPRs this would be lowercase plural kind. * @param name the custom object's name * @param body The JSON schema of the Resource to replace. * @param {*} [options] Override http request options. */ replaceClusterCustomObject(group, version, plural, name, body, options = {}) { const localVarPath = this.basePath + '/apis/{group}/{version}/{plural}/{name}' .replace('{' + 'group' + '}', encodeURIComponent(String(group))) .replace('{' + 'version' + '}', encodeURIComponent(String(version))) .replace('{' + 'plural' + '}', encodeURIComponent(String(plural))) .replace('{' + 'name' + '}', encodeURIComponent(String(name))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; // verify required parameter 'group' is not null or undefined if (group === null || group === undefined) { throw new Error('Required parameter group was null or undefined when calling replaceClusterCustomObject.'); } // verify required parameter 'version' is not null or undefined if (version === null || version === undefined) { throw new Error('Required parameter version was null or undefined when calling replaceClusterCustomObject.'); } // verify required parameter 'plural' is not null or undefined if (plural === null || plural === undefined) { throw new Error('Required parameter plural was null or undefined when calling replaceClusterCustomObject.'); } // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling replaceClusterCustomObject.'); } // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling replaceClusterCustomObject.'); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'PUT', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: ObjectSerializer.serialize(body, "any") }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "any"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * replace scale of the specified cluster scoped custom object * @param group the custom resource's group * @param version the custom resource's version * @param plural the custom resource's plural name. For TPRs this would be lowercase plural kind. * @param name the custom object's name * @param body * @param {*} [options] Override http request options. */ replaceClusterCustomObjectScale(group, version, plural, name, body, options = {}) { const localVarPath = this.basePath + '/apis/{group}/{version}/{plural}/{name}/scale' .replace('{' + 'group' + '}', encodeURIComponent(String(group))) .replace('{' + 'version' + '}', encodeURIComponent(String(version))) .replace('{' + 'plural' + '}', encodeURIComponent(String(plural))) .replace('{' + 'name' + '}', encodeURIComponent(String(name))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; // verify required parameter 'group' is not null or undefined if (group === null || group === undefined) { throw new Error('Required parameter group was null or undefined when calling replaceClusterCustomObjectScale.'); } // verify required parameter 'version' is not null or undefined if (version === null || version === undefined) { throw new Error('Required parameter version was null or undefined when calling replaceClusterCustomObjectScale.'); } // verify required parameter 'plural' is not null or undefined if (plural === null || plural === undefined) { throw new Error('Required parameter plural was null or undefined when calling replaceClusterCustomObjectScale.'); } // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling replaceClusterCustomObjectScale.'); } // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling replaceClusterCustomObjectScale.'); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'PUT', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: ObjectSerializer.serialize(body, "any") }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "any"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * replace status of the cluster scoped specified custom object * @param group the custom resource's group * @param version the custom resource's version * @param plural the custom resource's plural name. For TPRs this would be lowercase plural kind. * @param name the custom object's name * @param body * @param {*} [options] Override http request options. */ replaceClusterCustomObjectStatus(group, version, plural, name, body, options = {}) { const localVarPath = this.basePath + '/apis/{group}/{version}/{plural}/{name}/status' .replace('{' + 'group' + '}', encodeURIComponent(String(group))) .replace('{' + 'version' + '}', encodeURIComponent(String(version))) .replace('{' + 'plural' + '}', encodeURIComponent(String(plural))) .replace('{' + 'name' + '}', encodeURIComponent(String(name))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; // verify required parameter 'group' is not null or undefined if (group === null || group === undefined) { throw new Error('Required parameter group was null or undefined when calling replaceClusterCustomObjectStatus.'); } // verify required parameter 'version' is not null or undefined if (version === null || version === undefined) { throw new Error('Required parameter version was null or undefined when calling replaceClusterCustomObjectStatus.'); } // verify required parameter 'plural' is not null or undefined if (plural === null || plural === undefined) { throw new Error('Required parameter plural was null or undefined when calling replaceClusterCustomObjectStatus.'); } // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling replaceClusterCustomObjectStatus.'); } // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling replaceClusterCustomObjectStatus.'); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'PUT', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: ObjectSerializer.serialize(body, "any") }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "any"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * replace the specified namespace scoped custom object * @param group the custom resource's group * @param version the custom resource's version * @param namespace The custom resource's namespace * @param plural the custom resource's plural name. For TPRs this would be lowercase plural kind. * @param name the custom object's name * @param body The JSON schema of the Resource to replace. * @param {*} [options] Override http request options. */ replaceNamespacedCustomObject(group, version, namespace, plural, name, body, options = {}) { const localVarPath = this.basePath + '/apis/{group}/{version}/namespaces/{namespace}/{plural}/{name}' .replace('{' + 'group' + '}', encodeURIComponent(String(group))) .replace('{' + 'version' + '}', encodeURIComponent(String(version))) .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))) .replace('{' + 'plural' + '}', encodeURIComponent(String(plural))) .replace('{' + 'name' + '}', encodeURIComponent(String(name))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; // verify required parameter 'group' is not null or undefined if (group === null || group === undefined) { throw new Error('Required parameter group was null or undefined when calling replaceNamespacedCustomObject.'); } // verify required parameter 'version' is not null or undefined if (version === null || version === undefined) { throw new Error('Required parameter version was null or undefined when calling replaceNamespacedCustomObject.'); } // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling replaceNamespacedCustomObject.'); } // verify required parameter 'plural' is not null or undefined if (plural === null || plural === undefined) { throw new Error('Required parameter plural was null or undefined when calling replaceNamespacedCustomObject.'); } // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling replaceNamespacedCustomObject.'); } // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling replaceNamespacedCustomObject.'); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'PUT', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: ObjectSerializer.serialize(body, "any") }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "any"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * replace scale of the specified namespace scoped custom object * @param group the custom resource's group * @param version the custom resource's version * @param namespace The custom resource's namespace * @param plural the custom resource's plural name. For TPRs this would be lowercase plural kind. * @param name the custom object's name * @param body * @param {*} [options] Override http request options. */ replaceNamespacedCustomObjectScale(group, version, namespace, plural, name, body, options = {}) { const localVarPath = this.basePath + '/apis/{group}/{version}/namespaces/{namespace}/{plural}/{name}/scale' .replace('{' + 'group' + '}', encodeURIComponent(String(group))) .replace('{' + 'version' + '}', encodeURIComponent(String(version))) .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))) .replace('{' + 'plural' + '}', encodeURIComponent(String(plural))) .replace('{' + 'name' + '}', encodeURIComponent(String(name))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; // verify required parameter 'group' is not null or undefined if (group === null || group === undefined) { throw new Error('Required parameter group was null or undefined when calling replaceNamespacedCustomObjectScale.'); } // verify required parameter 'version' is not null or undefined if (version === null || version === undefined) { throw new Error('Required parameter version was null or undefined when calling replaceNamespacedCustomObjectScale.'); } // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling replaceNamespacedCustomObjectScale.'); } // verify required parameter 'plural' is not null or undefined if (plural === null || plural === undefined) { throw new Error('Required parameter plural was null or undefined when calling replaceNamespacedCustomObjectScale.'); } // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling replaceNamespacedCustomObjectScale.'); } // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling replaceNamespacedCustomObjectScale.'); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'PUT', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: ObjectSerializer.serialize(body, "any") }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "any"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * replace status of the specified namespace scoped custom object * @param group the custom resource's group * @param version the custom resource's version * @param namespace The custom resource's namespace * @param plural the custom resource's plural name. For TPRs this would be lowercase plural kind. * @param name the custom object's name * @param body * @param {*} [options] Override http request options. */ replaceNamespacedCustomObjectStatus(group, version, namespace, plural, name, body, options = {}) { const localVarPath = this.basePath + '/apis/{group}/{version}/namespaces/{namespace}/{plural}/{name}/status' .replace('{' + 'group' + '}', encodeURIComponent(String(group))) .replace('{' + 'version' + '}', encodeURIComponent(String(version))) .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))) .replace('{' + 'plural' + '}', encodeURIComponent(String(plural))) .replace('{' + 'name' + '}', encodeURIComponent(String(name))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; // verify required parameter 'group' is not null or undefined if (group === null || group === undefined) { throw new Error('Required parameter group was null or undefined when calling replaceNamespacedCustomObjectStatus.'); } // verify required parameter 'version' is not null or undefined if (version === null || version === undefined) { throw new Error('Required parameter version was null or undefined when calling replaceNamespacedCustomObjectStatus.'); } // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling replaceNamespacedCustomObjectStatus.'); } // verify required parameter 'plural' is not null or undefined if (plural === null || plural === undefined) { throw new Error('Required parameter plural was null or undefined when calling replaceNamespacedCustomObjectStatus.'); } // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling replaceNamespacedCustomObjectStatus.'); } // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling replaceNamespacedCustomObjectStatus.'); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'PUT', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: ObjectSerializer.serialize(body, "any") }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "any"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } } exports.CustomObjectsApi = CustomObjectsApi; var EventsApiApiKeys; (function (EventsApiApiKeys) { EventsApiApiKeys[EventsApiApiKeys["BearerToken"] = 0] = "BearerToken"; })(EventsApiApiKeys = exports.EventsApiApiKeys || (exports.EventsApiApiKeys = {})); class EventsApi { constructor(basePathOrUsername, password, basePath) { this._basePath = defaultBasePath; this.defaultHeaders = {}; this._useQuerystring = false; this.authentications = { 'default': new VoidAuth(), 'BearerToken': new ApiKeyAuth('header', 'authorization'), }; if (password) { if (basePath) { this.basePath = basePath; } } else { if (basePathOrUsername) { this.basePath = basePathOrUsername; } } } set useQuerystring(value) { this._useQuerystring = value; } set basePath(basePath) { this._basePath = basePath; } get basePath() { return this._basePath; } setDefaultAuthentication(auth) { this.authentications.default = auth; } setApiKey(key, value) { this.authentications[EventsApiApiKeys[key]].apiKey = value; } /** * get information of a group * @param {*} [options] Override http request options. */ getAPIGroup(options = {}) { const localVarPath = this.basePath + '/apis/events.k8s.io/'; let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'GET', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "V1APIGroup"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } } exports.EventsApi = EventsApi; var EventsV1beta1ApiApiKeys; (function (EventsV1beta1ApiApiKeys) { EventsV1beta1ApiApiKeys[EventsV1beta1ApiApiKeys["BearerToken"] = 0] = "BearerToken"; })(EventsV1beta1ApiApiKeys = exports.EventsV1beta1ApiApiKeys || (exports.EventsV1beta1ApiApiKeys = {})); class EventsV1beta1Api { constructor(basePathOrUsername, password, basePath) { this._basePath = defaultBasePath; this.defaultHeaders = {}; this._useQuerystring = false; this.authentications = { 'default': new VoidAuth(), 'BearerToken': new ApiKeyAuth('header', 'authorization'), }; if (password) { if (basePath) { this.basePath = basePath; } } else { if (basePathOrUsername) { this.basePath = basePathOrUsername; } } } set useQuerystring(value) { this._useQuerystring = value; } set basePath(basePath) { this._basePath = basePath; } get basePath() { return this._basePath; } setDefaultAuthentication(auth) { this.authentications.default = auth; } setApiKey(key, value) { this.authentications[EventsV1beta1ApiApiKeys[key]].apiKey = value; } /** * create an Event * @param namespace object name and auth scope, such as for teams and projects * @param body * @param includeUninitialized If true, partially initialized resources are included in the response. * @param pretty If 'true', then the output is pretty printed. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param {*} [options] Override http request options. */ createNamespacedEvent(namespace, body, includeUninitialized, pretty, dryRun, options = {}) { const localVarPath = this.basePath + '/apis/events.k8s.io/v1beta1/namespaces/{namespace}/events' .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling createNamespacedEvent.'); } // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling createNamespacedEvent.'); } if (includeUninitialized !== undefined) { localVarQueryParameters['includeUninitialized'] = ObjectSerializer.serialize(includeUninitialized, "boolean"); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'POST', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: ObjectSerializer.serialize(body, "V1beta1Event") }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "V1beta1Event"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * delete collection of Event * @param namespace object name and auth scope, such as for teams and projects * @param includeUninitialized If true, partially initialized resources are included in the response. * @param pretty If 'true', then the output is pretty printed. * @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. * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything. * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything. * @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. * @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. * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. * @param watch Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion. * @param {*} [options] Override http request options. */ deleteCollectionNamespacedEvent(namespace, includeUninitialized, pretty, _continue, fieldSelector, labelSelector, limit, resourceVersion, timeoutSeconds, watch, options = {}) { const localVarPath = this.basePath + '/apis/events.k8s.io/v1beta1/namespaces/{namespace}/events' .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling deleteCollectionNamespacedEvent.'); } if (includeUninitialized !== undefined) { localVarQueryParameters['includeUninitialized'] = ObjectSerializer.serialize(includeUninitialized, "boolean"); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, "string"); } if (_continue !== undefined) { localVarQueryParameters['continue'] = ObjectSerializer.serialize(_continue, "string"); } if (fieldSelector !== undefined) { localVarQueryParameters['fieldSelector'] = ObjectSerializer.serialize(fieldSelector, "string"); } if (labelSelector !== undefined) { localVarQueryParameters['labelSelector'] = ObjectSerializer.serialize(labelSelector, "string"); } if (limit !== undefined) { localVarQueryParameters['limit'] = ObjectSerializer.serialize(limit, "number"); } if (resourceVersion !== undefined) { localVarQueryParameters['resourceVersion'] = ObjectSerializer.serialize(resourceVersion, "string"); } if (timeoutSeconds !== undefined) { localVarQueryParameters['timeoutSeconds'] = ObjectSerializer.serialize(timeoutSeconds, "number"); } if (watch !== undefined) { localVarQueryParameters['watch'] = ObjectSerializer.serialize(watch, "boolean"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'DELETE', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "V1Status"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * delete an Event * @param name name of the Event * @param namespace object name and auth scope, such as for teams and projects * @param pretty If 'true', then the output is pretty printed. * @param body * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @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. * @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. * @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. * @param {*} [options] Override http request options. */ deleteNamespacedEvent(name, namespace, pretty, body, dryRun, gracePeriodSeconds, orphanDependents, propagationPolicy, options = {}) { const localVarPath = this.basePath + '/apis/events.k8s.io/v1beta1/namespaces/{namespace}/events/{name}' .replace('{' + 'name' + '}', encodeURIComponent(String(name))) .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling deleteNamespacedEvent.'); } // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling deleteNamespacedEvent.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, "string"); } if (gracePeriodSeconds !== undefined) { localVarQueryParameters['gracePeriodSeconds'] = ObjectSerializer.serialize(gracePeriodSeconds, "number"); } if (orphanDependents !== undefined) { localVarQueryParameters['orphanDependents'] = ObjectSerializer.serialize(orphanDependents, "boolean"); } if (propagationPolicy !== undefined) { localVarQueryParameters['propagationPolicy'] = ObjectSerializer.serialize(propagationPolicy, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'DELETE', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: ObjectSerializer.serialize(body, "V1DeleteOptions") }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "V1Status"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * get available resources * @param {*} [options] Override http request options. */ getAPIResources(options = {}) { const localVarPath = this.basePath + '/apis/events.k8s.io/v1beta1/'; let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'GET', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "V1APIResourceList"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * list or watch objects of kind Event * @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. * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything. * @param includeUninitialized If true, partially initialized resources are included in the response. * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything. * @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. * @param pretty If 'true', then the output is pretty printed. * @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. * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. * @param watch Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion. * @param {*} [options] Override http request options. */ listEventForAllNamespaces(_continue, fieldSelector, includeUninitialized, labelSelector, limit, pretty, resourceVersion, timeoutSeconds, watch, options = {}) { const localVarPath = this.basePath + '/apis/events.k8s.io/v1beta1/events'; let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; if (_continue !== undefined) { localVarQueryParameters['continue'] = ObjectSerializer.serialize(_continue, "string"); } if (fieldSelector !== undefined) { localVarQueryParameters['fieldSelector'] = ObjectSerializer.serialize(fieldSelector, "string"); } if (includeUninitialized !== undefined) { localVarQueryParameters['includeUninitialized'] = ObjectSerializer.serialize(includeUninitialized, "boolean"); } if (labelSelector !== undefined) { localVarQueryParameters['labelSelector'] = ObjectSerializer.serialize(labelSelector, "string"); } if (limit !== undefined) { localVarQueryParameters['limit'] = ObjectSerializer.serialize(limit, "number"); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, "string"); } if (resourceVersion !== undefined) { localVarQueryParameters['resourceVersion'] = ObjectSerializer.serialize(resourceVersion, "string"); } if (timeoutSeconds !== undefined) { localVarQueryParameters['timeoutSeconds'] = ObjectSerializer.serialize(timeoutSeconds, "number"); } if (watch !== undefined) { localVarQueryParameters['watch'] = ObjectSerializer.serialize(watch, "boolean"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'GET', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "V1beta1EventList"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * list or watch objects of kind Event * @param namespace object name and auth scope, such as for teams and projects * @param includeUninitialized If true, partially initialized resources are included in the response. * @param pretty If 'true', then the output is pretty printed. * @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. * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything. * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything. * @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. * @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. * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. * @param watch Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion. * @param {*} [options] Override http request options. */ listNamespacedEvent(namespace, includeUninitialized, pretty, _continue, fieldSelector, labelSelector, limit, resourceVersion, timeoutSeconds, watch, options = {}) { const localVarPath = this.basePath + '/apis/events.k8s.io/v1beta1/namespaces/{namespace}/events' .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling listNamespacedEvent.'); } if (includeUninitialized !== undefined) { localVarQueryParameters['includeUninitialized'] = ObjectSerializer.serialize(includeUninitialized, "boolean"); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, "string"); } if (_continue !== undefined) { localVarQueryParameters['continue'] = ObjectSerializer.serialize(_continue, "string"); } if (fieldSelector !== undefined) { localVarQueryParameters['fieldSelector'] = ObjectSerializer.serialize(fieldSelector, "string"); } if (labelSelector !== undefined) { localVarQueryParameters['labelSelector'] = ObjectSerializer.serialize(labelSelector, "string"); } if (limit !== undefined) { localVarQueryParameters['limit'] = ObjectSerializer.serialize(limit, "number"); } if (resourceVersion !== undefined) { localVarQueryParameters['resourceVersion'] = ObjectSerializer.serialize(resourceVersion, "string"); } if (timeoutSeconds !== undefined) { localVarQueryParameters['timeoutSeconds'] = ObjectSerializer.serialize(timeoutSeconds, "number"); } if (watch !== undefined) { localVarQueryParameters['watch'] = ObjectSerializer.serialize(watch, "boolean"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'GET', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "V1beta1EventList"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * partially update the specified Event * @param name name of the Event * @param namespace object name and auth scope, such as for teams and projects * @param body * @param pretty If 'true', then the output is pretty printed. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param {*} [options] Override http request options. */ patchNamespacedEvent(name, namespace, body, pretty, dryRun, options = {}) { const localVarPath = this.basePath + '/apis/events.k8s.io/v1beta1/namespaces/{namespace}/events/{name}' .replace('{' + 'name' + '}', encodeURIComponent(String(name))) .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling patchNamespacedEvent.'); } // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling patchNamespacedEvent.'); } // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling patchNamespacedEvent.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'PATCH', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: ObjectSerializer.serialize(body, "any") }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "V1beta1Event"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * read the specified Event * @param name name of the Event * @param namespace object name and auth scope, such as for teams and projects * @param pretty If 'true', then the output is pretty printed. * @param exact Should the export be exact. Exact export maintains cluster-specific fields like 'Namespace'. * @param _export Should this value be exported. Export strips fields that a user can not specify. * @param {*} [options] Override http request options. */ readNamespacedEvent(name, namespace, pretty, exact, _export, options = {}) { const localVarPath = this.basePath + '/apis/events.k8s.io/v1beta1/namespaces/{namespace}/events/{name}' .replace('{' + 'name' + '}', encodeURIComponent(String(name))) .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling readNamespacedEvent.'); } // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling readNamespacedEvent.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, "string"); } if (exact !== undefined) { localVarQueryParameters['exact'] = ObjectSerializer.serialize(exact, "boolean"); } if (_export !== undefined) { localVarQueryParameters['export'] = ObjectSerializer.serialize(_export, "boolean"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'GET', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "V1beta1Event"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * replace the specified Event * @param name name of the Event * @param namespace object name and auth scope, such as for teams and projects * @param body * @param pretty If 'true', then the output is pretty printed. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param {*} [options] Override http request options. */ replaceNamespacedEvent(name, namespace, body, pretty, dryRun, options = {}) { const localVarPath = this.basePath + '/apis/events.k8s.io/v1beta1/namespaces/{namespace}/events/{name}' .replace('{' + 'name' + '}', encodeURIComponent(String(name))) .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling replaceNamespacedEvent.'); } // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling replaceNamespacedEvent.'); } // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling replaceNamespacedEvent.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'PUT', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: ObjectSerializer.serialize(body, "V1beta1Event") }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "V1beta1Event"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } } exports.EventsV1beta1Api = EventsV1beta1Api; var ExtensionsApiApiKeys; (function (ExtensionsApiApiKeys) { ExtensionsApiApiKeys[ExtensionsApiApiKeys["BearerToken"] = 0] = "BearerToken"; })(ExtensionsApiApiKeys = exports.ExtensionsApiApiKeys || (exports.ExtensionsApiApiKeys = {})); class ExtensionsApi { constructor(basePathOrUsername, password, basePath) { this._basePath = defaultBasePath; this.defaultHeaders = {}; this._useQuerystring = false; this.authentications = { 'default': new VoidAuth(), 'BearerToken': new ApiKeyAuth('header', 'authorization'), }; if (password) { if (basePath) { this.basePath = basePath; } } else { if (basePathOrUsername) { this.basePath = basePathOrUsername; } } } set useQuerystring(value) { this._useQuerystring = value; } set basePath(basePath) { this._basePath = basePath; } get basePath() { return this._basePath; } setDefaultAuthentication(auth) { this.authentications.default = auth; } setApiKey(key, value) { this.authentications[ExtensionsApiApiKeys[key]].apiKey = value; } /** * get information of a group * @param {*} [options] Override http request options. */ getAPIGroup(options = {}) { const localVarPath = this.basePath + '/apis/extensions/'; let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'GET', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "V1APIGroup"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } } exports.ExtensionsApi = ExtensionsApi; var ExtensionsV1beta1ApiApiKeys; (function (ExtensionsV1beta1ApiApiKeys) { ExtensionsV1beta1ApiApiKeys[ExtensionsV1beta1ApiApiKeys["BearerToken"] = 0] = "BearerToken"; })(ExtensionsV1beta1ApiApiKeys = exports.ExtensionsV1beta1ApiApiKeys || (exports.ExtensionsV1beta1ApiApiKeys = {})); class ExtensionsV1beta1Api { constructor(basePathOrUsername, password, basePath) { this._basePath = defaultBasePath; this.defaultHeaders = {}; this._useQuerystring = false; this.authentications = { 'default': new VoidAuth(), 'BearerToken': new ApiKeyAuth('header', 'authorization'), }; if (password) { if (basePath) { this.basePath = basePath; } } else { if (basePathOrUsername) { this.basePath = basePathOrUsername; } } } set useQuerystring(value) { this._useQuerystring = value; } set basePath(basePath) { this._basePath = basePath; } get basePath() { return this._basePath; } setDefaultAuthentication(auth) { this.authentications.default = auth; } setApiKey(key, value) { this.authentications[ExtensionsV1beta1ApiApiKeys[key]].apiKey = value; } /** * create a DaemonSet * @param namespace object name and auth scope, such as for teams and projects * @param body * @param includeUninitialized If true, partially initialized resources are included in the response. * @param pretty If 'true', then the output is pretty printed. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param {*} [options] Override http request options. */ createNamespacedDaemonSet(namespace, body, includeUninitialized, pretty, dryRun, options = {}) { const localVarPath = this.basePath + '/apis/extensions/v1beta1/namespaces/{namespace}/daemonsets' .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling createNamespacedDaemonSet.'); } // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling createNamespacedDaemonSet.'); } if (includeUninitialized !== undefined) { localVarQueryParameters['includeUninitialized'] = ObjectSerializer.serialize(includeUninitialized, "boolean"); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'POST', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: ObjectSerializer.serialize(body, "V1beta1DaemonSet") }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "V1beta1DaemonSet"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * create a Deployment * @param namespace object name and auth scope, such as for teams and projects * @param body * @param includeUninitialized If true, partially initialized resources are included in the response. * @param pretty If 'true', then the output is pretty printed. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param {*} [options] Override http request options. */ createNamespacedDeployment(namespace, body, includeUninitialized, pretty, dryRun, options = {}) { const localVarPath = this.basePath + '/apis/extensions/v1beta1/namespaces/{namespace}/deployments' .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling createNamespacedDeployment.'); } // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling createNamespacedDeployment.'); } if (includeUninitialized !== undefined) { localVarQueryParameters['includeUninitialized'] = ObjectSerializer.serialize(includeUninitialized, "boolean"); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'POST', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: ObjectSerializer.serialize(body, "ExtensionsV1beta1Deployment") }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "ExtensionsV1beta1Deployment"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * create rollback of a Deployment * @param name name of the DeploymentRollback * @param namespace object name and auth scope, such as for teams and projects * @param body * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param includeUninitialized If IncludeUninitialized is specified, the object may be returned without completing initialization. * @param pretty If 'true', then the output is pretty printed. * @param {*} [options] Override http request options. */ createNamespacedDeploymentRollback(name, namespace, body, dryRun, includeUninitialized, pretty, options = {}) { const localVarPath = this.basePath + '/apis/extensions/v1beta1/namespaces/{namespace}/deployments/{name}/rollback' .replace('{' + 'name' + '}', encodeURIComponent(String(name))) .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling createNamespacedDeploymentRollback.'); } // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling createNamespacedDeploymentRollback.'); } // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling createNamespacedDeploymentRollback.'); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, "string"); } if (includeUninitialized !== undefined) { localVarQueryParameters['includeUninitialized'] = ObjectSerializer.serialize(includeUninitialized, "boolean"); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'POST', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: ObjectSerializer.serialize(body, "ExtensionsV1beta1DeploymentRollback") }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "V1Status"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * create an Ingress * @param namespace object name and auth scope, such as for teams and projects * @param body * @param includeUninitialized If true, partially initialized resources are included in the response. * @param pretty If 'true', then the output is pretty printed. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param {*} [options] Override http request options. */ createNamespacedIngress(namespace, body, includeUninitialized, pretty, dryRun, options = {}) { const localVarPath = this.basePath + '/apis/extensions/v1beta1/namespaces/{namespace}/ingresses' .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling createNamespacedIngress.'); } // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling createNamespacedIngress.'); } if (includeUninitialized !== undefined) { localVarQueryParameters['includeUninitialized'] = ObjectSerializer.serialize(includeUninitialized, "boolean"); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'POST', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: ObjectSerializer.serialize(body, "V1beta1Ingress") }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "V1beta1Ingress"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * create a NetworkPolicy * @param namespace object name and auth scope, such as for teams and projects * @param body * @param includeUninitialized If true, partially initialized resources are included in the response. * @param pretty If 'true', then the output is pretty printed. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param {*} [options] Override http request options. */ createNamespacedNetworkPolicy(namespace, body, includeUninitialized, pretty, dryRun, options = {}) { const localVarPath = this.basePath + '/apis/extensions/v1beta1/namespaces/{namespace}/networkpolicies' .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling createNamespacedNetworkPolicy.'); } // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling createNamespacedNetworkPolicy.'); } if (includeUninitialized !== undefined) { localVarQueryParameters['includeUninitialized'] = ObjectSerializer.serialize(includeUninitialized, "boolean"); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'POST', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: ObjectSerializer.serialize(body, "V1beta1NetworkPolicy") }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "V1beta1NetworkPolicy"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * create a ReplicaSet * @param namespace object name and auth scope, such as for teams and projects * @param body * @param includeUninitialized If true, partially initialized resources are included in the response. * @param pretty If 'true', then the output is pretty printed. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param {*} [options] Override http request options. */ createNamespacedReplicaSet(namespace, body, includeUninitialized, pretty, dryRun, options = {}) { const localVarPath = this.basePath + '/apis/extensions/v1beta1/namespaces/{namespace}/replicasets' .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling createNamespacedReplicaSet.'); } // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling createNamespacedReplicaSet.'); } if (includeUninitialized !== undefined) { localVarQueryParameters['includeUninitialized'] = ObjectSerializer.serialize(includeUninitialized, "boolean"); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'POST', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: ObjectSerializer.serialize(body, "V1beta1ReplicaSet") }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "V1beta1ReplicaSet"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * create a PodSecurityPolicy * @param body * @param includeUninitialized If true, partially initialized resources are included in the response. * @param pretty If 'true', then the output is pretty printed. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param {*} [options] Override http request options. */ createPodSecurityPolicy(body, includeUninitialized, pretty, dryRun, options = {}) { const localVarPath = this.basePath + '/apis/extensions/v1beta1/podsecuritypolicies'; let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling createPodSecurityPolicy.'); } if (includeUninitialized !== undefined) { localVarQueryParameters['includeUninitialized'] = ObjectSerializer.serialize(includeUninitialized, "boolean"); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'POST', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: ObjectSerializer.serialize(body, "ExtensionsV1beta1PodSecurityPolicy") }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "ExtensionsV1beta1PodSecurityPolicy"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * delete collection of DaemonSet * @param namespace object name and auth scope, such as for teams and projects * @param includeUninitialized If true, partially initialized resources are included in the response. * @param pretty If 'true', then the output is pretty printed. * @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. * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything. * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything. * @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. * @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. * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. * @param watch Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion. * @param {*} [options] Override http request options. */ deleteCollectionNamespacedDaemonSet(namespace, includeUninitialized, pretty, _continue, fieldSelector, labelSelector, limit, resourceVersion, timeoutSeconds, watch, options = {}) { const localVarPath = this.basePath + '/apis/extensions/v1beta1/namespaces/{namespace}/daemonsets' .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling deleteCollectionNamespacedDaemonSet.'); } if (includeUninitialized !== undefined) { localVarQueryParameters['includeUninitialized'] = ObjectSerializer.serialize(includeUninitialized, "boolean"); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, "string"); } if (_continue !== undefined) { localVarQueryParameters['continue'] = ObjectSerializer.serialize(_continue, "string"); } if (fieldSelector !== undefined) { localVarQueryParameters['fieldSelector'] = ObjectSerializer.serialize(fieldSelector, "string"); } if (labelSelector !== undefined) { localVarQueryParameters['labelSelector'] = ObjectSerializer.serialize(labelSelector, "string"); } if (limit !== undefined) { localVarQueryParameters['limit'] = ObjectSerializer.serialize(limit, "number"); } if (resourceVersion !== undefined) { localVarQueryParameters['resourceVersion'] = ObjectSerializer.serialize(resourceVersion, "string"); } if (timeoutSeconds !== undefined) { localVarQueryParameters['timeoutSeconds'] = ObjectSerializer.serialize(timeoutSeconds, "number"); } if (watch !== undefined) { localVarQueryParameters['watch'] = ObjectSerializer.serialize(watch, "boolean"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'DELETE', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "V1Status"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * delete collection of Deployment * @param namespace object name and auth scope, such as for teams and projects * @param includeUninitialized If true, partially initialized resources are included in the response. * @param pretty If 'true', then the output is pretty printed. * @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. * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything. * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything. * @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. * @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. * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. * @param watch Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion. * @param {*} [options] Override http request options. */ deleteCollectionNamespacedDeployment(namespace, includeUninitialized, pretty, _continue, fieldSelector, labelSelector, limit, resourceVersion, timeoutSeconds, watch, options = {}) { const localVarPath = this.basePath + '/apis/extensions/v1beta1/namespaces/{namespace}/deployments' .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling deleteCollectionNamespacedDeployment.'); } if (includeUninitialized !== undefined) { localVarQueryParameters['includeUninitialized'] = ObjectSerializer.serialize(includeUninitialized, "boolean"); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, "string"); } if (_continue !== undefined) { localVarQueryParameters['continue'] = ObjectSerializer.serialize(_continue, "string"); } if (fieldSelector !== undefined) { localVarQueryParameters['fieldSelector'] = ObjectSerializer.serialize(fieldSelector, "string"); } if (labelSelector !== undefined) { localVarQueryParameters['labelSelector'] = ObjectSerializer.serialize(labelSelector, "string"); } if (limit !== undefined) { localVarQueryParameters['limit'] = ObjectSerializer.serialize(limit, "number"); } if (resourceVersion !== undefined) { localVarQueryParameters['resourceVersion'] = ObjectSerializer.serialize(resourceVersion, "string"); } if (timeoutSeconds !== undefined) { localVarQueryParameters['timeoutSeconds'] = ObjectSerializer.serialize(timeoutSeconds, "number"); } if (watch !== undefined) { localVarQueryParameters['watch'] = ObjectSerializer.serialize(watch, "boolean"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'DELETE', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "V1Status"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * delete collection of Ingress * @param namespace object name and auth scope, such as for teams and projects * @param includeUninitialized If true, partially initialized resources are included in the response. * @param pretty If 'true', then the output is pretty printed. * @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. * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything. * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything. * @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. * @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. * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. * @param watch Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion. * @param {*} [options] Override http request options. */ deleteCollectionNamespacedIngress(namespace, includeUninitialized, pretty, _continue, fieldSelector, labelSelector, limit, resourceVersion, timeoutSeconds, watch, options = {}) { const localVarPath = this.basePath + '/apis/extensions/v1beta1/namespaces/{namespace}/ingresses' .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling deleteCollectionNamespacedIngress.'); } if (includeUninitialized !== undefined) { localVarQueryParameters['includeUninitialized'] = ObjectSerializer.serialize(includeUninitialized, "boolean"); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, "string"); } if (_continue !== undefined) { localVarQueryParameters['continue'] = ObjectSerializer.serialize(_continue, "string"); } if (fieldSelector !== undefined) { localVarQueryParameters['fieldSelector'] = ObjectSerializer.serialize(fieldSelector, "string"); } if (labelSelector !== undefined) { localVarQueryParameters['labelSelector'] = ObjectSerializer.serialize(labelSelector, "string"); } if (limit !== undefined) { localVarQueryParameters['limit'] = ObjectSerializer.serialize(limit, "number"); } if (resourceVersion !== undefined) { localVarQueryParameters['resourceVersion'] = ObjectSerializer.serialize(resourceVersion, "string"); } if (timeoutSeconds !== undefined) { localVarQueryParameters['timeoutSeconds'] = ObjectSerializer.serialize(timeoutSeconds, "number"); } if (watch !== undefined) { localVarQueryParameters['watch'] = ObjectSerializer.serialize(watch, "boolean"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'DELETE', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "V1Status"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * delete collection of NetworkPolicy * @param namespace object name and auth scope, such as for teams and projects * @param includeUninitialized If true, partially initialized resources are included in the response. * @param pretty If 'true', then the output is pretty printed. * @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. * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything. * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything. * @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. * @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. * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. * @param watch Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion. * @param {*} [options] Override http request options. */ deleteCollectionNamespacedNetworkPolicy(namespace, includeUninitialized, pretty, _continue, fieldSelector, labelSelector, limit, resourceVersion, timeoutSeconds, watch, options = {}) { const localVarPath = this.basePath + '/apis/extensions/v1beta1/namespaces/{namespace}/networkpolicies' .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling deleteCollectionNamespacedNetworkPolicy.'); } if (includeUninitialized !== undefined) { localVarQueryParameters['includeUninitialized'] = ObjectSerializer.serialize(includeUninitialized, "boolean"); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, "string"); } if (_continue !== undefined) { localVarQueryParameters['continue'] = ObjectSerializer.serialize(_continue, "string"); } if (fieldSelector !== undefined) { localVarQueryParameters['fieldSelector'] = ObjectSerializer.serialize(fieldSelector, "string"); } if (labelSelector !== undefined) { localVarQueryParameters['labelSelector'] = ObjectSerializer.serialize(labelSelector, "string"); } if (limit !== undefined) { localVarQueryParameters['limit'] = ObjectSerializer.serialize(limit, "number"); } if (resourceVersion !== undefined) { localVarQueryParameters['resourceVersion'] = ObjectSerializer.serialize(resourceVersion, "string"); } if (timeoutSeconds !== undefined) { localVarQueryParameters['timeoutSeconds'] = ObjectSerializer.serialize(timeoutSeconds, "number"); } if (watch !== undefined) { localVarQueryParameters['watch'] = ObjectSerializer.serialize(watch, "boolean"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'DELETE', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "V1Status"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * delete collection of ReplicaSet * @param namespace object name and auth scope, such as for teams and projects * @param includeUninitialized If true, partially initialized resources are included in the response. * @param pretty If 'true', then the output is pretty printed. * @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. * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything. * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything. * @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. * @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. * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. * @param watch Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion. * @param {*} [options] Override http request options. */ deleteCollectionNamespacedReplicaSet(namespace, includeUninitialized, pretty, _continue, fieldSelector, labelSelector, limit, resourceVersion, timeoutSeconds, watch, options = {}) { const localVarPath = this.basePath + '/apis/extensions/v1beta1/namespaces/{namespace}/replicasets' .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling deleteCollectionNamespacedReplicaSet.'); } if (includeUninitialized !== undefined) { localVarQueryParameters['includeUninitialized'] = ObjectSerializer.serialize(includeUninitialized, "boolean"); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, "string"); } if (_continue !== undefined) { localVarQueryParameters['continue'] = ObjectSerializer.serialize(_continue, "string"); } if (fieldSelector !== undefined) { localVarQueryParameters['fieldSelector'] = ObjectSerializer.serialize(fieldSelector, "string"); } if (labelSelector !== undefined) { localVarQueryParameters['labelSelector'] = ObjectSerializer.serialize(labelSelector, "string"); } if (limit !== undefined) { localVarQueryParameters['limit'] = ObjectSerializer.serialize(limit, "number"); } if (resourceVersion !== undefined) { localVarQueryParameters['resourceVersion'] = ObjectSerializer.serialize(resourceVersion, "string"); } if (timeoutSeconds !== undefined) { localVarQueryParameters['timeoutSeconds'] = ObjectSerializer.serialize(timeoutSeconds, "number"); } if (watch !== undefined) { localVarQueryParameters['watch'] = ObjectSerializer.serialize(watch, "boolean"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'DELETE', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "V1Status"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * delete collection of PodSecurityPolicy * @param includeUninitialized If true, partially initialized resources are included in the response. * @param pretty If 'true', then the output is pretty printed. * @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. * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything. * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything. * @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. * @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. * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. * @param watch Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion. * @param {*} [options] Override http request options. */ deleteCollectionPodSecurityPolicy(includeUninitialized, pretty, _continue, fieldSelector, labelSelector, limit, resourceVersion, timeoutSeconds, watch, options = {}) { const localVarPath = this.basePath + '/apis/extensions/v1beta1/podsecuritypolicies'; let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; if (includeUninitialized !== undefined) { localVarQueryParameters['includeUninitialized'] = ObjectSerializer.serialize(includeUninitialized, "boolean"); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, "string"); } if (_continue !== undefined) { localVarQueryParameters['continue'] = ObjectSerializer.serialize(_continue, "string"); } if (fieldSelector !== undefined) { localVarQueryParameters['fieldSelector'] = ObjectSerializer.serialize(fieldSelector, "string"); } if (labelSelector !== undefined) { localVarQueryParameters['labelSelector'] = ObjectSerializer.serialize(labelSelector, "string"); } if (limit !== undefined) { localVarQueryParameters['limit'] = ObjectSerializer.serialize(limit, "number"); } if (resourceVersion !== undefined) { localVarQueryParameters['resourceVersion'] = ObjectSerializer.serialize(resourceVersion, "string"); } if (timeoutSeconds !== undefined) { localVarQueryParameters['timeoutSeconds'] = ObjectSerializer.serialize(timeoutSeconds, "number"); } if (watch !== undefined) { localVarQueryParameters['watch'] = ObjectSerializer.serialize(watch, "boolean"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'DELETE', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "V1Status"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * delete a DaemonSet * @param name name of the DaemonSet * @param namespace object name and auth scope, such as for teams and projects * @param pretty If 'true', then the output is pretty printed. * @param body * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @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. * @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. * @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. * @param {*} [options] Override http request options. */ deleteNamespacedDaemonSet(name, namespace, pretty, body, dryRun, gracePeriodSeconds, orphanDependents, propagationPolicy, options = {}) { const localVarPath = this.basePath + '/apis/extensions/v1beta1/namespaces/{namespace}/daemonsets/{name}' .replace('{' + 'name' + '}', encodeURIComponent(String(name))) .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling deleteNamespacedDaemonSet.'); } // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling deleteNamespacedDaemonSet.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, "string"); } if (gracePeriodSeconds !== undefined) { localVarQueryParameters['gracePeriodSeconds'] = ObjectSerializer.serialize(gracePeriodSeconds, "number"); } if (orphanDependents !== undefined) { localVarQueryParameters['orphanDependents'] = ObjectSerializer.serialize(orphanDependents, "boolean"); } if (propagationPolicy !== undefined) { localVarQueryParameters['propagationPolicy'] = ObjectSerializer.serialize(propagationPolicy, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'DELETE', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: ObjectSerializer.serialize(body, "V1DeleteOptions") }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "V1Status"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * delete a Deployment * @param name name of the Deployment * @param namespace object name and auth scope, such as for teams and projects * @param pretty If 'true', then the output is pretty printed. * @param body * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @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. * @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. * @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. * @param {*} [options] Override http request options. */ deleteNamespacedDeployment(name, namespace, pretty, body, dryRun, gracePeriodSeconds, orphanDependents, propagationPolicy, options = {}) { const localVarPath = this.basePath + '/apis/extensions/v1beta1/namespaces/{namespace}/deployments/{name}' .replace('{' + 'name' + '}', encodeURIComponent(String(name))) .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling deleteNamespacedDeployment.'); } // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling deleteNamespacedDeployment.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, "string"); } if (gracePeriodSeconds !== undefined) { localVarQueryParameters['gracePeriodSeconds'] = ObjectSerializer.serialize(gracePeriodSeconds, "number"); } if (orphanDependents !== undefined) { localVarQueryParameters['orphanDependents'] = ObjectSerializer.serialize(orphanDependents, "boolean"); } if (propagationPolicy !== undefined) { localVarQueryParameters['propagationPolicy'] = ObjectSerializer.serialize(propagationPolicy, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'DELETE', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: ObjectSerializer.serialize(body, "V1DeleteOptions") }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "V1Status"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * delete an Ingress * @param name name of the Ingress * @param namespace object name and auth scope, such as for teams and projects * @param pretty If 'true', then the output is pretty printed. * @param body * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @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. * @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. * @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. * @param {*} [options] Override http request options. */ deleteNamespacedIngress(name, namespace, pretty, body, dryRun, gracePeriodSeconds, orphanDependents, propagationPolicy, options = {}) { const localVarPath = this.basePath + '/apis/extensions/v1beta1/namespaces/{namespace}/ingresses/{name}' .replace('{' + 'name' + '}', encodeURIComponent(String(name))) .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling deleteNamespacedIngress.'); } // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling deleteNamespacedIngress.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, "string"); } if (gracePeriodSeconds !== undefined) { localVarQueryParameters['gracePeriodSeconds'] = ObjectSerializer.serialize(gracePeriodSeconds, "number"); } if (orphanDependents !== undefined) { localVarQueryParameters['orphanDependents'] = ObjectSerializer.serialize(orphanDependents, "boolean"); } if (propagationPolicy !== undefined) { localVarQueryParameters['propagationPolicy'] = ObjectSerializer.serialize(propagationPolicy, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'DELETE', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: ObjectSerializer.serialize(body, "V1DeleteOptions") }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "V1Status"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * delete a NetworkPolicy * @param name name of the NetworkPolicy * @param namespace object name and auth scope, such as for teams and projects * @param pretty If 'true', then the output is pretty printed. * @param body * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @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. * @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. * @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. * @param {*} [options] Override http request options. */ deleteNamespacedNetworkPolicy(name, namespace, pretty, body, dryRun, gracePeriodSeconds, orphanDependents, propagationPolicy, options = {}) { const localVarPath = this.basePath + '/apis/extensions/v1beta1/namespaces/{namespace}/networkpolicies/{name}' .replace('{' + 'name' + '}', encodeURIComponent(String(name))) .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling deleteNamespacedNetworkPolicy.'); } // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling deleteNamespacedNetworkPolicy.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, "string"); } if (gracePeriodSeconds !== undefined) { localVarQueryParameters['gracePeriodSeconds'] = ObjectSerializer.serialize(gracePeriodSeconds, "number"); } if (orphanDependents !== undefined) { localVarQueryParameters['orphanDependents'] = ObjectSerializer.serialize(orphanDependents, "boolean"); } if (propagationPolicy !== undefined) { localVarQueryParameters['propagationPolicy'] = ObjectSerializer.serialize(propagationPolicy, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'DELETE', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: ObjectSerializer.serialize(body, "V1DeleteOptions") }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "V1Status"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * delete a ReplicaSet * @param name name of the ReplicaSet * @param namespace object name and auth scope, such as for teams and projects * @param pretty If 'true', then the output is pretty printed. * @param body * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @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. * @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. * @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. * @param {*} [options] Override http request options. */ deleteNamespacedReplicaSet(name, namespace, pretty, body, dryRun, gracePeriodSeconds, orphanDependents, propagationPolicy, options = {}) { const localVarPath = this.basePath + '/apis/extensions/v1beta1/namespaces/{namespace}/replicasets/{name}' .replace('{' + 'name' + '}', encodeURIComponent(String(name))) .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling deleteNamespacedReplicaSet.'); } // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling deleteNamespacedReplicaSet.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, "string"); } if (gracePeriodSeconds !== undefined) { localVarQueryParameters['gracePeriodSeconds'] = ObjectSerializer.serialize(gracePeriodSeconds, "number"); } if (orphanDependents !== undefined) { localVarQueryParameters['orphanDependents'] = ObjectSerializer.serialize(orphanDependents, "boolean"); } if (propagationPolicy !== undefined) { localVarQueryParameters['propagationPolicy'] = ObjectSerializer.serialize(propagationPolicy, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'DELETE', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: ObjectSerializer.serialize(body, "V1DeleteOptions") }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "V1Status"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * delete a PodSecurityPolicy * @param name name of the PodSecurityPolicy * @param pretty If 'true', then the output is pretty printed. * @param body * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @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. * @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. * @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. * @param {*} [options] Override http request options. */ deletePodSecurityPolicy(name, pretty, body, dryRun, gracePeriodSeconds, orphanDependents, propagationPolicy, options = {}) { const localVarPath = this.basePath + '/apis/extensions/v1beta1/podsecuritypolicies/{name}' .replace('{' + 'name' + '}', encodeURIComponent(String(name))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling deletePodSecurityPolicy.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, "string"); } if (gracePeriodSeconds !== undefined) { localVarQueryParameters['gracePeriodSeconds'] = ObjectSerializer.serialize(gracePeriodSeconds, "number"); } if (orphanDependents !== undefined) { localVarQueryParameters['orphanDependents'] = ObjectSerializer.serialize(orphanDependents, "boolean"); } if (propagationPolicy !== undefined) { localVarQueryParameters['propagationPolicy'] = ObjectSerializer.serialize(propagationPolicy, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'DELETE', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: ObjectSerializer.serialize(body, "V1DeleteOptions") }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "V1Status"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * get available resources * @param {*} [options] Override http request options. */ getAPIResources(options = {}) { const localVarPath = this.basePath + '/apis/extensions/v1beta1/'; let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'GET', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "V1APIResourceList"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * list or watch objects of kind DaemonSet * @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. * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything. * @param includeUninitialized If true, partially initialized resources are included in the response. * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything. * @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. * @param pretty If 'true', then the output is pretty printed. * @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. * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. * @param watch Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion. * @param {*} [options] Override http request options. */ listDaemonSetForAllNamespaces(_continue, fieldSelector, includeUninitialized, labelSelector, limit, pretty, resourceVersion, timeoutSeconds, watch, options = {}) { const localVarPath = this.basePath + '/apis/extensions/v1beta1/daemonsets'; let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; if (_continue !== undefined) { localVarQueryParameters['continue'] = ObjectSerializer.serialize(_continue, "string"); } if (fieldSelector !== undefined) { localVarQueryParameters['fieldSelector'] = ObjectSerializer.serialize(fieldSelector, "string"); } if (includeUninitialized !== undefined) { localVarQueryParameters['includeUninitialized'] = ObjectSerializer.serialize(includeUninitialized, "boolean"); } if (labelSelector !== undefined) { localVarQueryParameters['labelSelector'] = ObjectSerializer.serialize(labelSelector, "string"); } if (limit !== undefined) { localVarQueryParameters['limit'] = ObjectSerializer.serialize(limit, "number"); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, "string"); } if (resourceVersion !== undefined) { localVarQueryParameters['resourceVersion'] = ObjectSerializer.serialize(resourceVersion, "string"); } if (timeoutSeconds !== undefined) { localVarQueryParameters['timeoutSeconds'] = ObjectSerializer.serialize(timeoutSeconds, "number"); } if (watch !== undefined) { localVarQueryParameters['watch'] = ObjectSerializer.serialize(watch, "boolean"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'GET', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "V1beta1DaemonSetList"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * list or watch objects of kind Deployment * @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. * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything. * @param includeUninitialized If true, partially initialized resources are included in the response. * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything. * @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. * @param pretty If 'true', then the output is pretty printed. * @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. * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. * @param watch Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion. * @param {*} [options] Override http request options. */ listDeploymentForAllNamespaces(_continue, fieldSelector, includeUninitialized, labelSelector, limit, pretty, resourceVersion, timeoutSeconds, watch, options = {}) { const localVarPath = this.basePath + '/apis/extensions/v1beta1/deployments'; let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; if (_continue !== undefined) { localVarQueryParameters['continue'] = ObjectSerializer.serialize(_continue, "string"); } if (fieldSelector !== undefined) { localVarQueryParameters['fieldSelector'] = ObjectSerializer.serialize(fieldSelector, "string"); } if (includeUninitialized !== undefined) { localVarQueryParameters['includeUninitialized'] = ObjectSerializer.serialize(includeUninitialized, "boolean"); } if (labelSelector !== undefined) { localVarQueryParameters['labelSelector'] = ObjectSerializer.serialize(labelSelector, "string"); } if (limit !== undefined) { localVarQueryParameters['limit'] = ObjectSerializer.serialize(limit, "number"); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, "string"); } if (resourceVersion !== undefined) { localVarQueryParameters['resourceVersion'] = ObjectSerializer.serialize(resourceVersion, "string"); } if (timeoutSeconds !== undefined) { localVarQueryParameters['timeoutSeconds'] = ObjectSerializer.serialize(timeoutSeconds, "number"); } if (watch !== undefined) { localVarQueryParameters['watch'] = ObjectSerializer.serialize(watch, "boolean"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'GET', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "ExtensionsV1beta1DeploymentList"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * list or watch objects of kind Ingress * @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. * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything. * @param includeUninitialized If true, partially initialized resources are included in the response. * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything. * @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. * @param pretty If 'true', then the output is pretty printed. * @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. * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. * @param watch Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion. * @param {*} [options] Override http request options. */ listIngressForAllNamespaces(_continue, fieldSelector, includeUninitialized, labelSelector, limit, pretty, resourceVersion, timeoutSeconds, watch, options = {}) { const localVarPath = this.basePath + '/apis/extensions/v1beta1/ingresses'; let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; if (_continue !== undefined) { localVarQueryParameters['continue'] = ObjectSerializer.serialize(_continue, "string"); } if (fieldSelector !== undefined) { localVarQueryParameters['fieldSelector'] = ObjectSerializer.serialize(fieldSelector, "string"); } if (includeUninitialized !== undefined) { localVarQueryParameters['includeUninitialized'] = ObjectSerializer.serialize(includeUninitialized, "boolean"); } if (labelSelector !== undefined) { localVarQueryParameters['labelSelector'] = ObjectSerializer.serialize(labelSelector, "string"); } if (limit !== undefined) { localVarQueryParameters['limit'] = ObjectSerializer.serialize(limit, "number"); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, "string"); } if (resourceVersion !== undefined) { localVarQueryParameters['resourceVersion'] = ObjectSerializer.serialize(resourceVersion, "string"); } if (timeoutSeconds !== undefined) { localVarQueryParameters['timeoutSeconds'] = ObjectSerializer.serialize(timeoutSeconds, "number"); } if (watch !== undefined) { localVarQueryParameters['watch'] = ObjectSerializer.serialize(watch, "boolean"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'GET', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "V1beta1IngressList"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * list or watch objects of kind DaemonSet * @param namespace object name and auth scope, such as for teams and projects * @param includeUninitialized If true, partially initialized resources are included in the response. * @param pretty If 'true', then the output is pretty printed. * @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. * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything. * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything. * @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. * @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. * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. * @param watch Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion. * @param {*} [options] Override http request options. */ listNamespacedDaemonSet(namespace, includeUninitialized, pretty, _continue, fieldSelector, labelSelector, limit, resourceVersion, timeoutSeconds, watch, options = {}) { const localVarPath = this.basePath + '/apis/extensions/v1beta1/namespaces/{namespace}/daemonsets' .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling listNamespacedDaemonSet.'); } if (includeUninitialized !== undefined) { localVarQueryParameters['includeUninitialized'] = ObjectSerializer.serialize(includeUninitialized, "boolean"); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, "string"); } if (_continue !== undefined) { localVarQueryParameters['continue'] = ObjectSerializer.serialize(_continue, "string"); } if (fieldSelector !== undefined) { localVarQueryParameters['fieldSelector'] = ObjectSerializer.serialize(fieldSelector, "string"); } if (labelSelector !== undefined) { localVarQueryParameters['labelSelector'] = ObjectSerializer.serialize(labelSelector, "string"); } if (limit !== undefined) { localVarQueryParameters['limit'] = ObjectSerializer.serialize(limit, "number"); } if (resourceVersion !== undefined) { localVarQueryParameters['resourceVersion'] = ObjectSerializer.serialize(resourceVersion, "string"); } if (timeoutSeconds !== undefined) { localVarQueryParameters['timeoutSeconds'] = ObjectSerializer.serialize(timeoutSeconds, "number"); } if (watch !== undefined) { localVarQueryParameters['watch'] = ObjectSerializer.serialize(watch, "boolean"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'GET', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "V1beta1DaemonSetList"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * list or watch objects of kind Deployment * @param namespace object name and auth scope, such as for teams and projects * @param includeUninitialized If true, partially initialized resources are included in the response. * @param pretty If 'true', then the output is pretty printed. * @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. * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything. * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything. * @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. * @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. * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. * @param watch Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion. * @param {*} [options] Override http request options. */ listNamespacedDeployment(namespace, includeUninitialized, pretty, _continue, fieldSelector, labelSelector, limit, resourceVersion, timeoutSeconds, watch, options = {}) { const localVarPath = this.basePath + '/apis/extensions/v1beta1/namespaces/{namespace}/deployments' .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling listNamespacedDeployment.'); } if (includeUninitialized !== undefined) { localVarQueryParameters['includeUninitialized'] = ObjectSerializer.serialize(includeUninitialized, "boolean"); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, "string"); } if (_continue !== undefined) { localVarQueryParameters['continue'] = ObjectSerializer.serialize(_continue, "string"); } if (fieldSelector !== undefined) { localVarQueryParameters['fieldSelector'] = ObjectSerializer.serialize(fieldSelector, "string"); } if (labelSelector !== undefined) { localVarQueryParameters['labelSelector'] = ObjectSerializer.serialize(labelSelector, "string"); } if (limit !== undefined) { localVarQueryParameters['limit'] = ObjectSerializer.serialize(limit, "number"); } if (resourceVersion !== undefined) { localVarQueryParameters['resourceVersion'] = ObjectSerializer.serialize(resourceVersion, "string"); } if (timeoutSeconds !== undefined) { localVarQueryParameters['timeoutSeconds'] = ObjectSerializer.serialize(timeoutSeconds, "number"); } if (watch !== undefined) { localVarQueryParameters['watch'] = ObjectSerializer.serialize(watch, "boolean"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'GET', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "ExtensionsV1beta1DeploymentList"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * list or watch objects of kind Ingress * @param namespace object name and auth scope, such as for teams and projects * @param includeUninitialized If true, partially initialized resources are included in the response. * @param pretty If 'true', then the output is pretty printed. * @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. * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything. * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything. * @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. * @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. * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. * @param watch Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion. * @param {*} [options] Override http request options. */ listNamespacedIngress(namespace, includeUninitialized, pretty, _continue, fieldSelector, labelSelector, limit, resourceVersion, timeoutSeconds, watch, options = {}) { const localVarPath = this.basePath + '/apis/extensions/v1beta1/namespaces/{namespace}/ingresses' .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling listNamespacedIngress.'); } if (includeUninitialized !== undefined) { localVarQueryParameters['includeUninitialized'] = ObjectSerializer.serialize(includeUninitialized, "boolean"); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, "string"); } if (_continue !== undefined) { localVarQueryParameters['continue'] = ObjectSerializer.serialize(_continue, "string"); } if (fieldSelector !== undefined) { localVarQueryParameters['fieldSelector'] = ObjectSerializer.serialize(fieldSelector, "string"); } if (labelSelector !== undefined) { localVarQueryParameters['labelSelector'] = ObjectSerializer.serialize(labelSelector, "string"); } if (limit !== undefined) { localVarQueryParameters['limit'] = ObjectSerializer.serialize(limit, "number"); } if (resourceVersion !== undefined) { localVarQueryParameters['resourceVersion'] = ObjectSerializer.serialize(resourceVersion, "string"); } if (timeoutSeconds !== undefined) { localVarQueryParameters['timeoutSeconds'] = ObjectSerializer.serialize(timeoutSeconds, "number"); } if (watch !== undefined) { localVarQueryParameters['watch'] = ObjectSerializer.serialize(watch, "boolean"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'GET', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "V1beta1IngressList"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * list or watch objects of kind NetworkPolicy * @param namespace object name and auth scope, such as for teams and projects * @param includeUninitialized If true, partially initialized resources are included in the response. * @param pretty If 'true', then the output is pretty printed. * @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. * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything. * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything. * @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. * @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. * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. * @param watch Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion. * @param {*} [options] Override http request options. */ listNamespacedNetworkPolicy(namespace, includeUninitialized, pretty, _continue, fieldSelector, labelSelector, limit, resourceVersion, timeoutSeconds, watch, options = {}) { const localVarPath = this.basePath + '/apis/extensions/v1beta1/namespaces/{namespace}/networkpolicies' .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling listNamespacedNetworkPolicy.'); } if (includeUninitialized !== undefined) { localVarQueryParameters['includeUninitialized'] = ObjectSerializer.serialize(includeUninitialized, "boolean"); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, "string"); } if (_continue !== undefined) { localVarQueryParameters['continue'] = ObjectSerializer.serialize(_continue, "string"); } if (fieldSelector !== undefined) { localVarQueryParameters['fieldSelector'] = ObjectSerializer.serialize(fieldSelector, "string"); } if (labelSelector !== undefined) { localVarQueryParameters['labelSelector'] = ObjectSerializer.serialize(labelSelector, "string"); } if (limit !== undefined) { localVarQueryParameters['limit'] = ObjectSerializer.serialize(limit, "number"); } if (resourceVersion !== undefined) { localVarQueryParameters['resourceVersion'] = ObjectSerializer.serialize(resourceVersion, "string"); } if (timeoutSeconds !== undefined) { localVarQueryParameters['timeoutSeconds'] = ObjectSerializer.serialize(timeoutSeconds, "number"); } if (watch !== undefined) { localVarQueryParameters['watch'] = ObjectSerializer.serialize(watch, "boolean"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'GET', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "V1beta1NetworkPolicyList"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * list or watch objects of kind ReplicaSet * @param namespace object name and auth scope, such as for teams and projects * @param includeUninitialized If true, partially initialized resources are included in the response. * @param pretty If 'true', then the output is pretty printed. * @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. * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything. * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything. * @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. * @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. * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. * @param watch Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion. * @param {*} [options] Override http request options. */ listNamespacedReplicaSet(namespace, includeUninitialized, pretty, _continue, fieldSelector, labelSelector, limit, resourceVersion, timeoutSeconds, watch, options = {}) { const localVarPath = this.basePath + '/apis/extensions/v1beta1/namespaces/{namespace}/replicasets' .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling listNamespacedReplicaSet.'); } if (includeUninitialized !== undefined) { localVarQueryParameters['includeUninitialized'] = ObjectSerializer.serialize(includeUninitialized, "boolean"); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, "string"); } if (_continue !== undefined) { localVarQueryParameters['continue'] = ObjectSerializer.serialize(_continue, "string"); } if (fieldSelector !== undefined) { localVarQueryParameters['fieldSelector'] = ObjectSerializer.serialize(fieldSelector, "string"); } if (labelSelector !== undefined) { localVarQueryParameters['labelSelector'] = ObjectSerializer.serialize(labelSelector, "string"); } if (limit !== undefined) { localVarQueryParameters['limit'] = ObjectSerializer.serialize(limit, "number"); } if (resourceVersion !== undefined) { localVarQueryParameters['resourceVersion'] = ObjectSerializer.serialize(resourceVersion, "string"); } if (timeoutSeconds !== undefined) { localVarQueryParameters['timeoutSeconds'] = ObjectSerializer.serialize(timeoutSeconds, "number"); } if (watch !== undefined) { localVarQueryParameters['watch'] = ObjectSerializer.serialize(watch, "boolean"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'GET', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "V1beta1ReplicaSetList"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * list or watch objects of kind NetworkPolicy * @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. * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything. * @param includeUninitialized If true, partially initialized resources are included in the response. * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything. * @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. * @param pretty If 'true', then the output is pretty printed. * @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. * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. * @param watch Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion. * @param {*} [options] Override http request options. */ listNetworkPolicyForAllNamespaces(_continue, fieldSelector, includeUninitialized, labelSelector, limit, pretty, resourceVersion, timeoutSeconds, watch, options = {}) { const localVarPath = this.basePath + '/apis/extensions/v1beta1/networkpolicies'; let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; if (_continue !== undefined) { localVarQueryParameters['continue'] = ObjectSerializer.serialize(_continue, "string"); } if (fieldSelector !== undefined) { localVarQueryParameters['fieldSelector'] = ObjectSerializer.serialize(fieldSelector, "string"); } if (includeUninitialized !== undefined) { localVarQueryParameters['includeUninitialized'] = ObjectSerializer.serialize(includeUninitialized, "boolean"); } if (labelSelector !== undefined) { localVarQueryParameters['labelSelector'] = ObjectSerializer.serialize(labelSelector, "string"); } if (limit !== undefined) { localVarQueryParameters['limit'] = ObjectSerializer.serialize(limit, "number"); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, "string"); } if (resourceVersion !== undefined) { localVarQueryParameters['resourceVersion'] = ObjectSerializer.serialize(resourceVersion, "string"); } if (timeoutSeconds !== undefined) { localVarQueryParameters['timeoutSeconds'] = ObjectSerializer.serialize(timeoutSeconds, "number"); } if (watch !== undefined) { localVarQueryParameters['watch'] = ObjectSerializer.serialize(watch, "boolean"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'GET', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "V1beta1NetworkPolicyList"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * list or watch objects of kind PodSecurityPolicy * @param includeUninitialized If true, partially initialized resources are included in the response. * @param pretty If 'true', then the output is pretty printed. * @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. * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything. * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything. * @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. * @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. * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. * @param watch Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion. * @param {*} [options] Override http request options. */ listPodSecurityPolicy(includeUninitialized, pretty, _continue, fieldSelector, labelSelector, limit, resourceVersion, timeoutSeconds, watch, options = {}) { const localVarPath = this.basePath + '/apis/extensions/v1beta1/podsecuritypolicies'; let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; if (includeUninitialized !== undefined) { localVarQueryParameters['includeUninitialized'] = ObjectSerializer.serialize(includeUninitialized, "boolean"); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, "string"); } if (_continue !== undefined) { localVarQueryParameters['continue'] = ObjectSerializer.serialize(_continue, "string"); } if (fieldSelector !== undefined) { localVarQueryParameters['fieldSelector'] = ObjectSerializer.serialize(fieldSelector, "string"); } if (labelSelector !== undefined) { localVarQueryParameters['labelSelector'] = ObjectSerializer.serialize(labelSelector, "string"); } if (limit !== undefined) { localVarQueryParameters['limit'] = ObjectSerializer.serialize(limit, "number"); } if (resourceVersion !== undefined) { localVarQueryParameters['resourceVersion'] = ObjectSerializer.serialize(resourceVersion, "string"); } if (timeoutSeconds !== undefined) { localVarQueryParameters['timeoutSeconds'] = ObjectSerializer.serialize(timeoutSeconds, "number"); } if (watch !== undefined) { localVarQueryParameters['watch'] = ObjectSerializer.serialize(watch, "boolean"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'GET', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "ExtensionsV1beta1PodSecurityPolicyList"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * list or watch objects of kind ReplicaSet * @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. * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything. * @param includeUninitialized If true, partially initialized resources are included in the response. * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything. * @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. * @param pretty If 'true', then the output is pretty printed. * @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. * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. * @param watch Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion. * @param {*} [options] Override http request options. */ listReplicaSetForAllNamespaces(_continue, fieldSelector, includeUninitialized, labelSelector, limit, pretty, resourceVersion, timeoutSeconds, watch, options = {}) { const localVarPath = this.basePath + '/apis/extensions/v1beta1/replicasets'; let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; if (_continue !== undefined) { localVarQueryParameters['continue'] = ObjectSerializer.serialize(_continue, "string"); } if (fieldSelector !== undefined) { localVarQueryParameters['fieldSelector'] = ObjectSerializer.serialize(fieldSelector, "string"); } if (includeUninitialized !== undefined) { localVarQueryParameters['includeUninitialized'] = ObjectSerializer.serialize(includeUninitialized, "boolean"); } if (labelSelector !== undefined) { localVarQueryParameters['labelSelector'] = ObjectSerializer.serialize(labelSelector, "string"); } if (limit !== undefined) { localVarQueryParameters['limit'] = ObjectSerializer.serialize(limit, "number"); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, "string"); } if (resourceVersion !== undefined) { localVarQueryParameters['resourceVersion'] = ObjectSerializer.serialize(resourceVersion, "string"); } if (timeoutSeconds !== undefined) { localVarQueryParameters['timeoutSeconds'] = ObjectSerializer.serialize(timeoutSeconds, "number"); } if (watch !== undefined) { localVarQueryParameters['watch'] = ObjectSerializer.serialize(watch, "boolean"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'GET', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "V1beta1ReplicaSetList"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * partially update the specified DaemonSet * @param name name of the DaemonSet * @param namespace object name and auth scope, such as for teams and projects * @param body * @param pretty If 'true', then the output is pretty printed. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param {*} [options] Override http request options. */ patchNamespacedDaemonSet(name, namespace, body, pretty, dryRun, options = {}) { const localVarPath = this.basePath + '/apis/extensions/v1beta1/namespaces/{namespace}/daemonsets/{name}' .replace('{' + 'name' + '}', encodeURIComponent(String(name))) .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling patchNamespacedDaemonSet.'); } // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling patchNamespacedDaemonSet.'); } // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling patchNamespacedDaemonSet.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'PATCH', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: ObjectSerializer.serialize(body, "any") }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "V1beta1DaemonSet"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * partially update status of the specified DaemonSet * @param name name of the DaemonSet * @param namespace object name and auth scope, such as for teams and projects * @param body * @param pretty If 'true', then the output is pretty printed. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param {*} [options] Override http request options. */ patchNamespacedDaemonSetStatus(name, namespace, body, pretty, dryRun, options = {}) { const localVarPath = this.basePath + '/apis/extensions/v1beta1/namespaces/{namespace}/daemonsets/{name}/status' .replace('{' + 'name' + '}', encodeURIComponent(String(name))) .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling patchNamespacedDaemonSetStatus.'); } // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling patchNamespacedDaemonSetStatus.'); } // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling patchNamespacedDaemonSetStatus.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'PATCH', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: ObjectSerializer.serialize(body, "any") }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "V1beta1DaemonSet"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * partially update the specified Deployment * @param name name of the Deployment * @param namespace object name and auth scope, such as for teams and projects * @param body * @param pretty If 'true', then the output is pretty printed. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param {*} [options] Override http request options. */ patchNamespacedDeployment(name, namespace, body, pretty, dryRun, options = {}) { const localVarPath = this.basePath + '/apis/extensions/v1beta1/namespaces/{namespace}/deployments/{name}' .replace('{' + 'name' + '}', encodeURIComponent(String(name))) .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling patchNamespacedDeployment.'); } // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling patchNamespacedDeployment.'); } // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling patchNamespacedDeployment.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'PATCH', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: ObjectSerializer.serialize(body, "any") }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "ExtensionsV1beta1Deployment"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * partially update scale of the specified Deployment * @param name name of the Scale * @param namespace object name and auth scope, such as for teams and projects * @param body * @param pretty If 'true', then the output is pretty printed. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param {*} [options] Override http request options. */ patchNamespacedDeploymentScale(name, namespace, body, pretty, dryRun, options = {}) { const localVarPath = this.basePath + '/apis/extensions/v1beta1/namespaces/{namespace}/deployments/{name}/scale' .replace('{' + 'name' + '}', encodeURIComponent(String(name))) .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling patchNamespacedDeploymentScale.'); } // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling patchNamespacedDeploymentScale.'); } // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling patchNamespacedDeploymentScale.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'PATCH', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: ObjectSerializer.serialize(body, "any") }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "ExtensionsV1beta1Scale"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * partially update status of the specified Deployment * @param name name of the Deployment * @param namespace object name and auth scope, such as for teams and projects * @param body * @param pretty If 'true', then the output is pretty printed. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param {*} [options] Override http request options. */ patchNamespacedDeploymentStatus(name, namespace, body, pretty, dryRun, options = {}) { const localVarPath = this.basePath + '/apis/extensions/v1beta1/namespaces/{namespace}/deployments/{name}/status' .replace('{' + 'name' + '}', encodeURIComponent(String(name))) .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling patchNamespacedDeploymentStatus.'); } // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling patchNamespacedDeploymentStatus.'); } // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling patchNamespacedDeploymentStatus.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'PATCH', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: ObjectSerializer.serialize(body, "any") }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "ExtensionsV1beta1Deployment"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * partially update the specified Ingress * @param name name of the Ingress * @param namespace object name and auth scope, such as for teams and projects * @param body * @param pretty If 'true', then the output is pretty printed. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param {*} [options] Override http request options. */ patchNamespacedIngress(name, namespace, body, pretty, dryRun, options = {}) { const localVarPath = this.basePath + '/apis/extensions/v1beta1/namespaces/{namespace}/ingresses/{name}' .replace('{' + 'name' + '}', encodeURIComponent(String(name))) .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling patchNamespacedIngress.'); } // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling patchNamespacedIngress.'); } // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling patchNamespacedIngress.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'PATCH', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: ObjectSerializer.serialize(body, "any") }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "V1beta1Ingress"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * partially update status of the specified Ingress * @param name name of the Ingress * @param namespace object name and auth scope, such as for teams and projects * @param body * @param pretty If 'true', then the output is pretty printed. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param {*} [options] Override http request options. */ patchNamespacedIngressStatus(name, namespace, body, pretty, dryRun, options = {}) { const localVarPath = this.basePath + '/apis/extensions/v1beta1/namespaces/{namespace}/ingresses/{name}/status' .replace('{' + 'name' + '}', encodeURIComponent(String(name))) .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling patchNamespacedIngressStatus.'); } // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling patchNamespacedIngressStatus.'); } // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling patchNamespacedIngressStatus.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'PATCH', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: ObjectSerializer.serialize(body, "any") }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "V1beta1Ingress"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * partially update the specified NetworkPolicy * @param name name of the NetworkPolicy * @param namespace object name and auth scope, such as for teams and projects * @param body * @param pretty If 'true', then the output is pretty printed. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param {*} [options] Override http request options. */ patchNamespacedNetworkPolicy(name, namespace, body, pretty, dryRun, options = {}) { const localVarPath = this.basePath + '/apis/extensions/v1beta1/namespaces/{namespace}/networkpolicies/{name}' .replace('{' + 'name' + '}', encodeURIComponent(String(name))) .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling patchNamespacedNetworkPolicy.'); } // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling patchNamespacedNetworkPolicy.'); } // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling patchNamespacedNetworkPolicy.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'PATCH', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: ObjectSerializer.serialize(body, "any") }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "V1beta1NetworkPolicy"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * partially update the specified ReplicaSet * @param name name of the ReplicaSet * @param namespace object name and auth scope, such as for teams and projects * @param body * @param pretty If 'true', then the output is pretty printed. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param {*} [options] Override http request options. */ patchNamespacedReplicaSet(name, namespace, body, pretty, dryRun, options = {}) { const localVarPath = this.basePath + '/apis/extensions/v1beta1/namespaces/{namespace}/replicasets/{name}' .replace('{' + 'name' + '}', encodeURIComponent(String(name))) .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling patchNamespacedReplicaSet.'); } // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling patchNamespacedReplicaSet.'); } // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling patchNamespacedReplicaSet.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'PATCH', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: ObjectSerializer.serialize(body, "any") }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "V1beta1ReplicaSet"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * partially update scale of the specified ReplicaSet * @param name name of the Scale * @param namespace object name and auth scope, such as for teams and projects * @param body * @param pretty If 'true', then the output is pretty printed. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param {*} [options] Override http request options. */ patchNamespacedReplicaSetScale(name, namespace, body, pretty, dryRun, options = {}) { const localVarPath = this.basePath + '/apis/extensions/v1beta1/namespaces/{namespace}/replicasets/{name}/scale' .replace('{' + 'name' + '}', encodeURIComponent(String(name))) .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling patchNamespacedReplicaSetScale.'); } // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling patchNamespacedReplicaSetScale.'); } // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling patchNamespacedReplicaSetScale.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'PATCH', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: ObjectSerializer.serialize(body, "any") }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "ExtensionsV1beta1Scale"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * partially update status of the specified ReplicaSet * @param name name of the ReplicaSet * @param namespace object name and auth scope, such as for teams and projects * @param body * @param pretty If 'true', then the output is pretty printed. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param {*} [options] Override http request options. */ patchNamespacedReplicaSetStatus(name, namespace, body, pretty, dryRun, options = {}) { const localVarPath = this.basePath + '/apis/extensions/v1beta1/namespaces/{namespace}/replicasets/{name}/status' .replace('{' + 'name' + '}', encodeURIComponent(String(name))) .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling patchNamespacedReplicaSetStatus.'); } // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling patchNamespacedReplicaSetStatus.'); } // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling patchNamespacedReplicaSetStatus.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'PATCH', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: ObjectSerializer.serialize(body, "any") }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "V1beta1ReplicaSet"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * partially update scale of the specified ReplicationControllerDummy * @param name name of the Scale * @param namespace object name and auth scope, such as for teams and projects * @param body * @param pretty If 'true', then the output is pretty printed. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param {*} [options] Override http request options. */ patchNamespacedReplicationControllerDummyScale(name, namespace, body, pretty, dryRun, options = {}) { const localVarPath = this.basePath + '/apis/extensions/v1beta1/namespaces/{namespace}/replicationcontrollers/{name}/scale' .replace('{' + 'name' + '}', encodeURIComponent(String(name))) .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling patchNamespacedReplicationControllerDummyScale.'); } // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling patchNamespacedReplicationControllerDummyScale.'); } // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling patchNamespacedReplicationControllerDummyScale.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'PATCH', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: ObjectSerializer.serialize(body, "any") }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "ExtensionsV1beta1Scale"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * partially update the specified PodSecurityPolicy * @param name name of the PodSecurityPolicy * @param body * @param pretty If 'true', then the output is pretty printed. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param {*} [options] Override http request options. */ patchPodSecurityPolicy(name, body, pretty, dryRun, options = {}) { const localVarPath = this.basePath + '/apis/extensions/v1beta1/podsecuritypolicies/{name}' .replace('{' + 'name' + '}', encodeURIComponent(String(name))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling patchPodSecurityPolicy.'); } // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling patchPodSecurityPolicy.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'PATCH', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: ObjectSerializer.serialize(body, "any") }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "ExtensionsV1beta1PodSecurityPolicy"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * read the specified DaemonSet * @param name name of the DaemonSet * @param namespace object name and auth scope, such as for teams and projects * @param pretty If 'true', then the output is pretty printed. * @param exact Should the export be exact. Exact export maintains cluster-specific fields like 'Namespace'. * @param _export Should this value be exported. Export strips fields that a user can not specify. * @param {*} [options] Override http request options. */ readNamespacedDaemonSet(name, namespace, pretty, exact, _export, options = {}) { const localVarPath = this.basePath + '/apis/extensions/v1beta1/namespaces/{namespace}/daemonsets/{name}' .replace('{' + 'name' + '}', encodeURIComponent(String(name))) .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling readNamespacedDaemonSet.'); } // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling readNamespacedDaemonSet.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, "string"); } if (exact !== undefined) { localVarQueryParameters['exact'] = ObjectSerializer.serialize(exact, "boolean"); } if (_export !== undefined) { localVarQueryParameters['export'] = ObjectSerializer.serialize(_export, "boolean"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'GET', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "V1beta1DaemonSet"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * read status of the specified DaemonSet * @param name name of the DaemonSet * @param namespace object name and auth scope, such as for teams and projects * @param pretty If 'true', then the output is pretty printed. * @param {*} [options] Override http request options. */ readNamespacedDaemonSetStatus(name, namespace, pretty, options = {}) { const localVarPath = this.basePath + '/apis/extensions/v1beta1/namespaces/{namespace}/daemonsets/{name}/status' .replace('{' + 'name' + '}', encodeURIComponent(String(name))) .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling readNamespacedDaemonSetStatus.'); } // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling readNamespacedDaemonSetStatus.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'GET', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "V1beta1DaemonSet"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * read the specified Deployment * @param name name of the Deployment * @param namespace object name and auth scope, such as for teams and projects * @param pretty If 'true', then the output is pretty printed. * @param exact Should the export be exact. Exact export maintains cluster-specific fields like 'Namespace'. * @param _export Should this value be exported. Export strips fields that a user can not specify. * @param {*} [options] Override http request options. */ readNamespacedDeployment(name, namespace, pretty, exact, _export, options = {}) { const localVarPath = this.basePath + '/apis/extensions/v1beta1/namespaces/{namespace}/deployments/{name}' .replace('{' + 'name' + '}', encodeURIComponent(String(name))) .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling readNamespacedDeployment.'); } // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling readNamespacedDeployment.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, "string"); } if (exact !== undefined) { localVarQueryParameters['exact'] = ObjectSerializer.serialize(exact, "boolean"); } if (_export !== undefined) { localVarQueryParameters['export'] = ObjectSerializer.serialize(_export, "boolean"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'GET', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "ExtensionsV1beta1Deployment"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * read scale of the specified Deployment * @param name name of the Scale * @param namespace object name and auth scope, such as for teams and projects * @param pretty If 'true', then the output is pretty printed. * @param {*} [options] Override http request options. */ readNamespacedDeploymentScale(name, namespace, pretty, options = {}) { const localVarPath = this.basePath + '/apis/extensions/v1beta1/namespaces/{namespace}/deployments/{name}/scale' .replace('{' + 'name' + '}', encodeURIComponent(String(name))) .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling readNamespacedDeploymentScale.'); } // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling readNamespacedDeploymentScale.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'GET', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "ExtensionsV1beta1Scale"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * read status of the specified Deployment * @param name name of the Deployment * @param namespace object name and auth scope, such as for teams and projects * @param pretty If 'true', then the output is pretty printed. * @param {*} [options] Override http request options. */ readNamespacedDeploymentStatus(name, namespace, pretty, options = {}) { const localVarPath = this.basePath + '/apis/extensions/v1beta1/namespaces/{namespace}/deployments/{name}/status' .replace('{' + 'name' + '}', encodeURIComponent(String(name))) .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling readNamespacedDeploymentStatus.'); } // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling readNamespacedDeploymentStatus.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'GET', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "ExtensionsV1beta1Deployment"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * read the specified Ingress * @param name name of the Ingress * @param namespace object name and auth scope, such as for teams and projects * @param pretty If 'true', then the output is pretty printed. * @param exact Should the export be exact. Exact export maintains cluster-specific fields like 'Namespace'. * @param _export Should this value be exported. Export strips fields that a user can not specify. * @param {*} [options] Override http request options. */ readNamespacedIngress(name, namespace, pretty, exact, _export, options = {}) { const localVarPath = this.basePath + '/apis/extensions/v1beta1/namespaces/{namespace}/ingresses/{name}' .replace('{' + 'name' + '}', encodeURIComponent(String(name))) .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling readNamespacedIngress.'); } // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling readNamespacedIngress.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, "string"); } if (exact !== undefined) { localVarQueryParameters['exact'] = ObjectSerializer.serialize(exact, "boolean"); } if (_export !== undefined) { localVarQueryParameters['export'] = ObjectSerializer.serialize(_export, "boolean"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'GET', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "V1beta1Ingress"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * read status of the specified Ingress * @param name name of the Ingress * @param namespace object name and auth scope, such as for teams and projects * @param pretty If 'true', then the output is pretty printed. * @param {*} [options] Override http request options. */ readNamespacedIngressStatus(name, namespace, pretty, options = {}) { const localVarPath = this.basePath + '/apis/extensions/v1beta1/namespaces/{namespace}/ingresses/{name}/status' .replace('{' + 'name' + '}', encodeURIComponent(String(name))) .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling readNamespacedIngressStatus.'); } // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling readNamespacedIngressStatus.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'GET', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "V1beta1Ingress"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * read the specified NetworkPolicy * @param name name of the NetworkPolicy * @param namespace object name and auth scope, such as for teams and projects * @param pretty If 'true', then the output is pretty printed. * @param exact Should the export be exact. Exact export maintains cluster-specific fields like 'Namespace'. * @param _export Should this value be exported. Export strips fields that a user can not specify. * @param {*} [options] Override http request options. */ readNamespacedNetworkPolicy(name, namespace, pretty, exact, _export, options = {}) { const localVarPath = this.basePath + '/apis/extensions/v1beta1/namespaces/{namespace}/networkpolicies/{name}' .replace('{' + 'name' + '}', encodeURIComponent(String(name))) .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling readNamespacedNetworkPolicy.'); } // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling readNamespacedNetworkPolicy.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, "string"); } if (exact !== undefined) { localVarQueryParameters['exact'] = ObjectSerializer.serialize(exact, "boolean"); } if (_export !== undefined) { localVarQueryParameters['export'] = ObjectSerializer.serialize(_export, "boolean"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'GET', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "V1beta1NetworkPolicy"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * read the specified ReplicaSet * @param name name of the ReplicaSet * @param namespace object name and auth scope, such as for teams and projects * @param pretty If 'true', then the output is pretty printed. * @param exact Should the export be exact. Exact export maintains cluster-specific fields like 'Namespace'. * @param _export Should this value be exported. Export strips fields that a user can not specify. * @param {*} [options] Override http request options. */ readNamespacedReplicaSet(name, namespace, pretty, exact, _export, options = {}) { const localVarPath = this.basePath + '/apis/extensions/v1beta1/namespaces/{namespace}/replicasets/{name}' .replace('{' + 'name' + '}', encodeURIComponent(String(name))) .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling readNamespacedReplicaSet.'); } // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling readNamespacedReplicaSet.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, "string"); } if (exact !== undefined) { localVarQueryParameters['exact'] = ObjectSerializer.serialize(exact, "boolean"); } if (_export !== undefined) { localVarQueryParameters['export'] = ObjectSerializer.serialize(_export, "boolean"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'GET', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "V1beta1ReplicaSet"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * read scale of the specified ReplicaSet * @param name name of the Scale * @param namespace object name and auth scope, such as for teams and projects * @param pretty If 'true', then the output is pretty printed. * @param {*} [options] Override http request options. */ readNamespacedReplicaSetScale(name, namespace, pretty, options = {}) { const localVarPath = this.basePath + '/apis/extensions/v1beta1/namespaces/{namespace}/replicasets/{name}/scale' .replace('{' + 'name' + '}', encodeURIComponent(String(name))) .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling readNamespacedReplicaSetScale.'); } // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling readNamespacedReplicaSetScale.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'GET', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "ExtensionsV1beta1Scale"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * read status of the specified ReplicaSet * @param name name of the ReplicaSet * @param namespace object name and auth scope, such as for teams and projects * @param pretty If 'true', then the output is pretty printed. * @param {*} [options] Override http request options. */ readNamespacedReplicaSetStatus(name, namespace, pretty, options = {}) { const localVarPath = this.basePath + '/apis/extensions/v1beta1/namespaces/{namespace}/replicasets/{name}/status' .replace('{' + 'name' + '}', encodeURIComponent(String(name))) .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling readNamespacedReplicaSetStatus.'); } // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling readNamespacedReplicaSetStatus.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'GET', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "V1beta1ReplicaSet"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * read scale of the specified ReplicationControllerDummy * @param name name of the Scale * @param namespace object name and auth scope, such as for teams and projects * @param pretty If 'true', then the output is pretty printed. * @param {*} [options] Override http request options. */ readNamespacedReplicationControllerDummyScale(name, namespace, pretty, options = {}) { const localVarPath = this.basePath + '/apis/extensions/v1beta1/namespaces/{namespace}/replicationcontrollers/{name}/scale' .replace('{' + 'name' + '}', encodeURIComponent(String(name))) .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling readNamespacedReplicationControllerDummyScale.'); } // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling readNamespacedReplicationControllerDummyScale.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'GET', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "ExtensionsV1beta1Scale"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * read the specified PodSecurityPolicy * @param name name of the PodSecurityPolicy * @param pretty If 'true', then the output is pretty printed. * @param exact Should the export be exact. Exact export maintains cluster-specific fields like 'Namespace'. * @param _export Should this value be exported. Export strips fields that a user can not specify. * @param {*} [options] Override http request options. */ readPodSecurityPolicy(name, pretty, exact, _export, options = {}) { const localVarPath = this.basePath + '/apis/extensions/v1beta1/podsecuritypolicies/{name}' .replace('{' + 'name' + '}', encodeURIComponent(String(name))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling readPodSecurityPolicy.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, "string"); } if (exact !== undefined) { localVarQueryParameters['exact'] = ObjectSerializer.serialize(exact, "boolean"); } if (_export !== undefined) { localVarQueryParameters['export'] = ObjectSerializer.serialize(_export, "boolean"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'GET', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "ExtensionsV1beta1PodSecurityPolicy"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * replace the specified DaemonSet * @param name name of the DaemonSet * @param namespace object name and auth scope, such as for teams and projects * @param body * @param pretty If 'true', then the output is pretty printed. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param {*} [options] Override http request options. */ replaceNamespacedDaemonSet(name, namespace, body, pretty, dryRun, options = {}) { const localVarPath = this.basePath + '/apis/extensions/v1beta1/namespaces/{namespace}/daemonsets/{name}' .replace('{' + 'name' + '}', encodeURIComponent(String(name))) .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling replaceNamespacedDaemonSet.'); } // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling replaceNamespacedDaemonSet.'); } // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling replaceNamespacedDaemonSet.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'PUT', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: ObjectSerializer.serialize(body, "V1beta1DaemonSet") }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "V1beta1DaemonSet"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * replace status of the specified DaemonSet * @param name name of the DaemonSet * @param namespace object name and auth scope, such as for teams and projects * @param body * @param pretty If 'true', then the output is pretty printed. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param {*} [options] Override http request options. */ replaceNamespacedDaemonSetStatus(name, namespace, body, pretty, dryRun, options = {}) { const localVarPath = this.basePath + '/apis/extensions/v1beta1/namespaces/{namespace}/daemonsets/{name}/status' .replace('{' + 'name' + '}', encodeURIComponent(String(name))) .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling replaceNamespacedDaemonSetStatus.'); } // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling replaceNamespacedDaemonSetStatus.'); } // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling replaceNamespacedDaemonSetStatus.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'PUT', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: ObjectSerializer.serialize(body, "V1beta1DaemonSet") }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "V1beta1DaemonSet"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * replace the specified Deployment * @param name name of the Deployment * @param namespace object name and auth scope, such as for teams and projects * @param body * @param pretty If 'true', then the output is pretty printed. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param {*} [options] Override http request options. */ replaceNamespacedDeployment(name, namespace, body, pretty, dryRun, options = {}) { const localVarPath = this.basePath + '/apis/extensions/v1beta1/namespaces/{namespace}/deployments/{name}' .replace('{' + 'name' + '}', encodeURIComponent(String(name))) .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling replaceNamespacedDeployment.'); } // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling replaceNamespacedDeployment.'); } // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling replaceNamespacedDeployment.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'PUT', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: ObjectSerializer.serialize(body, "ExtensionsV1beta1Deployment") }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "ExtensionsV1beta1Deployment"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * replace scale of the specified Deployment * @param name name of the Scale * @param namespace object name and auth scope, such as for teams and projects * @param body * @param pretty If 'true', then the output is pretty printed. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param {*} [options] Override http request options. */ replaceNamespacedDeploymentScale(name, namespace, body, pretty, dryRun, options = {}) { const localVarPath = this.basePath + '/apis/extensions/v1beta1/namespaces/{namespace}/deployments/{name}/scale' .replace('{' + 'name' + '}', encodeURIComponent(String(name))) .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling replaceNamespacedDeploymentScale.'); } // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling replaceNamespacedDeploymentScale.'); } // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling replaceNamespacedDeploymentScale.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'PUT', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: ObjectSerializer.serialize(body, "ExtensionsV1beta1Scale") }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "ExtensionsV1beta1Scale"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * replace status of the specified Deployment * @param name name of the Deployment * @param namespace object name and auth scope, such as for teams and projects * @param body * @param pretty If 'true', then the output is pretty printed. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param {*} [options] Override http request options. */ replaceNamespacedDeploymentStatus(name, namespace, body, pretty, dryRun, options = {}) { const localVarPath = this.basePath + '/apis/extensions/v1beta1/namespaces/{namespace}/deployments/{name}/status' .replace('{' + 'name' + '}', encodeURIComponent(String(name))) .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling replaceNamespacedDeploymentStatus.'); } // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling replaceNamespacedDeploymentStatus.'); } // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling replaceNamespacedDeploymentStatus.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'PUT', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: ObjectSerializer.serialize(body, "ExtensionsV1beta1Deployment") }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "ExtensionsV1beta1Deployment"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * replace the specified Ingress * @param name name of the Ingress * @param namespace object name and auth scope, such as for teams and projects * @param body * @param pretty If 'true', then the output is pretty printed. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param {*} [options] Override http request options. */ replaceNamespacedIngress(name, namespace, body, pretty, dryRun, options = {}) { const localVarPath = this.basePath + '/apis/extensions/v1beta1/namespaces/{namespace}/ingresses/{name}' .replace('{' + 'name' + '}', encodeURIComponent(String(name))) .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling replaceNamespacedIngress.'); } // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling replaceNamespacedIngress.'); } // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling replaceNamespacedIngress.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'PUT', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: ObjectSerializer.serialize(body, "V1beta1Ingress") }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "V1beta1Ingress"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * replace status of the specified Ingress * @param name name of the Ingress * @param namespace object name and auth scope, such as for teams and projects * @param body * @param pretty If 'true', then the output is pretty printed. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param {*} [options] Override http request options. */ replaceNamespacedIngressStatus(name, namespace, body, pretty, dryRun, options = {}) { const localVarPath = this.basePath + '/apis/extensions/v1beta1/namespaces/{namespace}/ingresses/{name}/status' .replace('{' + 'name' + '}', encodeURIComponent(String(name))) .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling replaceNamespacedIngressStatus.'); } // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling replaceNamespacedIngressStatus.'); } // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling replaceNamespacedIngressStatus.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'PUT', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: ObjectSerializer.serialize(body, "V1beta1Ingress") }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "V1beta1Ingress"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * replace the specified NetworkPolicy * @param name name of the NetworkPolicy * @param namespace object name and auth scope, such as for teams and projects * @param body * @param pretty If 'true', then the output is pretty printed. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param {*} [options] Override http request options. */ replaceNamespacedNetworkPolicy(name, namespace, body, pretty, dryRun, options = {}) { const localVarPath = this.basePath + '/apis/extensions/v1beta1/namespaces/{namespace}/networkpolicies/{name}' .replace('{' + 'name' + '}', encodeURIComponent(String(name))) .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling replaceNamespacedNetworkPolicy.'); } // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling replaceNamespacedNetworkPolicy.'); } // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling replaceNamespacedNetworkPolicy.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'PUT', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: ObjectSerializer.serialize(body, "V1beta1NetworkPolicy") }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "V1beta1NetworkPolicy"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * replace the specified ReplicaSet * @param name name of the ReplicaSet * @param namespace object name and auth scope, such as for teams and projects * @param body * @param pretty If 'true', then the output is pretty printed. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param {*} [options] Override http request options. */ replaceNamespacedReplicaSet(name, namespace, body, pretty, dryRun, options = {}) { const localVarPath = this.basePath + '/apis/extensions/v1beta1/namespaces/{namespace}/replicasets/{name}' .replace('{' + 'name' + '}', encodeURIComponent(String(name))) .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling replaceNamespacedReplicaSet.'); } // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling replaceNamespacedReplicaSet.'); } // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling replaceNamespacedReplicaSet.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'PUT', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: ObjectSerializer.serialize(body, "V1beta1ReplicaSet") }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "V1beta1ReplicaSet"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * replace scale of the specified ReplicaSet * @param name name of the Scale * @param namespace object name and auth scope, such as for teams and projects * @param body * @param pretty If 'true', then the output is pretty printed. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param {*} [options] Override http request options. */ replaceNamespacedReplicaSetScale(name, namespace, body, pretty, dryRun, options = {}) { const localVarPath = this.basePath + '/apis/extensions/v1beta1/namespaces/{namespace}/replicasets/{name}/scale' .replace('{' + 'name' + '}', encodeURIComponent(String(name))) .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling replaceNamespacedReplicaSetScale.'); } // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling replaceNamespacedReplicaSetScale.'); } // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling replaceNamespacedReplicaSetScale.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'PUT', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: ObjectSerializer.serialize(body, "ExtensionsV1beta1Scale") }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "ExtensionsV1beta1Scale"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * replace status of the specified ReplicaSet * @param name name of the ReplicaSet * @param namespace object name and auth scope, such as for teams and projects * @param body * @param pretty If 'true', then the output is pretty printed. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param {*} [options] Override http request options. */ replaceNamespacedReplicaSetStatus(name, namespace, body, pretty, dryRun, options = {}) { const localVarPath = this.basePath + '/apis/extensions/v1beta1/namespaces/{namespace}/replicasets/{name}/status' .replace('{' + 'name' + '}', encodeURIComponent(String(name))) .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling replaceNamespacedReplicaSetStatus.'); } // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling replaceNamespacedReplicaSetStatus.'); } // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling replaceNamespacedReplicaSetStatus.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'PUT', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: ObjectSerializer.serialize(body, "V1beta1ReplicaSet") }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "V1beta1ReplicaSet"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * replace scale of the specified ReplicationControllerDummy * @param name name of the Scale * @param namespace object name and auth scope, such as for teams and projects * @param body * @param pretty If 'true', then the output is pretty printed. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param {*} [options] Override http request options. */ replaceNamespacedReplicationControllerDummyScale(name, namespace, body, pretty, dryRun, options = {}) { const localVarPath = this.basePath + '/apis/extensions/v1beta1/namespaces/{namespace}/replicationcontrollers/{name}/scale' .replace('{' + 'name' + '}', encodeURIComponent(String(name))) .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling replaceNamespacedReplicationControllerDummyScale.'); } // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling replaceNamespacedReplicationControllerDummyScale.'); } // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling replaceNamespacedReplicationControllerDummyScale.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'PUT', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: ObjectSerializer.serialize(body, "ExtensionsV1beta1Scale") }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "ExtensionsV1beta1Scale"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * replace the specified PodSecurityPolicy * @param name name of the PodSecurityPolicy * @param body * @param pretty If 'true', then the output is pretty printed. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param {*} [options] Override http request options. */ replacePodSecurityPolicy(name, body, pretty, dryRun, options = {}) { const localVarPath = this.basePath + '/apis/extensions/v1beta1/podsecuritypolicies/{name}' .replace('{' + 'name' + '}', encodeURIComponent(String(name))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling replacePodSecurityPolicy.'); } // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling replacePodSecurityPolicy.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'PUT', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: ObjectSerializer.serialize(body, "ExtensionsV1beta1PodSecurityPolicy") }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "ExtensionsV1beta1PodSecurityPolicy"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } } exports.ExtensionsV1beta1Api = ExtensionsV1beta1Api; var LogsApiApiKeys; (function (LogsApiApiKeys) { LogsApiApiKeys[LogsApiApiKeys["BearerToken"] = 0] = "BearerToken"; })(LogsApiApiKeys = exports.LogsApiApiKeys || (exports.LogsApiApiKeys = {})); class LogsApi { constructor(basePathOrUsername, password, basePath) { this._basePath = defaultBasePath; this.defaultHeaders = {}; this._useQuerystring = false; this.authentications = { 'default': new VoidAuth(), 'BearerToken': new ApiKeyAuth('header', 'authorization'), }; if (password) { if (basePath) { this.basePath = basePath; } } else { if (basePathOrUsername) { this.basePath = basePathOrUsername; } } } set useQuerystring(value) { this._useQuerystring = value; } set basePath(basePath) { this._basePath = basePath; } get basePath() { return this._basePath; } setDefaultAuthentication(auth) { this.authentications.default = auth; } setApiKey(key, value) { this.authentications[LogsApiApiKeys[key]].apiKey = value; } /** * * @param logpath path to the log * @param {*} [options] Override http request options. */ logFileHandler(logpath, options = {}) { const localVarPath = this.basePath + '/logs/{logpath}' .replace('{' + 'logpath' + '}', encodeURIComponent(String(logpath))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; // verify required parameter 'logpath' is not null or undefined if (logpath === null || logpath === undefined) { throw new Error('Required parameter logpath was null or undefined when calling logFileHandler.'); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'GET', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * * @param {*} [options] Override http request options. */ logFileListHandler(options = {}) { const localVarPath = this.basePath + '/logs/'; let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'GET', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } } exports.LogsApi = LogsApi; var NetworkingApiApiKeys; (function (NetworkingApiApiKeys) { NetworkingApiApiKeys[NetworkingApiApiKeys["BearerToken"] = 0] = "BearerToken"; })(NetworkingApiApiKeys = exports.NetworkingApiApiKeys || (exports.NetworkingApiApiKeys = {})); class NetworkingApi { constructor(basePathOrUsername, password, basePath) { this._basePath = defaultBasePath; this.defaultHeaders = {}; this._useQuerystring = false; this.authentications = { 'default': new VoidAuth(), 'BearerToken': new ApiKeyAuth('header', 'authorization'), }; if (password) { if (basePath) { this.basePath = basePath; } } else { if (basePathOrUsername) { this.basePath = basePathOrUsername; } } } set useQuerystring(value) { this._useQuerystring = value; } set basePath(basePath) { this._basePath = basePath; } get basePath() { return this._basePath; } setDefaultAuthentication(auth) { this.authentications.default = auth; } setApiKey(key, value) { this.authentications[NetworkingApiApiKeys[key]].apiKey = value; } /** * get information of a group * @param {*} [options] Override http request options. */ getAPIGroup(options = {}) { const localVarPath = this.basePath + '/apis/networking.k8s.io/'; let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'GET', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "V1APIGroup"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } } exports.NetworkingApi = NetworkingApi; var NetworkingV1ApiApiKeys; (function (NetworkingV1ApiApiKeys) { NetworkingV1ApiApiKeys[NetworkingV1ApiApiKeys["BearerToken"] = 0] = "BearerToken"; })(NetworkingV1ApiApiKeys = exports.NetworkingV1ApiApiKeys || (exports.NetworkingV1ApiApiKeys = {})); class NetworkingV1Api { constructor(basePathOrUsername, password, basePath) { this._basePath = defaultBasePath; this.defaultHeaders = {}; this._useQuerystring = false; this.authentications = { 'default': new VoidAuth(), 'BearerToken': new ApiKeyAuth('header', 'authorization'), }; if (password) { if (basePath) { this.basePath = basePath; } } else { if (basePathOrUsername) { this.basePath = basePathOrUsername; } } } set useQuerystring(value) { this._useQuerystring = value; } set basePath(basePath) { this._basePath = basePath; } get basePath() { return this._basePath; } setDefaultAuthentication(auth) { this.authentications.default = auth; } setApiKey(key, value) { this.authentications[NetworkingV1ApiApiKeys[key]].apiKey = value; } /** * create a NetworkPolicy * @param namespace object name and auth scope, such as for teams and projects * @param body * @param includeUninitialized If true, partially initialized resources are included in the response. * @param pretty If 'true', then the output is pretty printed. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param {*} [options] Override http request options. */ createNamespacedNetworkPolicy(namespace, body, includeUninitialized, pretty, dryRun, options = {}) { const localVarPath = this.basePath + '/apis/networking.k8s.io/v1/namespaces/{namespace}/networkpolicies' .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling createNamespacedNetworkPolicy.'); } // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling createNamespacedNetworkPolicy.'); } if (includeUninitialized !== undefined) { localVarQueryParameters['includeUninitialized'] = ObjectSerializer.serialize(includeUninitialized, "boolean"); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'POST', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: ObjectSerializer.serialize(body, "V1NetworkPolicy") }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "V1NetworkPolicy"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * delete collection of NetworkPolicy * @param namespace object name and auth scope, such as for teams and projects * @param includeUninitialized If true, partially initialized resources are included in the response. * @param pretty If 'true', then the output is pretty printed. * @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. * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything. * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything. * @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. * @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. * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. * @param watch Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion. * @param {*} [options] Override http request options. */ deleteCollectionNamespacedNetworkPolicy(namespace, includeUninitialized, pretty, _continue, fieldSelector, labelSelector, limit, resourceVersion, timeoutSeconds, watch, options = {}) { const localVarPath = this.basePath + '/apis/networking.k8s.io/v1/namespaces/{namespace}/networkpolicies' .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling deleteCollectionNamespacedNetworkPolicy.'); } if (includeUninitialized !== undefined) { localVarQueryParameters['includeUninitialized'] = ObjectSerializer.serialize(includeUninitialized, "boolean"); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, "string"); } if (_continue !== undefined) { localVarQueryParameters['continue'] = ObjectSerializer.serialize(_continue, "string"); } if (fieldSelector !== undefined) { localVarQueryParameters['fieldSelector'] = ObjectSerializer.serialize(fieldSelector, "string"); } if (labelSelector !== undefined) { localVarQueryParameters['labelSelector'] = ObjectSerializer.serialize(labelSelector, "string"); } if (limit !== undefined) { localVarQueryParameters['limit'] = ObjectSerializer.serialize(limit, "number"); } if (resourceVersion !== undefined) { localVarQueryParameters['resourceVersion'] = ObjectSerializer.serialize(resourceVersion, "string"); } if (timeoutSeconds !== undefined) { localVarQueryParameters['timeoutSeconds'] = ObjectSerializer.serialize(timeoutSeconds, "number"); } if (watch !== undefined) { localVarQueryParameters['watch'] = ObjectSerializer.serialize(watch, "boolean"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'DELETE', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "V1Status"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * delete a NetworkPolicy * @param name name of the NetworkPolicy * @param namespace object name and auth scope, such as for teams and projects * @param pretty If 'true', then the output is pretty printed. * @param body * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @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. * @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. * @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. * @param {*} [options] Override http request options. */ deleteNamespacedNetworkPolicy(name, namespace, pretty, body, dryRun, gracePeriodSeconds, orphanDependents, propagationPolicy, options = {}) { const localVarPath = this.basePath + '/apis/networking.k8s.io/v1/namespaces/{namespace}/networkpolicies/{name}' .replace('{' + 'name' + '}', encodeURIComponent(String(name))) .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling deleteNamespacedNetworkPolicy.'); } // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling deleteNamespacedNetworkPolicy.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, "string"); } if (gracePeriodSeconds !== undefined) { localVarQueryParameters['gracePeriodSeconds'] = ObjectSerializer.serialize(gracePeriodSeconds, "number"); } if (orphanDependents !== undefined) { localVarQueryParameters['orphanDependents'] = ObjectSerializer.serialize(orphanDependents, "boolean"); } if (propagationPolicy !== undefined) { localVarQueryParameters['propagationPolicy'] = ObjectSerializer.serialize(propagationPolicy, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'DELETE', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: ObjectSerializer.serialize(body, "V1DeleteOptions") }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "V1Status"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * get available resources * @param {*} [options] Override http request options. */ getAPIResources(options = {}) { const localVarPath = this.basePath + '/apis/networking.k8s.io/v1/'; let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'GET', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "V1APIResourceList"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * list or watch objects of kind NetworkPolicy * @param namespace object name and auth scope, such as for teams and projects * @param includeUninitialized If true, partially initialized resources are included in the response. * @param pretty If 'true', then the output is pretty printed. * @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. * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything. * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything. * @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. * @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. * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. * @param watch Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion. * @param {*} [options] Override http request options. */ listNamespacedNetworkPolicy(namespace, includeUninitialized, pretty, _continue, fieldSelector, labelSelector, limit, resourceVersion, timeoutSeconds, watch, options = {}) { const localVarPath = this.basePath + '/apis/networking.k8s.io/v1/namespaces/{namespace}/networkpolicies' .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling listNamespacedNetworkPolicy.'); } if (includeUninitialized !== undefined) { localVarQueryParameters['includeUninitialized'] = ObjectSerializer.serialize(includeUninitialized, "boolean"); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, "string"); } if (_continue !== undefined) { localVarQueryParameters['continue'] = ObjectSerializer.serialize(_continue, "string"); } if (fieldSelector !== undefined) { localVarQueryParameters['fieldSelector'] = ObjectSerializer.serialize(fieldSelector, "string"); } if (labelSelector !== undefined) { localVarQueryParameters['labelSelector'] = ObjectSerializer.serialize(labelSelector, "string"); } if (limit !== undefined) { localVarQueryParameters['limit'] = ObjectSerializer.serialize(limit, "number"); } if (resourceVersion !== undefined) { localVarQueryParameters['resourceVersion'] = ObjectSerializer.serialize(resourceVersion, "string"); } if (timeoutSeconds !== undefined) { localVarQueryParameters['timeoutSeconds'] = ObjectSerializer.serialize(timeoutSeconds, "number"); } if (watch !== undefined) { localVarQueryParameters['watch'] = ObjectSerializer.serialize(watch, "boolean"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'GET', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "V1NetworkPolicyList"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * list or watch objects of kind NetworkPolicy * @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. * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything. * @param includeUninitialized If true, partially initialized resources are included in the response. * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything. * @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. * @param pretty If 'true', then the output is pretty printed. * @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. * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. * @param watch Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion. * @param {*} [options] Override http request options. */ listNetworkPolicyForAllNamespaces(_continue, fieldSelector, includeUninitialized, labelSelector, limit, pretty, resourceVersion, timeoutSeconds, watch, options = {}) { const localVarPath = this.basePath + '/apis/networking.k8s.io/v1/networkpolicies'; let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; if (_continue !== undefined) { localVarQueryParameters['continue'] = ObjectSerializer.serialize(_continue, "string"); } if (fieldSelector !== undefined) { localVarQueryParameters['fieldSelector'] = ObjectSerializer.serialize(fieldSelector, "string"); } if (includeUninitialized !== undefined) { localVarQueryParameters['includeUninitialized'] = ObjectSerializer.serialize(includeUninitialized, "boolean"); } if (labelSelector !== undefined) { localVarQueryParameters['labelSelector'] = ObjectSerializer.serialize(labelSelector, "string"); } if (limit !== undefined) { localVarQueryParameters['limit'] = ObjectSerializer.serialize(limit, "number"); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, "string"); } if (resourceVersion !== undefined) { localVarQueryParameters['resourceVersion'] = ObjectSerializer.serialize(resourceVersion, "string"); } if (timeoutSeconds !== undefined) { localVarQueryParameters['timeoutSeconds'] = ObjectSerializer.serialize(timeoutSeconds, "number"); } if (watch !== undefined) { localVarQueryParameters['watch'] = ObjectSerializer.serialize(watch, "boolean"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'GET', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "V1NetworkPolicyList"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * partially update the specified NetworkPolicy * @param name name of the NetworkPolicy * @param namespace object name and auth scope, such as for teams and projects * @param body * @param pretty If 'true', then the output is pretty printed. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param {*} [options] Override http request options. */ patchNamespacedNetworkPolicy(name, namespace, body, pretty, dryRun, options = {}) { const localVarPath = this.basePath + '/apis/networking.k8s.io/v1/namespaces/{namespace}/networkpolicies/{name}' .replace('{' + 'name' + '}', encodeURIComponent(String(name))) .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling patchNamespacedNetworkPolicy.'); } // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling patchNamespacedNetworkPolicy.'); } // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling patchNamespacedNetworkPolicy.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'PATCH', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: ObjectSerializer.serialize(body, "any") }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "V1NetworkPolicy"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * read the specified NetworkPolicy * @param name name of the NetworkPolicy * @param namespace object name and auth scope, such as for teams and projects * @param pretty If 'true', then the output is pretty printed. * @param exact Should the export be exact. Exact export maintains cluster-specific fields like 'Namespace'. * @param _export Should this value be exported. Export strips fields that a user can not specify. * @param {*} [options] Override http request options. */ readNamespacedNetworkPolicy(name, namespace, pretty, exact, _export, options = {}) { const localVarPath = this.basePath + '/apis/networking.k8s.io/v1/namespaces/{namespace}/networkpolicies/{name}' .replace('{' + 'name' + '}', encodeURIComponent(String(name))) .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling readNamespacedNetworkPolicy.'); } // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling readNamespacedNetworkPolicy.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, "string"); } if (exact !== undefined) { localVarQueryParameters['exact'] = ObjectSerializer.serialize(exact, "boolean"); } if (_export !== undefined) { localVarQueryParameters['export'] = ObjectSerializer.serialize(_export, "boolean"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'GET', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "V1NetworkPolicy"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * replace the specified NetworkPolicy * @param name name of the NetworkPolicy * @param namespace object name and auth scope, such as for teams and projects * @param body * @param pretty If 'true', then the output is pretty printed. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param {*} [options] Override http request options. */ replaceNamespacedNetworkPolicy(name, namespace, body, pretty, dryRun, options = {}) { const localVarPath = this.basePath + '/apis/networking.k8s.io/v1/namespaces/{namespace}/networkpolicies/{name}' .replace('{' + 'name' + '}', encodeURIComponent(String(name))) .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling replaceNamespacedNetworkPolicy.'); } // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling replaceNamespacedNetworkPolicy.'); } // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling replaceNamespacedNetworkPolicy.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'PUT', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: ObjectSerializer.serialize(body, "V1NetworkPolicy") }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "V1NetworkPolicy"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } } exports.NetworkingV1Api = NetworkingV1Api; var PolicyApiApiKeys; (function (PolicyApiApiKeys) { PolicyApiApiKeys[PolicyApiApiKeys["BearerToken"] = 0] = "BearerToken"; })(PolicyApiApiKeys = exports.PolicyApiApiKeys || (exports.PolicyApiApiKeys = {})); class PolicyApi { constructor(basePathOrUsername, password, basePath) { this._basePath = defaultBasePath; this.defaultHeaders = {}; this._useQuerystring = false; this.authentications = { 'default': new VoidAuth(), 'BearerToken': new ApiKeyAuth('header', 'authorization'), }; if (password) { if (basePath) { this.basePath = basePath; } } else { if (basePathOrUsername) { this.basePath = basePathOrUsername; } } } set useQuerystring(value) { this._useQuerystring = value; } set basePath(basePath) { this._basePath = basePath; } get basePath() { return this._basePath; } setDefaultAuthentication(auth) { this.authentications.default = auth; } setApiKey(key, value) { this.authentications[PolicyApiApiKeys[key]].apiKey = value; } /** * get information of a group * @param {*} [options] Override http request options. */ getAPIGroup(options = {}) { const localVarPath = this.basePath + '/apis/policy/'; let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'GET', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "V1APIGroup"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } } exports.PolicyApi = PolicyApi; var PolicyV1beta1ApiApiKeys; (function (PolicyV1beta1ApiApiKeys) { PolicyV1beta1ApiApiKeys[PolicyV1beta1ApiApiKeys["BearerToken"] = 0] = "BearerToken"; })(PolicyV1beta1ApiApiKeys = exports.PolicyV1beta1ApiApiKeys || (exports.PolicyV1beta1ApiApiKeys = {})); class PolicyV1beta1Api { constructor(basePathOrUsername, password, basePath) { this._basePath = defaultBasePath; this.defaultHeaders = {}; this._useQuerystring = false; this.authentications = { 'default': new VoidAuth(), 'BearerToken': new ApiKeyAuth('header', 'authorization'), }; if (password) { if (basePath) { this.basePath = basePath; } } else { if (basePathOrUsername) { this.basePath = basePathOrUsername; } } } set useQuerystring(value) { this._useQuerystring = value; } set basePath(basePath) { this._basePath = basePath; } get basePath() { return this._basePath; } setDefaultAuthentication(auth) { this.authentications.default = auth; } setApiKey(key, value) { this.authentications[PolicyV1beta1ApiApiKeys[key]].apiKey = value; } /** * create a PodDisruptionBudget * @param namespace object name and auth scope, such as for teams and projects * @param body * @param includeUninitialized If true, partially initialized resources are included in the response. * @param pretty If 'true', then the output is pretty printed. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param {*} [options] Override http request options. */ createNamespacedPodDisruptionBudget(namespace, body, includeUninitialized, pretty, dryRun, options = {}) { const localVarPath = this.basePath + '/apis/policy/v1beta1/namespaces/{namespace}/poddisruptionbudgets' .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling createNamespacedPodDisruptionBudget.'); } // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling createNamespacedPodDisruptionBudget.'); } if (includeUninitialized !== undefined) { localVarQueryParameters['includeUninitialized'] = ObjectSerializer.serialize(includeUninitialized, "boolean"); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'POST', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: ObjectSerializer.serialize(body, "V1beta1PodDisruptionBudget") }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "V1beta1PodDisruptionBudget"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * create a PodSecurityPolicy * @param body * @param includeUninitialized If true, partially initialized resources are included in the response. * @param pretty If 'true', then the output is pretty printed. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param {*} [options] Override http request options. */ createPodSecurityPolicy(body, includeUninitialized, pretty, dryRun, options = {}) { const localVarPath = this.basePath + '/apis/policy/v1beta1/podsecuritypolicies'; let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling createPodSecurityPolicy.'); } if (includeUninitialized !== undefined) { localVarQueryParameters['includeUninitialized'] = ObjectSerializer.serialize(includeUninitialized, "boolean"); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'POST', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: ObjectSerializer.serialize(body, "PolicyV1beta1PodSecurityPolicy") }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "PolicyV1beta1PodSecurityPolicy"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * delete collection of PodDisruptionBudget * @param namespace object name and auth scope, such as for teams and projects * @param includeUninitialized If true, partially initialized resources are included in the response. * @param pretty If 'true', then the output is pretty printed. * @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. * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything. * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything. * @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. * @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. * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. * @param watch Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion. * @param {*} [options] Override http request options. */ deleteCollectionNamespacedPodDisruptionBudget(namespace, includeUninitialized, pretty, _continue, fieldSelector, labelSelector, limit, resourceVersion, timeoutSeconds, watch, options = {}) { const localVarPath = this.basePath + '/apis/policy/v1beta1/namespaces/{namespace}/poddisruptionbudgets' .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling deleteCollectionNamespacedPodDisruptionBudget.'); } if (includeUninitialized !== undefined) { localVarQueryParameters['includeUninitialized'] = ObjectSerializer.serialize(includeUninitialized, "boolean"); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, "string"); } if (_continue !== undefined) { localVarQueryParameters['continue'] = ObjectSerializer.serialize(_continue, "string"); } if (fieldSelector !== undefined) { localVarQueryParameters['fieldSelector'] = ObjectSerializer.serialize(fieldSelector, "string"); } if (labelSelector !== undefined) { localVarQueryParameters['labelSelector'] = ObjectSerializer.serialize(labelSelector, "string"); } if (limit !== undefined) { localVarQueryParameters['limit'] = ObjectSerializer.serialize(limit, "number"); } if (resourceVersion !== undefined) { localVarQueryParameters['resourceVersion'] = ObjectSerializer.serialize(resourceVersion, "string"); } if (timeoutSeconds !== undefined) { localVarQueryParameters['timeoutSeconds'] = ObjectSerializer.serialize(timeoutSeconds, "number"); } if (watch !== undefined) { localVarQueryParameters['watch'] = ObjectSerializer.serialize(watch, "boolean"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'DELETE', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "V1Status"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * delete collection of PodSecurityPolicy * @param includeUninitialized If true, partially initialized resources are included in the response. * @param pretty If 'true', then the output is pretty printed. * @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. * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything. * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything. * @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. * @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. * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. * @param watch Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion. * @param {*} [options] Override http request options. */ deleteCollectionPodSecurityPolicy(includeUninitialized, pretty, _continue, fieldSelector, labelSelector, limit, resourceVersion, timeoutSeconds, watch, options = {}) { const localVarPath = this.basePath + '/apis/policy/v1beta1/podsecuritypolicies'; let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; if (includeUninitialized !== undefined) { localVarQueryParameters['includeUninitialized'] = ObjectSerializer.serialize(includeUninitialized, "boolean"); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, "string"); } if (_continue !== undefined) { localVarQueryParameters['continue'] = ObjectSerializer.serialize(_continue, "string"); } if (fieldSelector !== undefined) { localVarQueryParameters['fieldSelector'] = ObjectSerializer.serialize(fieldSelector, "string"); } if (labelSelector !== undefined) { localVarQueryParameters['labelSelector'] = ObjectSerializer.serialize(labelSelector, "string"); } if (limit !== undefined) { localVarQueryParameters['limit'] = ObjectSerializer.serialize(limit, "number"); } if (resourceVersion !== undefined) { localVarQueryParameters['resourceVersion'] = ObjectSerializer.serialize(resourceVersion, "string"); } if (timeoutSeconds !== undefined) { localVarQueryParameters['timeoutSeconds'] = ObjectSerializer.serialize(timeoutSeconds, "number"); } if (watch !== undefined) { localVarQueryParameters['watch'] = ObjectSerializer.serialize(watch, "boolean"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'DELETE', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "V1Status"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * delete a PodDisruptionBudget * @param name name of the PodDisruptionBudget * @param namespace object name and auth scope, such as for teams and projects * @param pretty If 'true', then the output is pretty printed. * @param body * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @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. * @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. * @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. * @param {*} [options] Override http request options. */ deleteNamespacedPodDisruptionBudget(name, namespace, pretty, body, dryRun, gracePeriodSeconds, orphanDependents, propagationPolicy, options = {}) { const localVarPath = this.basePath + '/apis/policy/v1beta1/namespaces/{namespace}/poddisruptionbudgets/{name}' .replace('{' + 'name' + '}', encodeURIComponent(String(name))) .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling deleteNamespacedPodDisruptionBudget.'); } // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling deleteNamespacedPodDisruptionBudget.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, "string"); } if (gracePeriodSeconds !== undefined) { localVarQueryParameters['gracePeriodSeconds'] = ObjectSerializer.serialize(gracePeriodSeconds, "number"); } if (orphanDependents !== undefined) { localVarQueryParameters['orphanDependents'] = ObjectSerializer.serialize(orphanDependents, "boolean"); } if (propagationPolicy !== undefined) { localVarQueryParameters['propagationPolicy'] = ObjectSerializer.serialize(propagationPolicy, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'DELETE', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: ObjectSerializer.serialize(body, "V1DeleteOptions") }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "V1Status"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * delete a PodSecurityPolicy * @param name name of the PodSecurityPolicy * @param pretty If 'true', then the output is pretty printed. * @param body * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @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. * @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. * @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. * @param {*} [options] Override http request options. */ deletePodSecurityPolicy(name, pretty, body, dryRun, gracePeriodSeconds, orphanDependents, propagationPolicy, options = {}) { const localVarPath = this.basePath + '/apis/policy/v1beta1/podsecuritypolicies/{name}' .replace('{' + 'name' + '}', encodeURIComponent(String(name))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling deletePodSecurityPolicy.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, "string"); } if (gracePeriodSeconds !== undefined) { localVarQueryParameters['gracePeriodSeconds'] = ObjectSerializer.serialize(gracePeriodSeconds, "number"); } if (orphanDependents !== undefined) { localVarQueryParameters['orphanDependents'] = ObjectSerializer.serialize(orphanDependents, "boolean"); } if (propagationPolicy !== undefined) { localVarQueryParameters['propagationPolicy'] = ObjectSerializer.serialize(propagationPolicy, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'DELETE', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: ObjectSerializer.serialize(body, "V1DeleteOptions") }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "V1Status"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * get available resources * @param {*} [options] Override http request options. */ getAPIResources(options = {}) { const localVarPath = this.basePath + '/apis/policy/v1beta1/'; let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'GET', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "V1APIResourceList"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * list or watch objects of kind PodDisruptionBudget * @param namespace object name and auth scope, such as for teams and projects * @param includeUninitialized If true, partially initialized resources are included in the response. * @param pretty If 'true', then the output is pretty printed. * @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. * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything. * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything. * @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. * @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. * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. * @param watch Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion. * @param {*} [options] Override http request options. */ listNamespacedPodDisruptionBudget(namespace, includeUninitialized, pretty, _continue, fieldSelector, labelSelector, limit, resourceVersion, timeoutSeconds, watch, options = {}) { const localVarPath = this.basePath + '/apis/policy/v1beta1/namespaces/{namespace}/poddisruptionbudgets' .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling listNamespacedPodDisruptionBudget.'); } if (includeUninitialized !== undefined) { localVarQueryParameters['includeUninitialized'] = ObjectSerializer.serialize(includeUninitialized, "boolean"); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, "string"); } if (_continue !== undefined) { localVarQueryParameters['continue'] = ObjectSerializer.serialize(_continue, "string"); } if (fieldSelector !== undefined) { localVarQueryParameters['fieldSelector'] = ObjectSerializer.serialize(fieldSelector, "string"); } if (labelSelector !== undefined) { localVarQueryParameters['labelSelector'] = ObjectSerializer.serialize(labelSelector, "string"); } if (limit !== undefined) { localVarQueryParameters['limit'] = ObjectSerializer.serialize(limit, "number"); } if (resourceVersion !== undefined) { localVarQueryParameters['resourceVersion'] = ObjectSerializer.serialize(resourceVersion, "string"); } if (timeoutSeconds !== undefined) { localVarQueryParameters['timeoutSeconds'] = ObjectSerializer.serialize(timeoutSeconds, "number"); } if (watch !== undefined) { localVarQueryParameters['watch'] = ObjectSerializer.serialize(watch, "boolean"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'GET', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "V1beta1PodDisruptionBudgetList"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * list or watch objects of kind PodDisruptionBudget * @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. * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything. * @param includeUninitialized If true, partially initialized resources are included in the response. * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything. * @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. * @param pretty If 'true', then the output is pretty printed. * @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. * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. * @param watch Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion. * @param {*} [options] Override http request options. */ listPodDisruptionBudgetForAllNamespaces(_continue, fieldSelector, includeUninitialized, labelSelector, limit, pretty, resourceVersion, timeoutSeconds, watch, options = {}) { const localVarPath = this.basePath + '/apis/policy/v1beta1/poddisruptionbudgets'; let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; if (_continue !== undefined) { localVarQueryParameters['continue'] = ObjectSerializer.serialize(_continue, "string"); } if (fieldSelector !== undefined) { localVarQueryParameters['fieldSelector'] = ObjectSerializer.serialize(fieldSelector, "string"); } if (includeUninitialized !== undefined) { localVarQueryParameters['includeUninitialized'] = ObjectSerializer.serialize(includeUninitialized, "boolean"); } if (labelSelector !== undefined) { localVarQueryParameters['labelSelector'] = ObjectSerializer.serialize(labelSelector, "string"); } if (limit !== undefined) { localVarQueryParameters['limit'] = ObjectSerializer.serialize(limit, "number"); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, "string"); } if (resourceVersion !== undefined) { localVarQueryParameters['resourceVersion'] = ObjectSerializer.serialize(resourceVersion, "string"); } if (timeoutSeconds !== undefined) { localVarQueryParameters['timeoutSeconds'] = ObjectSerializer.serialize(timeoutSeconds, "number"); } if (watch !== undefined) { localVarQueryParameters['watch'] = ObjectSerializer.serialize(watch, "boolean"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'GET', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "V1beta1PodDisruptionBudgetList"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * list or watch objects of kind PodSecurityPolicy * @param includeUninitialized If true, partially initialized resources are included in the response. * @param pretty If 'true', then the output is pretty printed. * @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. * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything. * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything. * @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. * @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. * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. * @param watch Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion. * @param {*} [options] Override http request options. */ listPodSecurityPolicy(includeUninitialized, pretty, _continue, fieldSelector, labelSelector, limit, resourceVersion, timeoutSeconds, watch, options = {}) { const localVarPath = this.basePath + '/apis/policy/v1beta1/podsecuritypolicies'; let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; if (includeUninitialized !== undefined) { localVarQueryParameters['includeUninitialized'] = ObjectSerializer.serialize(includeUninitialized, "boolean"); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, "string"); } if (_continue !== undefined) { localVarQueryParameters['continue'] = ObjectSerializer.serialize(_continue, "string"); } if (fieldSelector !== undefined) { localVarQueryParameters['fieldSelector'] = ObjectSerializer.serialize(fieldSelector, "string"); } if (labelSelector !== undefined) { localVarQueryParameters['labelSelector'] = ObjectSerializer.serialize(labelSelector, "string"); } if (limit !== undefined) { localVarQueryParameters['limit'] = ObjectSerializer.serialize(limit, "number"); } if (resourceVersion !== undefined) { localVarQueryParameters['resourceVersion'] = ObjectSerializer.serialize(resourceVersion, "string"); } if (timeoutSeconds !== undefined) { localVarQueryParameters['timeoutSeconds'] = ObjectSerializer.serialize(timeoutSeconds, "number"); } if (watch !== undefined) { localVarQueryParameters['watch'] = ObjectSerializer.serialize(watch, "boolean"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'GET', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "PolicyV1beta1PodSecurityPolicyList"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * partially update the specified PodDisruptionBudget * @param name name of the PodDisruptionBudget * @param namespace object name and auth scope, such as for teams and projects * @param body * @param pretty If 'true', then the output is pretty printed. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param {*} [options] Override http request options. */ patchNamespacedPodDisruptionBudget(name, namespace, body, pretty, dryRun, options = {}) { const localVarPath = this.basePath + '/apis/policy/v1beta1/namespaces/{namespace}/poddisruptionbudgets/{name}' .replace('{' + 'name' + '}', encodeURIComponent(String(name))) .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling patchNamespacedPodDisruptionBudget.'); } // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling patchNamespacedPodDisruptionBudget.'); } // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling patchNamespacedPodDisruptionBudget.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'PATCH', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: ObjectSerializer.serialize(body, "any") }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "V1beta1PodDisruptionBudget"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * partially update status of the specified PodDisruptionBudget * @param name name of the PodDisruptionBudget * @param namespace object name and auth scope, such as for teams and projects * @param body * @param pretty If 'true', then the output is pretty printed. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param {*} [options] Override http request options. */ patchNamespacedPodDisruptionBudgetStatus(name, namespace, body, pretty, dryRun, options = {}) { const localVarPath = this.basePath + '/apis/policy/v1beta1/namespaces/{namespace}/poddisruptionbudgets/{name}/status' .replace('{' + 'name' + '}', encodeURIComponent(String(name))) .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling patchNamespacedPodDisruptionBudgetStatus.'); } // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling patchNamespacedPodDisruptionBudgetStatus.'); } // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling patchNamespacedPodDisruptionBudgetStatus.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'PATCH', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: ObjectSerializer.serialize(body, "any") }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "V1beta1PodDisruptionBudget"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * partially update the specified PodSecurityPolicy * @param name name of the PodSecurityPolicy * @param body * @param pretty If 'true', then the output is pretty printed. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param {*} [options] Override http request options. */ patchPodSecurityPolicy(name, body, pretty, dryRun, options = {}) { const localVarPath = this.basePath + '/apis/policy/v1beta1/podsecuritypolicies/{name}' .replace('{' + 'name' + '}', encodeURIComponent(String(name))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling patchPodSecurityPolicy.'); } // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling patchPodSecurityPolicy.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'PATCH', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: ObjectSerializer.serialize(body, "any") }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "PolicyV1beta1PodSecurityPolicy"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * read the specified PodDisruptionBudget * @param name name of the PodDisruptionBudget * @param namespace object name and auth scope, such as for teams and projects * @param pretty If 'true', then the output is pretty printed. * @param exact Should the export be exact. Exact export maintains cluster-specific fields like 'Namespace'. * @param _export Should this value be exported. Export strips fields that a user can not specify. * @param {*} [options] Override http request options. */ readNamespacedPodDisruptionBudget(name, namespace, pretty, exact, _export, options = {}) { const localVarPath = this.basePath + '/apis/policy/v1beta1/namespaces/{namespace}/poddisruptionbudgets/{name}' .replace('{' + 'name' + '}', encodeURIComponent(String(name))) .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling readNamespacedPodDisruptionBudget.'); } // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling readNamespacedPodDisruptionBudget.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, "string"); } if (exact !== undefined) { localVarQueryParameters['exact'] = ObjectSerializer.serialize(exact, "boolean"); } if (_export !== undefined) { localVarQueryParameters['export'] = ObjectSerializer.serialize(_export, "boolean"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'GET', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "V1beta1PodDisruptionBudget"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * read status of the specified PodDisruptionBudget * @param name name of the PodDisruptionBudget * @param namespace object name and auth scope, such as for teams and projects * @param pretty If 'true', then the output is pretty printed. * @param {*} [options] Override http request options. */ readNamespacedPodDisruptionBudgetStatus(name, namespace, pretty, options = {}) { const localVarPath = this.basePath + '/apis/policy/v1beta1/namespaces/{namespace}/poddisruptionbudgets/{name}/status' .replace('{' + 'name' + '}', encodeURIComponent(String(name))) .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling readNamespacedPodDisruptionBudgetStatus.'); } // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling readNamespacedPodDisruptionBudgetStatus.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'GET', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "V1beta1PodDisruptionBudget"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * read the specified PodSecurityPolicy * @param name name of the PodSecurityPolicy * @param pretty If 'true', then the output is pretty printed. * @param exact Should the export be exact. Exact export maintains cluster-specific fields like 'Namespace'. * @param _export Should this value be exported. Export strips fields that a user can not specify. * @param {*} [options] Override http request options. */ readPodSecurityPolicy(name, pretty, exact, _export, options = {}) { const localVarPath = this.basePath + '/apis/policy/v1beta1/podsecuritypolicies/{name}' .replace('{' + 'name' + '}', encodeURIComponent(String(name))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling readPodSecurityPolicy.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, "string"); } if (exact !== undefined) { localVarQueryParameters['exact'] = ObjectSerializer.serialize(exact, "boolean"); } if (_export !== undefined) { localVarQueryParameters['export'] = ObjectSerializer.serialize(_export, "boolean"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'GET', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "PolicyV1beta1PodSecurityPolicy"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * replace the specified PodDisruptionBudget * @param name name of the PodDisruptionBudget * @param namespace object name and auth scope, such as for teams and projects * @param body * @param pretty If 'true', then the output is pretty printed. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param {*} [options] Override http request options. */ replaceNamespacedPodDisruptionBudget(name, namespace, body, pretty, dryRun, options = {}) { const localVarPath = this.basePath + '/apis/policy/v1beta1/namespaces/{namespace}/poddisruptionbudgets/{name}' .replace('{' + 'name' + '}', encodeURIComponent(String(name))) .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling replaceNamespacedPodDisruptionBudget.'); } // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling replaceNamespacedPodDisruptionBudget.'); } // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling replaceNamespacedPodDisruptionBudget.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'PUT', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: ObjectSerializer.serialize(body, "V1beta1PodDisruptionBudget") }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "V1beta1PodDisruptionBudget"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * replace status of the specified PodDisruptionBudget * @param name name of the PodDisruptionBudget * @param namespace object name and auth scope, such as for teams and projects * @param body * @param pretty If 'true', then the output is pretty printed. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param {*} [options] Override http request options. */ replaceNamespacedPodDisruptionBudgetStatus(name, namespace, body, pretty, dryRun, options = {}) { const localVarPath = this.basePath + '/apis/policy/v1beta1/namespaces/{namespace}/poddisruptionbudgets/{name}/status' .replace('{' + 'name' + '}', encodeURIComponent(String(name))) .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling replaceNamespacedPodDisruptionBudgetStatus.'); } // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling replaceNamespacedPodDisruptionBudgetStatus.'); } // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling replaceNamespacedPodDisruptionBudgetStatus.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'PUT', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: ObjectSerializer.serialize(body, "V1beta1PodDisruptionBudget") }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "V1beta1PodDisruptionBudget"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * replace the specified PodSecurityPolicy * @param name name of the PodSecurityPolicy * @param body * @param pretty If 'true', then the output is pretty printed. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param {*} [options] Override http request options. */ replacePodSecurityPolicy(name, body, pretty, dryRun, options = {}) { const localVarPath = this.basePath + '/apis/policy/v1beta1/podsecuritypolicies/{name}' .replace('{' + 'name' + '}', encodeURIComponent(String(name))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling replacePodSecurityPolicy.'); } // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling replacePodSecurityPolicy.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'PUT', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: ObjectSerializer.serialize(body, "PolicyV1beta1PodSecurityPolicy") }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "PolicyV1beta1PodSecurityPolicy"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } } exports.PolicyV1beta1Api = PolicyV1beta1Api; var RbacAuthorizationApiApiKeys; (function (RbacAuthorizationApiApiKeys) { RbacAuthorizationApiApiKeys[RbacAuthorizationApiApiKeys["BearerToken"] = 0] = "BearerToken"; })(RbacAuthorizationApiApiKeys = exports.RbacAuthorizationApiApiKeys || (exports.RbacAuthorizationApiApiKeys = {})); class RbacAuthorizationApi { constructor(basePathOrUsername, password, basePath) { this._basePath = defaultBasePath; this.defaultHeaders = {}; this._useQuerystring = false; this.authentications = { 'default': new VoidAuth(), 'BearerToken': new ApiKeyAuth('header', 'authorization'), }; if (password) { if (basePath) { this.basePath = basePath; } } else { if (basePathOrUsername) { this.basePath = basePathOrUsername; } } } set useQuerystring(value) { this._useQuerystring = value; } set basePath(basePath) { this._basePath = basePath; } get basePath() { return this._basePath; } setDefaultAuthentication(auth) { this.authentications.default = auth; } setApiKey(key, value) { this.authentications[RbacAuthorizationApiApiKeys[key]].apiKey = value; } /** * get information of a group * @param {*} [options] Override http request options. */ getAPIGroup(options = {}) { const localVarPath = this.basePath + '/apis/rbac.authorization.k8s.io/'; let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'GET', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "V1APIGroup"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } } exports.RbacAuthorizationApi = RbacAuthorizationApi; var RbacAuthorizationV1ApiApiKeys; (function (RbacAuthorizationV1ApiApiKeys) { RbacAuthorizationV1ApiApiKeys[RbacAuthorizationV1ApiApiKeys["BearerToken"] = 0] = "BearerToken"; })(RbacAuthorizationV1ApiApiKeys = exports.RbacAuthorizationV1ApiApiKeys || (exports.RbacAuthorizationV1ApiApiKeys = {})); class RbacAuthorizationV1Api { constructor(basePathOrUsername, password, basePath) { this._basePath = defaultBasePath; this.defaultHeaders = {}; this._useQuerystring = false; this.authentications = { 'default': new VoidAuth(), 'BearerToken': new ApiKeyAuth('header', 'authorization'), }; if (password) { if (basePath) { this.basePath = basePath; } } else { if (basePathOrUsername) { this.basePath = basePathOrUsername; } } } set useQuerystring(value) { this._useQuerystring = value; } set basePath(basePath) { this._basePath = basePath; } get basePath() { return this._basePath; } setDefaultAuthentication(auth) { this.authentications.default = auth; } setApiKey(key, value) { this.authentications[RbacAuthorizationV1ApiApiKeys[key]].apiKey = value; } /** * create a ClusterRole * @param body * @param includeUninitialized If true, partially initialized resources are included in the response. * @param pretty If 'true', then the output is pretty printed. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param {*} [options] Override http request options. */ createClusterRole(body, includeUninitialized, pretty, dryRun, options = {}) { const localVarPath = this.basePath + '/apis/rbac.authorization.k8s.io/v1/clusterroles'; let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling createClusterRole.'); } if (includeUninitialized !== undefined) { localVarQueryParameters['includeUninitialized'] = ObjectSerializer.serialize(includeUninitialized, "boolean"); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'POST', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: ObjectSerializer.serialize(body, "V1ClusterRole") }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "V1ClusterRole"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * create a ClusterRoleBinding * @param body * @param includeUninitialized If true, partially initialized resources are included in the response. * @param pretty If 'true', then the output is pretty printed. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param {*} [options] Override http request options. */ createClusterRoleBinding(body, includeUninitialized, pretty, dryRun, options = {}) { const localVarPath = this.basePath + '/apis/rbac.authorization.k8s.io/v1/clusterrolebindings'; let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling createClusterRoleBinding.'); } if (includeUninitialized !== undefined) { localVarQueryParameters['includeUninitialized'] = ObjectSerializer.serialize(includeUninitialized, "boolean"); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'POST', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: ObjectSerializer.serialize(body, "V1ClusterRoleBinding") }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "V1ClusterRoleBinding"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * create a Role * @param namespace object name and auth scope, such as for teams and projects * @param body * @param includeUninitialized If true, partially initialized resources are included in the response. * @param pretty If 'true', then the output is pretty printed. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param {*} [options] Override http request options. */ createNamespacedRole(namespace, body, includeUninitialized, pretty, dryRun, options = {}) { const localVarPath = this.basePath + '/apis/rbac.authorization.k8s.io/v1/namespaces/{namespace}/roles' .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling createNamespacedRole.'); } // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling createNamespacedRole.'); } if (includeUninitialized !== undefined) { localVarQueryParameters['includeUninitialized'] = ObjectSerializer.serialize(includeUninitialized, "boolean"); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'POST', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: ObjectSerializer.serialize(body, "V1Role") }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "V1Role"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * create a RoleBinding * @param namespace object name and auth scope, such as for teams and projects * @param body * @param includeUninitialized If true, partially initialized resources are included in the response. * @param pretty If 'true', then the output is pretty printed. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param {*} [options] Override http request options. */ createNamespacedRoleBinding(namespace, body, includeUninitialized, pretty, dryRun, options = {}) { const localVarPath = this.basePath + '/apis/rbac.authorization.k8s.io/v1/namespaces/{namespace}/rolebindings' .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling createNamespacedRoleBinding.'); } // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling createNamespacedRoleBinding.'); } if (includeUninitialized !== undefined) { localVarQueryParameters['includeUninitialized'] = ObjectSerializer.serialize(includeUninitialized, "boolean"); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'POST', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: ObjectSerializer.serialize(body, "V1RoleBinding") }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "V1RoleBinding"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * delete a ClusterRole * @param name name of the ClusterRole * @param pretty If 'true', then the output is pretty printed. * @param body * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @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. * @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. * @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. * @param {*} [options] Override http request options. */ deleteClusterRole(name, pretty, body, dryRun, gracePeriodSeconds, orphanDependents, propagationPolicy, options = {}) { const localVarPath = this.basePath + '/apis/rbac.authorization.k8s.io/v1/clusterroles/{name}' .replace('{' + 'name' + '}', encodeURIComponent(String(name))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling deleteClusterRole.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, "string"); } if (gracePeriodSeconds !== undefined) { localVarQueryParameters['gracePeriodSeconds'] = ObjectSerializer.serialize(gracePeriodSeconds, "number"); } if (orphanDependents !== undefined) { localVarQueryParameters['orphanDependents'] = ObjectSerializer.serialize(orphanDependents, "boolean"); } if (propagationPolicy !== undefined) { localVarQueryParameters['propagationPolicy'] = ObjectSerializer.serialize(propagationPolicy, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'DELETE', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: ObjectSerializer.serialize(body, "V1DeleteOptions") }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "V1Status"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * delete a ClusterRoleBinding * @param name name of the ClusterRoleBinding * @param pretty If 'true', then the output is pretty printed. * @param body * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @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. * @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. * @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. * @param {*} [options] Override http request options. */ deleteClusterRoleBinding(name, pretty, body, dryRun, gracePeriodSeconds, orphanDependents, propagationPolicy, options = {}) { const localVarPath = this.basePath + '/apis/rbac.authorization.k8s.io/v1/clusterrolebindings/{name}' .replace('{' + 'name' + '}', encodeURIComponent(String(name))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling deleteClusterRoleBinding.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, "string"); } if (gracePeriodSeconds !== undefined) { localVarQueryParameters['gracePeriodSeconds'] = ObjectSerializer.serialize(gracePeriodSeconds, "number"); } if (orphanDependents !== undefined) { localVarQueryParameters['orphanDependents'] = ObjectSerializer.serialize(orphanDependents, "boolean"); } if (propagationPolicy !== undefined) { localVarQueryParameters['propagationPolicy'] = ObjectSerializer.serialize(propagationPolicy, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'DELETE', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: ObjectSerializer.serialize(body, "V1DeleteOptions") }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "V1Status"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * delete collection of ClusterRole * @param includeUninitialized If true, partially initialized resources are included in the response. * @param pretty If 'true', then the output is pretty printed. * @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. * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything. * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything. * @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. * @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. * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. * @param watch Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion. * @param {*} [options] Override http request options. */ deleteCollectionClusterRole(includeUninitialized, pretty, _continue, fieldSelector, labelSelector, limit, resourceVersion, timeoutSeconds, watch, options = {}) { const localVarPath = this.basePath + '/apis/rbac.authorization.k8s.io/v1/clusterroles'; let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; if (includeUninitialized !== undefined) { localVarQueryParameters['includeUninitialized'] = ObjectSerializer.serialize(includeUninitialized, "boolean"); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, "string"); } if (_continue !== undefined) { localVarQueryParameters['continue'] = ObjectSerializer.serialize(_continue, "string"); } if (fieldSelector !== undefined) { localVarQueryParameters['fieldSelector'] = ObjectSerializer.serialize(fieldSelector, "string"); } if (labelSelector !== undefined) { localVarQueryParameters['labelSelector'] = ObjectSerializer.serialize(labelSelector, "string"); } if (limit !== undefined) { localVarQueryParameters['limit'] = ObjectSerializer.serialize(limit, "number"); } if (resourceVersion !== undefined) { localVarQueryParameters['resourceVersion'] = ObjectSerializer.serialize(resourceVersion, "string"); } if (timeoutSeconds !== undefined) { localVarQueryParameters['timeoutSeconds'] = ObjectSerializer.serialize(timeoutSeconds, "number"); } if (watch !== undefined) { localVarQueryParameters['watch'] = ObjectSerializer.serialize(watch, "boolean"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'DELETE', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "V1Status"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * delete collection of ClusterRoleBinding * @param includeUninitialized If true, partially initialized resources are included in the response. * @param pretty If 'true', then the output is pretty printed. * @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. * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything. * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything. * @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. * @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. * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. * @param watch Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion. * @param {*} [options] Override http request options. */ deleteCollectionClusterRoleBinding(includeUninitialized, pretty, _continue, fieldSelector, labelSelector, limit, resourceVersion, timeoutSeconds, watch, options = {}) { const localVarPath = this.basePath + '/apis/rbac.authorization.k8s.io/v1/clusterrolebindings'; let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; if (includeUninitialized !== undefined) { localVarQueryParameters['includeUninitialized'] = ObjectSerializer.serialize(includeUninitialized, "boolean"); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, "string"); } if (_continue !== undefined) { localVarQueryParameters['continue'] = ObjectSerializer.serialize(_continue, "string"); } if (fieldSelector !== undefined) { localVarQueryParameters['fieldSelector'] = ObjectSerializer.serialize(fieldSelector, "string"); } if (labelSelector !== undefined) { localVarQueryParameters['labelSelector'] = ObjectSerializer.serialize(labelSelector, "string"); } if (limit !== undefined) { localVarQueryParameters['limit'] = ObjectSerializer.serialize(limit, "number"); } if (resourceVersion !== undefined) { localVarQueryParameters['resourceVersion'] = ObjectSerializer.serialize(resourceVersion, "string"); } if (timeoutSeconds !== undefined) { localVarQueryParameters['timeoutSeconds'] = ObjectSerializer.serialize(timeoutSeconds, "number"); } if (watch !== undefined) { localVarQueryParameters['watch'] = ObjectSerializer.serialize(watch, "boolean"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'DELETE', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "V1Status"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * delete collection of Role * @param namespace object name and auth scope, such as for teams and projects * @param includeUninitialized If true, partially initialized resources are included in the response. * @param pretty If 'true', then the output is pretty printed. * @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. * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything. * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything. * @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. * @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. * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. * @param watch Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion. * @param {*} [options] Override http request options. */ deleteCollectionNamespacedRole(namespace, includeUninitialized, pretty, _continue, fieldSelector, labelSelector, limit, resourceVersion, timeoutSeconds, watch, options = {}) { const localVarPath = this.basePath + '/apis/rbac.authorization.k8s.io/v1/namespaces/{namespace}/roles' .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling deleteCollectionNamespacedRole.'); } if (includeUninitialized !== undefined) { localVarQueryParameters['includeUninitialized'] = ObjectSerializer.serialize(includeUninitialized, "boolean"); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, "string"); } if (_continue !== undefined) { localVarQueryParameters['continue'] = ObjectSerializer.serialize(_continue, "string"); } if (fieldSelector !== undefined) { localVarQueryParameters['fieldSelector'] = ObjectSerializer.serialize(fieldSelector, "string"); } if (labelSelector !== undefined) { localVarQueryParameters['labelSelector'] = ObjectSerializer.serialize(labelSelector, "string"); } if (limit !== undefined) { localVarQueryParameters['limit'] = ObjectSerializer.serialize(limit, "number"); } if (resourceVersion !== undefined) { localVarQueryParameters['resourceVersion'] = ObjectSerializer.serialize(resourceVersion, "string"); } if (timeoutSeconds !== undefined) { localVarQueryParameters['timeoutSeconds'] = ObjectSerializer.serialize(timeoutSeconds, "number"); } if (watch !== undefined) { localVarQueryParameters['watch'] = ObjectSerializer.serialize(watch, "boolean"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'DELETE', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "V1Status"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * delete collection of RoleBinding * @param namespace object name and auth scope, such as for teams and projects * @param includeUninitialized If true, partially initialized resources are included in the response. * @param pretty If 'true', then the output is pretty printed. * @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. * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything. * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything. * @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. * @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. * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. * @param watch Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion. * @param {*} [options] Override http request options. */ deleteCollectionNamespacedRoleBinding(namespace, includeUninitialized, pretty, _continue, fieldSelector, labelSelector, limit, resourceVersion, timeoutSeconds, watch, options = {}) { const localVarPath = this.basePath + '/apis/rbac.authorization.k8s.io/v1/namespaces/{namespace}/rolebindings' .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling deleteCollectionNamespacedRoleBinding.'); } if (includeUninitialized !== undefined) { localVarQueryParameters['includeUninitialized'] = ObjectSerializer.serialize(includeUninitialized, "boolean"); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, "string"); } if (_continue !== undefined) { localVarQueryParameters['continue'] = ObjectSerializer.serialize(_continue, "string"); } if (fieldSelector !== undefined) { localVarQueryParameters['fieldSelector'] = ObjectSerializer.serialize(fieldSelector, "string"); } if (labelSelector !== undefined) { localVarQueryParameters['labelSelector'] = ObjectSerializer.serialize(labelSelector, "string"); } if (limit !== undefined) { localVarQueryParameters['limit'] = ObjectSerializer.serialize(limit, "number"); } if (resourceVersion !== undefined) { localVarQueryParameters['resourceVersion'] = ObjectSerializer.serialize(resourceVersion, "string"); } if (timeoutSeconds !== undefined) { localVarQueryParameters['timeoutSeconds'] = ObjectSerializer.serialize(timeoutSeconds, "number"); } if (watch !== undefined) { localVarQueryParameters['watch'] = ObjectSerializer.serialize(watch, "boolean"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'DELETE', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "V1Status"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * delete a Role * @param name name of the Role * @param namespace object name and auth scope, such as for teams and projects * @param pretty If 'true', then the output is pretty printed. * @param body * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @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. * @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. * @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. * @param {*} [options] Override http request options. */ deleteNamespacedRole(name, namespace, pretty, body, dryRun, gracePeriodSeconds, orphanDependents, propagationPolicy, options = {}) { const localVarPath = this.basePath + '/apis/rbac.authorization.k8s.io/v1/namespaces/{namespace}/roles/{name}' .replace('{' + 'name' + '}', encodeURIComponent(String(name))) .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling deleteNamespacedRole.'); } // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling deleteNamespacedRole.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, "string"); } if (gracePeriodSeconds !== undefined) { localVarQueryParameters['gracePeriodSeconds'] = ObjectSerializer.serialize(gracePeriodSeconds, "number"); } if (orphanDependents !== undefined) { localVarQueryParameters['orphanDependents'] = ObjectSerializer.serialize(orphanDependents, "boolean"); } if (propagationPolicy !== undefined) { localVarQueryParameters['propagationPolicy'] = ObjectSerializer.serialize(propagationPolicy, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'DELETE', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: ObjectSerializer.serialize(body, "V1DeleteOptions") }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "V1Status"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * delete a RoleBinding * @param name name of the RoleBinding * @param namespace object name and auth scope, such as for teams and projects * @param pretty If 'true', then the output is pretty printed. * @param body * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @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. * @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. * @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. * @param {*} [options] Override http request options. */ deleteNamespacedRoleBinding(name, namespace, pretty, body, dryRun, gracePeriodSeconds, orphanDependents, propagationPolicy, options = {}) { const localVarPath = this.basePath + '/apis/rbac.authorization.k8s.io/v1/namespaces/{namespace}/rolebindings/{name}' .replace('{' + 'name' + '}', encodeURIComponent(String(name))) .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling deleteNamespacedRoleBinding.'); } // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling deleteNamespacedRoleBinding.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, "string"); } if (gracePeriodSeconds !== undefined) { localVarQueryParameters['gracePeriodSeconds'] = ObjectSerializer.serialize(gracePeriodSeconds, "number"); } if (orphanDependents !== undefined) { localVarQueryParameters['orphanDependents'] = ObjectSerializer.serialize(orphanDependents, "boolean"); } if (propagationPolicy !== undefined) { localVarQueryParameters['propagationPolicy'] = ObjectSerializer.serialize(propagationPolicy, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'DELETE', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: ObjectSerializer.serialize(body, "V1DeleteOptions") }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "V1Status"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * get available resources * @param {*} [options] Override http request options. */ getAPIResources(options = {}) { const localVarPath = this.basePath + '/apis/rbac.authorization.k8s.io/v1/'; let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'GET', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "V1APIResourceList"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * list or watch objects of kind ClusterRole * @param includeUninitialized If true, partially initialized resources are included in the response. * @param pretty If 'true', then the output is pretty printed. * @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. * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything. * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything. * @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. * @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. * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. * @param watch Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion. * @param {*} [options] Override http request options. */ listClusterRole(includeUninitialized, pretty, _continue, fieldSelector, labelSelector, limit, resourceVersion, timeoutSeconds, watch, options = {}) { const localVarPath = this.basePath + '/apis/rbac.authorization.k8s.io/v1/clusterroles'; let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; if (includeUninitialized !== undefined) { localVarQueryParameters['includeUninitialized'] = ObjectSerializer.serialize(includeUninitialized, "boolean"); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, "string"); } if (_continue !== undefined) { localVarQueryParameters['continue'] = ObjectSerializer.serialize(_continue, "string"); } if (fieldSelector !== undefined) { localVarQueryParameters['fieldSelector'] = ObjectSerializer.serialize(fieldSelector, "string"); } if (labelSelector !== undefined) { localVarQueryParameters['labelSelector'] = ObjectSerializer.serialize(labelSelector, "string"); } if (limit !== undefined) { localVarQueryParameters['limit'] = ObjectSerializer.serialize(limit, "number"); } if (resourceVersion !== undefined) { localVarQueryParameters['resourceVersion'] = ObjectSerializer.serialize(resourceVersion, "string"); } if (timeoutSeconds !== undefined) { localVarQueryParameters['timeoutSeconds'] = ObjectSerializer.serialize(timeoutSeconds, "number"); } if (watch !== undefined) { localVarQueryParameters['watch'] = ObjectSerializer.serialize(watch, "boolean"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'GET', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "V1ClusterRoleList"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * list or watch objects of kind ClusterRoleBinding * @param includeUninitialized If true, partially initialized resources are included in the response. * @param pretty If 'true', then the output is pretty printed. * @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. * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything. * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything. * @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. * @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. * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. * @param watch Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion. * @param {*} [options] Override http request options. */ listClusterRoleBinding(includeUninitialized, pretty, _continue, fieldSelector, labelSelector, limit, resourceVersion, timeoutSeconds, watch, options = {}) { const localVarPath = this.basePath + '/apis/rbac.authorization.k8s.io/v1/clusterrolebindings'; let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; if (includeUninitialized !== undefined) { localVarQueryParameters['includeUninitialized'] = ObjectSerializer.serialize(includeUninitialized, "boolean"); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, "string"); } if (_continue !== undefined) { localVarQueryParameters['continue'] = ObjectSerializer.serialize(_continue, "string"); } if (fieldSelector !== undefined) { localVarQueryParameters['fieldSelector'] = ObjectSerializer.serialize(fieldSelector, "string"); } if (labelSelector !== undefined) { localVarQueryParameters['labelSelector'] = ObjectSerializer.serialize(labelSelector, "string"); } if (limit !== undefined) { localVarQueryParameters['limit'] = ObjectSerializer.serialize(limit, "number"); } if (resourceVersion !== undefined) { localVarQueryParameters['resourceVersion'] = ObjectSerializer.serialize(resourceVersion, "string"); } if (timeoutSeconds !== undefined) { localVarQueryParameters['timeoutSeconds'] = ObjectSerializer.serialize(timeoutSeconds, "number"); } if (watch !== undefined) { localVarQueryParameters['watch'] = ObjectSerializer.serialize(watch, "boolean"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'GET', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "V1ClusterRoleBindingList"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * list or watch objects of kind Role * @param namespace object name and auth scope, such as for teams and projects * @param includeUninitialized If true, partially initialized resources are included in the response. * @param pretty If 'true', then the output is pretty printed. * @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. * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything. * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything. * @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. * @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. * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. * @param watch Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion. * @param {*} [options] Override http request options. */ listNamespacedRole(namespace, includeUninitialized, pretty, _continue, fieldSelector, labelSelector, limit, resourceVersion, timeoutSeconds, watch, options = {}) { const localVarPath = this.basePath + '/apis/rbac.authorization.k8s.io/v1/namespaces/{namespace}/roles' .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling listNamespacedRole.'); } if (includeUninitialized !== undefined) { localVarQueryParameters['includeUninitialized'] = ObjectSerializer.serialize(includeUninitialized, "boolean"); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, "string"); } if (_continue !== undefined) { localVarQueryParameters['continue'] = ObjectSerializer.serialize(_continue, "string"); } if (fieldSelector !== undefined) { localVarQueryParameters['fieldSelector'] = ObjectSerializer.serialize(fieldSelector, "string"); } if (labelSelector !== undefined) { localVarQueryParameters['labelSelector'] = ObjectSerializer.serialize(labelSelector, "string"); } if (limit !== undefined) { localVarQueryParameters['limit'] = ObjectSerializer.serialize(limit, "number"); } if (resourceVersion !== undefined) { localVarQueryParameters['resourceVersion'] = ObjectSerializer.serialize(resourceVersion, "string"); } if (timeoutSeconds !== undefined) { localVarQueryParameters['timeoutSeconds'] = ObjectSerializer.serialize(timeoutSeconds, "number"); } if (watch !== undefined) { localVarQueryParameters['watch'] = ObjectSerializer.serialize(watch, "boolean"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'GET', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "V1RoleList"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * list or watch objects of kind RoleBinding * @param namespace object name and auth scope, such as for teams and projects * @param includeUninitialized If true, partially initialized resources are included in the response. * @param pretty If 'true', then the output is pretty printed. * @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. * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything. * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything. * @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. * @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. * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. * @param watch Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion. * @param {*} [options] Override http request options. */ listNamespacedRoleBinding(namespace, includeUninitialized, pretty, _continue, fieldSelector, labelSelector, limit, resourceVersion, timeoutSeconds, watch, options = {}) { const localVarPath = this.basePath + '/apis/rbac.authorization.k8s.io/v1/namespaces/{namespace}/rolebindings' .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling listNamespacedRoleBinding.'); } if (includeUninitialized !== undefined) { localVarQueryParameters['includeUninitialized'] = ObjectSerializer.serialize(includeUninitialized, "boolean"); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, "string"); } if (_continue !== undefined) { localVarQueryParameters['continue'] = ObjectSerializer.serialize(_continue, "string"); } if (fieldSelector !== undefined) { localVarQueryParameters['fieldSelector'] = ObjectSerializer.serialize(fieldSelector, "string"); } if (labelSelector !== undefined) { localVarQueryParameters['labelSelector'] = ObjectSerializer.serialize(labelSelector, "string"); } if (limit !== undefined) { localVarQueryParameters['limit'] = ObjectSerializer.serialize(limit, "number"); } if (resourceVersion !== undefined) { localVarQueryParameters['resourceVersion'] = ObjectSerializer.serialize(resourceVersion, "string"); } if (timeoutSeconds !== undefined) { localVarQueryParameters['timeoutSeconds'] = ObjectSerializer.serialize(timeoutSeconds, "number"); } if (watch !== undefined) { localVarQueryParameters['watch'] = ObjectSerializer.serialize(watch, "boolean"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'GET', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "V1RoleBindingList"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * list or watch objects of kind RoleBinding * @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. * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything. * @param includeUninitialized If true, partially initialized resources are included in the response. * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything. * @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. * @param pretty If 'true', then the output is pretty printed. * @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. * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. * @param watch Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion. * @param {*} [options] Override http request options. */ listRoleBindingForAllNamespaces(_continue, fieldSelector, includeUninitialized, labelSelector, limit, pretty, resourceVersion, timeoutSeconds, watch, options = {}) { const localVarPath = this.basePath + '/apis/rbac.authorization.k8s.io/v1/rolebindings'; let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; if (_continue !== undefined) { localVarQueryParameters['continue'] = ObjectSerializer.serialize(_continue, "string"); } if (fieldSelector !== undefined) { localVarQueryParameters['fieldSelector'] = ObjectSerializer.serialize(fieldSelector, "string"); } if (includeUninitialized !== undefined) { localVarQueryParameters['includeUninitialized'] = ObjectSerializer.serialize(includeUninitialized, "boolean"); } if (labelSelector !== undefined) { localVarQueryParameters['labelSelector'] = ObjectSerializer.serialize(labelSelector, "string"); } if (limit !== undefined) { localVarQueryParameters['limit'] = ObjectSerializer.serialize(limit, "number"); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, "string"); } if (resourceVersion !== undefined) { localVarQueryParameters['resourceVersion'] = ObjectSerializer.serialize(resourceVersion, "string"); } if (timeoutSeconds !== undefined) { localVarQueryParameters['timeoutSeconds'] = ObjectSerializer.serialize(timeoutSeconds, "number"); } if (watch !== undefined) { localVarQueryParameters['watch'] = ObjectSerializer.serialize(watch, "boolean"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'GET', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "V1RoleBindingList"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * list or watch objects of kind Role * @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. * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything. * @param includeUninitialized If true, partially initialized resources are included in the response. * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything. * @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. * @param pretty If 'true', then the output is pretty printed. * @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. * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. * @param watch Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion. * @param {*} [options] Override http request options. */ listRoleForAllNamespaces(_continue, fieldSelector, includeUninitialized, labelSelector, limit, pretty, resourceVersion, timeoutSeconds, watch, options = {}) { const localVarPath = this.basePath + '/apis/rbac.authorization.k8s.io/v1/roles'; let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; if (_continue !== undefined) { localVarQueryParameters['continue'] = ObjectSerializer.serialize(_continue, "string"); } if (fieldSelector !== undefined) { localVarQueryParameters['fieldSelector'] = ObjectSerializer.serialize(fieldSelector, "string"); } if (includeUninitialized !== undefined) { localVarQueryParameters['includeUninitialized'] = ObjectSerializer.serialize(includeUninitialized, "boolean"); } if (labelSelector !== undefined) { localVarQueryParameters['labelSelector'] = ObjectSerializer.serialize(labelSelector, "string"); } if (limit !== undefined) { localVarQueryParameters['limit'] = ObjectSerializer.serialize(limit, "number"); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, "string"); } if (resourceVersion !== undefined) { localVarQueryParameters['resourceVersion'] = ObjectSerializer.serialize(resourceVersion, "string"); } if (timeoutSeconds !== undefined) { localVarQueryParameters['timeoutSeconds'] = ObjectSerializer.serialize(timeoutSeconds, "number"); } if (watch !== undefined) { localVarQueryParameters['watch'] = ObjectSerializer.serialize(watch, "boolean"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'GET', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "V1RoleList"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * partially update the specified ClusterRole * @param name name of the ClusterRole * @param body * @param pretty If 'true', then the output is pretty printed. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param {*} [options] Override http request options. */ patchClusterRole(name, body, pretty, dryRun, options = {}) { const localVarPath = this.basePath + '/apis/rbac.authorization.k8s.io/v1/clusterroles/{name}' .replace('{' + 'name' + '}', encodeURIComponent(String(name))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling patchClusterRole.'); } // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling patchClusterRole.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'PATCH', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: ObjectSerializer.serialize(body, "any") }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "V1ClusterRole"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * partially update the specified ClusterRoleBinding * @param name name of the ClusterRoleBinding * @param body * @param pretty If 'true', then the output is pretty printed. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param {*} [options] Override http request options. */ patchClusterRoleBinding(name, body, pretty, dryRun, options = {}) { const localVarPath = this.basePath + '/apis/rbac.authorization.k8s.io/v1/clusterrolebindings/{name}' .replace('{' + 'name' + '}', encodeURIComponent(String(name))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling patchClusterRoleBinding.'); } // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling patchClusterRoleBinding.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'PATCH', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: ObjectSerializer.serialize(body, "any") }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "V1ClusterRoleBinding"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * partially update the specified Role * @param name name of the Role * @param namespace object name and auth scope, such as for teams and projects * @param body * @param pretty If 'true', then the output is pretty printed. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param {*} [options] Override http request options. */ patchNamespacedRole(name, namespace, body, pretty, dryRun, options = {}) { const localVarPath = this.basePath + '/apis/rbac.authorization.k8s.io/v1/namespaces/{namespace}/roles/{name}' .replace('{' + 'name' + '}', encodeURIComponent(String(name))) .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling patchNamespacedRole.'); } // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling patchNamespacedRole.'); } // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling patchNamespacedRole.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'PATCH', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: ObjectSerializer.serialize(body, "any") }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "V1Role"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * partially update the specified RoleBinding * @param name name of the RoleBinding * @param namespace object name and auth scope, such as for teams and projects * @param body * @param pretty If 'true', then the output is pretty printed. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param {*} [options] Override http request options. */ patchNamespacedRoleBinding(name, namespace, body, pretty, dryRun, options = {}) { const localVarPath = this.basePath + '/apis/rbac.authorization.k8s.io/v1/namespaces/{namespace}/rolebindings/{name}' .replace('{' + 'name' + '}', encodeURIComponent(String(name))) .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling patchNamespacedRoleBinding.'); } // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling patchNamespacedRoleBinding.'); } // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling patchNamespacedRoleBinding.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'PATCH', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: ObjectSerializer.serialize(body, "any") }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "V1RoleBinding"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * read the specified ClusterRole * @param name name of the ClusterRole * @param pretty If 'true', then the output is pretty printed. * @param {*} [options] Override http request options. */ readClusterRole(name, pretty, options = {}) { const localVarPath = this.basePath + '/apis/rbac.authorization.k8s.io/v1/clusterroles/{name}' .replace('{' + 'name' + '}', encodeURIComponent(String(name))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling readClusterRole.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'GET', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "V1ClusterRole"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * read the specified ClusterRoleBinding * @param name name of the ClusterRoleBinding * @param pretty If 'true', then the output is pretty printed. * @param {*} [options] Override http request options. */ readClusterRoleBinding(name, pretty, options = {}) { const localVarPath = this.basePath + '/apis/rbac.authorization.k8s.io/v1/clusterrolebindings/{name}' .replace('{' + 'name' + '}', encodeURIComponent(String(name))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling readClusterRoleBinding.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'GET', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "V1ClusterRoleBinding"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * read the specified Role * @param name name of the Role * @param namespace object name and auth scope, such as for teams and projects * @param pretty If 'true', then the output is pretty printed. * @param {*} [options] Override http request options. */ readNamespacedRole(name, namespace, pretty, options = {}) { const localVarPath = this.basePath + '/apis/rbac.authorization.k8s.io/v1/namespaces/{namespace}/roles/{name}' .replace('{' + 'name' + '}', encodeURIComponent(String(name))) .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling readNamespacedRole.'); } // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling readNamespacedRole.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'GET', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "V1Role"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * read the specified RoleBinding * @param name name of the RoleBinding * @param namespace object name and auth scope, such as for teams and projects * @param pretty If 'true', then the output is pretty printed. * @param {*} [options] Override http request options. */ readNamespacedRoleBinding(name, namespace, pretty, options = {}) { const localVarPath = this.basePath + '/apis/rbac.authorization.k8s.io/v1/namespaces/{namespace}/rolebindings/{name}' .replace('{' + 'name' + '}', encodeURIComponent(String(name))) .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling readNamespacedRoleBinding.'); } // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling readNamespacedRoleBinding.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'GET', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "V1RoleBinding"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * replace the specified ClusterRole * @param name name of the ClusterRole * @param body * @param pretty If 'true', then the output is pretty printed. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param {*} [options] Override http request options. */ replaceClusterRole(name, body, pretty, dryRun, options = {}) { const localVarPath = this.basePath + '/apis/rbac.authorization.k8s.io/v1/clusterroles/{name}' .replace('{' + 'name' + '}', encodeURIComponent(String(name))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling replaceClusterRole.'); } // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling replaceClusterRole.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'PUT', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: ObjectSerializer.serialize(body, "V1ClusterRole") }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "V1ClusterRole"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * replace the specified ClusterRoleBinding * @param name name of the ClusterRoleBinding * @param body * @param pretty If 'true', then the output is pretty printed. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param {*} [options] Override http request options. */ replaceClusterRoleBinding(name, body, pretty, dryRun, options = {}) { const localVarPath = this.basePath + '/apis/rbac.authorization.k8s.io/v1/clusterrolebindings/{name}' .replace('{' + 'name' + '}', encodeURIComponent(String(name))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling replaceClusterRoleBinding.'); } // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling replaceClusterRoleBinding.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'PUT', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: ObjectSerializer.serialize(body, "V1ClusterRoleBinding") }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "V1ClusterRoleBinding"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * replace the specified Role * @param name name of the Role * @param namespace object name and auth scope, such as for teams and projects * @param body * @param pretty If 'true', then the output is pretty printed. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param {*} [options] Override http request options. */ replaceNamespacedRole(name, namespace, body, pretty, dryRun, options = {}) { const localVarPath = this.basePath + '/apis/rbac.authorization.k8s.io/v1/namespaces/{namespace}/roles/{name}' .replace('{' + 'name' + '}', encodeURIComponent(String(name))) .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling replaceNamespacedRole.'); } // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling replaceNamespacedRole.'); } // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling replaceNamespacedRole.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'PUT', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: ObjectSerializer.serialize(body, "V1Role") }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "V1Role"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * replace the specified RoleBinding * @param name name of the RoleBinding * @param namespace object name and auth scope, such as for teams and projects * @param body * @param pretty If 'true', then the output is pretty printed. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param {*} [options] Override http request options. */ replaceNamespacedRoleBinding(name, namespace, body, pretty, dryRun, options = {}) { const localVarPath = this.basePath + '/apis/rbac.authorization.k8s.io/v1/namespaces/{namespace}/rolebindings/{name}' .replace('{' + 'name' + '}', encodeURIComponent(String(name))) .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling replaceNamespacedRoleBinding.'); } // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling replaceNamespacedRoleBinding.'); } // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling replaceNamespacedRoleBinding.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'PUT', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: ObjectSerializer.serialize(body, "V1RoleBinding") }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "V1RoleBinding"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } } exports.RbacAuthorizationV1Api = RbacAuthorizationV1Api; var RbacAuthorizationV1alpha1ApiApiKeys; (function (RbacAuthorizationV1alpha1ApiApiKeys) { RbacAuthorizationV1alpha1ApiApiKeys[RbacAuthorizationV1alpha1ApiApiKeys["BearerToken"] = 0] = "BearerToken"; })(RbacAuthorizationV1alpha1ApiApiKeys = exports.RbacAuthorizationV1alpha1ApiApiKeys || (exports.RbacAuthorizationV1alpha1ApiApiKeys = {})); class RbacAuthorizationV1alpha1Api { constructor(basePathOrUsername, password, basePath) { this._basePath = defaultBasePath; this.defaultHeaders = {}; this._useQuerystring = false; this.authentications = { 'default': new VoidAuth(), 'BearerToken': new ApiKeyAuth('header', 'authorization'), }; if (password) { if (basePath) { this.basePath = basePath; } } else { if (basePathOrUsername) { this.basePath = basePathOrUsername; } } } set useQuerystring(value) { this._useQuerystring = value; } set basePath(basePath) { this._basePath = basePath; } get basePath() { return this._basePath; } setDefaultAuthentication(auth) { this.authentications.default = auth; } setApiKey(key, value) { this.authentications[RbacAuthorizationV1alpha1ApiApiKeys[key]].apiKey = value; } /** * create a ClusterRole * @param body * @param includeUninitialized If true, partially initialized resources are included in the response. * @param pretty If 'true', then the output is pretty printed. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param {*} [options] Override http request options. */ createClusterRole(body, includeUninitialized, pretty, dryRun, options = {}) { const localVarPath = this.basePath + '/apis/rbac.authorization.k8s.io/v1alpha1/clusterroles'; let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling createClusterRole.'); } if (includeUninitialized !== undefined) { localVarQueryParameters['includeUninitialized'] = ObjectSerializer.serialize(includeUninitialized, "boolean"); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'POST', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: ObjectSerializer.serialize(body, "V1alpha1ClusterRole") }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "V1alpha1ClusterRole"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * create a ClusterRoleBinding * @param body * @param includeUninitialized If true, partially initialized resources are included in the response. * @param pretty If 'true', then the output is pretty printed. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param {*} [options] Override http request options. */ createClusterRoleBinding(body, includeUninitialized, pretty, dryRun, options = {}) { const localVarPath = this.basePath + '/apis/rbac.authorization.k8s.io/v1alpha1/clusterrolebindings'; let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling createClusterRoleBinding.'); } if (includeUninitialized !== undefined) { localVarQueryParameters['includeUninitialized'] = ObjectSerializer.serialize(includeUninitialized, "boolean"); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'POST', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: ObjectSerializer.serialize(body, "V1alpha1ClusterRoleBinding") }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "V1alpha1ClusterRoleBinding"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * create a Role * @param namespace object name and auth scope, such as for teams and projects * @param body * @param includeUninitialized If true, partially initialized resources are included in the response. * @param pretty If 'true', then the output is pretty printed. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param {*} [options] Override http request options. */ createNamespacedRole(namespace, body, includeUninitialized, pretty, dryRun, options = {}) { const localVarPath = this.basePath + '/apis/rbac.authorization.k8s.io/v1alpha1/namespaces/{namespace}/roles' .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling createNamespacedRole.'); } // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling createNamespacedRole.'); } if (includeUninitialized !== undefined) { localVarQueryParameters['includeUninitialized'] = ObjectSerializer.serialize(includeUninitialized, "boolean"); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'POST', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: ObjectSerializer.serialize(body, "V1alpha1Role") }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "V1alpha1Role"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * create a RoleBinding * @param namespace object name and auth scope, such as for teams and projects * @param body * @param includeUninitialized If true, partially initialized resources are included in the response. * @param pretty If 'true', then the output is pretty printed. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param {*} [options] Override http request options. */ createNamespacedRoleBinding(namespace, body, includeUninitialized, pretty, dryRun, options = {}) { const localVarPath = this.basePath + '/apis/rbac.authorization.k8s.io/v1alpha1/namespaces/{namespace}/rolebindings' .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling createNamespacedRoleBinding.'); } // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling createNamespacedRoleBinding.'); } if (includeUninitialized !== undefined) { localVarQueryParameters['includeUninitialized'] = ObjectSerializer.serialize(includeUninitialized, "boolean"); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'POST', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: ObjectSerializer.serialize(body, "V1alpha1RoleBinding") }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "V1alpha1RoleBinding"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * delete a ClusterRole * @param name name of the ClusterRole * @param pretty If 'true', then the output is pretty printed. * @param body * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @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. * @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. * @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. * @param {*} [options] Override http request options. */ deleteClusterRole(name, pretty, body, dryRun, gracePeriodSeconds, orphanDependents, propagationPolicy, options = {}) { const localVarPath = this.basePath + '/apis/rbac.authorization.k8s.io/v1alpha1/clusterroles/{name}' .replace('{' + 'name' + '}', encodeURIComponent(String(name))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling deleteClusterRole.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, "string"); } if (gracePeriodSeconds !== undefined) { localVarQueryParameters['gracePeriodSeconds'] = ObjectSerializer.serialize(gracePeriodSeconds, "number"); } if (orphanDependents !== undefined) { localVarQueryParameters['orphanDependents'] = ObjectSerializer.serialize(orphanDependents, "boolean"); } if (propagationPolicy !== undefined) { localVarQueryParameters['propagationPolicy'] = ObjectSerializer.serialize(propagationPolicy, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'DELETE', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: ObjectSerializer.serialize(body, "V1DeleteOptions") }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "V1Status"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * delete a ClusterRoleBinding * @param name name of the ClusterRoleBinding * @param pretty If 'true', then the output is pretty printed. * @param body * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @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. * @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. * @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. * @param {*} [options] Override http request options. */ deleteClusterRoleBinding(name, pretty, body, dryRun, gracePeriodSeconds, orphanDependents, propagationPolicy, options = {}) { const localVarPath = this.basePath + '/apis/rbac.authorization.k8s.io/v1alpha1/clusterrolebindings/{name}' .replace('{' + 'name' + '}', encodeURIComponent(String(name))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling deleteClusterRoleBinding.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, "string"); } if (gracePeriodSeconds !== undefined) { localVarQueryParameters['gracePeriodSeconds'] = ObjectSerializer.serialize(gracePeriodSeconds, "number"); } if (orphanDependents !== undefined) { localVarQueryParameters['orphanDependents'] = ObjectSerializer.serialize(orphanDependents, "boolean"); } if (propagationPolicy !== undefined) { localVarQueryParameters['propagationPolicy'] = ObjectSerializer.serialize(propagationPolicy, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'DELETE', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: ObjectSerializer.serialize(body, "V1DeleteOptions") }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "V1Status"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * delete collection of ClusterRole * @param includeUninitialized If true, partially initialized resources are included in the response. * @param pretty If 'true', then the output is pretty printed. * @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. * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything. * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything. * @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. * @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. * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. * @param watch Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion. * @param {*} [options] Override http request options. */ deleteCollectionClusterRole(includeUninitialized, pretty, _continue, fieldSelector, labelSelector, limit, resourceVersion, timeoutSeconds, watch, options = {}) { const localVarPath = this.basePath + '/apis/rbac.authorization.k8s.io/v1alpha1/clusterroles'; let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; if (includeUninitialized !== undefined) { localVarQueryParameters['includeUninitialized'] = ObjectSerializer.serialize(includeUninitialized, "boolean"); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, "string"); } if (_continue !== undefined) { localVarQueryParameters['continue'] = ObjectSerializer.serialize(_continue, "string"); } if (fieldSelector !== undefined) { localVarQueryParameters['fieldSelector'] = ObjectSerializer.serialize(fieldSelector, "string"); } if (labelSelector !== undefined) { localVarQueryParameters['labelSelector'] = ObjectSerializer.serialize(labelSelector, "string"); } if (limit !== undefined) { localVarQueryParameters['limit'] = ObjectSerializer.serialize(limit, "number"); } if (resourceVersion !== undefined) { localVarQueryParameters['resourceVersion'] = ObjectSerializer.serialize(resourceVersion, "string"); } if (timeoutSeconds !== undefined) { localVarQueryParameters['timeoutSeconds'] = ObjectSerializer.serialize(timeoutSeconds, "number"); } if (watch !== undefined) { localVarQueryParameters['watch'] = ObjectSerializer.serialize(watch, "boolean"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'DELETE', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "V1Status"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * delete collection of ClusterRoleBinding * @param includeUninitialized If true, partially initialized resources are included in the response. * @param pretty If 'true', then the output is pretty printed. * @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. * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything. * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything. * @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. * @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. * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. * @param watch Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion. * @param {*} [options] Override http request options. */ deleteCollectionClusterRoleBinding(includeUninitialized, pretty, _continue, fieldSelector, labelSelector, limit, resourceVersion, timeoutSeconds, watch, options = {}) { const localVarPath = this.basePath + '/apis/rbac.authorization.k8s.io/v1alpha1/clusterrolebindings'; let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; if (includeUninitialized !== undefined) { localVarQueryParameters['includeUninitialized'] = ObjectSerializer.serialize(includeUninitialized, "boolean"); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, "string"); } if (_continue !== undefined) { localVarQueryParameters['continue'] = ObjectSerializer.serialize(_continue, "string"); } if (fieldSelector !== undefined) { localVarQueryParameters['fieldSelector'] = ObjectSerializer.serialize(fieldSelector, "string"); } if (labelSelector !== undefined) { localVarQueryParameters['labelSelector'] = ObjectSerializer.serialize(labelSelector, "string"); } if (limit !== undefined) { localVarQueryParameters['limit'] = ObjectSerializer.serialize(limit, "number"); } if (resourceVersion !== undefined) { localVarQueryParameters['resourceVersion'] = ObjectSerializer.serialize(resourceVersion, "string"); } if (timeoutSeconds !== undefined) { localVarQueryParameters['timeoutSeconds'] = ObjectSerializer.serialize(timeoutSeconds, "number"); } if (watch !== undefined) { localVarQueryParameters['watch'] = ObjectSerializer.serialize(watch, "boolean"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'DELETE', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "V1Status"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * delete collection of Role * @param namespace object name and auth scope, such as for teams and projects * @param includeUninitialized If true, partially initialized resources are included in the response. * @param pretty If 'true', then the output is pretty printed. * @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. * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything. * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything. * @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. * @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. * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. * @param watch Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion. * @param {*} [options] Override http request options. */ deleteCollectionNamespacedRole(namespace, includeUninitialized, pretty, _continue, fieldSelector, labelSelector, limit, resourceVersion, timeoutSeconds, watch, options = {}) { const localVarPath = this.basePath + '/apis/rbac.authorization.k8s.io/v1alpha1/namespaces/{namespace}/roles' .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling deleteCollectionNamespacedRole.'); } if (includeUninitialized !== undefined) { localVarQueryParameters['includeUninitialized'] = ObjectSerializer.serialize(includeUninitialized, "boolean"); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, "string"); } if (_continue !== undefined) { localVarQueryParameters['continue'] = ObjectSerializer.serialize(_continue, "string"); } if (fieldSelector !== undefined) { localVarQueryParameters['fieldSelector'] = ObjectSerializer.serialize(fieldSelector, "string"); } if (labelSelector !== undefined) { localVarQueryParameters['labelSelector'] = ObjectSerializer.serialize(labelSelector, "string"); } if (limit !== undefined) { localVarQueryParameters['limit'] = ObjectSerializer.serialize(limit, "number"); } if (resourceVersion !== undefined) { localVarQueryParameters['resourceVersion'] = ObjectSerializer.serialize(resourceVersion, "string"); } if (timeoutSeconds !== undefined) { localVarQueryParameters['timeoutSeconds'] = ObjectSerializer.serialize(timeoutSeconds, "number"); } if (watch !== undefined) { localVarQueryParameters['watch'] = ObjectSerializer.serialize(watch, "boolean"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'DELETE', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "V1Status"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * delete collection of RoleBinding * @param namespace object name and auth scope, such as for teams and projects * @param includeUninitialized If true, partially initialized resources are included in the response. * @param pretty If 'true', then the output is pretty printed. * @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. * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything. * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything. * @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. * @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. * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. * @param watch Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion. * @param {*} [options] Override http request options. */ deleteCollectionNamespacedRoleBinding(namespace, includeUninitialized, pretty, _continue, fieldSelector, labelSelector, limit, resourceVersion, timeoutSeconds, watch, options = {}) { const localVarPath = this.basePath + '/apis/rbac.authorization.k8s.io/v1alpha1/namespaces/{namespace}/rolebindings' .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling deleteCollectionNamespacedRoleBinding.'); } if (includeUninitialized !== undefined) { localVarQueryParameters['includeUninitialized'] = ObjectSerializer.serialize(includeUninitialized, "boolean"); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, "string"); } if (_continue !== undefined) { localVarQueryParameters['continue'] = ObjectSerializer.serialize(_continue, "string"); } if (fieldSelector !== undefined) { localVarQueryParameters['fieldSelector'] = ObjectSerializer.serialize(fieldSelector, "string"); } if (labelSelector !== undefined) { localVarQueryParameters['labelSelector'] = ObjectSerializer.serialize(labelSelector, "string"); } if (limit !== undefined) { localVarQueryParameters['limit'] = ObjectSerializer.serialize(limit, "number"); } if (resourceVersion !== undefined) { localVarQueryParameters['resourceVersion'] = ObjectSerializer.serialize(resourceVersion, "string"); } if (timeoutSeconds !== undefined) { localVarQueryParameters['timeoutSeconds'] = ObjectSerializer.serialize(timeoutSeconds, "number"); } if (watch !== undefined) { localVarQueryParameters['watch'] = ObjectSerializer.serialize(watch, "boolean"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'DELETE', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "V1Status"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * delete a Role * @param name name of the Role * @param namespace object name and auth scope, such as for teams and projects * @param pretty If 'true', then the output is pretty printed. * @param body * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @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. * @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. * @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. * @param {*} [options] Override http request options. */ deleteNamespacedRole(name, namespace, pretty, body, dryRun, gracePeriodSeconds, orphanDependents, propagationPolicy, options = {}) { const localVarPath = this.basePath + '/apis/rbac.authorization.k8s.io/v1alpha1/namespaces/{namespace}/roles/{name}' .replace('{' + 'name' + '}', encodeURIComponent(String(name))) .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling deleteNamespacedRole.'); } // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling deleteNamespacedRole.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, "string"); } if (gracePeriodSeconds !== undefined) { localVarQueryParameters['gracePeriodSeconds'] = ObjectSerializer.serialize(gracePeriodSeconds, "number"); } if (orphanDependents !== undefined) { localVarQueryParameters['orphanDependents'] = ObjectSerializer.serialize(orphanDependents, "boolean"); } if (propagationPolicy !== undefined) { localVarQueryParameters['propagationPolicy'] = ObjectSerializer.serialize(propagationPolicy, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'DELETE', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: ObjectSerializer.serialize(body, "V1DeleteOptions") }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "V1Status"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * delete a RoleBinding * @param name name of the RoleBinding * @param namespace object name and auth scope, such as for teams and projects * @param pretty If 'true', then the output is pretty printed. * @param body * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @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. * @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. * @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. * @param {*} [options] Override http request options. */ deleteNamespacedRoleBinding(name, namespace, pretty, body, dryRun, gracePeriodSeconds, orphanDependents, propagationPolicy, options = {}) { const localVarPath = this.basePath + '/apis/rbac.authorization.k8s.io/v1alpha1/namespaces/{namespace}/rolebindings/{name}' .replace('{' + 'name' + '}', encodeURIComponent(String(name))) .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling deleteNamespacedRoleBinding.'); } // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling deleteNamespacedRoleBinding.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, "string"); } if (gracePeriodSeconds !== undefined) { localVarQueryParameters['gracePeriodSeconds'] = ObjectSerializer.serialize(gracePeriodSeconds, "number"); } if (orphanDependents !== undefined) { localVarQueryParameters['orphanDependents'] = ObjectSerializer.serialize(orphanDependents, "boolean"); } if (propagationPolicy !== undefined) { localVarQueryParameters['propagationPolicy'] = ObjectSerializer.serialize(propagationPolicy, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'DELETE', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: ObjectSerializer.serialize(body, "V1DeleteOptions") }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "V1Status"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * get available resources * @param {*} [options] Override http request options. */ getAPIResources(options = {}) { const localVarPath = this.basePath + '/apis/rbac.authorization.k8s.io/v1alpha1/'; let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'GET', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "V1APIResourceList"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * list or watch objects of kind ClusterRole * @param includeUninitialized If true, partially initialized resources are included in the response. * @param pretty If 'true', then the output is pretty printed. * @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. * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything. * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything. * @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. * @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. * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. * @param watch Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion. * @param {*} [options] Override http request options. */ listClusterRole(includeUninitialized, pretty, _continue, fieldSelector, labelSelector, limit, resourceVersion, timeoutSeconds, watch, options = {}) { const localVarPath = this.basePath + '/apis/rbac.authorization.k8s.io/v1alpha1/clusterroles'; let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; if (includeUninitialized !== undefined) { localVarQueryParameters['includeUninitialized'] = ObjectSerializer.serialize(includeUninitialized, "boolean"); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, "string"); } if (_continue !== undefined) { localVarQueryParameters['continue'] = ObjectSerializer.serialize(_continue, "string"); } if (fieldSelector !== undefined) { localVarQueryParameters['fieldSelector'] = ObjectSerializer.serialize(fieldSelector, "string"); } if (labelSelector !== undefined) { localVarQueryParameters['labelSelector'] = ObjectSerializer.serialize(labelSelector, "string"); } if (limit !== undefined) { localVarQueryParameters['limit'] = ObjectSerializer.serialize(limit, "number"); } if (resourceVersion !== undefined) { localVarQueryParameters['resourceVersion'] = ObjectSerializer.serialize(resourceVersion, "string"); } if (timeoutSeconds !== undefined) { localVarQueryParameters['timeoutSeconds'] = ObjectSerializer.serialize(timeoutSeconds, "number"); } if (watch !== undefined) { localVarQueryParameters['watch'] = ObjectSerializer.serialize(watch, "boolean"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'GET', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "V1alpha1ClusterRoleList"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * list or watch objects of kind ClusterRoleBinding * @param includeUninitialized If true, partially initialized resources are included in the response. * @param pretty If 'true', then the output is pretty printed. * @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. * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything. * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything. * @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. * @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. * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. * @param watch Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion. * @param {*} [options] Override http request options. */ listClusterRoleBinding(includeUninitialized, pretty, _continue, fieldSelector, labelSelector, limit, resourceVersion, timeoutSeconds, watch, options = {}) { const localVarPath = this.basePath + '/apis/rbac.authorization.k8s.io/v1alpha1/clusterrolebindings'; let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; if (includeUninitialized !== undefined) { localVarQueryParameters['includeUninitialized'] = ObjectSerializer.serialize(includeUninitialized, "boolean"); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, "string"); } if (_continue !== undefined) { localVarQueryParameters['continue'] = ObjectSerializer.serialize(_continue, "string"); } if (fieldSelector !== undefined) { localVarQueryParameters['fieldSelector'] = ObjectSerializer.serialize(fieldSelector, "string"); } if (labelSelector !== undefined) { localVarQueryParameters['labelSelector'] = ObjectSerializer.serialize(labelSelector, "string"); } if (limit !== undefined) { localVarQueryParameters['limit'] = ObjectSerializer.serialize(limit, "number"); } if (resourceVersion !== undefined) { localVarQueryParameters['resourceVersion'] = ObjectSerializer.serialize(resourceVersion, "string"); } if (timeoutSeconds !== undefined) { localVarQueryParameters['timeoutSeconds'] = ObjectSerializer.serialize(timeoutSeconds, "number"); } if (watch !== undefined) { localVarQueryParameters['watch'] = ObjectSerializer.serialize(watch, "boolean"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'GET', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "V1alpha1ClusterRoleBindingList"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * list or watch objects of kind Role * @param namespace object name and auth scope, such as for teams and projects * @param includeUninitialized If true, partially initialized resources are included in the response. * @param pretty If 'true', then the output is pretty printed. * @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. * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything. * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything. * @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. * @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. * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. * @param watch Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion. * @param {*} [options] Override http request options. */ listNamespacedRole(namespace, includeUninitialized, pretty, _continue, fieldSelector, labelSelector, limit, resourceVersion, timeoutSeconds, watch, options = {}) { const localVarPath = this.basePath + '/apis/rbac.authorization.k8s.io/v1alpha1/namespaces/{namespace}/roles' .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling listNamespacedRole.'); } if (includeUninitialized !== undefined) { localVarQueryParameters['includeUninitialized'] = ObjectSerializer.serialize(includeUninitialized, "boolean"); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, "string"); } if (_continue !== undefined) { localVarQueryParameters['continue'] = ObjectSerializer.serialize(_continue, "string"); } if (fieldSelector !== undefined) { localVarQueryParameters['fieldSelector'] = ObjectSerializer.serialize(fieldSelector, "string"); } if (labelSelector !== undefined) { localVarQueryParameters['labelSelector'] = ObjectSerializer.serialize(labelSelector, "string"); } if (limit !== undefined) { localVarQueryParameters['limit'] = ObjectSerializer.serialize(limit, "number"); } if (resourceVersion !== undefined) { localVarQueryParameters['resourceVersion'] = ObjectSerializer.serialize(resourceVersion, "string"); } if (timeoutSeconds !== undefined) { localVarQueryParameters['timeoutSeconds'] = ObjectSerializer.serialize(timeoutSeconds, "number"); } if (watch !== undefined) { localVarQueryParameters['watch'] = ObjectSerializer.serialize(watch, "boolean"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'GET', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "V1alpha1RoleList"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * list or watch objects of kind RoleBinding * @param namespace object name and auth scope, such as for teams and projects * @param includeUninitialized If true, partially initialized resources are included in the response. * @param pretty If 'true', then the output is pretty printed. * @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. * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything. * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything. * @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. * @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. * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. * @param watch Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion. * @param {*} [options] Override http request options. */ listNamespacedRoleBinding(namespace, includeUninitialized, pretty, _continue, fieldSelector, labelSelector, limit, resourceVersion, timeoutSeconds, watch, options = {}) { const localVarPath = this.basePath + '/apis/rbac.authorization.k8s.io/v1alpha1/namespaces/{namespace}/rolebindings' .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling listNamespacedRoleBinding.'); } if (includeUninitialized !== undefined) { localVarQueryParameters['includeUninitialized'] = ObjectSerializer.serialize(includeUninitialized, "boolean"); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, "string"); } if (_continue !== undefined) { localVarQueryParameters['continue'] = ObjectSerializer.serialize(_continue, "string"); } if (fieldSelector !== undefined) { localVarQueryParameters['fieldSelector'] = ObjectSerializer.serialize(fieldSelector, "string"); } if (labelSelector !== undefined) { localVarQueryParameters['labelSelector'] = ObjectSerializer.serialize(labelSelector, "string"); } if (limit !== undefined) { localVarQueryParameters['limit'] = ObjectSerializer.serialize(limit, "number"); } if (resourceVersion !== undefined) { localVarQueryParameters['resourceVersion'] = ObjectSerializer.serialize(resourceVersion, "string"); } if (timeoutSeconds !== undefined) { localVarQueryParameters['timeoutSeconds'] = ObjectSerializer.serialize(timeoutSeconds, "number"); } if (watch !== undefined) { localVarQueryParameters['watch'] = ObjectSerializer.serialize(watch, "boolean"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'GET', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "V1alpha1RoleBindingList"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * list or watch objects of kind RoleBinding * @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. * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything. * @param includeUninitialized If true, partially initialized resources are included in the response. * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything. * @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. * @param pretty If 'true', then the output is pretty printed. * @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. * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. * @param watch Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion. * @param {*} [options] Override http request options. */ listRoleBindingForAllNamespaces(_continue, fieldSelector, includeUninitialized, labelSelector, limit, pretty, resourceVersion, timeoutSeconds, watch, options = {}) { const localVarPath = this.basePath + '/apis/rbac.authorization.k8s.io/v1alpha1/rolebindings'; let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; if (_continue !== undefined) { localVarQueryParameters['continue'] = ObjectSerializer.serialize(_continue, "string"); } if (fieldSelector !== undefined) { localVarQueryParameters['fieldSelector'] = ObjectSerializer.serialize(fieldSelector, "string"); } if (includeUninitialized !== undefined) { localVarQueryParameters['includeUninitialized'] = ObjectSerializer.serialize(includeUninitialized, "boolean"); } if (labelSelector !== undefined) { localVarQueryParameters['labelSelector'] = ObjectSerializer.serialize(labelSelector, "string"); } if (limit !== undefined) { localVarQueryParameters['limit'] = ObjectSerializer.serialize(limit, "number"); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, "string"); } if (resourceVersion !== undefined) { localVarQueryParameters['resourceVersion'] = ObjectSerializer.serialize(resourceVersion, "string"); } if (timeoutSeconds !== undefined) { localVarQueryParameters['timeoutSeconds'] = ObjectSerializer.serialize(timeoutSeconds, "number"); } if (watch !== undefined) { localVarQueryParameters['watch'] = ObjectSerializer.serialize(watch, "boolean"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'GET', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "V1alpha1RoleBindingList"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * list or watch objects of kind Role * @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. * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything. * @param includeUninitialized If true, partially initialized resources are included in the response. * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything. * @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. * @param pretty If 'true', then the output is pretty printed. * @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. * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. * @param watch Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion. * @param {*} [options] Override http request options. */ listRoleForAllNamespaces(_continue, fieldSelector, includeUninitialized, labelSelector, limit, pretty, resourceVersion, timeoutSeconds, watch, options = {}) { const localVarPath = this.basePath + '/apis/rbac.authorization.k8s.io/v1alpha1/roles'; let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; if (_continue !== undefined) { localVarQueryParameters['continue'] = ObjectSerializer.serialize(_continue, "string"); } if (fieldSelector !== undefined) { localVarQueryParameters['fieldSelector'] = ObjectSerializer.serialize(fieldSelector, "string"); } if (includeUninitialized !== undefined) { localVarQueryParameters['includeUninitialized'] = ObjectSerializer.serialize(includeUninitialized, "boolean"); } if (labelSelector !== undefined) { localVarQueryParameters['labelSelector'] = ObjectSerializer.serialize(labelSelector, "string"); } if (limit !== undefined) { localVarQueryParameters['limit'] = ObjectSerializer.serialize(limit, "number"); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, "string"); } if (resourceVersion !== undefined) { localVarQueryParameters['resourceVersion'] = ObjectSerializer.serialize(resourceVersion, "string"); } if (timeoutSeconds !== undefined) { localVarQueryParameters['timeoutSeconds'] = ObjectSerializer.serialize(timeoutSeconds, "number"); } if (watch !== undefined) { localVarQueryParameters['watch'] = ObjectSerializer.serialize(watch, "boolean"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'GET', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "V1alpha1RoleList"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * partially update the specified ClusterRole * @param name name of the ClusterRole * @param body * @param pretty If 'true', then the output is pretty printed. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param {*} [options] Override http request options. */ patchClusterRole(name, body, pretty, dryRun, options = {}) { const localVarPath = this.basePath + '/apis/rbac.authorization.k8s.io/v1alpha1/clusterroles/{name}' .replace('{' + 'name' + '}', encodeURIComponent(String(name))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling patchClusterRole.'); } // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling patchClusterRole.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'PATCH', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: ObjectSerializer.serialize(body, "any") }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "V1alpha1ClusterRole"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * partially update the specified ClusterRoleBinding * @param name name of the ClusterRoleBinding * @param body * @param pretty If 'true', then the output is pretty printed. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param {*} [options] Override http request options. */ patchClusterRoleBinding(name, body, pretty, dryRun, options = {}) { const localVarPath = this.basePath + '/apis/rbac.authorization.k8s.io/v1alpha1/clusterrolebindings/{name}' .replace('{' + 'name' + '}', encodeURIComponent(String(name))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling patchClusterRoleBinding.'); } // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling patchClusterRoleBinding.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'PATCH', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: ObjectSerializer.serialize(body, "any") }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "V1alpha1ClusterRoleBinding"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * partially update the specified Role * @param name name of the Role * @param namespace object name and auth scope, such as for teams and projects * @param body * @param pretty If 'true', then the output is pretty printed. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param {*} [options] Override http request options. */ patchNamespacedRole(name, namespace, body, pretty, dryRun, options = {}) { const localVarPath = this.basePath + '/apis/rbac.authorization.k8s.io/v1alpha1/namespaces/{namespace}/roles/{name}' .replace('{' + 'name' + '}', encodeURIComponent(String(name))) .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling patchNamespacedRole.'); } // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling patchNamespacedRole.'); } // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling patchNamespacedRole.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'PATCH', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: ObjectSerializer.serialize(body, "any") }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "V1alpha1Role"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * partially update the specified RoleBinding * @param name name of the RoleBinding * @param namespace object name and auth scope, such as for teams and projects * @param body * @param pretty If 'true', then the output is pretty printed. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param {*} [options] Override http request options. */ patchNamespacedRoleBinding(name, namespace, body, pretty, dryRun, options = {}) { const localVarPath = this.basePath + '/apis/rbac.authorization.k8s.io/v1alpha1/namespaces/{namespace}/rolebindings/{name}' .replace('{' + 'name' + '}', encodeURIComponent(String(name))) .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling patchNamespacedRoleBinding.'); } // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling patchNamespacedRoleBinding.'); } // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling patchNamespacedRoleBinding.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'PATCH', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: ObjectSerializer.serialize(body, "any") }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "V1alpha1RoleBinding"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * read the specified ClusterRole * @param name name of the ClusterRole * @param pretty If 'true', then the output is pretty printed. * @param {*} [options] Override http request options. */ readClusterRole(name, pretty, options = {}) { const localVarPath = this.basePath + '/apis/rbac.authorization.k8s.io/v1alpha1/clusterroles/{name}' .replace('{' + 'name' + '}', encodeURIComponent(String(name))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling readClusterRole.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'GET', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "V1alpha1ClusterRole"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * read the specified ClusterRoleBinding * @param name name of the ClusterRoleBinding * @param pretty If 'true', then the output is pretty printed. * @param {*} [options] Override http request options. */ readClusterRoleBinding(name, pretty, options = {}) { const localVarPath = this.basePath + '/apis/rbac.authorization.k8s.io/v1alpha1/clusterrolebindings/{name}' .replace('{' + 'name' + '}', encodeURIComponent(String(name))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling readClusterRoleBinding.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'GET', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "V1alpha1ClusterRoleBinding"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * read the specified Role * @param name name of the Role * @param namespace object name and auth scope, such as for teams and projects * @param pretty If 'true', then the output is pretty printed. * @param {*} [options] Override http request options. */ readNamespacedRole(name, namespace, pretty, options = {}) { const localVarPath = this.basePath + '/apis/rbac.authorization.k8s.io/v1alpha1/namespaces/{namespace}/roles/{name}' .replace('{' + 'name' + '}', encodeURIComponent(String(name))) .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling readNamespacedRole.'); } // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling readNamespacedRole.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'GET', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "V1alpha1Role"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * read the specified RoleBinding * @param name name of the RoleBinding * @param namespace object name and auth scope, such as for teams and projects * @param pretty If 'true', then the output is pretty printed. * @param {*} [options] Override http request options. */ readNamespacedRoleBinding(name, namespace, pretty, options = {}) { const localVarPath = this.basePath + '/apis/rbac.authorization.k8s.io/v1alpha1/namespaces/{namespace}/rolebindings/{name}' .replace('{' + 'name' + '}', encodeURIComponent(String(name))) .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling readNamespacedRoleBinding.'); } // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling readNamespacedRoleBinding.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'GET', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "V1alpha1RoleBinding"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * replace the specified ClusterRole * @param name name of the ClusterRole * @param body * @param pretty If 'true', then the output is pretty printed. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param {*} [options] Override http request options. */ replaceClusterRole(name, body, pretty, dryRun, options = {}) { const localVarPath = this.basePath + '/apis/rbac.authorization.k8s.io/v1alpha1/clusterroles/{name}' .replace('{' + 'name' + '}', encodeURIComponent(String(name))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling replaceClusterRole.'); } // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling replaceClusterRole.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'PUT', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: ObjectSerializer.serialize(body, "V1alpha1ClusterRole") }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "V1alpha1ClusterRole"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * replace the specified ClusterRoleBinding * @param name name of the ClusterRoleBinding * @param body * @param pretty If 'true', then the output is pretty printed. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param {*} [options] Override http request options. */ replaceClusterRoleBinding(name, body, pretty, dryRun, options = {}) { const localVarPath = this.basePath + '/apis/rbac.authorization.k8s.io/v1alpha1/clusterrolebindings/{name}' .replace('{' + 'name' + '}', encodeURIComponent(String(name))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling replaceClusterRoleBinding.'); } // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling replaceClusterRoleBinding.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'PUT', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: ObjectSerializer.serialize(body, "V1alpha1ClusterRoleBinding") }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "V1alpha1ClusterRoleBinding"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * replace the specified Role * @param name name of the Role * @param namespace object name and auth scope, such as for teams and projects * @param body * @param pretty If 'true', then the output is pretty printed. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param {*} [options] Override http request options. */ replaceNamespacedRole(name, namespace, body, pretty, dryRun, options = {}) { const localVarPath = this.basePath + '/apis/rbac.authorization.k8s.io/v1alpha1/namespaces/{namespace}/roles/{name}' .replace('{' + 'name' + '}', encodeURIComponent(String(name))) .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling replaceNamespacedRole.'); } // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling replaceNamespacedRole.'); } // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling replaceNamespacedRole.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'PUT', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: ObjectSerializer.serialize(body, "V1alpha1Role") }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "V1alpha1Role"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * replace the specified RoleBinding * @param name name of the RoleBinding * @param namespace object name and auth scope, such as for teams and projects * @param body * @param pretty If 'true', then the output is pretty printed. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param {*} [options] Override http request options. */ replaceNamespacedRoleBinding(name, namespace, body, pretty, dryRun, options = {}) { const localVarPath = this.basePath + '/apis/rbac.authorization.k8s.io/v1alpha1/namespaces/{namespace}/rolebindings/{name}' .replace('{' + 'name' + '}', encodeURIComponent(String(name))) .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling replaceNamespacedRoleBinding.'); } // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling replaceNamespacedRoleBinding.'); } // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling replaceNamespacedRoleBinding.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'PUT', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: ObjectSerializer.serialize(body, "V1alpha1RoleBinding") }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "V1alpha1RoleBinding"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } } exports.RbacAuthorizationV1alpha1Api = RbacAuthorizationV1alpha1Api; var RbacAuthorizationV1beta1ApiApiKeys; (function (RbacAuthorizationV1beta1ApiApiKeys) { RbacAuthorizationV1beta1ApiApiKeys[RbacAuthorizationV1beta1ApiApiKeys["BearerToken"] = 0] = "BearerToken"; })(RbacAuthorizationV1beta1ApiApiKeys = exports.RbacAuthorizationV1beta1ApiApiKeys || (exports.RbacAuthorizationV1beta1ApiApiKeys = {})); class RbacAuthorizationV1beta1Api { constructor(basePathOrUsername, password, basePath) { this._basePath = defaultBasePath; this.defaultHeaders = {}; this._useQuerystring = false; this.authentications = { 'default': new VoidAuth(), 'BearerToken': new ApiKeyAuth('header', 'authorization'), }; if (password) { if (basePath) { this.basePath = basePath; } } else { if (basePathOrUsername) { this.basePath = basePathOrUsername; } } } set useQuerystring(value) { this._useQuerystring = value; } set basePath(basePath) { this._basePath = basePath; } get basePath() { return this._basePath; } setDefaultAuthentication(auth) { this.authentications.default = auth; } setApiKey(key, value) { this.authentications[RbacAuthorizationV1beta1ApiApiKeys[key]].apiKey = value; } /** * create a ClusterRole * @param body * @param includeUninitialized If true, partially initialized resources are included in the response. * @param pretty If 'true', then the output is pretty printed. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param {*} [options] Override http request options. */ createClusterRole(body, includeUninitialized, pretty, dryRun, options = {}) { const localVarPath = this.basePath + '/apis/rbac.authorization.k8s.io/v1beta1/clusterroles'; let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling createClusterRole.'); } if (includeUninitialized !== undefined) { localVarQueryParameters['includeUninitialized'] = ObjectSerializer.serialize(includeUninitialized, "boolean"); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'POST', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: ObjectSerializer.serialize(body, "V1beta1ClusterRole") }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "V1beta1ClusterRole"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * create a ClusterRoleBinding * @param body * @param includeUninitialized If true, partially initialized resources are included in the response. * @param pretty If 'true', then the output is pretty printed. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param {*} [options] Override http request options. */ createClusterRoleBinding(body, includeUninitialized, pretty, dryRun, options = {}) { const localVarPath = this.basePath + '/apis/rbac.authorization.k8s.io/v1beta1/clusterrolebindings'; let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling createClusterRoleBinding.'); } if (includeUninitialized !== undefined) { localVarQueryParameters['includeUninitialized'] = ObjectSerializer.serialize(includeUninitialized, "boolean"); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'POST', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: ObjectSerializer.serialize(body, "V1beta1ClusterRoleBinding") }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "V1beta1ClusterRoleBinding"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * create a Role * @param namespace object name and auth scope, such as for teams and projects * @param body * @param includeUninitialized If true, partially initialized resources are included in the response. * @param pretty If 'true', then the output is pretty printed. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param {*} [options] Override http request options. */ createNamespacedRole(namespace, body, includeUninitialized, pretty, dryRun, options = {}) { const localVarPath = this.basePath + '/apis/rbac.authorization.k8s.io/v1beta1/namespaces/{namespace}/roles' .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling createNamespacedRole.'); } // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling createNamespacedRole.'); } if (includeUninitialized !== undefined) { localVarQueryParameters['includeUninitialized'] = ObjectSerializer.serialize(includeUninitialized, "boolean"); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'POST', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: ObjectSerializer.serialize(body, "V1beta1Role") }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "V1beta1Role"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * create a RoleBinding * @param namespace object name and auth scope, such as for teams and projects * @param body * @param includeUninitialized If true, partially initialized resources are included in the response. * @param pretty If 'true', then the output is pretty printed. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param {*} [options] Override http request options. */ createNamespacedRoleBinding(namespace, body, includeUninitialized, pretty, dryRun, options = {}) { const localVarPath = this.basePath + '/apis/rbac.authorization.k8s.io/v1beta1/namespaces/{namespace}/rolebindings' .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling createNamespacedRoleBinding.'); } // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling createNamespacedRoleBinding.'); } if (includeUninitialized !== undefined) { localVarQueryParameters['includeUninitialized'] = ObjectSerializer.serialize(includeUninitialized, "boolean"); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'POST', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: ObjectSerializer.serialize(body, "V1beta1RoleBinding") }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "V1beta1RoleBinding"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * delete a ClusterRole * @param name name of the ClusterRole * @param pretty If 'true', then the output is pretty printed. * @param body * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @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. * @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. * @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. * @param {*} [options] Override http request options. */ deleteClusterRole(name, pretty, body, dryRun, gracePeriodSeconds, orphanDependents, propagationPolicy, options = {}) { const localVarPath = this.basePath + '/apis/rbac.authorization.k8s.io/v1beta1/clusterroles/{name}' .replace('{' + 'name' + '}', encodeURIComponent(String(name))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling deleteClusterRole.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, "string"); } if (gracePeriodSeconds !== undefined) { localVarQueryParameters['gracePeriodSeconds'] = ObjectSerializer.serialize(gracePeriodSeconds, "number"); } if (orphanDependents !== undefined) { localVarQueryParameters['orphanDependents'] = ObjectSerializer.serialize(orphanDependents, "boolean"); } if (propagationPolicy !== undefined) { localVarQueryParameters['propagationPolicy'] = ObjectSerializer.serialize(propagationPolicy, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'DELETE', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: ObjectSerializer.serialize(body, "V1DeleteOptions") }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "V1Status"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * delete a ClusterRoleBinding * @param name name of the ClusterRoleBinding * @param pretty If 'true', then the output is pretty printed. * @param body * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @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. * @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. * @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. * @param {*} [options] Override http request options. */ deleteClusterRoleBinding(name, pretty, body, dryRun, gracePeriodSeconds, orphanDependents, propagationPolicy, options = {}) { const localVarPath = this.basePath + '/apis/rbac.authorization.k8s.io/v1beta1/clusterrolebindings/{name}' .replace('{' + 'name' + '}', encodeURIComponent(String(name))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling deleteClusterRoleBinding.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, "string"); } if (gracePeriodSeconds !== undefined) { localVarQueryParameters['gracePeriodSeconds'] = ObjectSerializer.serialize(gracePeriodSeconds, "number"); } if (orphanDependents !== undefined) { localVarQueryParameters['orphanDependents'] = ObjectSerializer.serialize(orphanDependents, "boolean"); } if (propagationPolicy !== undefined) { localVarQueryParameters['propagationPolicy'] = ObjectSerializer.serialize(propagationPolicy, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'DELETE', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: ObjectSerializer.serialize(body, "V1DeleteOptions") }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "V1Status"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * delete collection of ClusterRole * @param includeUninitialized If true, partially initialized resources are included in the response. * @param pretty If 'true', then the output is pretty printed. * @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. * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything. * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything. * @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. * @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. * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. * @param watch Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion. * @param {*} [options] Override http request options. */ deleteCollectionClusterRole(includeUninitialized, pretty, _continue, fieldSelector, labelSelector, limit, resourceVersion, timeoutSeconds, watch, options = {}) { const localVarPath = this.basePath + '/apis/rbac.authorization.k8s.io/v1beta1/clusterroles'; let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; if (includeUninitialized !== undefined) { localVarQueryParameters['includeUninitialized'] = ObjectSerializer.serialize(includeUninitialized, "boolean"); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, "string"); } if (_continue !== undefined) { localVarQueryParameters['continue'] = ObjectSerializer.serialize(_continue, "string"); } if (fieldSelector !== undefined) { localVarQueryParameters['fieldSelector'] = ObjectSerializer.serialize(fieldSelector, "string"); } if (labelSelector !== undefined) { localVarQueryParameters['labelSelector'] = ObjectSerializer.serialize(labelSelector, "string"); } if (limit !== undefined) { localVarQueryParameters['limit'] = ObjectSerializer.serialize(limit, "number"); } if (resourceVersion !== undefined) { localVarQueryParameters['resourceVersion'] = ObjectSerializer.serialize(resourceVersion, "string"); } if (timeoutSeconds !== undefined) { localVarQueryParameters['timeoutSeconds'] = ObjectSerializer.serialize(timeoutSeconds, "number"); } if (watch !== undefined) { localVarQueryParameters['watch'] = ObjectSerializer.serialize(watch, "boolean"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'DELETE', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "V1Status"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * delete collection of ClusterRoleBinding * @param includeUninitialized If true, partially initialized resources are included in the response. * @param pretty If 'true', then the output is pretty printed. * @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. * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything. * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything. * @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. * @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. * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. * @param watch Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion. * @param {*} [options] Override http request options. */ deleteCollectionClusterRoleBinding(includeUninitialized, pretty, _continue, fieldSelector, labelSelector, limit, resourceVersion, timeoutSeconds, watch, options = {}) { const localVarPath = this.basePath + '/apis/rbac.authorization.k8s.io/v1beta1/clusterrolebindings'; let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; if (includeUninitialized !== undefined) { localVarQueryParameters['includeUninitialized'] = ObjectSerializer.serialize(includeUninitialized, "boolean"); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, "string"); } if (_continue !== undefined) { localVarQueryParameters['continue'] = ObjectSerializer.serialize(_continue, "string"); } if (fieldSelector !== undefined) { localVarQueryParameters['fieldSelector'] = ObjectSerializer.serialize(fieldSelector, "string"); } if (labelSelector !== undefined) { localVarQueryParameters['labelSelector'] = ObjectSerializer.serialize(labelSelector, "string"); } if (limit !== undefined) { localVarQueryParameters['limit'] = ObjectSerializer.serialize(limit, "number"); } if (resourceVersion !== undefined) { localVarQueryParameters['resourceVersion'] = ObjectSerializer.serialize(resourceVersion, "string"); } if (timeoutSeconds !== undefined) { localVarQueryParameters['timeoutSeconds'] = ObjectSerializer.serialize(timeoutSeconds, "number"); } if (watch !== undefined) { localVarQueryParameters['watch'] = ObjectSerializer.serialize(watch, "boolean"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'DELETE', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "V1Status"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * delete collection of Role * @param namespace object name and auth scope, such as for teams and projects * @param includeUninitialized If true, partially initialized resources are included in the response. * @param pretty If 'true', then the output is pretty printed. * @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. * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything. * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything. * @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. * @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. * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. * @param watch Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion. * @param {*} [options] Override http request options. */ deleteCollectionNamespacedRole(namespace, includeUninitialized, pretty, _continue, fieldSelector, labelSelector, limit, resourceVersion, timeoutSeconds, watch, options = {}) { const localVarPath = this.basePath + '/apis/rbac.authorization.k8s.io/v1beta1/namespaces/{namespace}/roles' .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling deleteCollectionNamespacedRole.'); } if (includeUninitialized !== undefined) { localVarQueryParameters['includeUninitialized'] = ObjectSerializer.serialize(includeUninitialized, "boolean"); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, "string"); } if (_continue !== undefined) { localVarQueryParameters['continue'] = ObjectSerializer.serialize(_continue, "string"); } if (fieldSelector !== undefined) { localVarQueryParameters['fieldSelector'] = ObjectSerializer.serialize(fieldSelector, "string"); } if (labelSelector !== undefined) { localVarQueryParameters['labelSelector'] = ObjectSerializer.serialize(labelSelector, "string"); } if (limit !== undefined) { localVarQueryParameters['limit'] = ObjectSerializer.serialize(limit, "number"); } if (resourceVersion !== undefined) { localVarQueryParameters['resourceVersion'] = ObjectSerializer.serialize(resourceVersion, "string"); } if (timeoutSeconds !== undefined) { localVarQueryParameters['timeoutSeconds'] = ObjectSerializer.serialize(timeoutSeconds, "number"); } if (watch !== undefined) { localVarQueryParameters['watch'] = ObjectSerializer.serialize(watch, "boolean"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'DELETE', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "V1Status"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * delete collection of RoleBinding * @param namespace object name and auth scope, such as for teams and projects * @param includeUninitialized If true, partially initialized resources are included in the response. * @param pretty If 'true', then the output is pretty printed. * @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. * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything. * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything. * @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. * @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. * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. * @param watch Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion. * @param {*} [options] Override http request options. */ deleteCollectionNamespacedRoleBinding(namespace, includeUninitialized, pretty, _continue, fieldSelector, labelSelector, limit, resourceVersion, timeoutSeconds, watch, options = {}) { const localVarPath = this.basePath + '/apis/rbac.authorization.k8s.io/v1beta1/namespaces/{namespace}/rolebindings' .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling deleteCollectionNamespacedRoleBinding.'); } if (includeUninitialized !== undefined) { localVarQueryParameters['includeUninitialized'] = ObjectSerializer.serialize(includeUninitialized, "boolean"); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, "string"); } if (_continue !== undefined) { localVarQueryParameters['continue'] = ObjectSerializer.serialize(_continue, "string"); } if (fieldSelector !== undefined) { localVarQueryParameters['fieldSelector'] = ObjectSerializer.serialize(fieldSelector, "string"); } if (labelSelector !== undefined) { localVarQueryParameters['labelSelector'] = ObjectSerializer.serialize(labelSelector, "string"); } if (limit !== undefined) { localVarQueryParameters['limit'] = ObjectSerializer.serialize(limit, "number"); } if (resourceVersion !== undefined) { localVarQueryParameters['resourceVersion'] = ObjectSerializer.serialize(resourceVersion, "string"); } if (timeoutSeconds !== undefined) { localVarQueryParameters['timeoutSeconds'] = ObjectSerializer.serialize(timeoutSeconds, "number"); } if (watch !== undefined) { localVarQueryParameters['watch'] = ObjectSerializer.serialize(watch, "boolean"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'DELETE', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "V1Status"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * delete a Role * @param name name of the Role * @param namespace object name and auth scope, such as for teams and projects * @param pretty If 'true', then the output is pretty printed. * @param body * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @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. * @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. * @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. * @param {*} [options] Override http request options. */ deleteNamespacedRole(name, namespace, pretty, body, dryRun, gracePeriodSeconds, orphanDependents, propagationPolicy, options = {}) { const localVarPath = this.basePath + '/apis/rbac.authorization.k8s.io/v1beta1/namespaces/{namespace}/roles/{name}' .replace('{' + 'name' + '}', encodeURIComponent(String(name))) .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling deleteNamespacedRole.'); } // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling deleteNamespacedRole.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, "string"); } if (gracePeriodSeconds !== undefined) { localVarQueryParameters['gracePeriodSeconds'] = ObjectSerializer.serialize(gracePeriodSeconds, "number"); } if (orphanDependents !== undefined) { localVarQueryParameters['orphanDependents'] = ObjectSerializer.serialize(orphanDependents, "boolean"); } if (propagationPolicy !== undefined) { localVarQueryParameters['propagationPolicy'] = ObjectSerializer.serialize(propagationPolicy, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'DELETE', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: ObjectSerializer.serialize(body, "V1DeleteOptions") }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "V1Status"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * delete a RoleBinding * @param name name of the RoleBinding * @param namespace object name and auth scope, such as for teams and projects * @param pretty If 'true', then the output is pretty printed. * @param body * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @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. * @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. * @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. * @param {*} [options] Override http request options. */ deleteNamespacedRoleBinding(name, namespace, pretty, body, dryRun, gracePeriodSeconds, orphanDependents, propagationPolicy, options = {}) { const localVarPath = this.basePath + '/apis/rbac.authorization.k8s.io/v1beta1/namespaces/{namespace}/rolebindings/{name}' .replace('{' + 'name' + '}', encodeURIComponent(String(name))) .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling deleteNamespacedRoleBinding.'); } // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling deleteNamespacedRoleBinding.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, "string"); } if (gracePeriodSeconds !== undefined) { localVarQueryParameters['gracePeriodSeconds'] = ObjectSerializer.serialize(gracePeriodSeconds, "number"); } if (orphanDependents !== undefined) { localVarQueryParameters['orphanDependents'] = ObjectSerializer.serialize(orphanDependents, "boolean"); } if (propagationPolicy !== undefined) { localVarQueryParameters['propagationPolicy'] = ObjectSerializer.serialize(propagationPolicy, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'DELETE', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: ObjectSerializer.serialize(body, "V1DeleteOptions") }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "V1Status"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * get available resources * @param {*} [options] Override http request options. */ getAPIResources(options = {}) { const localVarPath = this.basePath + '/apis/rbac.authorization.k8s.io/v1beta1/'; let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'GET', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "V1APIResourceList"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * list or watch objects of kind ClusterRole * @param includeUninitialized If true, partially initialized resources are included in the response. * @param pretty If 'true', then the output is pretty printed. * @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. * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything. * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything. * @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. * @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. * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. * @param watch Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion. * @param {*} [options] Override http request options. */ listClusterRole(includeUninitialized, pretty, _continue, fieldSelector, labelSelector, limit, resourceVersion, timeoutSeconds, watch, options = {}) { const localVarPath = this.basePath + '/apis/rbac.authorization.k8s.io/v1beta1/clusterroles'; let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; if (includeUninitialized !== undefined) { localVarQueryParameters['includeUninitialized'] = ObjectSerializer.serialize(includeUninitialized, "boolean"); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, "string"); } if (_continue !== undefined) { localVarQueryParameters['continue'] = ObjectSerializer.serialize(_continue, "string"); } if (fieldSelector !== undefined) { localVarQueryParameters['fieldSelector'] = ObjectSerializer.serialize(fieldSelector, "string"); } if (labelSelector !== undefined) { localVarQueryParameters['labelSelector'] = ObjectSerializer.serialize(labelSelector, "string"); } if (limit !== undefined) { localVarQueryParameters['limit'] = ObjectSerializer.serialize(limit, "number"); } if (resourceVersion !== undefined) { localVarQueryParameters['resourceVersion'] = ObjectSerializer.serialize(resourceVersion, "string"); } if (timeoutSeconds !== undefined) { localVarQueryParameters['timeoutSeconds'] = ObjectSerializer.serialize(timeoutSeconds, "number"); } if (watch !== undefined) { localVarQueryParameters['watch'] = ObjectSerializer.serialize(watch, "boolean"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'GET', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "V1beta1ClusterRoleList"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * list or watch objects of kind ClusterRoleBinding * @param includeUninitialized If true, partially initialized resources are included in the response. * @param pretty If 'true', then the output is pretty printed. * @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. * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything. * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything. * @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. * @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. * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. * @param watch Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion. * @param {*} [options] Override http request options. */ listClusterRoleBinding(includeUninitialized, pretty, _continue, fieldSelector, labelSelector, limit, resourceVersion, timeoutSeconds, watch, options = {}) { const localVarPath = this.basePath + '/apis/rbac.authorization.k8s.io/v1beta1/clusterrolebindings'; let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; if (includeUninitialized !== undefined) { localVarQueryParameters['includeUninitialized'] = ObjectSerializer.serialize(includeUninitialized, "boolean"); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, "string"); } if (_continue !== undefined) { localVarQueryParameters['continue'] = ObjectSerializer.serialize(_continue, "string"); } if (fieldSelector !== undefined) { localVarQueryParameters['fieldSelector'] = ObjectSerializer.serialize(fieldSelector, "string"); } if (labelSelector !== undefined) { localVarQueryParameters['labelSelector'] = ObjectSerializer.serialize(labelSelector, "string"); } if (limit !== undefined) { localVarQueryParameters['limit'] = ObjectSerializer.serialize(limit, "number"); } if (resourceVersion !== undefined) { localVarQueryParameters['resourceVersion'] = ObjectSerializer.serialize(resourceVersion, "string"); } if (timeoutSeconds !== undefined) { localVarQueryParameters['timeoutSeconds'] = ObjectSerializer.serialize(timeoutSeconds, "number"); } if (watch !== undefined) { localVarQueryParameters['watch'] = ObjectSerializer.serialize(watch, "boolean"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'GET', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "V1beta1ClusterRoleBindingList"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * list or watch objects of kind Role * @param namespace object name and auth scope, such as for teams and projects * @param includeUninitialized If true, partially initialized resources are included in the response. * @param pretty If 'true', then the output is pretty printed. * @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. * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything. * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything. * @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. * @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. * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. * @param watch Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion. * @param {*} [options] Override http request options. */ listNamespacedRole(namespace, includeUninitialized, pretty, _continue, fieldSelector, labelSelector, limit, resourceVersion, timeoutSeconds, watch, options = {}) { const localVarPath = this.basePath + '/apis/rbac.authorization.k8s.io/v1beta1/namespaces/{namespace}/roles' .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling listNamespacedRole.'); } if (includeUninitialized !== undefined) { localVarQueryParameters['includeUninitialized'] = ObjectSerializer.serialize(includeUninitialized, "boolean"); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, "string"); } if (_continue !== undefined) { localVarQueryParameters['continue'] = ObjectSerializer.serialize(_continue, "string"); } if (fieldSelector !== undefined) { localVarQueryParameters['fieldSelector'] = ObjectSerializer.serialize(fieldSelector, "string"); } if (labelSelector !== undefined) { localVarQueryParameters['labelSelector'] = ObjectSerializer.serialize(labelSelector, "string"); } if (limit !== undefined) { localVarQueryParameters['limit'] = ObjectSerializer.serialize(limit, "number"); } if (resourceVersion !== undefined) { localVarQueryParameters['resourceVersion'] = ObjectSerializer.serialize(resourceVersion, "string"); } if (timeoutSeconds !== undefined) { localVarQueryParameters['timeoutSeconds'] = ObjectSerializer.serialize(timeoutSeconds, "number"); } if (watch !== undefined) { localVarQueryParameters['watch'] = ObjectSerializer.serialize(watch, "boolean"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'GET', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "V1beta1RoleList"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * list or watch objects of kind RoleBinding * @param namespace object name and auth scope, such as for teams and projects * @param includeUninitialized If true, partially initialized resources are included in the response. * @param pretty If 'true', then the output is pretty printed. * @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. * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything. * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything. * @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. * @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. * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. * @param watch Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion. * @param {*} [options] Override http request options. */ listNamespacedRoleBinding(namespace, includeUninitialized, pretty, _continue, fieldSelector, labelSelector, limit, resourceVersion, timeoutSeconds, watch, options = {}) { const localVarPath = this.basePath + '/apis/rbac.authorization.k8s.io/v1beta1/namespaces/{namespace}/rolebindings' .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling listNamespacedRoleBinding.'); } if (includeUninitialized !== undefined) { localVarQueryParameters['includeUninitialized'] = ObjectSerializer.serialize(includeUninitialized, "boolean"); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, "string"); } if (_continue !== undefined) { localVarQueryParameters['continue'] = ObjectSerializer.serialize(_continue, "string"); } if (fieldSelector !== undefined) { localVarQueryParameters['fieldSelector'] = ObjectSerializer.serialize(fieldSelector, "string"); } if (labelSelector !== undefined) { localVarQueryParameters['labelSelector'] = ObjectSerializer.serialize(labelSelector, "string"); } if (limit !== undefined) { localVarQueryParameters['limit'] = ObjectSerializer.serialize(limit, "number"); } if (resourceVersion !== undefined) { localVarQueryParameters['resourceVersion'] = ObjectSerializer.serialize(resourceVersion, "string"); } if (timeoutSeconds !== undefined) { localVarQueryParameters['timeoutSeconds'] = ObjectSerializer.serialize(timeoutSeconds, "number"); } if (watch !== undefined) { localVarQueryParameters['watch'] = ObjectSerializer.serialize(watch, "boolean"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'GET', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "V1beta1RoleBindingList"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * list or watch objects of kind RoleBinding * @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. * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything. * @param includeUninitialized If true, partially initialized resources are included in the response. * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything. * @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. * @param pretty If 'true', then the output is pretty printed. * @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. * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. * @param watch Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion. * @param {*} [options] Override http request options. */ listRoleBindingForAllNamespaces(_continue, fieldSelector, includeUninitialized, labelSelector, limit, pretty, resourceVersion, timeoutSeconds, watch, options = {}) { const localVarPath = this.basePath + '/apis/rbac.authorization.k8s.io/v1beta1/rolebindings'; let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; if (_continue !== undefined) { localVarQueryParameters['continue'] = ObjectSerializer.serialize(_continue, "string"); } if (fieldSelector !== undefined) { localVarQueryParameters['fieldSelector'] = ObjectSerializer.serialize(fieldSelector, "string"); } if (includeUninitialized !== undefined) { localVarQueryParameters['includeUninitialized'] = ObjectSerializer.serialize(includeUninitialized, "boolean"); } if (labelSelector !== undefined) { localVarQueryParameters['labelSelector'] = ObjectSerializer.serialize(labelSelector, "string"); } if (limit !== undefined) { localVarQueryParameters['limit'] = ObjectSerializer.serialize(limit, "number"); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, "string"); } if (resourceVersion !== undefined) { localVarQueryParameters['resourceVersion'] = ObjectSerializer.serialize(resourceVersion, "string"); } if (timeoutSeconds !== undefined) { localVarQueryParameters['timeoutSeconds'] = ObjectSerializer.serialize(timeoutSeconds, "number"); } if (watch !== undefined) { localVarQueryParameters['watch'] = ObjectSerializer.serialize(watch, "boolean"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'GET', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "V1beta1RoleBindingList"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * list or watch objects of kind Role * @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. * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything. * @param includeUninitialized If true, partially initialized resources are included in the response. * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything. * @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. * @param pretty If 'true', then the output is pretty printed. * @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. * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. * @param watch Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion. * @param {*} [options] Override http request options. */ listRoleForAllNamespaces(_continue, fieldSelector, includeUninitialized, labelSelector, limit, pretty, resourceVersion, timeoutSeconds, watch, options = {}) { const localVarPath = this.basePath + '/apis/rbac.authorization.k8s.io/v1beta1/roles'; let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; if (_continue !== undefined) { localVarQueryParameters['continue'] = ObjectSerializer.serialize(_continue, "string"); } if (fieldSelector !== undefined) { localVarQueryParameters['fieldSelector'] = ObjectSerializer.serialize(fieldSelector, "string"); } if (includeUninitialized !== undefined) { localVarQueryParameters['includeUninitialized'] = ObjectSerializer.serialize(includeUninitialized, "boolean"); } if (labelSelector !== undefined) { localVarQueryParameters['labelSelector'] = ObjectSerializer.serialize(labelSelector, "string"); } if (limit !== undefined) { localVarQueryParameters['limit'] = ObjectSerializer.serialize(limit, "number"); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, "string"); } if (resourceVersion !== undefined) { localVarQueryParameters['resourceVersion'] = ObjectSerializer.serialize(resourceVersion, "string"); } if (timeoutSeconds !== undefined) { localVarQueryParameters['timeoutSeconds'] = ObjectSerializer.serialize(timeoutSeconds, "number"); } if (watch !== undefined) { localVarQueryParameters['watch'] = ObjectSerializer.serialize(watch, "boolean"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'GET', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "V1beta1RoleList"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * partially update the specified ClusterRole * @param name name of the ClusterRole * @param body * @param pretty If 'true', then the output is pretty printed. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param {*} [options] Override http request options. */ patchClusterRole(name, body, pretty, dryRun, options = {}) { const localVarPath = this.basePath + '/apis/rbac.authorization.k8s.io/v1beta1/clusterroles/{name}' .replace('{' + 'name' + '}', encodeURIComponent(String(name))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling patchClusterRole.'); } // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling patchClusterRole.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'PATCH', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: ObjectSerializer.serialize(body, "any") }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "V1beta1ClusterRole"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * partially update the specified ClusterRoleBinding * @param name name of the ClusterRoleBinding * @param body * @param pretty If 'true', then the output is pretty printed. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param {*} [options] Override http request options. */ patchClusterRoleBinding(name, body, pretty, dryRun, options = {}) { const localVarPath = this.basePath + '/apis/rbac.authorization.k8s.io/v1beta1/clusterrolebindings/{name}' .replace('{' + 'name' + '}', encodeURIComponent(String(name))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling patchClusterRoleBinding.'); } // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling patchClusterRoleBinding.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'PATCH', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: ObjectSerializer.serialize(body, "any") }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "V1beta1ClusterRoleBinding"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * partially update the specified Role * @param name name of the Role * @param namespace object name and auth scope, such as for teams and projects * @param body * @param pretty If 'true', then the output is pretty printed. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param {*} [options] Override http request options. */ patchNamespacedRole(name, namespace, body, pretty, dryRun, options = {}) { const localVarPath = this.basePath + '/apis/rbac.authorization.k8s.io/v1beta1/namespaces/{namespace}/roles/{name}' .replace('{' + 'name' + '}', encodeURIComponent(String(name))) .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling patchNamespacedRole.'); } // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling patchNamespacedRole.'); } // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling patchNamespacedRole.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'PATCH', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: ObjectSerializer.serialize(body, "any") }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "V1beta1Role"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * partially update the specified RoleBinding * @param name name of the RoleBinding * @param namespace object name and auth scope, such as for teams and projects * @param body * @param pretty If 'true', then the output is pretty printed. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param {*} [options] Override http request options. */ patchNamespacedRoleBinding(name, namespace, body, pretty, dryRun, options = {}) { const localVarPath = this.basePath + '/apis/rbac.authorization.k8s.io/v1beta1/namespaces/{namespace}/rolebindings/{name}' .replace('{' + 'name' + '}', encodeURIComponent(String(name))) .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling patchNamespacedRoleBinding.'); } // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling patchNamespacedRoleBinding.'); } // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling patchNamespacedRoleBinding.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'PATCH', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: ObjectSerializer.serialize(body, "any") }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "V1beta1RoleBinding"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * read the specified ClusterRole * @param name name of the ClusterRole * @param pretty If 'true', then the output is pretty printed. * @param {*} [options] Override http request options. */ readClusterRole(name, pretty, options = {}) { const localVarPath = this.basePath + '/apis/rbac.authorization.k8s.io/v1beta1/clusterroles/{name}' .replace('{' + 'name' + '}', encodeURIComponent(String(name))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling readClusterRole.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'GET', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "V1beta1ClusterRole"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * read the specified ClusterRoleBinding * @param name name of the ClusterRoleBinding * @param pretty If 'true', then the output is pretty printed. * @param {*} [options] Override http request options. */ readClusterRoleBinding(name, pretty, options = {}) { const localVarPath = this.basePath + '/apis/rbac.authorization.k8s.io/v1beta1/clusterrolebindings/{name}' .replace('{' + 'name' + '}', encodeURIComponent(String(name))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling readClusterRoleBinding.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'GET', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "V1beta1ClusterRoleBinding"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * read the specified Role * @param name name of the Role * @param namespace object name and auth scope, such as for teams and projects * @param pretty If 'true', then the output is pretty printed. * @param {*} [options] Override http request options. */ readNamespacedRole(name, namespace, pretty, options = {}) { const localVarPath = this.basePath + '/apis/rbac.authorization.k8s.io/v1beta1/namespaces/{namespace}/roles/{name}' .replace('{' + 'name' + '}', encodeURIComponent(String(name))) .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling readNamespacedRole.'); } // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling readNamespacedRole.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'GET', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "V1beta1Role"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * read the specified RoleBinding * @param name name of the RoleBinding * @param namespace object name and auth scope, such as for teams and projects * @param pretty If 'true', then the output is pretty printed. * @param {*} [options] Override http request options. */ readNamespacedRoleBinding(name, namespace, pretty, options = {}) { const localVarPath = this.basePath + '/apis/rbac.authorization.k8s.io/v1beta1/namespaces/{namespace}/rolebindings/{name}' .replace('{' + 'name' + '}', encodeURIComponent(String(name))) .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling readNamespacedRoleBinding.'); } // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling readNamespacedRoleBinding.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'GET', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "V1beta1RoleBinding"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * replace the specified ClusterRole * @param name name of the ClusterRole * @param body * @param pretty If 'true', then the output is pretty printed. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param {*} [options] Override http request options. */ replaceClusterRole(name, body, pretty, dryRun, options = {}) { const localVarPath = this.basePath + '/apis/rbac.authorization.k8s.io/v1beta1/clusterroles/{name}' .replace('{' + 'name' + '}', encodeURIComponent(String(name))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling replaceClusterRole.'); } // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling replaceClusterRole.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'PUT', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: ObjectSerializer.serialize(body, "V1beta1ClusterRole") }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "V1beta1ClusterRole"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * replace the specified ClusterRoleBinding * @param name name of the ClusterRoleBinding * @param body * @param pretty If 'true', then the output is pretty printed. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param {*} [options] Override http request options. */ replaceClusterRoleBinding(name, body, pretty, dryRun, options = {}) { const localVarPath = this.basePath + '/apis/rbac.authorization.k8s.io/v1beta1/clusterrolebindings/{name}' .replace('{' + 'name' + '}', encodeURIComponent(String(name))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling replaceClusterRoleBinding.'); } // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling replaceClusterRoleBinding.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'PUT', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: ObjectSerializer.serialize(body, "V1beta1ClusterRoleBinding") }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "V1beta1ClusterRoleBinding"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * replace the specified Role * @param name name of the Role * @param namespace object name and auth scope, such as for teams and projects * @param body * @param pretty If 'true', then the output is pretty printed. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param {*} [options] Override http request options. */ replaceNamespacedRole(name, namespace, body, pretty, dryRun, options = {}) { const localVarPath = this.basePath + '/apis/rbac.authorization.k8s.io/v1beta1/namespaces/{namespace}/roles/{name}' .replace('{' + 'name' + '}', encodeURIComponent(String(name))) .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling replaceNamespacedRole.'); } // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling replaceNamespacedRole.'); } // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling replaceNamespacedRole.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'PUT', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: ObjectSerializer.serialize(body, "V1beta1Role") }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "V1beta1Role"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * replace the specified RoleBinding * @param name name of the RoleBinding * @param namespace object name and auth scope, such as for teams and projects * @param body * @param pretty If 'true', then the output is pretty printed. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param {*} [options] Override http request options. */ replaceNamespacedRoleBinding(name, namespace, body, pretty, dryRun, options = {}) { const localVarPath = this.basePath + '/apis/rbac.authorization.k8s.io/v1beta1/namespaces/{namespace}/rolebindings/{name}' .replace('{' + 'name' + '}', encodeURIComponent(String(name))) .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling replaceNamespacedRoleBinding.'); } // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling replaceNamespacedRoleBinding.'); } // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling replaceNamespacedRoleBinding.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'PUT', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: ObjectSerializer.serialize(body, "V1beta1RoleBinding") }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "V1beta1RoleBinding"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } } exports.RbacAuthorizationV1beta1Api = RbacAuthorizationV1beta1Api; var SchedulingApiApiKeys; (function (SchedulingApiApiKeys) { SchedulingApiApiKeys[SchedulingApiApiKeys["BearerToken"] = 0] = "BearerToken"; })(SchedulingApiApiKeys = exports.SchedulingApiApiKeys || (exports.SchedulingApiApiKeys = {})); class SchedulingApi { constructor(basePathOrUsername, password, basePath) { this._basePath = defaultBasePath; this.defaultHeaders = {}; this._useQuerystring = false; this.authentications = { 'default': new VoidAuth(), 'BearerToken': new ApiKeyAuth('header', 'authorization'), }; if (password) { if (basePath) { this.basePath = basePath; } } else { if (basePathOrUsername) { this.basePath = basePathOrUsername; } } } set useQuerystring(value) { this._useQuerystring = value; } set basePath(basePath) { this._basePath = basePath; } get basePath() { return this._basePath; } setDefaultAuthentication(auth) { this.authentications.default = auth; } setApiKey(key, value) { this.authentications[SchedulingApiApiKeys[key]].apiKey = value; } /** * get information of a group * @param {*} [options] Override http request options. */ getAPIGroup(options = {}) { const localVarPath = this.basePath + '/apis/scheduling.k8s.io/'; let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'GET', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "V1APIGroup"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } } exports.SchedulingApi = SchedulingApi; var SchedulingV1alpha1ApiApiKeys; (function (SchedulingV1alpha1ApiApiKeys) { SchedulingV1alpha1ApiApiKeys[SchedulingV1alpha1ApiApiKeys["BearerToken"] = 0] = "BearerToken"; })(SchedulingV1alpha1ApiApiKeys = exports.SchedulingV1alpha1ApiApiKeys || (exports.SchedulingV1alpha1ApiApiKeys = {})); class SchedulingV1alpha1Api { constructor(basePathOrUsername, password, basePath) { this._basePath = defaultBasePath; this.defaultHeaders = {}; this._useQuerystring = false; this.authentications = { 'default': new VoidAuth(), 'BearerToken': new ApiKeyAuth('header', 'authorization'), }; if (password) { if (basePath) { this.basePath = basePath; } } else { if (basePathOrUsername) { this.basePath = basePathOrUsername; } } } set useQuerystring(value) { this._useQuerystring = value; } set basePath(basePath) { this._basePath = basePath; } get basePath() { return this._basePath; } setDefaultAuthentication(auth) { this.authentications.default = auth; } setApiKey(key, value) { this.authentications[SchedulingV1alpha1ApiApiKeys[key]].apiKey = value; } /** * create a PriorityClass * @param body * @param includeUninitialized If true, partially initialized resources are included in the response. * @param pretty If 'true', then the output is pretty printed. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param {*} [options] Override http request options. */ createPriorityClass(body, includeUninitialized, pretty, dryRun, options = {}) { const localVarPath = this.basePath + '/apis/scheduling.k8s.io/v1alpha1/priorityclasses'; let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling createPriorityClass.'); } if (includeUninitialized !== undefined) { localVarQueryParameters['includeUninitialized'] = ObjectSerializer.serialize(includeUninitialized, "boolean"); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'POST', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: ObjectSerializer.serialize(body, "V1alpha1PriorityClass") }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "V1alpha1PriorityClass"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * delete collection of PriorityClass * @param includeUninitialized If true, partially initialized resources are included in the response. * @param pretty If 'true', then the output is pretty printed. * @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. * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything. * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything. * @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. * @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. * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. * @param watch Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion. * @param {*} [options] Override http request options. */ deleteCollectionPriorityClass(includeUninitialized, pretty, _continue, fieldSelector, labelSelector, limit, resourceVersion, timeoutSeconds, watch, options = {}) { const localVarPath = this.basePath + '/apis/scheduling.k8s.io/v1alpha1/priorityclasses'; let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; if (includeUninitialized !== undefined) { localVarQueryParameters['includeUninitialized'] = ObjectSerializer.serialize(includeUninitialized, "boolean"); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, "string"); } if (_continue !== undefined) { localVarQueryParameters['continue'] = ObjectSerializer.serialize(_continue, "string"); } if (fieldSelector !== undefined) { localVarQueryParameters['fieldSelector'] = ObjectSerializer.serialize(fieldSelector, "string"); } if (labelSelector !== undefined) { localVarQueryParameters['labelSelector'] = ObjectSerializer.serialize(labelSelector, "string"); } if (limit !== undefined) { localVarQueryParameters['limit'] = ObjectSerializer.serialize(limit, "number"); } if (resourceVersion !== undefined) { localVarQueryParameters['resourceVersion'] = ObjectSerializer.serialize(resourceVersion, "string"); } if (timeoutSeconds !== undefined) { localVarQueryParameters['timeoutSeconds'] = ObjectSerializer.serialize(timeoutSeconds, "number"); } if (watch !== undefined) { localVarQueryParameters['watch'] = ObjectSerializer.serialize(watch, "boolean"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'DELETE', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "V1Status"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * delete a PriorityClass * @param name name of the PriorityClass * @param pretty If 'true', then the output is pretty printed. * @param body * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @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. * @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. * @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. * @param {*} [options] Override http request options. */ deletePriorityClass(name, pretty, body, dryRun, gracePeriodSeconds, orphanDependents, propagationPolicy, options = {}) { const localVarPath = this.basePath + '/apis/scheduling.k8s.io/v1alpha1/priorityclasses/{name}' .replace('{' + 'name' + '}', encodeURIComponent(String(name))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling deletePriorityClass.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, "string"); } if (gracePeriodSeconds !== undefined) { localVarQueryParameters['gracePeriodSeconds'] = ObjectSerializer.serialize(gracePeriodSeconds, "number"); } if (orphanDependents !== undefined) { localVarQueryParameters['orphanDependents'] = ObjectSerializer.serialize(orphanDependents, "boolean"); } if (propagationPolicy !== undefined) { localVarQueryParameters['propagationPolicy'] = ObjectSerializer.serialize(propagationPolicy, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'DELETE', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: ObjectSerializer.serialize(body, "V1DeleteOptions") }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "V1Status"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * get available resources * @param {*} [options] Override http request options. */ getAPIResources(options = {}) { const localVarPath = this.basePath + '/apis/scheduling.k8s.io/v1alpha1/'; let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'GET', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "V1APIResourceList"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * list or watch objects of kind PriorityClass * @param includeUninitialized If true, partially initialized resources are included in the response. * @param pretty If 'true', then the output is pretty printed. * @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. * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything. * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything. * @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. * @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. * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. * @param watch Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion. * @param {*} [options] Override http request options. */ listPriorityClass(includeUninitialized, pretty, _continue, fieldSelector, labelSelector, limit, resourceVersion, timeoutSeconds, watch, options = {}) { const localVarPath = this.basePath + '/apis/scheduling.k8s.io/v1alpha1/priorityclasses'; let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; if (includeUninitialized !== undefined) { localVarQueryParameters['includeUninitialized'] = ObjectSerializer.serialize(includeUninitialized, "boolean"); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, "string"); } if (_continue !== undefined) { localVarQueryParameters['continue'] = ObjectSerializer.serialize(_continue, "string"); } if (fieldSelector !== undefined) { localVarQueryParameters['fieldSelector'] = ObjectSerializer.serialize(fieldSelector, "string"); } if (labelSelector !== undefined) { localVarQueryParameters['labelSelector'] = ObjectSerializer.serialize(labelSelector, "string"); } if (limit !== undefined) { localVarQueryParameters['limit'] = ObjectSerializer.serialize(limit, "number"); } if (resourceVersion !== undefined) { localVarQueryParameters['resourceVersion'] = ObjectSerializer.serialize(resourceVersion, "string"); } if (timeoutSeconds !== undefined) { localVarQueryParameters['timeoutSeconds'] = ObjectSerializer.serialize(timeoutSeconds, "number"); } if (watch !== undefined) { localVarQueryParameters['watch'] = ObjectSerializer.serialize(watch, "boolean"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'GET', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "V1alpha1PriorityClassList"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * partially update the specified PriorityClass * @param name name of the PriorityClass * @param body * @param pretty If 'true', then the output is pretty printed. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param {*} [options] Override http request options. */ patchPriorityClass(name, body, pretty, dryRun, options = {}) { const localVarPath = this.basePath + '/apis/scheduling.k8s.io/v1alpha1/priorityclasses/{name}' .replace('{' + 'name' + '}', encodeURIComponent(String(name))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling patchPriorityClass.'); } // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling patchPriorityClass.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'PATCH', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: ObjectSerializer.serialize(body, "any") }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "V1alpha1PriorityClass"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * read the specified PriorityClass * @param name name of the PriorityClass * @param pretty If 'true', then the output is pretty printed. * @param exact Should the export be exact. Exact export maintains cluster-specific fields like 'Namespace'. * @param _export Should this value be exported. Export strips fields that a user can not specify. * @param {*} [options] Override http request options. */ readPriorityClass(name, pretty, exact, _export, options = {}) { const localVarPath = this.basePath + '/apis/scheduling.k8s.io/v1alpha1/priorityclasses/{name}' .replace('{' + 'name' + '}', encodeURIComponent(String(name))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling readPriorityClass.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, "string"); } if (exact !== undefined) { localVarQueryParameters['exact'] = ObjectSerializer.serialize(exact, "boolean"); } if (_export !== undefined) { localVarQueryParameters['export'] = ObjectSerializer.serialize(_export, "boolean"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'GET', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "V1alpha1PriorityClass"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * replace the specified PriorityClass * @param name name of the PriorityClass * @param body * @param pretty If 'true', then the output is pretty printed. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param {*} [options] Override http request options. */ replacePriorityClass(name, body, pretty, dryRun, options = {}) { const localVarPath = this.basePath + '/apis/scheduling.k8s.io/v1alpha1/priorityclasses/{name}' .replace('{' + 'name' + '}', encodeURIComponent(String(name))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling replacePriorityClass.'); } // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling replacePriorityClass.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'PUT', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: ObjectSerializer.serialize(body, "V1alpha1PriorityClass") }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "V1alpha1PriorityClass"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } } exports.SchedulingV1alpha1Api = SchedulingV1alpha1Api; var SchedulingV1beta1ApiApiKeys; (function (SchedulingV1beta1ApiApiKeys) { SchedulingV1beta1ApiApiKeys[SchedulingV1beta1ApiApiKeys["BearerToken"] = 0] = "BearerToken"; })(SchedulingV1beta1ApiApiKeys = exports.SchedulingV1beta1ApiApiKeys || (exports.SchedulingV1beta1ApiApiKeys = {})); class SchedulingV1beta1Api { constructor(basePathOrUsername, password, basePath) { this._basePath = defaultBasePath; this.defaultHeaders = {}; this._useQuerystring = false; this.authentications = { 'default': new VoidAuth(), 'BearerToken': new ApiKeyAuth('header', 'authorization'), }; if (password) { if (basePath) { this.basePath = basePath; } } else { if (basePathOrUsername) { this.basePath = basePathOrUsername; } } } set useQuerystring(value) { this._useQuerystring = value; } set basePath(basePath) { this._basePath = basePath; } get basePath() { return this._basePath; } setDefaultAuthentication(auth) { this.authentications.default = auth; } setApiKey(key, value) { this.authentications[SchedulingV1beta1ApiApiKeys[key]].apiKey = value; } /** * create a PriorityClass * @param body * @param includeUninitialized If true, partially initialized resources are included in the response. * @param pretty If 'true', then the output is pretty printed. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param {*} [options] Override http request options. */ createPriorityClass(body, includeUninitialized, pretty, dryRun, options = {}) { const localVarPath = this.basePath + '/apis/scheduling.k8s.io/v1beta1/priorityclasses'; let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling createPriorityClass.'); } if (includeUninitialized !== undefined) { localVarQueryParameters['includeUninitialized'] = ObjectSerializer.serialize(includeUninitialized, "boolean"); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'POST', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: ObjectSerializer.serialize(body, "V1beta1PriorityClass") }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "V1beta1PriorityClass"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * delete collection of PriorityClass * @param includeUninitialized If true, partially initialized resources are included in the response. * @param pretty If 'true', then the output is pretty printed. * @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. * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything. * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything. * @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. * @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. * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. * @param watch Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion. * @param {*} [options] Override http request options. */ deleteCollectionPriorityClass(includeUninitialized, pretty, _continue, fieldSelector, labelSelector, limit, resourceVersion, timeoutSeconds, watch, options = {}) { const localVarPath = this.basePath + '/apis/scheduling.k8s.io/v1beta1/priorityclasses'; let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; if (includeUninitialized !== undefined) { localVarQueryParameters['includeUninitialized'] = ObjectSerializer.serialize(includeUninitialized, "boolean"); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, "string"); } if (_continue !== undefined) { localVarQueryParameters['continue'] = ObjectSerializer.serialize(_continue, "string"); } if (fieldSelector !== undefined) { localVarQueryParameters['fieldSelector'] = ObjectSerializer.serialize(fieldSelector, "string"); } if (labelSelector !== undefined) { localVarQueryParameters['labelSelector'] = ObjectSerializer.serialize(labelSelector, "string"); } if (limit !== undefined) { localVarQueryParameters['limit'] = ObjectSerializer.serialize(limit, "number"); } if (resourceVersion !== undefined) { localVarQueryParameters['resourceVersion'] = ObjectSerializer.serialize(resourceVersion, "string"); } if (timeoutSeconds !== undefined) { localVarQueryParameters['timeoutSeconds'] = ObjectSerializer.serialize(timeoutSeconds, "number"); } if (watch !== undefined) { localVarQueryParameters['watch'] = ObjectSerializer.serialize(watch, "boolean"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'DELETE', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "V1Status"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * delete a PriorityClass * @param name name of the PriorityClass * @param pretty If 'true', then the output is pretty printed. * @param body * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @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. * @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. * @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. * @param {*} [options] Override http request options. */ deletePriorityClass(name, pretty, body, dryRun, gracePeriodSeconds, orphanDependents, propagationPolicy, options = {}) { const localVarPath = this.basePath + '/apis/scheduling.k8s.io/v1beta1/priorityclasses/{name}' .replace('{' + 'name' + '}', encodeURIComponent(String(name))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling deletePriorityClass.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, "string"); } if (gracePeriodSeconds !== undefined) { localVarQueryParameters['gracePeriodSeconds'] = ObjectSerializer.serialize(gracePeriodSeconds, "number"); } if (orphanDependents !== undefined) { localVarQueryParameters['orphanDependents'] = ObjectSerializer.serialize(orphanDependents, "boolean"); } if (propagationPolicy !== undefined) { localVarQueryParameters['propagationPolicy'] = ObjectSerializer.serialize(propagationPolicy, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'DELETE', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: ObjectSerializer.serialize(body, "V1DeleteOptions") }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "V1Status"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * get available resources * @param {*} [options] Override http request options. */ getAPIResources(options = {}) { const localVarPath = this.basePath + '/apis/scheduling.k8s.io/v1beta1/'; let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'GET', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "V1APIResourceList"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * list or watch objects of kind PriorityClass * @param includeUninitialized If true, partially initialized resources are included in the response. * @param pretty If 'true', then the output is pretty printed. * @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. * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything. * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything. * @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. * @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. * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. * @param watch Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion. * @param {*} [options] Override http request options. */ listPriorityClass(includeUninitialized, pretty, _continue, fieldSelector, labelSelector, limit, resourceVersion, timeoutSeconds, watch, options = {}) { const localVarPath = this.basePath + '/apis/scheduling.k8s.io/v1beta1/priorityclasses'; let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; if (includeUninitialized !== undefined) { localVarQueryParameters['includeUninitialized'] = ObjectSerializer.serialize(includeUninitialized, "boolean"); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, "string"); } if (_continue !== undefined) { localVarQueryParameters['continue'] = ObjectSerializer.serialize(_continue, "string"); } if (fieldSelector !== undefined) { localVarQueryParameters['fieldSelector'] = ObjectSerializer.serialize(fieldSelector, "string"); } if (labelSelector !== undefined) { localVarQueryParameters['labelSelector'] = ObjectSerializer.serialize(labelSelector, "string"); } if (limit !== undefined) { localVarQueryParameters['limit'] = ObjectSerializer.serialize(limit, "number"); } if (resourceVersion !== undefined) { localVarQueryParameters['resourceVersion'] = ObjectSerializer.serialize(resourceVersion, "string"); } if (timeoutSeconds !== undefined) { localVarQueryParameters['timeoutSeconds'] = ObjectSerializer.serialize(timeoutSeconds, "number"); } if (watch !== undefined) { localVarQueryParameters['watch'] = ObjectSerializer.serialize(watch, "boolean"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'GET', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "V1beta1PriorityClassList"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * partially update the specified PriorityClass * @param name name of the PriorityClass * @param body * @param pretty If 'true', then the output is pretty printed. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param {*} [options] Override http request options. */ patchPriorityClass(name, body, pretty, dryRun, options = {}) { const localVarPath = this.basePath + '/apis/scheduling.k8s.io/v1beta1/priorityclasses/{name}' .replace('{' + 'name' + '}', encodeURIComponent(String(name))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling patchPriorityClass.'); } // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling patchPriorityClass.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'PATCH', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: ObjectSerializer.serialize(body, "any") }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "V1beta1PriorityClass"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * read the specified PriorityClass * @param name name of the PriorityClass * @param pretty If 'true', then the output is pretty printed. * @param exact Should the export be exact. Exact export maintains cluster-specific fields like 'Namespace'. * @param _export Should this value be exported. Export strips fields that a user can not specify. * @param {*} [options] Override http request options. */ readPriorityClass(name, pretty, exact, _export, options = {}) { const localVarPath = this.basePath + '/apis/scheduling.k8s.io/v1beta1/priorityclasses/{name}' .replace('{' + 'name' + '}', encodeURIComponent(String(name))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling readPriorityClass.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, "string"); } if (exact !== undefined) { localVarQueryParameters['exact'] = ObjectSerializer.serialize(exact, "boolean"); } if (_export !== undefined) { localVarQueryParameters['export'] = ObjectSerializer.serialize(_export, "boolean"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'GET', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "V1beta1PriorityClass"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * replace the specified PriorityClass * @param name name of the PriorityClass * @param body * @param pretty If 'true', then the output is pretty printed. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param {*} [options] Override http request options. */ replacePriorityClass(name, body, pretty, dryRun, options = {}) { const localVarPath = this.basePath + '/apis/scheduling.k8s.io/v1beta1/priorityclasses/{name}' .replace('{' + 'name' + '}', encodeURIComponent(String(name))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling replacePriorityClass.'); } // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling replacePriorityClass.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'PUT', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: ObjectSerializer.serialize(body, "V1beta1PriorityClass") }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "V1beta1PriorityClass"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } } exports.SchedulingV1beta1Api = SchedulingV1beta1Api; var SettingsApiApiKeys; (function (SettingsApiApiKeys) { SettingsApiApiKeys[SettingsApiApiKeys["BearerToken"] = 0] = "BearerToken"; })(SettingsApiApiKeys = exports.SettingsApiApiKeys || (exports.SettingsApiApiKeys = {})); class SettingsApi { constructor(basePathOrUsername, password, basePath) { this._basePath = defaultBasePath; this.defaultHeaders = {}; this._useQuerystring = false; this.authentications = { 'default': new VoidAuth(), 'BearerToken': new ApiKeyAuth('header', 'authorization'), }; if (password) { if (basePath) { this.basePath = basePath; } } else { if (basePathOrUsername) { this.basePath = basePathOrUsername; } } } set useQuerystring(value) { this._useQuerystring = value; } set basePath(basePath) { this._basePath = basePath; } get basePath() { return this._basePath; } setDefaultAuthentication(auth) { this.authentications.default = auth; } setApiKey(key, value) { this.authentications[SettingsApiApiKeys[key]].apiKey = value; } /** * get information of a group * @param {*} [options] Override http request options. */ getAPIGroup(options = {}) { const localVarPath = this.basePath + '/apis/settings.k8s.io/'; let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'GET', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "V1APIGroup"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } } exports.SettingsApi = SettingsApi; var SettingsV1alpha1ApiApiKeys; (function (SettingsV1alpha1ApiApiKeys) { SettingsV1alpha1ApiApiKeys[SettingsV1alpha1ApiApiKeys["BearerToken"] = 0] = "BearerToken"; })(SettingsV1alpha1ApiApiKeys = exports.SettingsV1alpha1ApiApiKeys || (exports.SettingsV1alpha1ApiApiKeys = {})); class SettingsV1alpha1Api { constructor(basePathOrUsername, password, basePath) { this._basePath = defaultBasePath; this.defaultHeaders = {}; this._useQuerystring = false; this.authentications = { 'default': new VoidAuth(), 'BearerToken': new ApiKeyAuth('header', 'authorization'), }; if (password) { if (basePath) { this.basePath = basePath; } } else { if (basePathOrUsername) { this.basePath = basePathOrUsername; } } } set useQuerystring(value) { this._useQuerystring = value; } set basePath(basePath) { this._basePath = basePath; } get basePath() { return this._basePath; } setDefaultAuthentication(auth) { this.authentications.default = auth; } setApiKey(key, value) { this.authentications[SettingsV1alpha1ApiApiKeys[key]].apiKey = value; } /** * create a PodPreset * @param namespace object name and auth scope, such as for teams and projects * @param body * @param includeUninitialized If true, partially initialized resources are included in the response. * @param pretty If 'true', then the output is pretty printed. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param {*} [options] Override http request options. */ createNamespacedPodPreset(namespace, body, includeUninitialized, pretty, dryRun, options = {}) { const localVarPath = this.basePath + '/apis/settings.k8s.io/v1alpha1/namespaces/{namespace}/podpresets' .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling createNamespacedPodPreset.'); } // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling createNamespacedPodPreset.'); } if (includeUninitialized !== undefined) { localVarQueryParameters['includeUninitialized'] = ObjectSerializer.serialize(includeUninitialized, "boolean"); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'POST', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: ObjectSerializer.serialize(body, "V1alpha1PodPreset") }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "V1alpha1PodPreset"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * delete collection of PodPreset * @param namespace object name and auth scope, such as for teams and projects * @param includeUninitialized If true, partially initialized resources are included in the response. * @param pretty If 'true', then the output is pretty printed. * @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. * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything. * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything. * @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. * @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. * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. * @param watch Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion. * @param {*} [options] Override http request options. */ deleteCollectionNamespacedPodPreset(namespace, includeUninitialized, pretty, _continue, fieldSelector, labelSelector, limit, resourceVersion, timeoutSeconds, watch, options = {}) { const localVarPath = this.basePath + '/apis/settings.k8s.io/v1alpha1/namespaces/{namespace}/podpresets' .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling deleteCollectionNamespacedPodPreset.'); } if (includeUninitialized !== undefined) { localVarQueryParameters['includeUninitialized'] = ObjectSerializer.serialize(includeUninitialized, "boolean"); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, "string"); } if (_continue !== undefined) { localVarQueryParameters['continue'] = ObjectSerializer.serialize(_continue, "string"); } if (fieldSelector !== undefined) { localVarQueryParameters['fieldSelector'] = ObjectSerializer.serialize(fieldSelector, "string"); } if (labelSelector !== undefined) { localVarQueryParameters['labelSelector'] = ObjectSerializer.serialize(labelSelector, "string"); } if (limit !== undefined) { localVarQueryParameters['limit'] = ObjectSerializer.serialize(limit, "number"); } if (resourceVersion !== undefined) { localVarQueryParameters['resourceVersion'] = ObjectSerializer.serialize(resourceVersion, "string"); } if (timeoutSeconds !== undefined) { localVarQueryParameters['timeoutSeconds'] = ObjectSerializer.serialize(timeoutSeconds, "number"); } if (watch !== undefined) { localVarQueryParameters['watch'] = ObjectSerializer.serialize(watch, "boolean"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'DELETE', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "V1Status"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * delete a PodPreset * @param name name of the PodPreset * @param namespace object name and auth scope, such as for teams and projects * @param pretty If 'true', then the output is pretty printed. * @param body * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @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. * @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. * @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. * @param {*} [options] Override http request options. */ deleteNamespacedPodPreset(name, namespace, pretty, body, dryRun, gracePeriodSeconds, orphanDependents, propagationPolicy, options = {}) { const localVarPath = this.basePath + '/apis/settings.k8s.io/v1alpha1/namespaces/{namespace}/podpresets/{name}' .replace('{' + 'name' + '}', encodeURIComponent(String(name))) .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling deleteNamespacedPodPreset.'); } // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling deleteNamespacedPodPreset.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, "string"); } if (gracePeriodSeconds !== undefined) { localVarQueryParameters['gracePeriodSeconds'] = ObjectSerializer.serialize(gracePeriodSeconds, "number"); } if (orphanDependents !== undefined) { localVarQueryParameters['orphanDependents'] = ObjectSerializer.serialize(orphanDependents, "boolean"); } if (propagationPolicy !== undefined) { localVarQueryParameters['propagationPolicy'] = ObjectSerializer.serialize(propagationPolicy, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'DELETE', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: ObjectSerializer.serialize(body, "V1DeleteOptions") }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "V1Status"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * get available resources * @param {*} [options] Override http request options. */ getAPIResources(options = {}) { const localVarPath = this.basePath + '/apis/settings.k8s.io/v1alpha1/'; let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'GET', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "V1APIResourceList"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * list or watch objects of kind PodPreset * @param namespace object name and auth scope, such as for teams and projects * @param includeUninitialized If true, partially initialized resources are included in the response. * @param pretty If 'true', then the output is pretty printed. * @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. * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything. * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything. * @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. * @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. * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. * @param watch Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion. * @param {*} [options] Override http request options. */ listNamespacedPodPreset(namespace, includeUninitialized, pretty, _continue, fieldSelector, labelSelector, limit, resourceVersion, timeoutSeconds, watch, options = {}) { const localVarPath = this.basePath + '/apis/settings.k8s.io/v1alpha1/namespaces/{namespace}/podpresets' .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling listNamespacedPodPreset.'); } if (includeUninitialized !== undefined) { localVarQueryParameters['includeUninitialized'] = ObjectSerializer.serialize(includeUninitialized, "boolean"); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, "string"); } if (_continue !== undefined) { localVarQueryParameters['continue'] = ObjectSerializer.serialize(_continue, "string"); } if (fieldSelector !== undefined) { localVarQueryParameters['fieldSelector'] = ObjectSerializer.serialize(fieldSelector, "string"); } if (labelSelector !== undefined) { localVarQueryParameters['labelSelector'] = ObjectSerializer.serialize(labelSelector, "string"); } if (limit !== undefined) { localVarQueryParameters['limit'] = ObjectSerializer.serialize(limit, "number"); } if (resourceVersion !== undefined) { localVarQueryParameters['resourceVersion'] = ObjectSerializer.serialize(resourceVersion, "string"); } if (timeoutSeconds !== undefined) { localVarQueryParameters['timeoutSeconds'] = ObjectSerializer.serialize(timeoutSeconds, "number"); } if (watch !== undefined) { localVarQueryParameters['watch'] = ObjectSerializer.serialize(watch, "boolean"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'GET', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "V1alpha1PodPresetList"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * list or watch objects of kind PodPreset * @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. * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything. * @param includeUninitialized If true, partially initialized resources are included in the response. * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything. * @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. * @param pretty If 'true', then the output is pretty printed. * @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. * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. * @param watch Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion. * @param {*} [options] Override http request options. */ listPodPresetForAllNamespaces(_continue, fieldSelector, includeUninitialized, labelSelector, limit, pretty, resourceVersion, timeoutSeconds, watch, options = {}) { const localVarPath = this.basePath + '/apis/settings.k8s.io/v1alpha1/podpresets'; let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; if (_continue !== undefined) { localVarQueryParameters['continue'] = ObjectSerializer.serialize(_continue, "string"); } if (fieldSelector !== undefined) { localVarQueryParameters['fieldSelector'] = ObjectSerializer.serialize(fieldSelector, "string"); } if (includeUninitialized !== undefined) { localVarQueryParameters['includeUninitialized'] = ObjectSerializer.serialize(includeUninitialized, "boolean"); } if (labelSelector !== undefined) { localVarQueryParameters['labelSelector'] = ObjectSerializer.serialize(labelSelector, "string"); } if (limit !== undefined) { localVarQueryParameters['limit'] = ObjectSerializer.serialize(limit, "number"); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, "string"); } if (resourceVersion !== undefined) { localVarQueryParameters['resourceVersion'] = ObjectSerializer.serialize(resourceVersion, "string"); } if (timeoutSeconds !== undefined) { localVarQueryParameters['timeoutSeconds'] = ObjectSerializer.serialize(timeoutSeconds, "number"); } if (watch !== undefined) { localVarQueryParameters['watch'] = ObjectSerializer.serialize(watch, "boolean"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'GET', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "V1alpha1PodPresetList"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * partially update the specified PodPreset * @param name name of the PodPreset * @param namespace object name and auth scope, such as for teams and projects * @param body * @param pretty If 'true', then the output is pretty printed. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param {*} [options] Override http request options. */ patchNamespacedPodPreset(name, namespace, body, pretty, dryRun, options = {}) { const localVarPath = this.basePath + '/apis/settings.k8s.io/v1alpha1/namespaces/{namespace}/podpresets/{name}' .replace('{' + 'name' + '}', encodeURIComponent(String(name))) .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling patchNamespacedPodPreset.'); } // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling patchNamespacedPodPreset.'); } // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling patchNamespacedPodPreset.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'PATCH', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: ObjectSerializer.serialize(body, "any") }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "V1alpha1PodPreset"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * read the specified PodPreset * @param name name of the PodPreset * @param namespace object name and auth scope, such as for teams and projects * @param pretty If 'true', then the output is pretty printed. * @param exact Should the export be exact. Exact export maintains cluster-specific fields like 'Namespace'. * @param _export Should this value be exported. Export strips fields that a user can not specify. * @param {*} [options] Override http request options. */ readNamespacedPodPreset(name, namespace, pretty, exact, _export, options = {}) { const localVarPath = this.basePath + '/apis/settings.k8s.io/v1alpha1/namespaces/{namespace}/podpresets/{name}' .replace('{' + 'name' + '}', encodeURIComponent(String(name))) .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling readNamespacedPodPreset.'); } // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling readNamespacedPodPreset.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, "string"); } if (exact !== undefined) { localVarQueryParameters['exact'] = ObjectSerializer.serialize(exact, "boolean"); } if (_export !== undefined) { localVarQueryParameters['export'] = ObjectSerializer.serialize(_export, "boolean"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'GET', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "V1alpha1PodPreset"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * replace the specified PodPreset * @param name name of the PodPreset * @param namespace object name and auth scope, such as for teams and projects * @param body * @param pretty If 'true', then the output is pretty printed. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param {*} [options] Override http request options. */ replaceNamespacedPodPreset(name, namespace, body, pretty, dryRun, options = {}) { const localVarPath = this.basePath + '/apis/settings.k8s.io/v1alpha1/namespaces/{namespace}/podpresets/{name}' .replace('{' + 'name' + '}', encodeURIComponent(String(name))) .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling replaceNamespacedPodPreset.'); } // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling replaceNamespacedPodPreset.'); } // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling replaceNamespacedPodPreset.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'PUT', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: ObjectSerializer.serialize(body, "V1alpha1PodPreset") }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "V1alpha1PodPreset"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } } exports.SettingsV1alpha1Api = SettingsV1alpha1Api; var StorageApiApiKeys; (function (StorageApiApiKeys) { StorageApiApiKeys[StorageApiApiKeys["BearerToken"] = 0] = "BearerToken"; })(StorageApiApiKeys = exports.StorageApiApiKeys || (exports.StorageApiApiKeys = {})); class StorageApi { constructor(basePathOrUsername, password, basePath) { this._basePath = defaultBasePath; this.defaultHeaders = {}; this._useQuerystring = false; this.authentications = { 'default': new VoidAuth(), 'BearerToken': new ApiKeyAuth('header', 'authorization'), }; if (password) { if (basePath) { this.basePath = basePath; } } else { if (basePathOrUsername) { this.basePath = basePathOrUsername; } } } set useQuerystring(value) { this._useQuerystring = value; } set basePath(basePath) { this._basePath = basePath; } get basePath() { return this._basePath; } setDefaultAuthentication(auth) { this.authentications.default = auth; } setApiKey(key, value) { this.authentications[StorageApiApiKeys[key]].apiKey = value; } /** * get information of a group * @param {*} [options] Override http request options. */ getAPIGroup(options = {}) { const localVarPath = this.basePath + '/apis/storage.k8s.io/'; let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'GET', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "V1APIGroup"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } } exports.StorageApi = StorageApi; var StorageV1ApiApiKeys; (function (StorageV1ApiApiKeys) { StorageV1ApiApiKeys[StorageV1ApiApiKeys["BearerToken"] = 0] = "BearerToken"; })(StorageV1ApiApiKeys = exports.StorageV1ApiApiKeys || (exports.StorageV1ApiApiKeys = {})); class StorageV1Api { constructor(basePathOrUsername, password, basePath) { this._basePath = defaultBasePath; this.defaultHeaders = {}; this._useQuerystring = false; this.authentications = { 'default': new VoidAuth(), 'BearerToken': new ApiKeyAuth('header', 'authorization'), }; if (password) { if (basePath) { this.basePath = basePath; } } else { if (basePathOrUsername) { this.basePath = basePathOrUsername; } } } set useQuerystring(value) { this._useQuerystring = value; } set basePath(basePath) { this._basePath = basePath; } get basePath() { return this._basePath; } setDefaultAuthentication(auth) { this.authentications.default = auth; } setApiKey(key, value) { this.authentications[StorageV1ApiApiKeys[key]].apiKey = value; } /** * create a StorageClass * @param body * @param includeUninitialized If true, partially initialized resources are included in the response. * @param pretty If 'true', then the output is pretty printed. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param {*} [options] Override http request options. */ createStorageClass(body, includeUninitialized, pretty, dryRun, options = {}) { const localVarPath = this.basePath + '/apis/storage.k8s.io/v1/storageclasses'; let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling createStorageClass.'); } if (includeUninitialized !== undefined) { localVarQueryParameters['includeUninitialized'] = ObjectSerializer.serialize(includeUninitialized, "boolean"); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'POST', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: ObjectSerializer.serialize(body, "V1StorageClass") }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "V1StorageClass"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * create a VolumeAttachment * @param body * @param includeUninitialized If true, partially initialized resources are included in the response. * @param pretty If 'true', then the output is pretty printed. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param {*} [options] Override http request options. */ createVolumeAttachment(body, includeUninitialized, pretty, dryRun, options = {}) { const localVarPath = this.basePath + '/apis/storage.k8s.io/v1/volumeattachments'; let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling createVolumeAttachment.'); } if (includeUninitialized !== undefined) { localVarQueryParameters['includeUninitialized'] = ObjectSerializer.serialize(includeUninitialized, "boolean"); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'POST', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: ObjectSerializer.serialize(body, "V1VolumeAttachment") }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "V1VolumeAttachment"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * delete collection of StorageClass * @param includeUninitialized If true, partially initialized resources are included in the response. * @param pretty If 'true', then the output is pretty printed. * @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. * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything. * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything. * @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. * @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. * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. * @param watch Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion. * @param {*} [options] Override http request options. */ deleteCollectionStorageClass(includeUninitialized, pretty, _continue, fieldSelector, labelSelector, limit, resourceVersion, timeoutSeconds, watch, options = {}) { const localVarPath = this.basePath + '/apis/storage.k8s.io/v1/storageclasses'; let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; if (includeUninitialized !== undefined) { localVarQueryParameters['includeUninitialized'] = ObjectSerializer.serialize(includeUninitialized, "boolean"); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, "string"); } if (_continue !== undefined) { localVarQueryParameters['continue'] = ObjectSerializer.serialize(_continue, "string"); } if (fieldSelector !== undefined) { localVarQueryParameters['fieldSelector'] = ObjectSerializer.serialize(fieldSelector, "string"); } if (labelSelector !== undefined) { localVarQueryParameters['labelSelector'] = ObjectSerializer.serialize(labelSelector, "string"); } if (limit !== undefined) { localVarQueryParameters['limit'] = ObjectSerializer.serialize(limit, "number"); } if (resourceVersion !== undefined) { localVarQueryParameters['resourceVersion'] = ObjectSerializer.serialize(resourceVersion, "string"); } if (timeoutSeconds !== undefined) { localVarQueryParameters['timeoutSeconds'] = ObjectSerializer.serialize(timeoutSeconds, "number"); } if (watch !== undefined) { localVarQueryParameters['watch'] = ObjectSerializer.serialize(watch, "boolean"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'DELETE', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "V1Status"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * delete collection of VolumeAttachment * @param includeUninitialized If true, partially initialized resources are included in the response. * @param pretty If 'true', then the output is pretty printed. * @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. * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything. * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything. * @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. * @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. * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. * @param watch Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion. * @param {*} [options] Override http request options. */ deleteCollectionVolumeAttachment(includeUninitialized, pretty, _continue, fieldSelector, labelSelector, limit, resourceVersion, timeoutSeconds, watch, options = {}) { const localVarPath = this.basePath + '/apis/storage.k8s.io/v1/volumeattachments'; let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; if (includeUninitialized !== undefined) { localVarQueryParameters['includeUninitialized'] = ObjectSerializer.serialize(includeUninitialized, "boolean"); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, "string"); } if (_continue !== undefined) { localVarQueryParameters['continue'] = ObjectSerializer.serialize(_continue, "string"); } if (fieldSelector !== undefined) { localVarQueryParameters['fieldSelector'] = ObjectSerializer.serialize(fieldSelector, "string"); } if (labelSelector !== undefined) { localVarQueryParameters['labelSelector'] = ObjectSerializer.serialize(labelSelector, "string"); } if (limit !== undefined) { localVarQueryParameters['limit'] = ObjectSerializer.serialize(limit, "number"); } if (resourceVersion !== undefined) { localVarQueryParameters['resourceVersion'] = ObjectSerializer.serialize(resourceVersion, "string"); } if (timeoutSeconds !== undefined) { localVarQueryParameters['timeoutSeconds'] = ObjectSerializer.serialize(timeoutSeconds, "number"); } if (watch !== undefined) { localVarQueryParameters['watch'] = ObjectSerializer.serialize(watch, "boolean"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'DELETE', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "V1Status"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * delete a StorageClass * @param name name of the StorageClass * @param pretty If 'true', then the output is pretty printed. * @param body * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @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. * @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. * @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. * @param {*} [options] Override http request options. */ deleteStorageClass(name, pretty, body, dryRun, gracePeriodSeconds, orphanDependents, propagationPolicy, options = {}) { const localVarPath = this.basePath + '/apis/storage.k8s.io/v1/storageclasses/{name}' .replace('{' + 'name' + '}', encodeURIComponent(String(name))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling deleteStorageClass.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, "string"); } if (gracePeriodSeconds !== undefined) { localVarQueryParameters['gracePeriodSeconds'] = ObjectSerializer.serialize(gracePeriodSeconds, "number"); } if (orphanDependents !== undefined) { localVarQueryParameters['orphanDependents'] = ObjectSerializer.serialize(orphanDependents, "boolean"); } if (propagationPolicy !== undefined) { localVarQueryParameters['propagationPolicy'] = ObjectSerializer.serialize(propagationPolicy, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'DELETE', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: ObjectSerializer.serialize(body, "V1DeleteOptions") }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "V1Status"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * delete a VolumeAttachment * @param name name of the VolumeAttachment * @param pretty If 'true', then the output is pretty printed. * @param body * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @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. * @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. * @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. * @param {*} [options] Override http request options. */ deleteVolumeAttachment(name, pretty, body, dryRun, gracePeriodSeconds, orphanDependents, propagationPolicy, options = {}) { const localVarPath = this.basePath + '/apis/storage.k8s.io/v1/volumeattachments/{name}' .replace('{' + 'name' + '}', encodeURIComponent(String(name))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling deleteVolumeAttachment.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, "string"); } if (gracePeriodSeconds !== undefined) { localVarQueryParameters['gracePeriodSeconds'] = ObjectSerializer.serialize(gracePeriodSeconds, "number"); } if (orphanDependents !== undefined) { localVarQueryParameters['orphanDependents'] = ObjectSerializer.serialize(orphanDependents, "boolean"); } if (propagationPolicy !== undefined) { localVarQueryParameters['propagationPolicy'] = ObjectSerializer.serialize(propagationPolicy, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'DELETE', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: ObjectSerializer.serialize(body, "V1DeleteOptions") }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "V1Status"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * get available resources * @param {*} [options] Override http request options. */ getAPIResources(options = {}) { const localVarPath = this.basePath + '/apis/storage.k8s.io/v1/'; let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'GET', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "V1APIResourceList"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * list or watch objects of kind StorageClass * @param includeUninitialized If true, partially initialized resources are included in the response. * @param pretty If 'true', then the output is pretty printed. * @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. * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything. * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything. * @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. * @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. * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. * @param watch Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion. * @param {*} [options] Override http request options. */ listStorageClass(includeUninitialized, pretty, _continue, fieldSelector, labelSelector, limit, resourceVersion, timeoutSeconds, watch, options = {}) { const localVarPath = this.basePath + '/apis/storage.k8s.io/v1/storageclasses'; let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; if (includeUninitialized !== undefined) { localVarQueryParameters['includeUninitialized'] = ObjectSerializer.serialize(includeUninitialized, "boolean"); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, "string"); } if (_continue !== undefined) { localVarQueryParameters['continue'] = ObjectSerializer.serialize(_continue, "string"); } if (fieldSelector !== undefined) { localVarQueryParameters['fieldSelector'] = ObjectSerializer.serialize(fieldSelector, "string"); } if (labelSelector !== undefined) { localVarQueryParameters['labelSelector'] = ObjectSerializer.serialize(labelSelector, "string"); } if (limit !== undefined) { localVarQueryParameters['limit'] = ObjectSerializer.serialize(limit, "number"); } if (resourceVersion !== undefined) { localVarQueryParameters['resourceVersion'] = ObjectSerializer.serialize(resourceVersion, "string"); } if (timeoutSeconds !== undefined) { localVarQueryParameters['timeoutSeconds'] = ObjectSerializer.serialize(timeoutSeconds, "number"); } if (watch !== undefined) { localVarQueryParameters['watch'] = ObjectSerializer.serialize(watch, "boolean"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'GET', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "V1StorageClassList"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * list or watch objects of kind VolumeAttachment * @param includeUninitialized If true, partially initialized resources are included in the response. * @param pretty If 'true', then the output is pretty printed. * @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. * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything. * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything. * @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. * @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. * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. * @param watch Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion. * @param {*} [options] Override http request options. */ listVolumeAttachment(includeUninitialized, pretty, _continue, fieldSelector, labelSelector, limit, resourceVersion, timeoutSeconds, watch, options = {}) { const localVarPath = this.basePath + '/apis/storage.k8s.io/v1/volumeattachments'; let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; if (includeUninitialized !== undefined) { localVarQueryParameters['includeUninitialized'] = ObjectSerializer.serialize(includeUninitialized, "boolean"); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, "string"); } if (_continue !== undefined) { localVarQueryParameters['continue'] = ObjectSerializer.serialize(_continue, "string"); } if (fieldSelector !== undefined) { localVarQueryParameters['fieldSelector'] = ObjectSerializer.serialize(fieldSelector, "string"); } if (labelSelector !== undefined) { localVarQueryParameters['labelSelector'] = ObjectSerializer.serialize(labelSelector, "string"); } if (limit !== undefined) { localVarQueryParameters['limit'] = ObjectSerializer.serialize(limit, "number"); } if (resourceVersion !== undefined) { localVarQueryParameters['resourceVersion'] = ObjectSerializer.serialize(resourceVersion, "string"); } if (timeoutSeconds !== undefined) { localVarQueryParameters['timeoutSeconds'] = ObjectSerializer.serialize(timeoutSeconds, "number"); } if (watch !== undefined) { localVarQueryParameters['watch'] = ObjectSerializer.serialize(watch, "boolean"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'GET', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "V1VolumeAttachmentList"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * partially update the specified StorageClass * @param name name of the StorageClass * @param body * @param pretty If 'true', then the output is pretty printed. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param {*} [options] Override http request options. */ patchStorageClass(name, body, pretty, dryRun, options = {}) { const localVarPath = this.basePath + '/apis/storage.k8s.io/v1/storageclasses/{name}' .replace('{' + 'name' + '}', encodeURIComponent(String(name))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling patchStorageClass.'); } // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling patchStorageClass.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'PATCH', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: ObjectSerializer.serialize(body, "any") }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "V1StorageClass"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * partially update the specified VolumeAttachment * @param name name of the VolumeAttachment * @param body * @param pretty If 'true', then the output is pretty printed. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param {*} [options] Override http request options. */ patchVolumeAttachment(name, body, pretty, dryRun, options = {}) { const localVarPath = this.basePath + '/apis/storage.k8s.io/v1/volumeattachments/{name}' .replace('{' + 'name' + '}', encodeURIComponent(String(name))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling patchVolumeAttachment.'); } // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling patchVolumeAttachment.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'PATCH', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: ObjectSerializer.serialize(body, "any") }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "V1VolumeAttachment"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * partially update status of the specified VolumeAttachment * @param name name of the VolumeAttachment * @param body * @param pretty If 'true', then the output is pretty printed. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param {*} [options] Override http request options. */ patchVolumeAttachmentStatus(name, body, pretty, dryRun, options = {}) { const localVarPath = this.basePath + '/apis/storage.k8s.io/v1/volumeattachments/{name}/status' .replace('{' + 'name' + '}', encodeURIComponent(String(name))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling patchVolumeAttachmentStatus.'); } // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling patchVolumeAttachmentStatus.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'PATCH', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: ObjectSerializer.serialize(body, "any") }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "V1VolumeAttachment"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * read the specified StorageClass * @param name name of the StorageClass * @param pretty If 'true', then the output is pretty printed. * @param exact Should the export be exact. Exact export maintains cluster-specific fields like 'Namespace'. * @param _export Should this value be exported. Export strips fields that a user can not specify. * @param {*} [options] Override http request options. */ readStorageClass(name, pretty, exact, _export, options = {}) { const localVarPath = this.basePath + '/apis/storage.k8s.io/v1/storageclasses/{name}' .replace('{' + 'name' + '}', encodeURIComponent(String(name))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling readStorageClass.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, "string"); } if (exact !== undefined) { localVarQueryParameters['exact'] = ObjectSerializer.serialize(exact, "boolean"); } if (_export !== undefined) { localVarQueryParameters['export'] = ObjectSerializer.serialize(_export, "boolean"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'GET', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "V1StorageClass"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * read the specified VolumeAttachment * @param name name of the VolumeAttachment * @param pretty If 'true', then the output is pretty printed. * @param exact Should the export be exact. Exact export maintains cluster-specific fields like 'Namespace'. * @param _export Should this value be exported. Export strips fields that a user can not specify. * @param {*} [options] Override http request options. */ readVolumeAttachment(name, pretty, exact, _export, options = {}) { const localVarPath = this.basePath + '/apis/storage.k8s.io/v1/volumeattachments/{name}' .replace('{' + 'name' + '}', encodeURIComponent(String(name))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling readVolumeAttachment.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, "string"); } if (exact !== undefined) { localVarQueryParameters['exact'] = ObjectSerializer.serialize(exact, "boolean"); } if (_export !== undefined) { localVarQueryParameters['export'] = ObjectSerializer.serialize(_export, "boolean"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'GET', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "V1VolumeAttachment"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * read status of the specified VolumeAttachment * @param name name of the VolumeAttachment * @param pretty If 'true', then the output is pretty printed. * @param {*} [options] Override http request options. */ readVolumeAttachmentStatus(name, pretty, options = {}) { const localVarPath = this.basePath + '/apis/storage.k8s.io/v1/volumeattachments/{name}/status' .replace('{' + 'name' + '}', encodeURIComponent(String(name))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling readVolumeAttachmentStatus.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'GET', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "V1VolumeAttachment"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * replace the specified StorageClass * @param name name of the StorageClass * @param body * @param pretty If 'true', then the output is pretty printed. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param {*} [options] Override http request options. */ replaceStorageClass(name, body, pretty, dryRun, options = {}) { const localVarPath = this.basePath + '/apis/storage.k8s.io/v1/storageclasses/{name}' .replace('{' + 'name' + '}', encodeURIComponent(String(name))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling replaceStorageClass.'); } // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling replaceStorageClass.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'PUT', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: ObjectSerializer.serialize(body, "V1StorageClass") }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "V1StorageClass"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * replace the specified VolumeAttachment * @param name name of the VolumeAttachment * @param body * @param pretty If 'true', then the output is pretty printed. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param {*} [options] Override http request options. */ replaceVolumeAttachment(name, body, pretty, dryRun, options = {}) { const localVarPath = this.basePath + '/apis/storage.k8s.io/v1/volumeattachments/{name}' .replace('{' + 'name' + '}', encodeURIComponent(String(name))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling replaceVolumeAttachment.'); } // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling replaceVolumeAttachment.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'PUT', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: ObjectSerializer.serialize(body, "V1VolumeAttachment") }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "V1VolumeAttachment"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * replace status of the specified VolumeAttachment * @param name name of the VolumeAttachment * @param body * @param pretty If 'true', then the output is pretty printed. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param {*} [options] Override http request options. */ replaceVolumeAttachmentStatus(name, body, pretty, dryRun, options = {}) { const localVarPath = this.basePath + '/apis/storage.k8s.io/v1/volumeattachments/{name}/status' .replace('{' + 'name' + '}', encodeURIComponent(String(name))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling replaceVolumeAttachmentStatus.'); } // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling replaceVolumeAttachmentStatus.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'PUT', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: ObjectSerializer.serialize(body, "V1VolumeAttachment") }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "V1VolumeAttachment"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } } exports.StorageV1Api = StorageV1Api; var StorageV1alpha1ApiApiKeys; (function (StorageV1alpha1ApiApiKeys) { StorageV1alpha1ApiApiKeys[StorageV1alpha1ApiApiKeys["BearerToken"] = 0] = "BearerToken"; })(StorageV1alpha1ApiApiKeys = exports.StorageV1alpha1ApiApiKeys || (exports.StorageV1alpha1ApiApiKeys = {})); class StorageV1alpha1Api { constructor(basePathOrUsername, password, basePath) { this._basePath = defaultBasePath; this.defaultHeaders = {}; this._useQuerystring = false; this.authentications = { 'default': new VoidAuth(), 'BearerToken': new ApiKeyAuth('header', 'authorization'), }; if (password) { if (basePath) { this.basePath = basePath; } } else { if (basePathOrUsername) { this.basePath = basePathOrUsername; } } } set useQuerystring(value) { this._useQuerystring = value; } set basePath(basePath) { this._basePath = basePath; } get basePath() { return this._basePath; } setDefaultAuthentication(auth) { this.authentications.default = auth; } setApiKey(key, value) { this.authentications[StorageV1alpha1ApiApiKeys[key]].apiKey = value; } /** * create a VolumeAttachment * @param body * @param includeUninitialized If true, partially initialized resources are included in the response. * @param pretty If 'true', then the output is pretty printed. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param {*} [options] Override http request options. */ createVolumeAttachment(body, includeUninitialized, pretty, dryRun, options = {}) { const localVarPath = this.basePath + '/apis/storage.k8s.io/v1alpha1/volumeattachments'; let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling createVolumeAttachment.'); } if (includeUninitialized !== undefined) { localVarQueryParameters['includeUninitialized'] = ObjectSerializer.serialize(includeUninitialized, "boolean"); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'POST', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: ObjectSerializer.serialize(body, "V1alpha1VolumeAttachment") }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "V1alpha1VolumeAttachment"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * delete collection of VolumeAttachment * @param includeUninitialized If true, partially initialized resources are included in the response. * @param pretty If 'true', then the output is pretty printed. * @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. * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything. * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything. * @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. * @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. * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. * @param watch Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion. * @param {*} [options] Override http request options. */ deleteCollectionVolumeAttachment(includeUninitialized, pretty, _continue, fieldSelector, labelSelector, limit, resourceVersion, timeoutSeconds, watch, options = {}) { const localVarPath = this.basePath + '/apis/storage.k8s.io/v1alpha1/volumeattachments'; let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; if (includeUninitialized !== undefined) { localVarQueryParameters['includeUninitialized'] = ObjectSerializer.serialize(includeUninitialized, "boolean"); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, "string"); } if (_continue !== undefined) { localVarQueryParameters['continue'] = ObjectSerializer.serialize(_continue, "string"); } if (fieldSelector !== undefined) { localVarQueryParameters['fieldSelector'] = ObjectSerializer.serialize(fieldSelector, "string"); } if (labelSelector !== undefined) { localVarQueryParameters['labelSelector'] = ObjectSerializer.serialize(labelSelector, "string"); } if (limit !== undefined) { localVarQueryParameters['limit'] = ObjectSerializer.serialize(limit, "number"); } if (resourceVersion !== undefined) { localVarQueryParameters['resourceVersion'] = ObjectSerializer.serialize(resourceVersion, "string"); } if (timeoutSeconds !== undefined) { localVarQueryParameters['timeoutSeconds'] = ObjectSerializer.serialize(timeoutSeconds, "number"); } if (watch !== undefined) { localVarQueryParameters['watch'] = ObjectSerializer.serialize(watch, "boolean"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'DELETE', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "V1Status"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * delete a VolumeAttachment * @param name name of the VolumeAttachment * @param pretty If 'true', then the output is pretty printed. * @param body * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @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. * @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. * @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. * @param {*} [options] Override http request options. */ deleteVolumeAttachment(name, pretty, body, dryRun, gracePeriodSeconds, orphanDependents, propagationPolicy, options = {}) { const localVarPath = this.basePath + '/apis/storage.k8s.io/v1alpha1/volumeattachments/{name}' .replace('{' + 'name' + '}', encodeURIComponent(String(name))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling deleteVolumeAttachment.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, "string"); } if (gracePeriodSeconds !== undefined) { localVarQueryParameters['gracePeriodSeconds'] = ObjectSerializer.serialize(gracePeriodSeconds, "number"); } if (orphanDependents !== undefined) { localVarQueryParameters['orphanDependents'] = ObjectSerializer.serialize(orphanDependents, "boolean"); } if (propagationPolicy !== undefined) { localVarQueryParameters['propagationPolicy'] = ObjectSerializer.serialize(propagationPolicy, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'DELETE', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: ObjectSerializer.serialize(body, "V1DeleteOptions") }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "V1Status"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * get available resources * @param {*} [options] Override http request options. */ getAPIResources(options = {}) { const localVarPath = this.basePath + '/apis/storage.k8s.io/v1alpha1/'; let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'GET', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "V1APIResourceList"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * list or watch objects of kind VolumeAttachment * @param includeUninitialized If true, partially initialized resources are included in the response. * @param pretty If 'true', then the output is pretty printed. * @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. * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything. * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything. * @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. * @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. * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. * @param watch Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion. * @param {*} [options] Override http request options. */ listVolumeAttachment(includeUninitialized, pretty, _continue, fieldSelector, labelSelector, limit, resourceVersion, timeoutSeconds, watch, options = {}) { const localVarPath = this.basePath + '/apis/storage.k8s.io/v1alpha1/volumeattachments'; let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; if (includeUninitialized !== undefined) { localVarQueryParameters['includeUninitialized'] = ObjectSerializer.serialize(includeUninitialized, "boolean"); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, "string"); } if (_continue !== undefined) { localVarQueryParameters['continue'] = ObjectSerializer.serialize(_continue, "string"); } if (fieldSelector !== undefined) { localVarQueryParameters['fieldSelector'] = ObjectSerializer.serialize(fieldSelector, "string"); } if (labelSelector !== undefined) { localVarQueryParameters['labelSelector'] = ObjectSerializer.serialize(labelSelector, "string"); } if (limit !== undefined) { localVarQueryParameters['limit'] = ObjectSerializer.serialize(limit, "number"); } if (resourceVersion !== undefined) { localVarQueryParameters['resourceVersion'] = ObjectSerializer.serialize(resourceVersion, "string"); } if (timeoutSeconds !== undefined) { localVarQueryParameters['timeoutSeconds'] = ObjectSerializer.serialize(timeoutSeconds, "number"); } if (watch !== undefined) { localVarQueryParameters['watch'] = ObjectSerializer.serialize(watch, "boolean"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'GET', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "V1alpha1VolumeAttachmentList"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * partially update the specified VolumeAttachment * @param name name of the VolumeAttachment * @param body * @param pretty If 'true', then the output is pretty printed. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param {*} [options] Override http request options. */ patchVolumeAttachment(name, body, pretty, dryRun, options = {}) { const localVarPath = this.basePath + '/apis/storage.k8s.io/v1alpha1/volumeattachments/{name}' .replace('{' + 'name' + '}', encodeURIComponent(String(name))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling patchVolumeAttachment.'); } // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling patchVolumeAttachment.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'PATCH', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: ObjectSerializer.serialize(body, "any") }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "V1alpha1VolumeAttachment"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * read the specified VolumeAttachment * @param name name of the VolumeAttachment * @param pretty If 'true', then the output is pretty printed. * @param exact Should the export be exact. Exact export maintains cluster-specific fields like 'Namespace'. * @param _export Should this value be exported. Export strips fields that a user can not specify. * @param {*} [options] Override http request options. */ readVolumeAttachment(name, pretty, exact, _export, options = {}) { const localVarPath = this.basePath + '/apis/storage.k8s.io/v1alpha1/volumeattachments/{name}' .replace('{' + 'name' + '}', encodeURIComponent(String(name))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling readVolumeAttachment.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, "string"); } if (exact !== undefined) { localVarQueryParameters['exact'] = ObjectSerializer.serialize(exact, "boolean"); } if (_export !== undefined) { localVarQueryParameters['export'] = ObjectSerializer.serialize(_export, "boolean"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'GET', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "V1alpha1VolumeAttachment"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * replace the specified VolumeAttachment * @param name name of the VolumeAttachment * @param body * @param pretty If 'true', then the output is pretty printed. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param {*} [options] Override http request options. */ replaceVolumeAttachment(name, body, pretty, dryRun, options = {}) { const localVarPath = this.basePath + '/apis/storage.k8s.io/v1alpha1/volumeattachments/{name}' .replace('{' + 'name' + '}', encodeURIComponent(String(name))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling replaceVolumeAttachment.'); } // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling replaceVolumeAttachment.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'PUT', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: ObjectSerializer.serialize(body, "V1alpha1VolumeAttachment") }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "V1alpha1VolumeAttachment"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } } exports.StorageV1alpha1Api = StorageV1alpha1Api; var StorageV1beta1ApiApiKeys; (function (StorageV1beta1ApiApiKeys) { StorageV1beta1ApiApiKeys[StorageV1beta1ApiApiKeys["BearerToken"] = 0] = "BearerToken"; })(StorageV1beta1ApiApiKeys = exports.StorageV1beta1ApiApiKeys || (exports.StorageV1beta1ApiApiKeys = {})); class StorageV1beta1Api { constructor(basePathOrUsername, password, basePath) { this._basePath = defaultBasePath; this.defaultHeaders = {}; this._useQuerystring = false; this.authentications = { 'default': new VoidAuth(), 'BearerToken': new ApiKeyAuth('header', 'authorization'), }; if (password) { if (basePath) { this.basePath = basePath; } } else { if (basePathOrUsername) { this.basePath = basePathOrUsername; } } } set useQuerystring(value) { this._useQuerystring = value; } set basePath(basePath) { this._basePath = basePath; } get basePath() { return this._basePath; } setDefaultAuthentication(auth) { this.authentications.default = auth; } setApiKey(key, value) { this.authentications[StorageV1beta1ApiApiKeys[key]].apiKey = value; } /** * create a StorageClass * @param body * @param includeUninitialized If true, partially initialized resources are included in the response. * @param pretty If 'true', then the output is pretty printed. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param {*} [options] Override http request options. */ createStorageClass(body, includeUninitialized, pretty, dryRun, options = {}) { const localVarPath = this.basePath + '/apis/storage.k8s.io/v1beta1/storageclasses'; let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling createStorageClass.'); } if (includeUninitialized !== undefined) { localVarQueryParameters['includeUninitialized'] = ObjectSerializer.serialize(includeUninitialized, "boolean"); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'POST', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: ObjectSerializer.serialize(body, "V1beta1StorageClass") }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "V1beta1StorageClass"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * create a VolumeAttachment * @param body * @param includeUninitialized If true, partially initialized resources are included in the response. * @param pretty If 'true', then the output is pretty printed. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param {*} [options] Override http request options. */ createVolumeAttachment(body, includeUninitialized, pretty, dryRun, options = {}) { const localVarPath = this.basePath + '/apis/storage.k8s.io/v1beta1/volumeattachments'; let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling createVolumeAttachment.'); } if (includeUninitialized !== undefined) { localVarQueryParameters['includeUninitialized'] = ObjectSerializer.serialize(includeUninitialized, "boolean"); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'POST', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: ObjectSerializer.serialize(body, "V1beta1VolumeAttachment") }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "V1beta1VolumeAttachment"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * delete collection of StorageClass * @param includeUninitialized If true, partially initialized resources are included in the response. * @param pretty If 'true', then the output is pretty printed. * @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. * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything. * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything. * @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. * @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. * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. * @param watch Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion. * @param {*} [options] Override http request options. */ deleteCollectionStorageClass(includeUninitialized, pretty, _continue, fieldSelector, labelSelector, limit, resourceVersion, timeoutSeconds, watch, options = {}) { const localVarPath = this.basePath + '/apis/storage.k8s.io/v1beta1/storageclasses'; let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; if (includeUninitialized !== undefined) { localVarQueryParameters['includeUninitialized'] = ObjectSerializer.serialize(includeUninitialized, "boolean"); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, "string"); } if (_continue !== undefined) { localVarQueryParameters['continue'] = ObjectSerializer.serialize(_continue, "string"); } if (fieldSelector !== undefined) { localVarQueryParameters['fieldSelector'] = ObjectSerializer.serialize(fieldSelector, "string"); } if (labelSelector !== undefined) { localVarQueryParameters['labelSelector'] = ObjectSerializer.serialize(labelSelector, "string"); } if (limit !== undefined) { localVarQueryParameters['limit'] = ObjectSerializer.serialize(limit, "number"); } if (resourceVersion !== undefined) { localVarQueryParameters['resourceVersion'] = ObjectSerializer.serialize(resourceVersion, "string"); } if (timeoutSeconds !== undefined) { localVarQueryParameters['timeoutSeconds'] = ObjectSerializer.serialize(timeoutSeconds, "number"); } if (watch !== undefined) { localVarQueryParameters['watch'] = ObjectSerializer.serialize(watch, "boolean"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'DELETE', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "V1Status"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * delete collection of VolumeAttachment * @param includeUninitialized If true, partially initialized resources are included in the response. * @param pretty If 'true', then the output is pretty printed. * @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. * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything. * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything. * @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. * @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. * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. * @param watch Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion. * @param {*} [options] Override http request options. */ deleteCollectionVolumeAttachment(includeUninitialized, pretty, _continue, fieldSelector, labelSelector, limit, resourceVersion, timeoutSeconds, watch, options = {}) { const localVarPath = this.basePath + '/apis/storage.k8s.io/v1beta1/volumeattachments'; let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; if (includeUninitialized !== undefined) { localVarQueryParameters['includeUninitialized'] = ObjectSerializer.serialize(includeUninitialized, "boolean"); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, "string"); } if (_continue !== undefined) { localVarQueryParameters['continue'] = ObjectSerializer.serialize(_continue, "string"); } if (fieldSelector !== undefined) { localVarQueryParameters['fieldSelector'] = ObjectSerializer.serialize(fieldSelector, "string"); } if (labelSelector !== undefined) { localVarQueryParameters['labelSelector'] = ObjectSerializer.serialize(labelSelector, "string"); } if (limit !== undefined) { localVarQueryParameters['limit'] = ObjectSerializer.serialize(limit, "number"); } if (resourceVersion !== undefined) { localVarQueryParameters['resourceVersion'] = ObjectSerializer.serialize(resourceVersion, "string"); } if (timeoutSeconds !== undefined) { localVarQueryParameters['timeoutSeconds'] = ObjectSerializer.serialize(timeoutSeconds, "number"); } if (watch !== undefined) { localVarQueryParameters['watch'] = ObjectSerializer.serialize(watch, "boolean"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'DELETE', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "V1Status"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * delete a StorageClass * @param name name of the StorageClass * @param pretty If 'true', then the output is pretty printed. * @param body * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @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. * @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. * @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. * @param {*} [options] Override http request options. */ deleteStorageClass(name, pretty, body, dryRun, gracePeriodSeconds, orphanDependents, propagationPolicy, options = {}) { const localVarPath = this.basePath + '/apis/storage.k8s.io/v1beta1/storageclasses/{name}' .replace('{' + 'name' + '}', encodeURIComponent(String(name))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling deleteStorageClass.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, "string"); } if (gracePeriodSeconds !== undefined) { localVarQueryParameters['gracePeriodSeconds'] = ObjectSerializer.serialize(gracePeriodSeconds, "number"); } if (orphanDependents !== undefined) { localVarQueryParameters['orphanDependents'] = ObjectSerializer.serialize(orphanDependents, "boolean"); } if (propagationPolicy !== undefined) { localVarQueryParameters['propagationPolicy'] = ObjectSerializer.serialize(propagationPolicy, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'DELETE', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: ObjectSerializer.serialize(body, "V1DeleteOptions") }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "V1Status"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * delete a VolumeAttachment * @param name name of the VolumeAttachment * @param pretty If 'true', then the output is pretty printed. * @param body * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @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. * @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. * @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. * @param {*} [options] Override http request options. */ deleteVolumeAttachment(name, pretty, body, dryRun, gracePeriodSeconds, orphanDependents, propagationPolicy, options = {}) { const localVarPath = this.basePath + '/apis/storage.k8s.io/v1beta1/volumeattachments/{name}' .replace('{' + 'name' + '}', encodeURIComponent(String(name))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling deleteVolumeAttachment.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, "string"); } if (gracePeriodSeconds !== undefined) { localVarQueryParameters['gracePeriodSeconds'] = ObjectSerializer.serialize(gracePeriodSeconds, "number"); } if (orphanDependents !== undefined) { localVarQueryParameters['orphanDependents'] = ObjectSerializer.serialize(orphanDependents, "boolean"); } if (propagationPolicy !== undefined) { localVarQueryParameters['propagationPolicy'] = ObjectSerializer.serialize(propagationPolicy, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'DELETE', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: ObjectSerializer.serialize(body, "V1DeleteOptions") }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "V1Status"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * get available resources * @param {*} [options] Override http request options. */ getAPIResources(options = {}) { const localVarPath = this.basePath + '/apis/storage.k8s.io/v1beta1/'; let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'GET', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "V1APIResourceList"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * list or watch objects of kind StorageClass * @param includeUninitialized If true, partially initialized resources are included in the response. * @param pretty If 'true', then the output is pretty printed. * @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. * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything. * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything. * @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. * @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. * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. * @param watch Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion. * @param {*} [options] Override http request options. */ listStorageClass(includeUninitialized, pretty, _continue, fieldSelector, labelSelector, limit, resourceVersion, timeoutSeconds, watch, options = {}) { const localVarPath = this.basePath + '/apis/storage.k8s.io/v1beta1/storageclasses'; let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; if (includeUninitialized !== undefined) { localVarQueryParameters['includeUninitialized'] = ObjectSerializer.serialize(includeUninitialized, "boolean"); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, "string"); } if (_continue !== undefined) { localVarQueryParameters['continue'] = ObjectSerializer.serialize(_continue, "string"); } if (fieldSelector !== undefined) { localVarQueryParameters['fieldSelector'] = ObjectSerializer.serialize(fieldSelector, "string"); } if (labelSelector !== undefined) { localVarQueryParameters['labelSelector'] = ObjectSerializer.serialize(labelSelector, "string"); } if (limit !== undefined) { localVarQueryParameters['limit'] = ObjectSerializer.serialize(limit, "number"); } if (resourceVersion !== undefined) { localVarQueryParameters['resourceVersion'] = ObjectSerializer.serialize(resourceVersion, "string"); } if (timeoutSeconds !== undefined) { localVarQueryParameters['timeoutSeconds'] = ObjectSerializer.serialize(timeoutSeconds, "number"); } if (watch !== undefined) { localVarQueryParameters['watch'] = ObjectSerializer.serialize(watch, "boolean"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'GET', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "V1beta1StorageClassList"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * list or watch objects of kind VolumeAttachment * @param includeUninitialized If true, partially initialized resources are included in the response. * @param pretty If 'true', then the output is pretty printed. * @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. * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything. * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything. * @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. * @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. * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. * @param watch Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion. * @param {*} [options] Override http request options. */ listVolumeAttachment(includeUninitialized, pretty, _continue, fieldSelector, labelSelector, limit, resourceVersion, timeoutSeconds, watch, options = {}) { const localVarPath = this.basePath + '/apis/storage.k8s.io/v1beta1/volumeattachments'; let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; if (includeUninitialized !== undefined) { localVarQueryParameters['includeUninitialized'] = ObjectSerializer.serialize(includeUninitialized, "boolean"); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, "string"); } if (_continue !== undefined) { localVarQueryParameters['continue'] = ObjectSerializer.serialize(_continue, "string"); } if (fieldSelector !== undefined) { localVarQueryParameters['fieldSelector'] = ObjectSerializer.serialize(fieldSelector, "string"); } if (labelSelector !== undefined) { localVarQueryParameters['labelSelector'] = ObjectSerializer.serialize(labelSelector, "string"); } if (limit !== undefined) { localVarQueryParameters['limit'] = ObjectSerializer.serialize(limit, "number"); } if (resourceVersion !== undefined) { localVarQueryParameters['resourceVersion'] = ObjectSerializer.serialize(resourceVersion, "string"); } if (timeoutSeconds !== undefined) { localVarQueryParameters['timeoutSeconds'] = ObjectSerializer.serialize(timeoutSeconds, "number"); } if (watch !== undefined) { localVarQueryParameters['watch'] = ObjectSerializer.serialize(watch, "boolean"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'GET', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "V1beta1VolumeAttachmentList"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * partially update the specified StorageClass * @param name name of the StorageClass * @param body * @param pretty If 'true', then the output is pretty printed. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param {*} [options] Override http request options. */ patchStorageClass(name, body, pretty, dryRun, options = {}) { const localVarPath = this.basePath + '/apis/storage.k8s.io/v1beta1/storageclasses/{name}' .replace('{' + 'name' + '}', encodeURIComponent(String(name))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling patchStorageClass.'); } // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling patchStorageClass.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'PATCH', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: ObjectSerializer.serialize(body, "any") }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "V1beta1StorageClass"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * partially update the specified VolumeAttachment * @param name name of the VolumeAttachment * @param body * @param pretty If 'true', then the output is pretty printed. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param {*} [options] Override http request options. */ patchVolumeAttachment(name, body, pretty, dryRun, options = {}) { const localVarPath = this.basePath + '/apis/storage.k8s.io/v1beta1/volumeattachments/{name}' .replace('{' + 'name' + '}', encodeURIComponent(String(name))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling patchVolumeAttachment.'); } // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling patchVolumeAttachment.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'PATCH', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: ObjectSerializer.serialize(body, "any") }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "V1beta1VolumeAttachment"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * read the specified StorageClass * @param name name of the StorageClass * @param pretty If 'true', then the output is pretty printed. * @param exact Should the export be exact. Exact export maintains cluster-specific fields like 'Namespace'. * @param _export Should this value be exported. Export strips fields that a user can not specify. * @param {*} [options] Override http request options. */ readStorageClass(name, pretty, exact, _export, options = {}) { const localVarPath = this.basePath + '/apis/storage.k8s.io/v1beta1/storageclasses/{name}' .replace('{' + 'name' + '}', encodeURIComponent(String(name))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling readStorageClass.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, "string"); } if (exact !== undefined) { localVarQueryParameters['exact'] = ObjectSerializer.serialize(exact, "boolean"); } if (_export !== undefined) { localVarQueryParameters['export'] = ObjectSerializer.serialize(_export, "boolean"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'GET', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "V1beta1StorageClass"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * read the specified VolumeAttachment * @param name name of the VolumeAttachment * @param pretty If 'true', then the output is pretty printed. * @param exact Should the export be exact. Exact export maintains cluster-specific fields like 'Namespace'. * @param _export Should this value be exported. Export strips fields that a user can not specify. * @param {*} [options] Override http request options. */ readVolumeAttachment(name, pretty, exact, _export, options = {}) { const localVarPath = this.basePath + '/apis/storage.k8s.io/v1beta1/volumeattachments/{name}' .replace('{' + 'name' + '}', encodeURIComponent(String(name))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling readVolumeAttachment.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, "string"); } if (exact !== undefined) { localVarQueryParameters['exact'] = ObjectSerializer.serialize(exact, "boolean"); } if (_export !== undefined) { localVarQueryParameters['export'] = ObjectSerializer.serialize(_export, "boolean"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'GET', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "V1beta1VolumeAttachment"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * replace the specified StorageClass * @param name name of the StorageClass * @param body * @param pretty If 'true', then the output is pretty printed. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param {*} [options] Override http request options. */ replaceStorageClass(name, body, pretty, dryRun, options = {}) { const localVarPath = this.basePath + '/apis/storage.k8s.io/v1beta1/storageclasses/{name}' .replace('{' + 'name' + '}', encodeURIComponent(String(name))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling replaceStorageClass.'); } // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling replaceStorageClass.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'PUT', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: ObjectSerializer.serialize(body, "V1beta1StorageClass") }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "V1beta1StorageClass"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } /** * replace the specified VolumeAttachment * @param name name of the VolumeAttachment * @param body * @param pretty If 'true', then the output is pretty printed. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param {*} [options] Override http request options. */ replaceVolumeAttachment(name, body, pretty, dryRun, options = {}) { const localVarPath = this.basePath + '/apis/storage.k8s.io/v1beta1/volumeattachments/{name}' .replace('{' + 'name' + '}', encodeURIComponent(String(name))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling replaceVolumeAttachment.'); } // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling replaceVolumeAttachment.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = ObjectSerializer.serialize(dryRun, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'PUT', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: ObjectSerializer.serialize(body, "V1beta1VolumeAttachment") }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "V1beta1VolumeAttachment"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } } exports.StorageV1beta1Api = StorageV1beta1Api; var VersionApiApiKeys; (function (VersionApiApiKeys) { VersionApiApiKeys[VersionApiApiKeys["BearerToken"] = 0] = "BearerToken"; })(VersionApiApiKeys = exports.VersionApiApiKeys || (exports.VersionApiApiKeys = {})); class VersionApi { constructor(basePathOrUsername, password, basePath) { this._basePath = defaultBasePath; this.defaultHeaders = {}; this._useQuerystring = false; this.authentications = { 'default': new VoidAuth(), 'BearerToken': new ApiKeyAuth('header', 'authorization'), }; if (password) { if (basePath) { this.basePath = basePath; } } else { if (basePathOrUsername) { this.basePath = basePathOrUsername; } } } set useQuerystring(value) { this._useQuerystring = value; } set basePath(basePath) { this._basePath = basePath; } get basePath() { return this._basePath; } setDefaultAuthentication(auth) { this.authentications.default = auth; } setApiKey(key, value) { this.authentications[VersionApiApiKeys[key]].apiKey = value; } /** * get the code version * @param {*} [options] Override http request options. */ getCode(options = {}) { const localVarPath = this.basePath + '/version/'; let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this.defaultHeaders); let localVarFormParams = {}; Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'GET', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; this.authentications.BearerToken.applyToRequest(localVarRequestOptions); this.authentications.default.applyToRequest(localVarRequestOptions); if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "VersionInfo"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject({ response: response, body: body }); } } }); }); } } exports.VersionApi = VersionApi; //# sourceMappingURL=api.js.map /***/ }), /***/ 48698: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); const tslib_1 = __webpack_require__(75636); const querystring = __webpack_require__(71191); const terminal_size_queue_1 = __webpack_require__(76023); const web_socket_handler_1 = __webpack_require__(47581); class Attach { constructor(config, websocketInterface) { if (websocketInterface) { this.handler = websocketInterface; } else { this.handler = new web_socket_handler_1.WebSocketHandler(config); } } attach(namespace, podName, containerName, stdout, stderr, stdin, tty) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const query = { container: containerName, stderr: stderr != null, stdin: stdin != null, stdout: stdout != null, tty, }; const queryStr = querystring.stringify(query); const path = `/api/v1/namespaces/${namespace}/pods/${podName}/attach?${queryStr}`; const conn = yield this.handler.connect(path, null, (streamNum, buff) => { web_socket_handler_1.WebSocketHandler.handleStandardStreams(streamNum, buff, stdout, stderr); return true; }); if (stdin != null) { web_socket_handler_1.WebSocketHandler.handleStandardInput(conn, stdin, web_socket_handler_1.WebSocketHandler.StdinStream); } if (terminal_size_queue_1.isResizable(stdout)) { this.terminalSizeQueue = new terminal_size_queue_1.TerminalSizeQueue(); web_socket_handler_1.WebSocketHandler.handleStandardInput(conn, this.terminalSizeQueue, web_socket_handler_1.WebSocketHandler.ResizeStream); this.terminalSizeQueue.handleResizes(stdout); } return conn; }); } } exports.Attach = Attach; //# sourceMappingURL=attach.js.map /***/ }), /***/ 5434: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); const tslib_1 = __webpack_require__(75636); const informer_1 = __webpack_require__(88029); class ListWatch { constructor(path, watch, listFn, autoStart = true) { this.path = path; this.watch = watch; this.listFn = listFn; this.objects = []; this.indexCache = {}; this.callbackCache = {}; this.watch = watch; this.listFn = listFn; if (autoStart) { this.doneHandler(null); } } start() { this.doneHandler(null); } on(verb, cb) { if (verb !== informer_1.ADD && verb !== informer_1.UPDATE && verb !== informer_1.DELETE) { throw new Error(`Unknown verb: ${verb}`); } if (!this.callbackCache[verb]) { this.callbackCache[verb] = []; } this.callbackCache[verb].push(cb); } get(name, namespace) { return this.objects.find((obj) => { return obj.metadata.name === name && (!namespace || obj.metadata.namespace === namespace); }); } list(namespace) { if (!namespace) { return this.objects; } return this.indexCache[namespace]; } doneHandler(err) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const promise = this.listFn(); const result = yield promise; const list = result.body; deleteItems(this.objects, list.items, this.callbackCache[informer_1.DELETE]); this.addOrUpdateItems(list.items); this.watch.watch(this.path, { resourceVersion: list.metadata.resourceVersion }, this.watchHandler.bind(this), this.doneHandler.bind(this)); }); } addOrUpdateItems(items) { items.forEach((obj) => { addOrUpdateObject(this.objects, obj, this.callbackCache[informer_1.ADD], this.callbackCache[informer_1.UPDATE]); if (obj.metadata.namespace) { this.indexObj(obj); } }); } indexObj(obj) { let namespaceList = this.indexCache[obj.metadata.namespace]; if (!namespaceList) { namespaceList = []; this.indexCache[obj.metadata.namespace] = namespaceList; } addOrUpdateObject(namespaceList, obj); } watchHandler(phase, obj) { switch (phase) { case 'ADDED': case 'MODIFIED': addOrUpdateObject(this.objects, obj, this.callbackCache[informer_1.ADD], this.callbackCache[informer_1.UPDATE]); if (obj.metadata.namespace) { this.indexObj(obj); } break; case 'DELETED': deleteObject(this.objects, obj, this.callbackCache[informer_1.DELETE]); if (obj.metadata.namespace) { const namespaceList = this.indexCache[obj.metadata.namespace]; if (namespaceList) { deleteObject(namespaceList, obj); } } break; } } } exports.ListWatch = ListWatch; // external for testing function deleteItems(oldObjects, newObjects, deleteCallback) { return oldObjects.filter((obj) => { if (findKubernetesObject(newObjects, obj) === -1) { if (deleteCallback) { deleteCallback.forEach((fn) => fn(obj)); } return false; } return true; }); } exports.deleteItems = deleteItems; // Only public for testing. function addOrUpdateObject(objects, obj, addCallback, updateCallback) { const ix = findKubernetesObject(objects, obj); if (ix === -1) { objects.push(obj); if (addCallback) { addCallback.forEach((elt) => elt(obj)); } } else { objects[ix] = obj; if (updateCallback) { updateCallback.forEach((elt) => elt(obj)); } } } exports.addOrUpdateObject = addOrUpdateObject; function isSameObject(o1, o2) { return o1.metadata.name === o2.metadata.name && o1.metadata.namespace === o2.metadata.namespace; } function findKubernetesObject(objects, obj) { return objects.findIndex((elt) => { return isSameObject(elt, obj); }); } // Public for testing. function deleteObject(objects, obj, deleteCallback) { const ix = findKubernetesObject(objects, obj); if (ix !== -1) { objects.splice(ix, 1); if (deleteCallback) { deleteCallback.forEach((elt) => elt(obj)); } } } exports.deleteObject = deleteObject; //# sourceMappingURL=cache.js.map /***/ }), /***/ 10032: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); const jsonpath = __webpack_require__(63269); const shelljs = __webpack_require__(33516); class CloudAuth { isAuthProvider(user) { if (!user || !user.authProvider) { return false; } return user.authProvider.name === 'azure' || user.authProvider.name === 'gcp'; } getToken(user) { const config = user.authProvider.config; if (this.isExpired(config)) { this.updateAccessToken(config); } return 'Bearer ' + config['access-token']; } isExpired(config) { const token = config['access-token']; const expiry = config.expiry; if (!token) { return true; } if (!expiry) { return false; } const expiration = Date.parse(expiry); if (expiration < Date.now()) { return true; } return false; } updateAccessToken(config) { if (!config['cmd-path']) { throw new Error('Token is expired!'); } const args = config['cmd-args']; // TODO: Cache to file? // TODO: do this asynchronously let result; try { let cmd = config['cmd-path']; if (args) { cmd = `"${cmd}" ${args}`; } result = shelljs.exec(cmd, { silent: true }); if (result.code !== 0) { throw new Error(result.stderr); } } catch (err) { throw new Error('Failed to refresh token: ' + err.message); } const output = result.stdout.toString(); const resultObj = JSON.parse(output); const tokenPathKeyInConfig = config['token-key']; const expiryPathKeyInConfig = config['expiry-key']; // Format in file is {}, so slice it out and add '$' const tokenPathKey = '$' + tokenPathKeyInConfig.slice(1, -1); const expiryPathKey = '$' + expiryPathKeyInConfig.slice(1, -1); config['access-token'] = jsonpath.JSONPath(tokenPathKey, resultObj); config.expiry = jsonpath.JSONPath(expiryPathKey, resultObj); } } exports.CloudAuth = CloudAuth; //# sourceMappingURL=cloud_auth.js.map /***/ }), /***/ 14958: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); const fs = __webpack_require__(35747); const path = __webpack_require__(85622); const yaml = __webpack_require__(21917); const shelljs = __webpack_require__(33516); const api = __webpack_require__(56664); const cloud_auth_1 = __webpack_require__(10032); const config_types_1 = __webpack_require__(86218); const exec_auth_1 = __webpack_require__(18325); // fs.existsSync was removed in node 10 function fileExists(filepath) { try { fs.accessSync(filepath); return true; // tslint:disable-next-line:no-empty } catch (ignore) { } return false; } class KubeConfig { getContexts() { return this.contexts; } getClusters() { return this.clusters; } getUsers() { return this.users; } getCurrentContext() { return this.currentContext; } setCurrentContext(context) { this.currentContext = context; } getContextObject(name) { if (!this.contexts) { return null; } return findObject(this.contexts, name, 'context'); } getCurrentCluster() { const context = this.getCurrentContextObject(); if (!context) { return null; } return this.getCluster(context.cluster); } getCluster(name) { return findObject(this.clusters, name, 'cluster'); } getCurrentUser() { const ctx = this.getCurrentContextObject(); if (!ctx) { return null; } return this.getUser(ctx.user); } getUser(name) { return findObject(this.users, name, 'user'); } loadFromFile(file) { const rootDirectory = path.dirname(file); this.loadFromString(fs.readFileSync(file, 'utf8')); this.makePathsAbsolute(rootDirectory); } applytoHTTPSOptions(opts) { const user = this.getCurrentUser(); this.applyOptions(opts); if (user && user.username) { opts.auth = `${user.username}:${user.password}`; } } applyToRequest(opts) { const cluster = this.getCurrentCluster(); const user = this.getCurrentUser(); this.applyOptions(opts); if (cluster && cluster.skipTLSVerify) { opts.strictSSL = false; } if (user && user.username) { opts.auth = { password: user.password, username: user.username, }; } } loadFromString(config) { const obj = yaml.safeLoad(config); if (obj.apiVersion !== 'v1') { throw new TypeError('unknown version: ' + obj.apiVersion); } this.clusters = config_types_1.newClusters(obj.clusters); this.contexts = config_types_1.newContexts(obj.contexts); this.users = config_types_1.newUsers(obj.users); this.currentContext = obj['current-context']; } loadFromOptions(options) { this.clusters = options.clusters; this.contexts = options.contexts; this.users = options.users; this.currentContext = options.currentContext; } loadFromClusterAndUser(cluster, user) { this.clusters = [cluster]; this.users = [user]; this.currentContext = 'loaded-context'; this.contexts = [ { cluster: cluster.name, user: user.name, name: this.currentContext, }, ]; } loadFromCluster(pathPrefix = '') { const host = process.env.KUBERNETES_SERVICE_HOST; const port = process.env.KUBERNETES_SERVICE_PORT; const clusterName = 'inCluster'; const userName = 'inClusterUser'; const contextName = 'inClusterContext'; let scheme = 'https'; if (port === '80' || port === '8080' || port === '8001') { scheme = 'http'; } this.clusters = [ { name: clusterName, caFile: `${pathPrefix}${Config.SERVICEACCOUNT_CA_PATH}`, server: `${scheme}://${host}:${port}`, skipTLSVerify: false, }, ]; this.users = [ { name: userName, token: fs.readFileSync(`${pathPrefix}${Config.SERVICEACCOUNT_TOKEN_PATH}`).toString(), }, ]; this.contexts = [ { cluster: clusterName, name: contextName, user: userName, }, ]; this.currentContext = contextName; } mergeConfig(config) { this.currentContext = config.currentContext; config.clusters.forEach((cluster) => { this.addCluster(cluster); }); config.users.forEach((user) => { this.addUser(user); }); config.contexts.forEach((ctx) => { this.addContext(ctx); }); } addCluster(cluster) { this.clusters.forEach((c, ix) => { if (c.name === cluster.name) { throw new Error(`Duplicate cluster: ${c.name}`); } }); this.clusters.push(cluster); } addUser(user) { this.users.forEach((c, ix) => { if (c.name === user.name) { throw new Error(`Duplicate user: ${c.name}`); } }); this.users.push(user); } addContext(ctx) { this.contexts.forEach((c, ix) => { if (c.name === ctx.name) { throw new Error(`Duplicate context: ${c.name}`); } }); this.contexts.push(ctx); } loadFromDefault() { if (process.env.KUBECONFIG && process.env.KUBECONFIG.length > 0) { const files = process.env.KUBECONFIG.split(path.delimiter); this.loadFromFile(files[0]); for (let i = 1; i < files.length; i++) { const kc = new KubeConfig(); kc.loadFromFile(files[i]); this.mergeConfig(kc); } return; } const home = findHomeDir(); if (home) { const config = path.join(home, '.kube', 'config'); if (fileExists(config)) { this.loadFromFile(config); return; } } if (process.platform === 'win32' && shelljs.which('wsl.exe')) { // TODO: Handle if someome set $KUBECONFIG in wsl here... const result = shelljs.exec('wsl.exe cat $HOME/.kube/config', { silent: true, }); if (result.code === 0) { this.loadFromString(result.stdout); return; } } if (fileExists(Config.SERVICEACCOUNT_TOKEN_PATH)) { this.loadFromCluster(); return; } this.loadFromClusterAndUser({ name: 'cluster', server: 'http://localhost:8080' }, { name: 'user' }); } makeApiClient(apiClientType) { const cluster = this.getCurrentCluster(); if (!cluster) { throw new Error('No active cluster!'); } const apiClient = new apiClientType(cluster.server); apiClient.setDefaultAuthentication(this); return apiClient; } makePathsAbsolute(rootDirectory) { this.clusters.forEach((cluster) => { if (cluster.caFile) { cluster.caFile = makeAbsolutePath(rootDirectory, cluster.caFile); } }); this.users.forEach((user) => { if (user.certFile) { user.certFile = makeAbsolutePath(rootDirectory, user.certFile); } if (user.keyFile) { user.keyFile = makeAbsolutePath(rootDirectory, user.keyFile); } }); } getCurrentContextObject() { return this.getContextObject(this.currentContext); } applyHTTPSOptions(opts) { const cluster = this.getCurrentCluster(); const user = this.getCurrentUser(); if (!user) { return; } if (cluster != null && cluster.skipTLSVerify) { opts.rejectUnauthorized = false; } const ca = cluster != null ? bufferFromFileOrString(cluster.caFile, cluster.caData) : null; if (ca) { opts.ca = ca; } const cert = bufferFromFileOrString(user.certFile, user.certData); if (cert) { opts.cert = cert; } const key = bufferFromFileOrString(user.keyFile, user.keyData); if (key) { opts.key = key; } } applyAuthorizationHeader(opts) { const user = this.getCurrentUser(); if (!user) { return; } let token = null; KubeConfig.authenticators.forEach((authenticator) => { if (authenticator.isAuthProvider(user)) { token = authenticator.getToken(user); } }); if (user.token) { token = 'Bearer ' + user.token; } if (token) { if (!opts.headers) { opts.headers = []; } opts.headers.Authorization = token; } } applyOptions(opts) { this.applyHTTPSOptions(opts); this.applyAuthorizationHeader(opts); } } KubeConfig.authenticators = [new cloud_auth_1.CloudAuth(), new exec_auth_1.ExecAuth()]; exports.KubeConfig = KubeConfig; // This class is deprecated and will eventually be removed. class Config { static fromFile(filename) { return Config.apiFromFile(filename, api.CoreV1Api); } static fromCluster() { return Config.apiFromCluster(api.CoreV1Api); } static defaultClient() { return Config.apiFromDefaultClient(api.CoreV1Api); } static apiFromFile(filename, apiClientType) { const kc = new KubeConfig(); kc.loadFromFile(filename); return kc.makeApiClient(apiClientType); } static apiFromCluster(apiClientType) { const kc = new KubeConfig(); kc.loadFromCluster(); const cluster = kc.getCurrentCluster(); if (!cluster) { throw new Error('No active cluster!'); } const k8sApi = new apiClientType(cluster.server); k8sApi.setDefaultAuthentication(kc); return k8sApi; } static apiFromDefaultClient(apiClientType) { const kc = new KubeConfig(); kc.loadFromDefault(); return kc.makeApiClient(apiClientType); } } Config.SERVICEACCOUNT_ROOT = '/var/run/secrets/kubernetes.io/serviceaccount'; Config.SERVICEACCOUNT_CA_PATH = Config.SERVICEACCOUNT_ROOT + '/ca.crt'; Config.SERVICEACCOUNT_TOKEN_PATH = Config.SERVICEACCOUNT_ROOT + '/token'; exports.Config = Config; function makeAbsolutePath(root, file) { if (!root || path.isAbsolute(file)) { return file; } return path.join(root, file); } exports.makeAbsolutePath = makeAbsolutePath; // This is public really only for testing. function bufferFromFileOrString(file, data) { if (file) { return fs.readFileSync(file); } if (data) { return Buffer.from(data, 'base64'); } return null; } exports.bufferFromFileOrString = bufferFromFileOrString; // Only public for testing. function findHomeDir() { if (process.env.HOME) { try { fs.accessSync(process.env.HOME); return process.env.HOME; // tslint:disable-next-line:no-empty } catch (ignore) { } } if (process.platform !== 'win32') { return null; } if (process.env.HOMEDRIVE && process.env.HOMEPATH) { const dir = path.join(process.env.HOMEDRIVE, process.env.HOMEPATH); try { fs.accessSync(dir); return dir; // tslint:disable-next-line:no-empty } catch (ignore) { } } if (process.env.USERPROFILE) { try { fs.accessSync(process.env.USERPROFILE); return process.env.USERPROFILE; // tslint:disable-next-line:no-empty } catch (ignore) { } } return null; } exports.findHomeDir = findHomeDir; // Only really public for testing... function findObject(list, name, key) { for (const obj of list) { if (obj.name === name) { if (obj[key]) { return obj[key]; } return obj; } } return null; } exports.findObject = findObject; //# sourceMappingURL=config.js.map /***/ }), /***/ 86218: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); const fs = __webpack_require__(35747); const u = __webpack_require__(83571); function newClusters(a) { return u.map(a, clusterIterator()); } exports.newClusters = newClusters; function clusterIterator() { return (elt, i, list) => { if (!elt.name) { throw new Error(`clusters[${i}].name is missing`); } if (!elt.cluster) { throw new Error(`clusters[${i}].cluster is missing`); } if (!elt.cluster.server) { throw new Error(`clusters[${i}].cluster.server is missing`); } return { caData: elt.cluster['certificate-authority-data'], caFile: elt.cluster['certificate-authority'], name: elt.name, server: elt.cluster.server, skipTLSVerify: elt.cluster['insecure-skip-tls-verify'] === true, }; }; } function newUsers(a) { return u.map(a, userIterator()); } exports.newUsers = newUsers; function userIterator() { return (elt, i, list) => { if (!elt.name) { throw new Error(`users[${i}].name is missing`); } return { authProvider: elt.user ? elt.user['auth-provider'] : null, certData: elt.user ? elt.user['client-certificate-data'] : null, certFile: elt.user ? elt.user['client-certificate'] : null, exec: elt.user ? elt.user.exec : null, keyData: elt.user ? elt.user['client-key-data'] : null, keyFile: elt.user ? elt.user['client-key'] : null, name: elt.name, token: findToken(elt.user), password: elt.user ? elt.user.password : null, username: elt.user ? elt.user.username : null, }; }; } function findToken(user) { if (user) { if (user.token) { return user.token; } if (user['token-file']) { return fs.readFileSync(user['token-file']).toString(); } } } function newContexts(a) { return u.map(a, contextIterator()); } exports.newContexts = newContexts; function contextIterator() { return (elt, i, list) => { if (!elt.name) { throw new Error(`contexts[${i}].name is missing`); } if (!elt.context) { throw new Error(`contexts[${i}].context is missing`); } if (!elt.context.cluster) { throw new Error(`contexts[${i}].context.cluster is missing`); } return { cluster: elt.context.cluster, name: elt.name, user: elt.context.user || undefined, namespace: elt.context.namespace || undefined, }; }; } //# sourceMappingURL=config_types.js.map /***/ }), /***/ 62864: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); const tslib_1 = __webpack_require__(75636); const querystring = __webpack_require__(71191); const terminal_size_queue_1 = __webpack_require__(76023); const web_socket_handler_1 = __webpack_require__(47581); class Exec { constructor(config, wsInterface) { if (wsInterface) { this.handler = wsInterface; } else { this.handler = new web_socket_handler_1.WebSocketHandler(config); } } /** * @param {string} namespace - The namespace of the pod to exec the command inside. * @param {string} podName - The name of the pod to exec the command inside. * @param {string} containerName - The name of the container in the pod to exec the command inside. * @param {(string|string[])} command - The command or command and arguments to execute. * @param {stream.Writable} stdout - The stream to write stdout data from the command. * @param {stream.Writable} stderr - The stream to write stderr data from the command. * @param {stream.Readable} stdin - The strream to write stdin data into the command. * @param {boolean} tty - Should the command execute in a TTY enabled session. * @param {(V1Status) => void} statusCallback - * A callback to received the status (e.g. exit code) from the command, optional. * @return {string} This is the result */ exec(namespace, podName, containerName, command, stdout, stderr, stdin, tty, statusCallback) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const query = { stdout: stdout != null, stderr: stderr != null, stdin: stdin != null, tty, command, container: containerName, }; const queryStr = querystring.stringify(query); const path = `/api/v1/namespaces/${namespace}/pods/${podName}/exec?${queryStr}`; const conn = yield this.handler.connect(path, null, (streamNum, buff) => { const status = web_socket_handler_1.WebSocketHandler.handleStandardStreams(streamNum, buff, stdout, stderr); if (status != null) { if (statusCallback) { statusCallback(status); } return false; } return true; }); if (stdin != null) { web_socket_handler_1.WebSocketHandler.handleStandardInput(conn, stdin, web_socket_handler_1.WebSocketHandler.StdinStream); } if (terminal_size_queue_1.isResizable(stdout)) { this.terminalSizeQueue = new terminal_size_queue_1.TerminalSizeQueue(); web_socket_handler_1.WebSocketHandler.handleStandardInput(conn, this.terminalSizeQueue, web_socket_handler_1.WebSocketHandler.ResizeStream); this.terminalSizeQueue.handleResizes(stdout); } return conn; }); } } exports.Exec = Exec; //# sourceMappingURL=exec.js.map /***/ }), /***/ 18325: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); const shell = __webpack_require__(33516); class ExecAuth { constructor() { this.tokenCache = {}; this.execFn = shell.exec; } isAuthProvider(user) { if (!user) { return false; } if (user.exec) { return true; } if (!user.authProvider) { return false; } return (user.authProvider.name === 'exec' || (user.authProvider.config && user.authProvider.config.exec)); } getToken(user) { // TODO: Handle client cert auth here, requires auth refactor. // See https://kubernetes.io/docs/reference/access-authn-authz/authentication/#input-and-output-formats // for details on this protocol. // TODO: Add a unit test for token caching. const cachedToken = this.tokenCache[user.name]; if (cachedToken) { const date = Date.parse(cachedToken.status.expirationTimestamp); if (date > Date.now()) { return `Bearer ${cachedToken.status.token}`; } this.tokenCache[user.name] = null; } let exec = null; if (user.authProvider && user.authProvider.config) { exec = user.authProvider.config.exec; } if (user.exec) { exec = user.exec; } if (!exec) { return null; } if (!exec.command) { throw new Error('No command was specified for exec authProvider!'); } let cmd = exec.command; if (exec.args) { cmd = `${cmd} ${exec.args.join(' ')}`; } let opts = { silent: true }; if (exec.env) { const env = process.env; exec.env.forEach((elt) => (env[elt.name] = elt.value)); opts = Object.assign({}, opts, { env }); } const result = this.execFn(cmd, opts); if (result.code === 0) { const obj = JSON.parse(result.stdout); this.tokenCache[user.name] = obj; return `Bearer ${obj.status.token}`; } throw new Error(result.stderr); } } exports.ExecAuth = ExecAuth; //# sourceMappingURL=exec_auth.js.map /***/ }), /***/ 89679: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); const tslib_1 = __webpack_require__(75636); tslib_1.__exportStar(__webpack_require__(14958), exports); tslib_1.__exportStar(__webpack_require__(5434), exports); tslib_1.__exportStar(__webpack_require__(56664), exports); tslib_1.__exportStar(__webpack_require__(48698), exports); tslib_1.__exportStar(__webpack_require__(7633), exports); tslib_1.__exportStar(__webpack_require__(62864), exports); tslib_1.__exportStar(__webpack_require__(32390), exports); tslib_1.__exportStar(__webpack_require__(18122), exports); tslib_1.__exportStar(__webpack_require__(44756), exports); tslib_1.__exportStar(__webpack_require__(88029), exports); //# sourceMappingURL=index.js.map /***/ }), /***/ 88029: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); const cache_1 = __webpack_require__(5434); const watch_1 = __webpack_require__(7633); exports.ADD = 'add'; exports.UPDATE = 'update'; exports.DELETE = 'delete'; function makeInformer(kubeconfig, path, listPromiseFn) { const watch = new watch_1.Watch(kubeconfig); return new cache_1.ListWatch(path, watch, listPromiseFn, false); } exports.makeInformer = makeInformer; //# sourceMappingURL=informer.js.map /***/ }), /***/ 44756: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); const request = __webpack_require__(48699); class Log { constructor(config) { this.config = config; } log(namespace, podName, containerName, stream, done, options = {}) { const path = `/api/v1/namespaces/${namespace}/pods/${podName}/log`; const cluster = this.config.getCurrentCluster(); if (!cluster) { throw new Error('No currently active cluster'); } const url = cluster.server + path; const requestOptions = { method: 'GET', qs: Object.assign({}, options, { container: containerName }), uri: url, }; this.config.applyToRequest(requestOptions); const req = request(requestOptions, (error, response, body) => { if (error) { done(error); } else if (response && response.statusCode !== 200) { done(body); } else { done(null); } }).on('response', (response) => { if (response.statusCode === 200) { req.pipe(stream); } }); return req; } } exports.Log = Log; //# sourceMappingURL=log.js.map /***/ }), /***/ 32390: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); const tslib_1 = __webpack_require__(75636); const querystring = __webpack_require__(71191); const util_1 = __webpack_require__(31669); const web_socket_handler_1 = __webpack_require__(47581); class PortForward { // handler is a parameter really only for injecting for testing. constructor(config, disconnectOnErr, handler) { if (!handler) { this.handler = new web_socket_handler_1.WebSocketHandler(config); } else { this.handler = handler; } this.disconnectOnErr = util_1.isUndefined(disconnectOnErr) ? true : disconnectOnErr; } // TODO: support multiple ports for real... portForward(namespace, podName, targetPorts, output, err, input, retryCount = 0) { return tslib_1.__awaiter(this, void 0, void 0, function* () { if (targetPorts.length === 0) { throw new Error('You must provide at least one port to forward to.'); } if (targetPorts.length > 1) { throw new Error('Only one port is currently supported for port-forward'); } const query = { ports: targetPorts[0], }; const queryStr = querystring.stringify(query); const needsToReadPortNumber = []; targetPorts.forEach((value, index) => { needsToReadPortNumber[index * 2] = true; needsToReadPortNumber[index * 2 + 1] = true; }); const path = `/api/v1/namespaces/${namespace}/pods/${podName}/portforward?${queryStr}`; const createWebSocket = () => { return this.handler.connect(path, null, (streamNum, buff) => { if (streamNum >= targetPorts.length * 2) { return !this.disconnectOnErr; } // First two bytes of each stream are the port number if (needsToReadPortNumber[streamNum]) { buff = buff.slice(2); needsToReadPortNumber[streamNum] = false; } if (streamNum % 2 === 1) { if (err) { err.write(buff); } } else { output.write(buff); } return true; }); }; if (retryCount < 1) { const ws = yield createWebSocket(); web_socket_handler_1.WebSocketHandler.handleStandardInput(ws, input, 0); return ws; } return web_socket_handler_1.WebSocketHandler.restartableHandleStandardInput(createWebSocket, input, 0, retryCount); }); } } exports.PortForward = PortForward; //# sourceMappingURL=portforward.js.map /***/ }), /***/ 76023: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); const stream_1 = __webpack_require__(92413); class TerminalSizeQueue extends stream_1.Readable { constructor(opts = {}) { super(Object.assign({}, opts, { // tslint:disable-next-line:no-empty read() { } })); } handleResizes(writeStream) { // Set initial size this.resize(getTerminalSize(writeStream)); // Handle future size updates writeStream.on('resize', () => this.resize(getTerminalSize(writeStream))); } resize(size) { this.push(JSON.stringify(size)); } } exports.TerminalSizeQueue = TerminalSizeQueue; function isResizable(stream) { if (stream == null) { return false; } const hasRows = 'rows' in stream; const hasColumns = 'columns' in stream; const hasOn = typeof stream.on === 'function'; return hasRows && hasColumns && hasOn; } exports.isResizable = isResizable; function getTerminalSize(writeStream) { return { height: writeStream.rows, width: writeStream.columns }; } //# sourceMappingURL=terminal-size-queue.js.map /***/ }), /***/ 7633: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); const JSONStream = __webpack_require__(81676); const request = __webpack_require__(48699); class DefaultRequest { webRequest(opts, callback) { return request(opts, callback); } } exports.DefaultRequest = DefaultRequest; class Watch { constructor(config, requestImpl) { this.config = config; if (requestImpl) { this.requestImpl = requestImpl; } else { this.requestImpl = new DefaultRequest(); } } watch(path, queryParams, callback, done) { const cluster = this.config.getCurrentCluster(); if (!cluster) { throw new Error('No currently active cluster'); } const url = cluster.server + path; queryParams.watch = true; const headerParams = {}; const requestOptions = { method: 'GET', qs: queryParams, headers: headerParams, uri: url, useQuerystring: true, json: true, }; this.config.applyToRequest(requestOptions); const stream = new JSONStream(); stream.on('data', (data) => callback(data.type, data.object)); const req = this.requestImpl.webRequest(requestOptions, (error, response, body) => { if (error) { done(error); } else { done(null); } }); req.pipe(stream); return req; } } exports.Watch = Watch; //# sourceMappingURL=watch.js.map /***/ }), /***/ 47581: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); const tslib_1 = __webpack_require__(75636); const WebSocket = __webpack_require__(64713); const protocols = ['v4.channel.k8s.io', 'v3.channel.k8s.io', 'v2.channel.k8s.io', 'channel.k8s.io']; class WebSocketHandler { // factory is really just for test injection constructor(config, socketFactory) { this.config = config; this.socketFactory = socketFactory; } static handleStandardStreams(streamNum, buff, stdout, stderr) { if (buff.length < 1) { return null; } if (stdout && streamNum === WebSocketHandler.StdoutStream) { stdout.write(buff); } else if (stderr && streamNum === WebSocketHandler.StderrStream) { stderr.write(buff); } else if (streamNum === WebSocketHandler.StatusStream) { // stream closing. if (stdout && stdout !== process.stdout) { stdout.end(); } if (stderr && stderr !== process.stderr) { stderr.end(); } return JSON.parse(buff.toString('utf8')); } else { throw new Error('Unknown stream: ' + streamNum); } return null; } static handleStandardInput(ws, stdin, streamNum = 0) { stdin.on('data', (data) => { const buff = Buffer.alloc(data.length + 1); buff.writeInt8(streamNum, 0); if (data instanceof Buffer) { data.copy(buff, 1); } else { buff.write(data, 1); } ws.send(buff); }); stdin.on('end', () => { ws.close(); }); // Keep the stream open return true; } static restartableHandleStandardInput(createWS, stdin, streamNum = 0, retryCount = 3) { if (retryCount < 0) { throw new Error("retryCount can't be lower than 0."); } let queue = Promise.resolve(); let ws; function processData(data) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const buff = Buffer.alloc(data.length + 1); buff.writeInt8(streamNum, 0); if (data instanceof Buffer) { data.copy(buff, 1); } else { buff.write(data, 1); } let i = 0; for (; i < retryCount; ++i) { if (ws !== null && ws.readyState === WebSocket.OPEN) { ws.send(buff); break; } else { ws = yield createWS(); } } if (i >= retryCount) { throw new Error("can't send data to ws"); } }); } stdin.on('data', (data) => { queue = queue.then(() => processData(data)); }); stdin.on('end', () => { if (ws) { ws.close(); } }); return () => ws; } /** * Connect to a web socket endpoint. * @param path The HTTP Path to connect to on the server. * @param textHandler Callback for text over the web socket. * Returns true if the connection should be kept alive, false to disconnect. * @param binaryHandler Callback for binary data over the web socket. * Returns true if the connection should be kept alive, false to disconnect. */ connect(path, textHandler, binaryHandler) { const cluster = this.config.getCurrentCluster(); if (!cluster) { throw new Error('No cluster is defined.'); } const server = cluster.server; const ssl = server.startsWith('https://'); const target = ssl ? server.substr(8) : server.substr(7); const proto = ssl ? 'wss' : 'ws'; const uri = `${proto}://${target}${path}`; const opts = {}; this.config.applytoHTTPSOptions(opts); return new Promise((resolve, reject) => { const client = this.socketFactory ? this.socketFactory(uri, opts) : new WebSocket(uri, protocols, opts); let resolved = false; client.onopen = () => { resolved = true; resolve(client); }; client.onerror = (err) => { if (!resolved) { reject(err); } }; client.onmessage = ({ data }) => { // TODO: support ArrayBuffer and Buffer[] data types? if (typeof data === 'string') { if (textHandler && !textHandler(data)) { client.close(); } } else if (data instanceof Buffer) { const streamNum = data.readInt8(0); if (binaryHandler && !binaryHandler(streamNum, data.slice(1))) { client.close(); } } }; }); } } WebSocketHandler.StdinStream = 0; WebSocketHandler.StdoutStream = 1; WebSocketHandler.StderrStream = 2; WebSocketHandler.StatusStream = 3; WebSocketHandler.ResizeStream = 4; exports.WebSocketHandler = WebSocketHandler; //# sourceMappingURL=web-socket-handler.js.map /***/ }), /***/ 18122: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); const yaml = __webpack_require__(21917); function loadYaml(data, opts) { return yaml.safeLoad(data, opts); } exports.loadYaml = loadYaml; function loadAllYaml(data, opts) { return yaml.safeLoadAll(data, undefined, opts); } exports.loadAllYaml = loadAllYaml; function dumpYaml(object, opts) { return yaml.safeDump(object, opts); } exports.dumpYaml = dumpYaml; //# sourceMappingURL=yaml.js.map /***/ }), /***/ 39436: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { const { define } = __webpack_require__(93998) const base = __webpack_require__(33318) const constants = __webpack_require__(90998) const decoders = __webpack_require__(82975) const encoders = __webpack_require__(2246) module.exports = { base, constants, decoders, define, encoders } /***/ }), /***/ 93998: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { const { inherits } = __webpack_require__(31669) const encoders = __webpack_require__(2246) const decoders = __webpack_require__(82975) module.exports.define = function define (name, body) { return new Entity(name, body) } function Entity (name, body) { this.name = name this.body = body this.decoders = {} this.encoders = {} } Entity.prototype._createNamed = function createNamed (Base) { const name = this.name function Generated (entity) { this._initNamed(entity, name) } inherits(Generated, Base) Generated.prototype._initNamed = function _initNamed (entity, name) { Base.call(this, entity, name) } return new Generated(this) } Entity.prototype._getDecoder = function _getDecoder (enc) { enc = enc || 'der' // Lazily create decoder if (!Object.prototype.hasOwnProperty.call(this.decoders, enc)) { this.decoders[enc] = this._createNamed(decoders[enc]) } return this.decoders[enc] } Entity.prototype.decode = function decode (data, enc, options) { return this._getDecoder(enc).decode(data, options) } Entity.prototype._getEncoder = function _getEncoder (enc) { enc = enc || 'der' // Lazily create encoder if (!Object.prototype.hasOwnProperty.call(this.encoders, enc)) { this.encoders[enc] = this._createNamed(encoders[enc]) } return this.encoders[enc] } Entity.prototype.encode = function encode (data, enc, /* internal */ reporter) { return this._getEncoder(enc).encode(data, reporter) } /***/ }), /***/ 28424: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { const { inherits } = __webpack_require__(31669) const { Reporter } = __webpack_require__(93026) function DecoderBuffer (base, options) { Reporter.call(this, options) if (!Buffer.isBuffer(base)) { this.error('Input not Buffer') return } this.base = base this.offset = 0 this.length = base.length } inherits(DecoderBuffer, Reporter) DecoderBuffer.isDecoderBuffer = function isDecoderBuffer (data) { if (data instanceof DecoderBuffer) { return true } // Or accept compatible API const isCompatible = typeof data === 'object' && Buffer.isBuffer(data.base) && data.constructor.name === 'DecoderBuffer' && typeof data.offset === 'number' && typeof data.length === 'number' && typeof data.save === 'function' && typeof data.restore === 'function' && typeof data.isEmpty === 'function' && typeof data.readUInt8 === 'function' && typeof data.skip === 'function' && typeof data.raw === 'function' return isCompatible } DecoderBuffer.prototype.save = function save () { return { offset: this.offset, reporter: Reporter.prototype.save.call(this) } } DecoderBuffer.prototype.restore = function restore (save) { // Return skipped data const res = new DecoderBuffer(this.base) res.offset = save.offset res.length = this.offset this.offset = save.offset Reporter.prototype.restore.call(this, save.reporter) return res } DecoderBuffer.prototype.isEmpty = function isEmpty () { return this.offset === this.length } DecoderBuffer.prototype.readUInt8 = function readUInt8 (fail) { if (this.offset + 1 <= this.length) { return this.base.readUInt8(this.offset++, true) } else { return this.error(fail || 'DecoderBuffer overrun') } } DecoderBuffer.prototype.skip = function skip (bytes, fail) { if (!(this.offset + bytes <= this.length)) { return this.error(fail || 'DecoderBuffer overrun') } const res = new DecoderBuffer(this.base) // Share reporter state res._reporterState = this._reporterState res.offset = this.offset res.length = this.offset + bytes this.offset += bytes return res } DecoderBuffer.prototype.raw = function raw (save) { return this.base.slice(save ? save.offset : this.offset, this.length) } function EncoderBuffer (value, reporter) { if (Array.isArray(value)) { this.length = 0 this.value = value.map(function (item) { if (!EncoderBuffer.isEncoderBuffer(item)) { item = new EncoderBuffer(item, reporter) } this.length += item.length return item }, this) } else if (typeof value === 'number') { if (!(value >= 0 && value <= 0xff)) { return reporter.error('non-byte EncoderBuffer value') } this.value = value this.length = 1 } else if (typeof value === 'string') { this.value = value this.length = Buffer.byteLength(value) } else if (Buffer.isBuffer(value)) { this.value = value this.length = value.length } else { return reporter.error(`Unsupported type: ${typeof value}`) } } EncoderBuffer.isEncoderBuffer = function isEncoderBuffer (data) { if (data instanceof EncoderBuffer) { return true } // Or accept compatible API const isCompatible = typeof data === 'object' && data.constructor.name === 'EncoderBuffer' && typeof data.length === 'number' && typeof data.join === 'function' return isCompatible } EncoderBuffer.prototype.join = function join (out, offset) { if (!out) { out = Buffer.alloc(this.length) } if (!offset) { offset = 0 } if (this.length === 0) { return out } if (Array.isArray(this.value)) { this.value.forEach(function (item) { item.join(out, offset) offset += item.length }) } else { 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) } offset += this.length } return out } module.exports = { DecoderBuffer, EncoderBuffer } /***/ }), /***/ 33318: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { const { Reporter } = __webpack_require__(93026) const { DecoderBuffer, EncoderBuffer } = __webpack_require__(28424) const Node = __webpack_require__(48674) module.exports = { DecoderBuffer, EncoderBuffer, Node, Reporter } /***/ }), /***/ 48674: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { const { strict: assert } = __webpack_require__(42357) const { Reporter } = __webpack_require__(93026) const { DecoderBuffer, EncoderBuffer } = __webpack_require__(28424) // Supported tags const tags = [ 'seq', 'seqof', 'set', 'setof', 'objid', 'bool', 'gentime', 'utctime', 'null_', 'enum', 'int', 'objDesc', 'bitstr', 'bmpstr', 'charstr', 'genstr', 'graphstr', 'ia5str', 'iso646str', 'numstr', 'octstr', 'printstr', 't61str', 'unistr', 'utf8str', 'videostr' ] // Public methods list const methods = [ 'key', 'obj', 'use', 'optional', 'explicit', 'implicit', 'def', 'choice', 'any', 'contains' ].concat(tags) // Overrided methods list const overrided = [ '_peekTag', '_decodeTag', '_use', '_decodeStr', '_decodeObjid', '_decodeTime', '_decodeNull', '_decodeInt', '_decodeBool', '_decodeList', '_encodeComposite', '_encodeStr', '_encodeObjid', '_encodeTime', '_encodeNull', '_encodeInt', '_encodeBool' ] function Node (enc, parent, name) { const state = {} this._baseState = state state.name = name state.enc = enc state.parent = parent || null state.children = null // State state.tag = null state.args = null state.reverseArgs = null state.choice = null state.optional = false state.any = false state.obj = false state.use = null state.useDecoder = null state.key = null state.default = null state.explicit = null state.implicit = null state.contains = null // Should create new instance on each method if (!state.parent) { state.children = [] this._wrap() } } const stateProps = [ 'enc', 'parent', 'children', 'tag', 'args', 'reverseArgs', 'choice', 'optional', 'any', 'obj', 'use', 'alteredUse', 'key', 'default', 'explicit', 'implicit', 'contains' ] Node.prototype.clone = function clone () { const state = this._baseState const cstate = {} stateProps.forEach(function (prop) { cstate[prop] = state[prop] }) const res = new this.constructor(cstate.parent) res._baseState = cstate return res } Node.prototype._wrap = function wrap () { const state = this._baseState methods.forEach(function (method) { this[method] = function _wrappedMethod () { const clone = new this.constructor(this) state.children.push(clone) return clone[method].apply(clone, arguments) } }, this) } Node.prototype._init = function init (body) { const state = this._baseState assert(state.parent === null) body.call(this) // Filter children state.children = state.children.filter(function (child) { return child._baseState.parent === this }, this) assert.equal(state.children.length, 1, 'Root node can have only one child') } Node.prototype._useArgs = function useArgs (args) { const state = this._baseState // Filter children and args const children = args.filter(function (arg) { return arg instanceof this.constructor }, this) args = args.filter(function (arg) { return !(arg instanceof this.constructor) }, this) if (children.length !== 0) { assert(state.children === null) state.children = children // Replace parent to maintain backward link children.forEach(function (child) { child._baseState.parent = this }, this) } if (args.length !== 0) { assert(state.args === null) state.args = args state.reverseArgs = args.map(function (arg) { if (typeof arg !== 'object' || arg.constructor !== Object) { return arg } const res = {} Object.keys(arg).forEach(function (key) { if (key == (key | 0)) { key |= 0 } // eslint-disable-line eqeqeq const value = arg[key] res[value] = key }) return res }) } } // // Overrided methods // overrided.forEach(function (method) { Node.prototype[method] = function _overrided () { const state = this._baseState throw new Error(`${method} not implemented for encoding: ${state.enc}`) } }) // // Public methods // tags.forEach(function (tag) { Node.prototype[tag] = function _tagMethod () { const state = this._baseState const args = Array.prototype.slice.call(arguments) assert(state.tag === null) state.tag = tag this._useArgs(args) return this } }) Node.prototype.use = function use (item) { assert(item) const state = this._baseState assert(state.use === null) state.use = item return this } Node.prototype.optional = function optional () { const state = this._baseState state.optional = true return this } Node.prototype.def = function def (val) { const state = this._baseState assert(state.default === null) state.default = val state.optional = true return this } Node.prototype.explicit = function explicit (num) { const state = this._baseState assert(state.explicit === null && state.implicit === null) state.explicit = num return this } Node.prototype.implicit = function implicit (num) { const state = this._baseState assert(state.explicit === null && state.implicit === null) state.implicit = num return this } Node.prototype.obj = function obj () { const state = this._baseState const args = Array.prototype.slice.call(arguments) state.obj = true if (args.length !== 0) { this._useArgs(args) } return this } Node.prototype.key = function key (newKey) { const state = this._baseState assert(state.key === null) state.key = newKey return this } Node.prototype.any = function any () { const state = this._baseState state.any = true return this } Node.prototype.choice = function choice (obj) { const state = this._baseState assert(state.choice === null) state.choice = obj this._useArgs(Object.keys(obj).map(function (key) { return obj[key] })) return this } Node.prototype.contains = function contains (item) { const state = this._baseState assert(state.use === null) state.contains = item return this } // // Decoding // Node.prototype._decode = function decode (input, options) { const state = this._baseState // Decode root node if (state.parent === null) { return input.wrapResult(state.children[0]._decode(input, options)) } let result = state.default let present = true let prevKey = null if (state.key !== null) { prevKey = input.enterKey(state.key) } // Check if tag is there if (state.optional) { let tag = null if (state.explicit !== null) { tag = state.explicit } else if (state.implicit !== null) { tag = state.implicit } else if (state.tag !== null) { tag = state.tag } if (tag === null && !state.any) { // Trial and Error const save = input.save() try { if (state.choice === null) { this._decodeGeneric(state.tag, input, options) } else { this._decodeChoice(input, options) } present = true } catch (e) { present = false } input.restore(save) } else { present = this._peekTag(input, tag, state.any) if (input.isError(present)) { return present } } } // Push object on stack let prevObj if (state.obj && present) { prevObj = input.enterObject() } if (present) { // Unwrap explicit values if (state.explicit !== null) { const explicit = this._decodeTag(input, state.explicit) if (input.isError(explicit)) { return explicit } input = explicit } const start = input.offset // Unwrap implicit and normal values if (state.use === null && state.choice === null) { let save if (state.any) { save = input.save() } const body = this._decodeTag( input, state.implicit !== null ? state.implicit : state.tag, state.any ) if (input.isError(body)) { return body } if (state.any) { result = input.raw(save) } else { input = body } } if (options && options.track && state.tag !== null) { options.track(input.path(), start, input.length, 'tagged') } if (options && options.track && state.tag !== null) { options.track(input.path(), input.offset, input.length, 'content') } // Select proper method for tag if (state.any) { // no-op } else if (state.choice === null) { result = this._decodeGeneric(state.tag, input, options) } else { result = this._decodeChoice(input, options) } if (input.isError(result)) { return result } // Decode children if (!state.any && state.choice === null && state.children !== null) { state.children.forEach(function decodeChildren (child) { // NOTE: We are ignoring errors here, to let parser continue with other // parts of encoded data child._decode(input, options) }) } // Decode contained/encoded by schema, only in bit or octet strings if (state.contains && (state.tag === 'octstr' || state.tag === 'bitstr')) { const data = new DecoderBuffer(result) result = this._getUse(state.contains, input._reporterState.obj) ._decode(data, options) } } // Pop object if (state.obj && present) { result = input.leaveObject(prevObj) } // Set key if (state.key !== null && (result !== null || present === true)) { input.leaveKey(prevKey, state.key, result) } else if (prevKey !== null) { input.exitKey(prevKey) } return result } Node.prototype._decodeGeneric = function decodeGeneric (tag, input, options) { const state = this._baseState if (tag === 'seq' || tag === 'set') { return null } 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) } if (state.use !== null) { return this._getUse(state.use, input._reporterState.obj) ._decode(input, options) } else { return input.error(`unknown tag: ${tag}`) } } Node.prototype._getUse = function _getUse (entity, obj) { const state = this._baseState // Create altered use decoder if implicit is set state.useDecoder = this._use(entity, obj) assert(state.useDecoder._baseState.parent === null) state.useDecoder = state.useDecoder._baseState.children[0] if (state.implicit !== state.useDecoder._baseState.implicit) { state.useDecoder = state.useDecoder.clone() state.useDecoder._baseState.implicit = state.implicit } return state.useDecoder } Node.prototype._decodeChoice = function decodeChoice (input, options) { const state = this._baseState let result = null let match = false Object.keys(state.choice).some(function (key) { const save = input.save() const node = state.choice[key] try { const value = node._decode(input, options) if (input.isError(value)) { return false } result = { type: key, value: value } match = true } catch (e) { input.restore(save) return false } return true }, this) if (!match) { return input.error('Choice not matched') } return result } // // Encoding // Node.prototype._createEncoderBuffer = function createEncoderBuffer (data) { return new EncoderBuffer(data, this.reporter) } Node.prototype._encode = function encode (data, reporter, parent) { const state = this._baseState if (state.default !== null && state.default === data) { return } const result = this._encodeValue(data, reporter, parent) if (result === undefined) { return } if (this._skipDefault(result, reporter, parent)) { return } return result } Node.prototype._encodeValue = function encode (data, reporter, parent) { const state = this._baseState // Decode root node if (state.parent === null) { return state.children[0]._encode(data, reporter || new Reporter()) } let result = null // Set reporter to share it with a child class this.reporter = reporter // Check if data is there if (state.optional && data === undefined) { if (state.default !== null) { data = state.default } else { return } } // Encode children first let content = null let primitive = false if (state.any) { // Anything that was given is translated to buffer result = this._createEncoderBuffer(data) } else if (state.choice) { result = this._encodeChoice(data, reporter) } else if (state.contains) { content = this._getUse(state.contains, parent)._encode(data, reporter) primitive = true } else if (state.children) { content = state.children.map(function (child) { if (child._baseState.tag === 'null_') { return child._encode(null, reporter, data) } if (child._baseState.key === null) { return reporter.error('Child should have a key') } const prevKey = reporter.enterKey(child._baseState.key) if (typeof data !== 'object') { return reporter.error('Child expected, but input is not object') } const res = child._encode(data[child._baseState.key], reporter, data) reporter.leaveKey(prevKey) return res }, this).filter(function (child) { return child }) content = this._createEncoderBuffer(content) } else { if (state.tag === 'seqof' || state.tag === 'setof') { if (!(state.args && state.args.length === 1)) { return reporter.error(`Too many args for: ${state.tag}`) } if (!Array.isArray(data)) { return reporter.error('seqof/setof, but data is not Array') } const child = this.clone() child._baseState.implicit = null content = this._createEncoderBuffer(data.map(function (item) { const state = this._baseState return this._getUse(state.args[0], data)._encode(item, reporter) }, child)) } else if (state.use !== null) { result = this._getUse(state.use, parent)._encode(data, reporter) } else { content = this._encodePrimitive(state.tag, data) primitive = true } } // Encode data itself if (!state.any && state.choice === null) { const tag = state.implicit !== null ? state.implicit : state.tag const cls = state.implicit === null ? 'universal' : 'context' if (tag === null) { if (state.use === null) { reporter.error('Tag could be omitted only for .use()') } } else { if (state.use === null) { result = this._encodeComposite(tag, primitive, cls, content) } } } // Wrap in explicit if (state.explicit !== null) { result = this._encodeComposite(state.explicit, false, 'context', result) } return result } Node.prototype._encodeChoice = function encodeChoice (data, reporter) { const state = this._baseState const node = state.choice[data.type] if (!node) { assert( false, `${data.type} not found in ${JSON.stringify(Object.keys(state.choice))}` ) } return node._encode(data.value, reporter) } Node.prototype._encodePrimitive = function encodePrimitive (tag, data) { const state = this._baseState 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}`) } } Node.prototype._isNumstr = function isNumstr (str) { return /^[0-9 ]*$/.test(str) } Node.prototype._isPrintstr = function isPrintstr (str) { return /^[A-Za-z0-9 '()+,-./:=?]*$/.test(str) } module.exports = Node /***/ }), /***/ 93026: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { const { inherits } = __webpack_require__(31669) function Reporter (options) { this._reporterState = { obj: null, path: [], options: options || {}, errors: [] } } Reporter.prototype.isError = function isError (obj) { return obj instanceof ReporterError } Reporter.prototype.save = function save () { const state = this._reporterState return { obj: state.obj, pathLen: state.path.length } } Reporter.prototype.restore = function restore (data) { const state = this._reporterState state.obj = data.obj state.path = state.path.slice(0, data.pathLen) } Reporter.prototype.enterKey = function enterKey (key) { return this._reporterState.path.push(key) } Reporter.prototype.exitKey = function exitKey (index) { const state = this._reporterState state.path = state.path.slice(0, index - 1) } Reporter.prototype.leaveKey = function leaveKey (index, key, value) { const state = this._reporterState this.exitKey(index) if (state.obj !== null) { state.obj[key] = value } } Reporter.prototype.path = function path () { return this._reporterState.path.join('/') } Reporter.prototype.enterObject = function enterObject () { const state = this._reporterState const prev = state.obj state.obj = {} return prev } Reporter.prototype.leaveObject = function leaveObject (prev) { const state = this._reporterState const now = state.obj state.obj = prev return now } Reporter.prototype.error = function error (msg) { let err const state = this._reporterState const inherited = msg instanceof ReporterError if (inherited) { err = msg } else { err = new ReporterError(state.path.map(function (elem) { return `[${JSON.stringify(elem)}]` }).join(''), msg.message || msg, msg.stack) } if (!state.options.partial) { throw err } if (!inherited) { state.errors.push(err) } return err } Reporter.prototype.wrapResult = function wrapResult (result) { const state = this._reporterState if (!state.options.partial) { return result } return { result: this.isError(result) ? null : result, errors: state.errors } } function ReporterError (path, msg) { this.path = path this.rethrow(msg) } inherits(ReporterError, Error) ReporterError.prototype.rethrow = function rethrow (msg) { this.message = `${msg} at: ${this.path || '(shallow)'}` if (Error.captureStackTrace) { Error.captureStackTrace(this, ReporterError) } if (!this.stack) { try { // IE only adds stack when thrown throw new Error(this.message) } catch (e) { this.stack = e.stack } } return this } exports.Reporter = Reporter /***/ }), /***/ 96018: /***/ ((__unused_webpack_module, exports) => { // Helper function reverse (map) { const res = {} Object.keys(map).forEach(function (key) { // Convert key to integer if it is stringified if ((key | 0) == key) { key = key | 0 } // eslint-disable-line eqeqeq const value = map[key] res[value] = key }) return res } exports.tagClass = { 0: 'universal', 1: 'application', 2: 'context', 3: 'private' } exports.tagClassByName = reverse(exports.tagClass) exports.tag = { 0x00: 'end', 0x01: 'bool', 0x02: 'int', 0x03: 'bitstr', 0x04: 'octstr', 0x05: 'null_', 0x06: 'objid', 0x07: 'objDesc', 0x08: 'external', 0x09: 'real', 0x0a: 'enum', 0x0b: 'embed', 0x0c: 'utf8str', 0x0d: 'relativeOid', 0x10: 'seq', 0x11: 'set', 0x12: 'numstr', 0x13: 'printstr', 0x14: 't61str', 0x15: 'videostr', 0x16: 'ia5str', 0x17: 'utctime', 0x18: 'gentime', 0x19: 'graphstr', 0x1a: 'iso646str', 0x1b: 'genstr', 0x1c: 'unistr', 0x1d: 'charstr', 0x1e: 'bmpstr' } exports.tagByName = reverse(exports.tag) /***/ }), /***/ 90998: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { module.exports = { der: __webpack_require__(96018) } /***/ }), /***/ 44798: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { /* global BigInt */ const { inherits } = __webpack_require__(31669) const { DecoderBuffer } = __webpack_require__(28424) const Node = __webpack_require__(48674) // Import DER constants const der = __webpack_require__(96018) function DERDecoder (entity) { this.enc = 'der' this.name = entity.name this.entity = entity // Construct base tree this.tree = new DERNode() this.tree._init(entity.body) } DERDecoder.prototype.decode = function decode (data, options) { if (!DecoderBuffer.isDecoderBuffer(data)) { data = new DecoderBuffer(data, options) } return this.tree._decode(data, options) } // Tree methods function DERNode (parent) { Node.call(this, 'der', parent) } inherits(DERNode, Node) DERNode.prototype._peekTag = function peekTag (buffer, tag, any) { if (buffer.isEmpty()) { return false } const state = buffer.save() const decodedTag = derDecodeTag(buffer, `Failed to peek tag: "${tag}"`) if (buffer.isError(decodedTag)) { return decodedTag } buffer.restore(state) return decodedTag.tag === tag || decodedTag.tagStr === tag || (decodedTag.tagStr + 'of') === tag || any } DERNode.prototype._decodeTag = function decodeTag (buffer, tag, any) { const decodedTag = derDecodeTag(buffer, `Failed to decode tag of "${tag}"`) if (buffer.isError(decodedTag)) { return decodedTag } let len = derDecodeLen(buffer, decodedTag.primitive, `Failed to get length of "${tag}"`) // Failure if (buffer.isError(len)) { return len } if (!any && decodedTag.tag !== tag && decodedTag.tagStr !== tag && decodedTag.tagStr + 'of' !== tag) { return buffer.error(`Failed to match tag: "${tag}"`) } if (decodedTag.primitive || len !== null) { return buffer.skip(len, `Failed to match body of: "${tag}"`) } // Indefinite length... find END tag const state = buffer.save() const res = this._skipUntilEnd( buffer, `Failed to skip indefinite length body: "${this.tag}"`) if (buffer.isError(res)) { return res } len = buffer.offset - state.offset buffer.restore(state) return buffer.skip(len, `Failed to match body of: "${tag}"`) } DERNode.prototype._skipUntilEnd = function skipUntilEnd (buffer, fail) { for (;;) { const tag = derDecodeTag(buffer, fail) if (buffer.isError(tag)) { return tag } const len = derDecodeLen(buffer, tag.primitive, fail) if (buffer.isError(len)) { return len } let res if (tag.primitive || len !== null) { res = buffer.skip(len) } else { res = this._skipUntilEnd(buffer, fail) } // Failure if (buffer.isError(res)) { return res } if (tag.tagStr === 'end') { break } } } DERNode.prototype._decodeList = function decodeList (buffer, tag, decoder, options) { const result = [] while (!buffer.isEmpty()) { const possibleEnd = this._peekTag(buffer, 'end') if (buffer.isError(possibleEnd)) { return possibleEnd } const res = decoder.decode(buffer, 'der', options) if (buffer.isError(res) && possibleEnd) { break } result.push(res) } return result } DERNode.prototype._decodeStr = function decodeStr (buffer, tag) { if (tag === 'bitstr') { const unused = buffer.readUInt8() if (buffer.isError(unused)) { return unused } return { unused: unused, data: buffer.raw() } } else if (tag === 'bmpstr') { const raw = buffer.raw() if (raw.length % 2 === 1) { return buffer.error('Decoding of string type: bmpstr length mismatch') } let str = '' for (let i = 0; i < raw.length / 2; i++) { str += String.fromCharCode(raw.readUInt16BE(i * 2)) } return str } else if (tag === 'numstr') { const numstr = buffer.raw().toString('ascii') if (!this._isNumstr(numstr)) { return buffer.error('Decoding of string type: numstr unsupported characters') } return numstr } else if (tag === 'octstr') { return buffer.raw() } else if (tag === 'objDesc') { return buffer.raw() } else if (tag === 'printstr') { const printstr = buffer.raw().toString('ascii') if (!this._isPrintstr(printstr)) { return buffer.error('Decoding of string type: printstr unsupported characters') } return printstr } else if (/str$/.test(tag)) { return buffer.raw().toString() } else { return buffer.error(`Decoding of string type: ${tag} unsupported`) } } DERNode.prototype._decodeObjid = function decodeObjid (buffer, values, relative) { let result const identifiers = [] let ident = 0 let subident = 0 while (!buffer.isEmpty()) { subident = buffer.readUInt8() ident <<= 7 ident |= subident & 0x7f if ((subident & 0x80) === 0) { identifiers.push(ident) ident = 0 } } if (subident & 0x80) { identifiers.push(ident) } const first = (identifiers[0] / 40) | 0 const second = identifiers[0] % 40 if (relative) { result = identifiers } else { result = [first, second].concat(identifiers.slice(1)) } if (values) { let tmp = values[result.join(' ')] if (tmp === undefined) { tmp = values[result.join('.')] } if (tmp !== undefined) { result = tmp } } return result } DERNode.prototype._decodeTime = function decodeTime (buffer, tag) { const str = buffer.raw().toString() let year let mon let day let hour let min let sec if (tag === 'gentime') { year = str.slice(0, 4) | 0 mon = str.slice(4, 6) | 0 day = str.slice(6, 8) | 0 hour = str.slice(8, 10) | 0 min = str.slice(10, 12) | 0 sec = str.slice(12, 14) | 0 } else if (tag === 'utctime') { year = str.slice(0, 2) | 0 mon = str.slice(2, 4) | 0 day = str.slice(4, 6) | 0 hour = str.slice(6, 8) | 0 min = str.slice(8, 10) | 0 sec = str.slice(10, 12) | 0 if (year < 70) { year = 2000 + year } else { year = 1900 + year } } else { return buffer.error(`Decoding ${tag} time is not supported yet`) } return Date.UTC(year, mon - 1, day, hour, min, sec, 0) } DERNode.prototype._decodeNull = function decodeNull () { return null } DERNode.prototype._decodeBool = function decodeBool (buffer) { const res = buffer.readUInt8() if (buffer.isError(res)) { return res } else { return res !== 0 } } DERNode.prototype._decodeInt = function decodeInt (buffer, values) { // Bigint, return as it is (assume big endian) const raw = buffer.raw() let res = BigInt(`0x${raw.toString('hex')}`) if (values) { res = values[res.toString(10)] || res } return res } DERNode.prototype._use = function use (entity, obj) { if (typeof entity === 'function') { entity = entity(obj) } return entity._getDecoder('der').tree } // Utility methods function derDecodeTag (buf, fail) { let tag = buf.readUInt8(fail) if (buf.isError(tag)) { return tag } const cls = der.tagClass[tag >> 6] const primitive = (tag & 0x20) === 0 // Multi-octet tag - load if ((tag & 0x1f) === 0x1f) { let oct = tag tag = 0 while ((oct & 0x80) === 0x80) { oct = buf.readUInt8(fail) if (buf.isError(oct)) { return oct } tag <<= 7 tag |= oct & 0x7f } } else { tag &= 0x1f } const tagStr = der.tag[tag] return { cls: cls, primitive: primitive, tag: tag, tagStr: tagStr } } function derDecodeLen (buf, primitive, fail) { let len = buf.readUInt8(fail) if (buf.isError(len)) { return len } // Indefinite form if (!primitive && len === 0x80) { return null } // Definite form if ((len & 0x80) === 0) { // Short form return len } // Long form const num = len & 0x7f if (num > 4) { return buf.error('length octect is too long') } len = 0 for (let i = 0; i < num; i++) { len <<= 8 const j = buf.readUInt8(fail) if (buf.isError(j)) { return j } len |= j } return len } module.exports = DERDecoder /***/ }), /***/ 82975: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { module.exports = { der: __webpack_require__(44798), pem: __webpack_require__(33956) } /***/ }), /***/ 33956: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { const { inherits } = __webpack_require__(31669) const DERDecoder = __webpack_require__(44798) function PEMDecoder (entity) { DERDecoder.call(this, entity) this.enc = 'pem' } inherits(PEMDecoder, DERDecoder) PEMDecoder.prototype.decode = function decode (data, options) { const lines = data.toString().split(/[\r\n]+/g) const label = options.label.toUpperCase() const re = /^-----(BEGIN|END) ([^-]+)-----$/ let start = -1 let end = -1 for (let i = 0; i < lines.length; i++) { const match = lines[i].match(re) if (match === null) { continue } if (match[2] !== label) { continue } if (start === -1) { if (match[1] !== 'BEGIN') { break } start = i } else { if (match[1] !== 'END') { break } end = i break } } if (start === -1 || end === -1) { throw new Error(`PEM section not found for: ${label}`) } const base64 = lines.slice(start + 1, end).join('') // Remove excessive symbols base64.replace(/[^a-z0-9+/=]+/gi, '') const input = Buffer.from(base64, 'base64') return DERDecoder.prototype.decode.call(this, input, options) } module.exports = PEMDecoder /***/ }), /***/ 20846: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { /* global BigInt */ const { inherits } = __webpack_require__(31669) const Node = __webpack_require__(48674) const der = __webpack_require__(96018) function DEREncoder (entity) { this.enc = 'der' this.name = entity.name this.entity = entity // Construct base tree this.tree = new DERNode() this.tree._init(entity.body) } DEREncoder.prototype.encode = function encode (data, reporter) { return this.tree._encode(data, reporter).join() } // Tree methods function DERNode (parent) { Node.call(this, 'der', parent) } inherits(DERNode, Node) DERNode.prototype._encodeComposite = function encodeComposite (tag, primitive, cls, content) { const encodedTag = encodeTag(tag, primitive, cls, this.reporter) // Short form if (content.length < 0x80) { const header = Buffer.alloc(2) header[0] = encodedTag header[1] = content.length return this._createEncoderBuffer([header, content]) } // Long form // Count octets required to store length let lenOctets = 1 for (let i = content.length; i >= 0x100; i >>= 8) { lenOctets++ } const header = Buffer.alloc(1 + 1 + lenOctets) header[0] = encodedTag header[1] = 0x80 | lenOctets for (let i = 1 + lenOctets, j = content.length; j > 0; i--, j >>= 8) { header[i] = j & 0xff } return this._createEncoderBuffer([header, content]) } DERNode.prototype._encodeStr = function encodeStr (str, tag) { if (tag === 'bitstr') { return this._createEncoderBuffer([str.unused | 0, str.data]) } else if (tag === 'bmpstr') { const buf = Buffer.alloc(str.length * 2) for (let i = 0; i < str.length; i++) { buf.writeUInt16BE(str.charCodeAt(i), i * 2) } return this._createEncoderBuffer(buf) } else if (tag === 'numstr') { if (!this._isNumstr(str)) { return this.reporter.error('Encoding of string type: numstr supports only digits and space') } return this._createEncoderBuffer(str) } else if (tag === 'printstr') { if (!this._isPrintstr(str)) { 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') } return this._createEncoderBuffer(str) } else if (/str$/.test(tag)) { return this._createEncoderBuffer(str) } else if (tag === 'objDesc') { return this._createEncoderBuffer(str) } else { return this.reporter.error(`Encoding of string type: ${tag} unsupported`) } } DERNode.prototype._encodeObjid = function encodeObjid (id, values, relative) { if (typeof id === 'string') { if (!values) { return this.reporter.error('string objid given, but no values map found') } if (!Object.prototype.hasOwnProperty.call(values, id)) { return this.reporter.error('objid not found in values map') } id = values[id].split(/[\s.]+/g) for (let i = 0; i < id.length; i++) { id[i] |= 0 } } else if (Array.isArray(id)) { id = id.slice() for (let i = 0; i < id.length; i++) { id[i] |= 0 } } if (!Array.isArray(id)) { return this.reporter.error(`objid() should be either array or string, got: ${JSON.stringify(id)}`) } if (!relative) { if (id[1] >= 40) { return this.reporter.error('Second objid identifier OOB') } id.splice(0, 2, id[0] * 40 + id[1]) } // Count number of octets let size = 0 for (let i = 0; i < id.length; i++) { let ident = id[i] for (size++; ident >= 0x80; ident >>= 7) { size++ } } const objid = Buffer.alloc(size) let offset = objid.length - 1 for (let i = id.length - 1; i >= 0; i--) { let ident = id[i] objid[offset--] = ident & 0x7f while ((ident >>= 7) > 0) { objid[offset--] = 0x80 | (ident & 0x7f) } } return this._createEncoderBuffer(objid) } function two (num) { if (num < 10) { return `0${num}` } else { return num } } DERNode.prototype._encodeTime = function encodeTime (time, tag) { let str const date = new Date(time) if (tag === 'gentime') { str = [ two(date.getUTCFullYear()), two(date.getUTCMonth() + 1), two(date.getUTCDate()), two(date.getUTCHours()), two(date.getUTCMinutes()), two(date.getUTCSeconds()), 'Z' ].join('') } else if (tag === 'utctime') { str = [ two(date.getUTCFullYear() % 100), two(date.getUTCMonth() + 1), two(date.getUTCDate()), two(date.getUTCHours()), two(date.getUTCMinutes()), two(date.getUTCSeconds()), 'Z' ].join('') } else { this.reporter.error(`Encoding ${tag} time is not supported yet`) } return this._encodeStr(str, 'octstr') } DERNode.prototype._encodeNull = function encodeNull () { return this._createEncoderBuffer('') } function bnToBuf (bn) { var hex = BigInt(bn).toString(16) if (hex.length % 2) { hex = '0' + hex } var len = hex.length / 2 var u8 = new Uint8Array(len) var i = 0 var j = 0 while (i < len) { u8[i] = parseInt(hex.slice(j, j + 2), 16) i += 1 j += 2 } return u8 } DERNode.prototype._encodeInt = function encodeInt (num, values) { if (typeof num === 'string') { if (!values) { return this.reporter.error('String int or enum given, but no values map') } if (!Object.prototype.hasOwnProperty.call(values, num)) { return this.reporter.error(`Values map doesn't contain: ${JSON.stringify(num)}`) } num = values[num] } if (typeof num === 'bigint') { const numArray = [...bnToBuf(num)] if (numArray[0] & 0x80) { numArray.unshift(0) } num = Buffer.from(numArray) } if (Buffer.isBuffer(num)) { let size = num.length if (num.length === 0) { size++ } const out = Buffer.alloc(size) num.copy(out) if (num.length === 0) { out[0] = 0 } return this._createEncoderBuffer(out) } if (num < 0x80) { return this._createEncoderBuffer(num) } if (num < 0x100) { return this._createEncoderBuffer([0, num]) } let size = 1 for (let i = num; i >= 0x100; i >>= 8) { size++ } const out = new Array(size) for (let i = out.length - 1; i >= 0; i--) { out[i] = num & 0xff num >>= 8 } if (out[0] & 0x80) { out.unshift(0) } return this._createEncoderBuffer(Buffer.from(out)) } DERNode.prototype._encodeBool = function encodeBool (value) { return this._createEncoderBuffer(value ? 0xff : 0) } DERNode.prototype._use = function use (entity, obj) { if (typeof entity === 'function') { entity = entity(obj) } return entity._getEncoder('der').tree } DERNode.prototype._skipDefault = function skipDefault (dataBuffer, reporter, parent) { const state = this._baseState let i if (state.default === null) { return false } const data = dataBuffer.join() if (state.defaultBuffer === undefined) { state.defaultBuffer = this._encodeValue(state.default, reporter, parent).join() } if (data.length !== state.defaultBuffer.length) { return false } for (i = 0; i < data.length; i++) { if (data[i] !== state.defaultBuffer[i]) { return false } } return true } // Utility methods function encodeTag (tag, primitive, cls, reporter) { let res if (tag === 'seqof') { tag = 'seq' } else if (tag === 'setof') { tag = 'set' } 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}`) } if (res >= 0x1f) { return reporter.error('Multi-octet tag encoding unsupported') } if (!primitive) { res |= 0x20 } res |= (der.tagClassByName[cls || 'universal'] << 6) return res } module.exports = DEREncoder /***/ }), /***/ 2246: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { module.exports = { der: __webpack_require__(20846), pem: __webpack_require__(26217) } /***/ }), /***/ 26217: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { const { inherits } = __webpack_require__(31669) const DEREncoder = __webpack_require__(20846) function PEMEncoder (entity) { DEREncoder.call(this, entity) this.enc = 'pem' } inherits(PEMEncoder, DEREncoder) PEMEncoder.prototype.encode = function encode (data, options) { const buf = DEREncoder.prototype.encode.call(this, data) const p = buf.toString('base64') const out = [`-----BEGIN ${options.label}-----`] for (let i = 0; i < p.length; i += 64) { out.push(p.slice(i, i + 64)) } out.push(`-----END ${options.label}-----`) return out.join('\n') } module.exports = PEMEncoder /***/ }), /***/ 7678: /***/ ((module, exports, __webpack_require__) => { "use strict"; /// /// /// /// Object.defineProperty(exports, "__esModule", ({ value: true })); // TODO: Use the `URL` global when targeting Node.js 10 // tslint:disable-next-line const URLGlobal = typeof URL === 'undefined' ? __webpack_require__(78835).URL : URL; const toString = Object.prototype.toString; const isOfType = (type) => (value) => typeof value === type; const isBuffer = (input) => !is.nullOrUndefined(input) && !is.nullOrUndefined(input.constructor) && is.function_(input.constructor.isBuffer) && input.constructor.isBuffer(input); const getObjectType = (value) => { const objectName = toString.call(value).slice(8, -1); if (objectName) { return objectName; } return null; }; const isObjectOfType = (type) => (value) => getObjectType(value) === type; function is(value) { switch (value) { case null: return "null" /* null */; case true: case false: return "boolean" /* boolean */; default: } switch (typeof value) { case 'undefined': return "undefined" /* undefined */; case 'string': return "string" /* string */; case 'number': return "number" /* number */; case 'symbol': return "symbol" /* symbol */; default: } if (is.function_(value)) { return "Function" /* Function */; } if (is.observable(value)) { return "Observable" /* Observable */; } if (Array.isArray(value)) { return "Array" /* Array */; } if (isBuffer(value)) { return "Buffer" /* Buffer */; } const tagType = getObjectType(value); if (tagType) { return tagType; } if (value instanceof String || value instanceof Boolean || value instanceof Number) { throw new TypeError('Please don\'t use object wrappers for primitive types'); } return "Object" /* Object */; } (function (is) { // tslint:disable-next-line:strict-type-predicates const isObject = (value) => typeof value === 'object'; // tslint:disable:variable-name is.undefined = isOfType('undefined'); is.string = isOfType('string'); is.number = isOfType('number'); is.function_ = isOfType('function'); // tslint:disable-next-line:strict-type-predicates is.null_ = (value) => value === null; is.class_ = (value) => is.function_(value) && value.toString().startsWith('class '); is.boolean = (value) => value === true || value === false; is.symbol = isOfType('symbol'); // tslint:enable:variable-name is.numericString = (value) => is.string(value) && value.length > 0 && !Number.isNaN(Number(value)); is.array = Array.isArray; is.buffer = isBuffer; is.nullOrUndefined = (value) => is.null_(value) || is.undefined(value); is.object = (value) => !is.nullOrUndefined(value) && (is.function_(value) || isObject(value)); is.iterable = (value) => !is.nullOrUndefined(value) && is.function_(value[Symbol.iterator]); is.asyncIterable = (value) => !is.nullOrUndefined(value) && is.function_(value[Symbol.asyncIterator]); is.generator = (value) => is.iterable(value) && is.function_(value.next) && is.function_(value.throw); is.nativePromise = (value) => isObjectOfType("Promise" /* Promise */)(value); const hasPromiseAPI = (value) => !is.null_(value) && isObject(value) && is.function_(value.then) && is.function_(value.catch); is.promise = (value) => is.nativePromise(value) || hasPromiseAPI(value); is.generatorFunction = isObjectOfType("GeneratorFunction" /* GeneratorFunction */); is.asyncFunction = isObjectOfType("AsyncFunction" /* AsyncFunction */); is.boundFunction = (value) => is.function_(value) && !value.hasOwnProperty('prototype'); is.regExp = isObjectOfType("RegExp" /* RegExp */); is.date = isObjectOfType("Date" /* Date */); is.error = isObjectOfType("Error" /* Error */); is.map = (value) => isObjectOfType("Map" /* Map */)(value); is.set = (value) => isObjectOfType("Set" /* Set */)(value); is.weakMap = (value) => isObjectOfType("WeakMap" /* WeakMap */)(value); is.weakSet = (value) => isObjectOfType("WeakSet" /* WeakSet */)(value); is.int8Array = isObjectOfType("Int8Array" /* Int8Array */); is.uint8Array = isObjectOfType("Uint8Array" /* Uint8Array */); is.uint8ClampedArray = isObjectOfType("Uint8ClampedArray" /* Uint8ClampedArray */); is.int16Array = isObjectOfType("Int16Array" /* Int16Array */); is.uint16Array = isObjectOfType("Uint16Array" /* Uint16Array */); is.int32Array = isObjectOfType("Int32Array" /* Int32Array */); is.uint32Array = isObjectOfType("Uint32Array" /* Uint32Array */); is.float32Array = isObjectOfType("Float32Array" /* Float32Array */); is.float64Array = isObjectOfType("Float64Array" /* Float64Array */); is.arrayBuffer = isObjectOfType("ArrayBuffer" /* ArrayBuffer */); is.sharedArrayBuffer = isObjectOfType("SharedArrayBuffer" /* SharedArrayBuffer */); is.dataView = isObjectOfType("DataView" /* DataView */); is.directInstanceOf = (instance, klass) => Object.getPrototypeOf(instance) === klass.prototype; is.urlInstance = (value) => isObjectOfType("URL" /* URL */)(value); is.urlString = (value) => { if (!is.string(value)) { return false; } try { new URLGlobal(value); // tslint:disable-line no-unused-expression return true; } catch (_a) { return false; } }; is.truthy = (value) => Boolean(value); is.falsy = (value) => !value; is.nan = (value) => Number.isNaN(value); const primitiveTypes = new Set([ 'undefined', 'string', 'number', 'boolean', 'symbol' ]); is.primitive = (value) => is.null_(value) || primitiveTypes.has(typeof value); is.integer = (value) => Number.isInteger(value); is.safeInteger = (value) => Number.isSafeInteger(value); is.plainObject = (value) => { // From: https://github.com/sindresorhus/is-plain-obj/blob/master/index.js let prototype; return getObjectType(value) === "Object" /* Object */ && (prototype = Object.getPrototypeOf(value), prototype === null || // tslint:disable-line:ban-comma-operator prototype === Object.getPrototypeOf({})); }; const typedArrayTypes = new Set([ "Int8Array" /* Int8Array */, "Uint8Array" /* Uint8Array */, "Uint8ClampedArray" /* Uint8ClampedArray */, "Int16Array" /* Int16Array */, "Uint16Array" /* Uint16Array */, "Int32Array" /* Int32Array */, "Uint32Array" /* Uint32Array */, "Float32Array" /* Float32Array */, "Float64Array" /* Float64Array */ ]); is.typedArray = (value) => { const objectType = getObjectType(value); if (objectType === null) { return false; } return typedArrayTypes.has(objectType); }; const isValidLength = (value) => is.safeInteger(value) && value > -1; is.arrayLike = (value) => !is.nullOrUndefined(value) && !is.function_(value) && isValidLength(value.length); is.inRange = (value, range) => { if (is.number(range)) { return value >= Math.min(0, range) && value <= Math.max(range, 0); } if (is.array(range) && range.length === 2) { return value >= Math.min(...range) && value <= Math.max(...range); } throw new TypeError(`Invalid range: ${JSON.stringify(range)}`); }; const NODE_TYPE_ELEMENT = 1; const DOM_PROPERTIES_TO_CHECK = [ 'innerHTML', 'ownerDocument', 'style', 'attributes', 'nodeValue' ]; is.domElement = (value) => is.object(value) && value.nodeType === NODE_TYPE_ELEMENT && is.string(value.nodeName) && !is.plainObject(value) && DOM_PROPERTIES_TO_CHECK.every(property => property in value); is.observable = (value) => { if (!value) { return false; } if (value[Symbol.observable] && value === value[Symbol.observable]()) { return true; } if (value['@@observable'] && value === value['@@observable']()) { return true; } return false; }; is.nodeStream = (value) => !is.nullOrUndefined(value) && isObject(value) && is.function_(value.pipe) && !is.observable(value); is.infinite = (value) => value === Infinity || value === -Infinity; const isAbsoluteMod2 = (rem) => (value) => is.integer(value) && Math.abs(value % 2) === rem; is.even = isAbsoluteMod2(0); is.odd = isAbsoluteMod2(1); const isWhiteSpaceString = (value) => is.string(value) && /\S/.test(value) === false; is.emptyArray = (value) => is.array(value) && value.length === 0; is.nonEmptyArray = (value) => is.array(value) && value.length > 0; is.emptyString = (value) => is.string(value) && value.length === 0; is.nonEmptyString = (value) => is.string(value) && value.length > 0; is.emptyStringOrWhitespace = (value) => is.emptyString(value) || isWhiteSpaceString(value); is.emptyObject = (value) => is.object(value) && !is.map(value) && !is.set(value) && Object.keys(value).length === 0; is.nonEmptyObject = (value) => is.object(value) && !is.map(value) && !is.set(value) && Object.keys(value).length > 0; is.emptySet = (value) => is.set(value) && value.size === 0; is.nonEmptySet = (value) => is.set(value) && value.size > 0; is.emptyMap = (value) => is.map(value) && value.size === 0; is.nonEmptyMap = (value) => is.map(value) && value.size > 0; const predicateOnArray = (method, predicate, values) => { if (is.function_(predicate) === false) { throw new TypeError(`Invalid predicate: ${JSON.stringify(predicate)}`); } if (values.length === 0) { throw new TypeError('Invalid number of values'); } return method.call(values, predicate); }; // tslint:disable variable-name is.any = (predicate, ...values) => predicateOnArray(Array.prototype.some, predicate, values); is.all = (predicate, ...values) => predicateOnArray(Array.prototype.every, predicate, values); // tslint:enable variable-name })(is || (is = {})); // Some few keywords are reserved, but we'll populate them for Node.js users // See https://github.com/Microsoft/TypeScript/issues/2536 Object.defineProperties(is, { class: { value: is.class_ }, function: { value: is.function_ }, null: { value: is.null_ } }); exports.default = is; // For CommonJS default export support module.exports = is; module.exports.default = is; //# sourceMappingURL=index.js.map /***/ }), /***/ 19308: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; const deferToConnect = __webpack_require__(17611); module.exports = request => { const timings = { start: Date.now(), socket: null, lookup: null, connect: null, upload: null, response: null, end: null, error: null, phases: { wait: null, dns: null, tcp: null, request: null, firstByte: null, download: null, total: null } }; const handleError = origin => { const emit = origin.emit.bind(origin); origin.emit = (event, ...args) => { // Catches the `error` event if (event === 'error') { timings.error = Date.now(); timings.phases.total = timings.error - timings.start; origin.emit = emit; } // Saves the original behavior return emit(event, ...args); }; }; let uploadFinished = false; const onUpload = () => { timings.upload = Date.now(); timings.phases.request = timings.upload - timings.connect; }; handleError(request); request.once('socket', socket => { timings.socket = Date.now(); timings.phases.wait = timings.socket - timings.start; const lookupListener = () => { timings.lookup = Date.now(); timings.phases.dns = timings.lookup - timings.socket; }; socket.once('lookup', lookupListener); deferToConnect(socket, () => { timings.connect = Date.now(); if (timings.lookup === null) { socket.removeListener('lookup', lookupListener); timings.lookup = timings.connect; timings.phases.dns = timings.lookup - timings.socket; } timings.phases.tcp = timings.connect - timings.lookup; if (uploadFinished && !timings.upload) { onUpload(); } }); }); request.once('finish', () => { uploadFinished = true; if (timings.connect) { onUpload(); } }); request.once('response', response => { timings.response = Date.now(); timings.phases.firstByte = timings.response - timings.upload; handleError(response); response.once('end', () => { timings.end = Date.now(); timings.phases.download = timings.end - timings.response; timings.phases.total = timings.end - timings.start; }); }); return timings; }; /***/ }), /***/ 61231: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; const indentString = __webpack_require__(98043); const cleanStack = __webpack_require__(27972); const cleanInternalStack = stack => stack.replace(/\s+at .*aggregate-error\/index.js:\d+:\d+\)?/g, ''); class AggregateError extends Error { constructor(errors) { if (!Array.isArray(errors)) { throw new TypeError(`Expected input to be an Array, got ${typeof errors}`); } errors = [...errors].map(error => { if (error instanceof Error) { return error; } if (error !== null && typeof error === 'object') { // Handle plain error objects with message property and/or possibly other metadata return Object.assign(new Error(error.message), error); } return new Error(error); }); let message = errors .map(error => { // The `stack` property is not standardized, so we can't assume it exists return typeof error.stack === 'string' ? cleanInternalStack(cleanStack(error.stack)) : String(error); }) .join('\n'); message = '\n' + indentString(message, 4); super(message); this.name = 'AggregateError'; Object.defineProperty(this, '_errors', {value: errors}); } * [Symbol.iterator]() { for (const error of this._errors) { yield error; } } } module.exports = AggregateError; /***/ }), /***/ 64941: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; var compileSchema = __webpack_require__(875) , resolve = __webpack_require__(63896) , Cache = __webpack_require__(93679) , SchemaObject = __webpack_require__(37605) , stableStringify = __webpack_require__(30969) , formats = __webpack_require__(66627) , rules = __webpack_require__(68561) , $dataMetaSchema = __webpack_require__(21412) , util = __webpack_require__(76578); module.exports = Ajv; Ajv.prototype.validate = validate; Ajv.prototype.compile = compile; Ajv.prototype.addSchema = addSchema; Ajv.prototype.addMetaSchema = addMetaSchema; Ajv.prototype.validateSchema = validateSchema; Ajv.prototype.getSchema = getSchema; Ajv.prototype.removeSchema = removeSchema; Ajv.prototype.addFormat = addFormat; Ajv.prototype.errorsText = errorsText; Ajv.prototype._addSchema = _addSchema; Ajv.prototype._compile = _compile; Ajv.prototype.compileAsync = __webpack_require__(80890); var customKeyword = __webpack_require__(53297); Ajv.prototype.addKeyword = customKeyword.add; Ajv.prototype.getKeyword = customKeyword.get; Ajv.prototype.removeKeyword = customKeyword.remove; Ajv.prototype.validateKeyword = customKeyword.validate; var errorClasses = __webpack_require__(25726); Ajv.ValidationError = errorClasses.Validation; Ajv.MissingRefError = errorClasses.MissingRef; Ajv.$dataMetaSchema = $dataMetaSchema; var META_SCHEMA_ID = 'http://json-schema.org/draft-07/schema'; var META_IGNORE_OPTIONS = [ 'removeAdditional', 'useDefaults', 'coerceTypes', 'strictDefaults' ]; var META_SUPPORT_DATA = ['/properties']; /** * Creates validator instance. * Usage: `Ajv(opts)` * @param {Object} opts optional options * @return {Object} ajv instance */ function Ajv(opts) { if (!(this instanceof Ajv)) return new Ajv(opts); opts = this._opts = util.copy(opts) || {}; setLogger(this); this._schemas = {}; this._refs = {}; this._fragments = {}; this._formats = formats(opts.format); this._cache = opts.cache || new Cache; this._loadingSchemas = {}; this._compilations = []; this.RULES = rules(); this._getId = chooseGetId(opts); opts.loopRequired = opts.loopRequired || Infinity; if (opts.errorDataPath == 'property') opts._errorDataPathProperty = true; if (opts.serialize === undefined) opts.serialize = stableStringify; this._metaOpts = getMetaSchemaOptions(this); if (opts.formats) addInitialFormats(this); if (opts.keywords) addInitialKeywords(this); addDefaultMetaSchema(this); if (typeof opts.meta == 'object') this.addMetaSchema(opts.meta); if (opts.nullable) this.addKeyword('nullable', {metaSchema: {type: 'boolean'}}); addInitialSchemas(this); } /** * Validate data using schema * 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. * @this Ajv * @param {String|Object} schemaKeyRef key, ref or schema object * @param {Any} data to be validated * @return {Boolean} validation result. Errors from the last validation will be available in `ajv.errors` (and also in compiled schema: `schema.errors`). */ function validate(schemaKeyRef, data) { var v; if (typeof schemaKeyRef == 'string') { v = this.getSchema(schemaKeyRef); if (!v) throw new Error('no schema with key or ref "' + schemaKeyRef + '"'); } else { var schemaObj = this._addSchema(schemaKeyRef); v = schemaObj.validate || this._compile(schemaObj); } var valid = v(data); if (v.$async !== true) this.errors = v.errors; return valid; } /** * Create validating function for passed schema. * @this Ajv * @param {Object} schema schema object * @param {Boolean} _meta true if schema is a meta-schema. Used internally to compile meta schemas of custom keywords. * @return {Function} validating function */ function compile(schema, _meta) { var schemaObj = this._addSchema(schema, undefined, _meta); return schemaObj.validate || this._compile(schemaObj); } /** * Adds schema to the instance. * @this Ajv * @param {Object|Array} schema schema or array of schemas. If array is passed, `key` and other parameters will be ignored. * @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`. * @param {Boolean} _skipValidation true to skip schema validation. Used internally, option validateSchema should be used instead. * @param {Boolean} _meta true if schema is a meta-schema. Used internally, addMetaSchema should be used instead. * @return {Ajv} this for method chaining */ function addSchema(schema, key, _skipValidation, _meta) { if (Array.isArray(schema)){ for (var i=0; i} errors optional array of validation errors, if not passed errors from the instance are used. * @param {Object} options optional options with properties `separator` and `dataVar`. * @return {String} human readable string with all errors descriptions */ function errorsText(errors, options) { errors = errors || this.errors; if (!errors) return 'No errors'; options = options || {}; var separator = options.separator === undefined ? ', ' : options.separator; var dataVar = options.dataVar === undefined ? 'data' : options.dataVar; var text = ''; for (var i=0; i { "use strict"; var Cache = module.exports = function Cache() { this._cache = {}; }; Cache.prototype.put = function Cache_put(key, value) { this._cache[key] = value; }; Cache.prototype.get = function Cache_get(key) { return this._cache[key]; }; Cache.prototype.del = function Cache_del(key) { delete this._cache[key]; }; Cache.prototype.clear = function Cache_clear() { this._cache = {}; }; /***/ }), /***/ 80890: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; var MissingRefError = __webpack_require__(25726).MissingRef; module.exports = compileAsync; /** * Creates validating function for passed schema with asynchronous loading of missing schemas. * `loadSchema` option should be a function that accepts schema uri and returns promise that resolves with the schema. * @this Ajv * @param {Object} schema schema object * @param {Boolean} meta optional true to compile meta-schema; this parameter can be skipped * @param {Function} callback an optional node-style callback, it is called with 2 parameters: error (or null) and validating function. * @return {Promise} promise that resolves with a validating function. */ function compileAsync(schema, meta, callback) { /* eslint no-shadow: 0 */ /* global Promise */ /* jshint validthis: true */ var self = this; if (typeof this._opts.loadSchema != 'function') throw new Error('options.loadSchema should be a function'); if (typeof meta == 'function') { callback = meta; meta = undefined; } var p = loadMetaSchemaOf(schema).then(function () { var schemaObj = self._addSchema(schema, undefined, meta); return schemaObj.validate || _compileAsync(schemaObj); }); if (callback) { p.then( function(v) { callback(null, v); }, callback ); } return p; function loadMetaSchemaOf(sch) { var $schema = sch.$schema; return $schema && !self.getSchema($schema) ? compileAsync.call(self, { $ref: $schema }, true) : Promise.resolve(); } function _compileAsync(schemaObj) { try { return self._compile(schemaObj); } catch(e) { if (e instanceof MissingRefError) return loadMissingSchema(e); throw e; } function loadMissingSchema(e) { var ref = e.missingSchema; if (added(ref)) throw new Error('Schema ' + ref + ' is loaded but ' + e.missingRef + ' cannot be resolved'); var schemaPromise = self._loadingSchemas[ref]; if (!schemaPromise) { schemaPromise = self._loadingSchemas[ref] = self._opts.loadSchema(ref); schemaPromise.then(removePromise, removePromise); } return schemaPromise.then(function (sch) { if (!added(ref)) { return loadMetaSchemaOf(sch).then(function () { if (!added(ref)) self.addSchema(sch, ref, undefined, meta); }); } }).then(function() { return _compileAsync(schemaObj); }); function removePromise() { delete self._loadingSchemas[ref]; } function added(ref) { return self._refs[ref] || self._schemas[ref]; } } } } /***/ }), /***/ 25726: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; var resolve = __webpack_require__(63896); module.exports = { Validation: errorSubclass(ValidationError), MissingRef: errorSubclass(MissingRefError) }; function ValidationError(errors) { this.message = 'validation failed'; this.errors = errors; this.ajv = this.validation = true; } MissingRefError.message = function (baseId, ref) { return 'can\'t resolve reference ' + ref + ' from id ' + baseId; }; function MissingRefError(baseId, ref, message) { this.message = message || MissingRefError.message(baseId, ref); this.missingRef = resolve.url(baseId, ref); this.missingSchema = resolve.normalizeId(resolve.fullPath(this.missingRef)); } function errorSubclass(Subclass) { Subclass.prototype = Object.create(Error.prototype); Subclass.prototype.constructor = Subclass; return Subclass; } /***/ }), /***/ 66627: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; var util = __webpack_require__(76578); var DATE = /^(\d\d\d\d)-(\d\d)-(\d\d)$/; var DAYS = [0,31,28,31,30,31,30,31,31,30,31,30,31]; var TIME = /^(\d\d):(\d\d):(\d\d)(\.\d+)?(z|[+-]\d\d(?::?\d\d)?)?$/i; var HOSTNAME = /^(?=.{1,253}\.?$)[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[-0-9a-z]{0,61}[0-9a-z])?)*\.?$/i; var URI = /^(?:[a-z][a-z0-9+\-.]*:)(?:\/?\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:(?:[0-9a-f]{1,4}:){6}|::(?:[0-9a-f]{1,4}:){5}|(?:[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){4}|(?:(?:[0-9a-f]{1,4}:){0,1}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){3}|(?:(?:[0-9a-f]{1,4}:){0,2}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){2}|(?:(?:[0-9a-f]{1,4}:){0,3}[0-9a-f]{1,4})?::[0-9a-f]{1,4}:|(?:(?:[0-9a-f]{1,4}:){0,4}[0-9a-f]{1,4})?::)(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?))|(?:(?:[0-9a-f]{1,4}:){0,5}[0-9a-f]{1,4})?::[0-9a-f]{1,4}|(?:(?:[0-9a-f]{1,4}:){0,6}[0-9a-f]{1,4})?::)|[Vv][0-9a-f]+\.[a-z0-9\-._~!$&'()*+,;=:]+)\]|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)|(?:[a-z0-9\-._~!$&'()*+,;=]|%[0-9a-f]{2})*)(?::\d*)?(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*|\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)(?:\?(?:[a-z0-9\-._~!$&'()*+,;=:@/?]|%[0-9a-f]{2})*)?(?:#(?:[a-z0-9\-._~!$&'()*+,;=:@/?]|%[0-9a-f]{2})*)?$/i; var URIREF = /^(?:[a-z][a-z0-9+\-.]*:)?(?:\/?\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:(?:[0-9a-f]{1,4}:){6}|::(?:[0-9a-f]{1,4}:){5}|(?:[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){4}|(?:(?:[0-9a-f]{1,4}:){0,1}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){3}|(?:(?:[0-9a-f]{1,4}:){0,2}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){2}|(?:(?:[0-9a-f]{1,4}:){0,3}[0-9a-f]{1,4})?::[0-9a-f]{1,4}:|(?:(?:[0-9a-f]{1,4}:){0,4}[0-9a-f]{1,4})?::)(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?))|(?:(?:[0-9a-f]{1,4}:){0,5}[0-9a-f]{1,4})?::[0-9a-f]{1,4}|(?:(?:[0-9a-f]{1,4}:){0,6}[0-9a-f]{1,4})?::)|[Vv][0-9a-f]+\.[a-z0-9\-._~!$&'()*+,;=:]+)\]|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)|(?:[a-z0-9\-._~!$&'"()*+,;=]|%[0-9a-f]{2})*)(?::\d*)?(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*|\/(?:(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*)?(?:\?(?:[a-z0-9\-._~!$&'"()*+,;=:@/?]|%[0-9a-f]{2})*)?(?:#(?:[a-z0-9\-._~!$&'"()*+,;=:@/?]|%[0-9a-f]{2})*)?$/i; // uri-template: https://tools.ietf.org/html/rfc6570 var URITEMPLATE = /^(?:(?:[^\x00-\x20"'<>%\\^`{|}]|%[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; // For the source: https://gist.github.com/dperini/729294 // For test cases: https://mathiasbynens.be/demo/url-regex // @todo Delete current URL in favour of the commented out URL rule when this issue is fixed https://github.com/eslint/eslint/issues/7983. // 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; var 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; var UUID = /^(?:urn:uuid:)?[0-9a-f]{8}-(?:[0-9a-f]{4}-){3}[0-9a-f]{12}$/i; var JSON_POINTER = /^(?:\/(?:[^~/]|~0|~1)*)*$/; var JSON_POINTER_URI_FRAGMENT = /^#(?:\/(?:[a-z0-9_\-.!$&'()*+,;:=@]|%[0-9a-f]{2}|~0|~1)*)*$/i; var RELATIVE_JSON_POINTER = /^(?:0|[1-9][0-9]*)(?:#|(?:\/(?:[^~/]|~0|~1)*)*)$/; module.exports = formats; function formats(mode) { mode = mode == 'full' ? 'full' : 'fast'; return util.copy(formats[mode]); } formats.fast = { // date: http://tools.ietf.org/html/rfc3339#section-5.6 date: /^\d\d\d\d-[0-1]\d-[0-3]\d$/, // date-time: http://tools.ietf.org/html/rfc3339#section-5.6 time: /^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)?$/i, '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, // uri: https://github.com/mafintosh/is-my-json-valid/blob/master/formats.js uri: /^(?:[a-z][a-z0-9+\-.]*:)(?:\/?\/)?[^\s]*$/i, 'uri-reference': /^(?:(?:[a-z][a-z0-9+\-.]*:)?\/?\/)?(?:[^\\\s#][^\s#]*)?(?:#[^\\\s]*)?$/i, 'uri-template': URITEMPLATE, url: URL, // email (sources from jsen validator): // http://stackoverflow.com/questions/201323/using-a-regular-expression-to-validate-an-email-address#answer-8829363 // http://www.w3.org/TR/html5/forms.html#valid-e-mail-address (search for 'willful violation') 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, hostname: HOSTNAME, // optimized https://www.safaribooksonline.com/library/view/regular-expressions-cookbook/9780596802837/ch07s16.html ipv4: /^(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)$/, // optimized http://stackoverflow.com/questions/53497/regular-expression-that-matches-valid-ipv6-addresses 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, regex: regex, // uuid: http://tools.ietf.org/html/rfc4122 uuid: UUID, // JSON-pointer: https://tools.ietf.org/html/rfc6901 // uri fragment: https://tools.ietf.org/html/rfc3986#appendix-A 'json-pointer': JSON_POINTER, 'json-pointer-uri-fragment': JSON_POINTER_URI_FRAGMENT, // relative JSON-pointer: http://tools.ietf.org/html/draft-luff-relative-json-pointer-00 'relative-json-pointer': RELATIVE_JSON_POINTER }; formats.full = { date: date, time: time, 'date-time': date_time, uri: uri, 'uri-reference': URIREF, 'uri-template': URITEMPLATE, url: URL, 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, hostname: HOSTNAME, ipv4: /^(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)$/, 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, regex: regex, uuid: UUID, 'json-pointer': JSON_POINTER, 'json-pointer-uri-fragment': JSON_POINTER_URI_FRAGMENT, 'relative-json-pointer': RELATIVE_JSON_POINTER }; function isLeapYear(year) { // https://tools.ietf.org/html/rfc3339#appendix-C return year % 4 === 0 && (year % 100 !== 0 || year % 400 === 0); } function date(str) { // full-date from http://tools.ietf.org/html/rfc3339#section-5.6 var matches = str.match(DATE); if (!matches) return false; var year = +matches[1]; var month = +matches[2]; var day = +matches[3]; return month >= 1 && month <= 12 && day >= 1 && day <= (month == 2 && isLeapYear(year) ? 29 : DAYS[month]); } function time(str, full) { var matches = str.match(TIME); if (!matches) return false; var hour = matches[1]; var minute = matches[2]; var second = matches[3]; var timeZone = matches[5]; return ((hour <= 23 && minute <= 59 && second <= 59) || (hour == 23 && minute == 59 && second == 60)) && (!full || timeZone); } var DATE_TIME_SEPARATOR = /t|\s/i; function date_time(str) { // http://tools.ietf.org/html/rfc3339#section-5.6 var dateTime = str.split(DATE_TIME_SEPARATOR); return dateTime.length == 2 && date(dateTime[0]) && time(dateTime[1], true); } var NOT_URI_FRAGMENT = /\/|:/; function uri(str) { // http://jmrware.com/articles/2009/uri_regexp/URI_regex.html + optional protocol + required "." return NOT_URI_FRAGMENT.test(str) && URI.test(str); } var Z_ANCHOR = /[^\\]\\Z/; function regex(str) { if (Z_ANCHOR.test(str)) return false; try { new RegExp(str); return true; } catch(e) { return false; } } /***/ }), /***/ 875: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; var resolve = __webpack_require__(63896) , util = __webpack_require__(76578) , errorClasses = __webpack_require__(25726) , stableStringify = __webpack_require__(30969); var validateGenerator = __webpack_require__(49585); /** * Functions below are used inside compiled validations function */ var ucs2length = util.ucs2length; var equal = __webpack_require__(28206); // this error is thrown by async schemas to return validation errors via exception var ValidationError = errorClasses.Validation; module.exports = compile; /** * Compiles schema to validation function * @this Ajv * @param {Object} schema schema object * @param {Object} root object with information about the root schema for this schema * @param {Object} localRefs the hash of local references inside the schema (created by resolve.id), used for inline resolution * @param {String} baseId base ID for IDs in the schema * @return {Function} validation function */ function compile(schema, root, localRefs, baseId) { /* jshint validthis: true, evil: true */ /* eslint no-shadow: 0 */ var self = this , opts = this._opts , refVal = [ undefined ] , refs = {} , patterns = [] , patternsHash = {} , defaults = [] , defaultsHash = {} , customRules = []; root = root || { schema: schema, refVal: refVal, refs: refs }; var c = checkCompiling.call(this, schema, root, baseId); var compilation = this._compilations[c.index]; if (c.compiling) return (compilation.callValidate = callValidate); var formats = this._formats; var RULES = this.RULES; try { var v = localCompile(schema, root, localRefs, baseId); compilation.validate = v; var cv = compilation.callValidate; if (cv) { cv.schema = v.schema; cv.errors = null; cv.refs = v.refs; cv.refVal = v.refVal; cv.root = v.root; cv.$async = v.$async; if (opts.sourceCode) cv.source = v.source; } return v; } finally { endCompiling.call(this, schema, root, baseId); } /* @this {*} - custom context, see passContext option */ function callValidate() { /* jshint validthis: true */ var validate = compilation.validate; var result = validate.apply(this, arguments); callValidate.errors = validate.errors; return result; } function localCompile(_schema, _root, localRefs, baseId) { var isRoot = !_root || (_root && _root.schema == _schema); if (_root.schema != root.schema) return compile.call(self, _schema, _root, localRefs, baseId); var $async = _schema.$async === true; var sourceCode = validateGenerator({ isTop: true, schema: _schema, isRoot: isRoot, baseId: baseId, root: _root, schemaPath: '', errSchemaPath: '#', errorPath: '""', MissingRefError: errorClasses.MissingRef, RULES: RULES, validate: validateGenerator, util: util, resolve: resolve, resolveRef: resolveRef, usePattern: usePattern, useDefault: useDefault, useCustomRule: useCustomRule, opts: opts, formats: formats, logger: self.logger, self: self }); sourceCode = vars(refVal, refValCode) + vars(patterns, patternCode) + vars(defaults, defaultCode) + vars(customRules, customRuleCode) + sourceCode; if (opts.processCode) sourceCode = opts.processCode(sourceCode, _schema); // console.log('\n\n\n *** \n', JSON.stringify(sourceCode)); var validate; try { var makeValidate = new Function( 'self', 'RULES', 'formats', 'root', 'refVal', 'defaults', 'customRules', 'equal', 'ucs2length', 'ValidationError', sourceCode ); validate = makeValidate( self, RULES, formats, root, refVal, defaults, customRules, equal, ucs2length, ValidationError ); refVal[0] = validate; } catch(e) { self.logger.error('Error compiling schema, function code:', sourceCode); throw e; } validate.schema = _schema; validate.errors = null; validate.refs = refs; validate.refVal = refVal; validate.root = isRoot ? validate : _root; if ($async) validate.$async = true; if (opts.sourceCode === true) { validate.source = { code: sourceCode, patterns: patterns, defaults: defaults }; } return validate; } function resolveRef(baseId, ref, isRoot) { ref = resolve.url(baseId, ref); var refIndex = refs[ref]; var _refVal, refCode; if (refIndex !== undefined) { _refVal = refVal[refIndex]; refCode = 'refVal[' + refIndex + ']'; return resolvedRef(_refVal, refCode); } if (!isRoot && root.refs) { var rootRefId = root.refs[ref]; if (rootRefId !== undefined) { _refVal = root.refVal[rootRefId]; refCode = addLocalRef(ref, _refVal); return resolvedRef(_refVal, refCode); } } refCode = addLocalRef(ref); var v = resolve.call(self, localCompile, root, ref); if (v === undefined) { var localSchema = localRefs && localRefs[ref]; if (localSchema) { v = resolve.inlineRef(localSchema, opts.inlineRefs) ? localSchema : compile.call(self, localSchema, root, localRefs, baseId); } } if (v === undefined) { removeLocalRef(ref); } else { replaceLocalRef(ref, v); return resolvedRef(v, refCode); } } function addLocalRef(ref, v) { var refId = refVal.length; refVal[refId] = v; refs[ref] = refId; return 'refVal' + refId; } function removeLocalRef(ref) { delete refs[ref]; } function replaceLocalRef(ref, v) { var refId = refs[ref]; refVal[refId] = v; } function resolvedRef(refVal, code) { return typeof refVal == 'object' || typeof refVal == 'boolean' ? { code: code, schema: refVal, inline: true } : { code: code, $async: refVal && !!refVal.$async }; } function usePattern(regexStr) { var index = patternsHash[regexStr]; if (index === undefined) { index = patternsHash[regexStr] = patterns.length; patterns[index] = regexStr; } return 'pattern' + index; } function useDefault(value) { switch (typeof value) { case 'boolean': case 'number': return '' + value; case 'string': return util.toQuotedString(value); case 'object': if (value === null) return 'null'; var valueStr = stableStringify(value); var index = defaultsHash[valueStr]; if (index === undefined) { index = defaultsHash[valueStr] = defaults.length; defaults[index] = value; } return 'default' + index; } } function useCustomRule(rule, schema, parentSchema, it) { if (self._opts.validateSchema !== false) { var deps = rule.definition.dependencies; if (deps && !deps.every(function(keyword) { return Object.prototype.hasOwnProperty.call(parentSchema, keyword); })) throw new Error('parent schema must have all required keywords: ' + deps.join(',')); var validateSchema = rule.definition.validateSchema; if (validateSchema) { var valid = validateSchema(schema); if (!valid) { var message = 'keyword schema is invalid: ' + self.errorsText(validateSchema.errors); if (self._opts.validateSchema == 'log') self.logger.error(message); else throw new Error(message); } } } var compile = rule.definition.compile , inline = rule.definition.inline , macro = rule.definition.macro; var validate; if (compile) { validate = compile.call(self, schema, parentSchema, it); } else if (macro) { validate = macro.call(self, schema, parentSchema, it); if (opts.validateSchema !== false) self.validateSchema(validate, true); } else if (inline) { validate = inline.call(self, it, rule.keyword, schema, parentSchema); } else { validate = rule.definition.validate; if (!validate) return; } if (validate === undefined) throw new Error('custom keyword "' + rule.keyword + '"failed to compile'); var index = customRules.length; customRules[index] = validate; return { code: 'customRule' + index, validate: validate }; } } /** * Checks if the schema is currently compiled * @this Ajv * @param {Object} schema schema to compile * @param {Object} root root object * @param {String} baseId base schema ID * @return {Object} object with properties "index" (compilation index) and "compiling" (boolean) */ function checkCompiling(schema, root, baseId) { /* jshint validthis: true */ var index = compIndex.call(this, schema, root, baseId); if (index >= 0) return { index: index, compiling: true }; index = this._compilations.length; this._compilations[index] = { schema: schema, root: root, baseId: baseId }; return { index: index, compiling: false }; } /** * Removes the schema from the currently compiled list * @this Ajv * @param {Object} schema schema to compile * @param {Object} root root object * @param {String} baseId base schema ID */ function endCompiling(schema, root, baseId) { /* jshint validthis: true */ var i = compIndex.call(this, schema, root, baseId); if (i >= 0) this._compilations.splice(i, 1); } /** * Index of schema compilation in the currently compiled list * @this Ajv * @param {Object} schema schema to compile * @param {Object} root root object * @param {String} baseId base schema ID * @return {Integer} compilation index */ function compIndex(schema, root, baseId) { /* jshint validthis: true */ for (var i=0; i { "use strict"; var URI = __webpack_require__(70020) , equal = __webpack_require__(28206) , util = __webpack_require__(76578) , SchemaObject = __webpack_require__(37605) , traverse = __webpack_require__(52533); module.exports = resolve; resolve.normalizeId = normalizeId; resolve.fullPath = getFullPath; resolve.url = resolveUrl; resolve.ids = resolveIds; resolve.inlineRef = inlineRef; resolve.schema = resolveSchema; /** * [resolve and compile the references ($ref)] * @this Ajv * @param {Function} compile reference to schema compilation funciton (localCompile) * @param {Object} root object with information about the root schema for the current schema * @param {String} ref reference to resolve * @return {Object|Function} schema object (if the schema can be inlined) or validation function */ function resolve(compile, root, ref) { /* jshint validthis: true */ var refVal = this._refs[ref]; if (typeof refVal == 'string') { if (this._refs[refVal]) refVal = this._refs[refVal]; else return resolve.call(this, compile, root, refVal); } refVal = refVal || this._schemas[ref]; if (refVal instanceof SchemaObject) { return inlineRef(refVal.schema, this._opts.inlineRefs) ? refVal.schema : refVal.validate || this._compile(refVal); } var res = resolveSchema.call(this, root, ref); var schema, v, baseId; if (res) { schema = res.schema; root = res.root; baseId = res.baseId; } if (schema instanceof SchemaObject) { v = schema.validate || compile.call(this, schema.schema, root, undefined, baseId); } else if (schema !== undefined) { v = inlineRef(schema, this._opts.inlineRefs) ? schema : compile.call(this, schema, root, undefined, baseId); } return v; } /** * Resolve schema, its root and baseId * @this Ajv * @param {Object} root root object with properties schema, refVal, refs * @param {String} ref reference to resolve * @return {Object} object with properties schema, root, baseId */ function resolveSchema(root, ref) { /* jshint validthis: true */ var p = URI.parse(ref) , refPath = _getFullPath(p) , baseId = getFullPath(this._getId(root.schema)); if (Object.keys(root.schema).length === 0 || refPath !== baseId) { var id = normalizeId(refPath); var refVal = this._refs[id]; if (typeof refVal == 'string') { return resolveRecursive.call(this, root, refVal, p); } else if (refVal instanceof SchemaObject) { if (!refVal.validate) this._compile(refVal); root = refVal; } else { refVal = this._schemas[id]; if (refVal instanceof SchemaObject) { if (!refVal.validate) this._compile(refVal); if (id == normalizeId(ref)) return { schema: refVal, root: root, baseId: baseId }; root = refVal; } else { return; } } if (!root.schema) return; baseId = getFullPath(this._getId(root.schema)); } return getJsonPointer.call(this, p, baseId, root.schema, root); } /* @this Ajv */ function resolveRecursive(root, ref, parsedRef) { /* jshint validthis: true */ var res = resolveSchema.call(this, root, ref); if (res) { var schema = res.schema; var baseId = res.baseId; root = res.root; var id = this._getId(schema); if (id) baseId = resolveUrl(baseId, id); return getJsonPointer.call(this, parsedRef, baseId, schema, root); } } var PREVENT_SCOPE_CHANGE = util.toHash(['properties', 'patternProperties', 'enum', 'dependencies', 'definitions']); /* @this Ajv */ function getJsonPointer(parsedRef, baseId, schema, root) { /* jshint validthis: true */ parsedRef.fragment = parsedRef.fragment || ''; if (parsedRef.fragment.slice(0,1) != '/') return; var parts = parsedRef.fragment.split('/'); for (var i = 1; i < parts.length; i++) { var part = parts[i]; if (part) { part = util.unescapeFragment(part); schema = schema[part]; if (schema === undefined) break; var id; if (!PREVENT_SCOPE_CHANGE[part]) { id = this._getId(schema); if (id) baseId = resolveUrl(baseId, id); if (schema.$ref) { var $ref = resolveUrl(baseId, schema.$ref); var res = resolveSchema.call(this, root, $ref); if (res) { schema = res.schema; root = res.root; baseId = res.baseId; } } } } } if (schema !== undefined && schema !== root.schema) return { schema: schema, root: root, baseId: baseId }; } var SIMPLE_INLINED = util.toHash([ 'type', 'format', 'pattern', 'maxLength', 'minLength', 'maxProperties', 'minProperties', 'maxItems', 'minItems', 'maximum', 'minimum', 'uniqueItems', 'multipleOf', 'required', 'enum' ]); function inlineRef(schema, limit) { if (limit === false) return false; if (limit === undefined || limit === true) return checkNoRef(schema); else if (limit) return countKeys(schema) <= limit; } function checkNoRef(schema) { var item; if (Array.isArray(schema)) { for (var i=0; i { "use strict"; var ruleModules = __webpack_require__(85810) , toHash = __webpack_require__(76578).toHash; module.exports = function rules() { var RULES = [ { type: 'number', rules: [ { 'maximum': ['exclusiveMaximum'] }, { 'minimum': ['exclusiveMinimum'] }, 'multipleOf', 'format'] }, { type: 'string', rules: [ 'maxLength', 'minLength', 'pattern', 'format' ] }, { type: 'array', rules: [ 'maxItems', 'minItems', 'items', 'contains', 'uniqueItems' ] }, { type: 'object', rules: [ 'maxProperties', 'minProperties', 'required', 'dependencies', 'propertyNames', { 'properties': ['additionalProperties', 'patternProperties'] } ] }, { rules: [ '$ref', 'const', 'enum', 'not', 'anyOf', 'oneOf', 'allOf', 'if' ] } ]; var ALL = [ 'type', '$comment' ]; var KEYWORDS = [ '$schema', '$id', 'id', '$data', '$async', 'title', 'description', 'default', 'definitions', 'examples', 'readOnly', 'writeOnly', 'contentMediaType', 'contentEncoding', 'additionalItems', 'then', 'else' ]; var TYPES = [ 'number', 'integer', 'string', 'array', 'object', 'boolean', 'null' ]; RULES.all = toHash(ALL); RULES.types = toHash(TYPES); RULES.forEach(function (group) { group.rules = group.rules.map(function (keyword) { var implKeywords; if (typeof keyword == 'object') { var key = Object.keys(keyword)[0]; implKeywords = keyword[key]; keyword = key; implKeywords.forEach(function (k) { ALL.push(k); RULES.all[k] = true; }); } ALL.push(keyword); var rule = RULES.all[keyword] = { keyword: keyword, code: ruleModules[keyword], implements: implKeywords }; return rule; }); RULES.all.$comment = { keyword: '$comment', code: ruleModules.$comment }; if (group.type) RULES.types[group.type] = group; }); RULES.keywords = toHash(ALL.concat(KEYWORDS)); RULES.custom = {}; return RULES; }; /***/ }), /***/ 37605: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; var util = __webpack_require__(76578); module.exports = SchemaObject; function SchemaObject(obj) { util.copy(obj, this); } /***/ }), /***/ 64580: /***/ ((module) => { "use strict"; // https://mathiasbynens.be/notes/javascript-encoding // https://github.com/bestiejs/punycode.js - punycode.ucs2.decode module.exports = function ucs2length(str) { var length = 0 , len = str.length , pos = 0 , value; while (pos < len) { length++; value = str.charCodeAt(pos++); if (value >= 0xD800 && value <= 0xDBFF && pos < len) { // high surrogate, and there is a next character value = str.charCodeAt(pos); if ((value & 0xFC00) == 0xDC00) pos++; // low surrogate } } return length; }; /***/ }), /***/ 76578: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; module.exports = { copy: copy, checkDataType: checkDataType, checkDataTypes: checkDataTypes, coerceToTypes: coerceToTypes, toHash: toHash, getProperty: getProperty, escapeQuotes: escapeQuotes, equal: __webpack_require__(28206), ucs2length: __webpack_require__(64580), varOccurences: varOccurences, varReplace: varReplace, schemaHasRules: schemaHasRules, schemaHasRulesExcept: schemaHasRulesExcept, schemaUnknownRules: schemaUnknownRules, toQuotedString: toQuotedString, getPathExpr: getPathExpr, getPath: getPath, getData: getData, unescapeFragment: unescapeFragment, unescapeJsonPointer: unescapeJsonPointer, escapeFragment: escapeFragment, escapeJsonPointer: escapeJsonPointer }; function copy(o, to) { to = to || {}; for (var key in o) to[key] = o[key]; return to; } function checkDataType(dataType, data, strictNumbers, negate) { var EQUAL = negate ? ' !== ' : ' === ' , AND = negate ? ' || ' : ' && ' , OK = negate ? '!' : '' , NOT = negate ? '' : '!'; switch (dataType) { case 'null': return data + EQUAL + 'null'; case 'array': return OK + 'Array.isArray(' + data + ')'; case 'object': return '(' + OK + data + AND + 'typeof ' + data + EQUAL + '"object"' + AND + NOT + 'Array.isArray(' + data + '))'; case 'integer': return '(typeof ' + data + EQUAL + '"number"' + AND + NOT + '(' + data + ' % 1)' + AND + data + EQUAL + data + (strictNumbers ? (AND + OK + 'isFinite(' + data + ')') : '') + ')'; case 'number': return '(typeof ' + data + EQUAL + '"' + dataType + '"' + (strictNumbers ? (AND + OK + 'isFinite(' + data + ')') : '') + ')'; default: return 'typeof ' + data + EQUAL + '"' + dataType + '"'; } } function checkDataTypes(dataTypes, data, strictNumbers) { switch (dataTypes.length) { case 1: return checkDataType(dataTypes[0], data, strictNumbers, true); default: var code = ''; var types = toHash(dataTypes); if (types.array && types.object) { code = types.null ? '(': '(!' + data + ' || '; code += 'typeof ' + data + ' !== "object")'; delete types.null; delete types.array; delete types.object; } if (types.number) delete types.integer; for (var t in types) code += (code ? ' && ' : '' ) + checkDataType(t, data, strictNumbers, true); return code; } } var COERCE_TO_TYPES = toHash([ 'string', 'number', 'integer', 'boolean', 'null' ]); function coerceToTypes(optionCoerceTypes, dataTypes) { if (Array.isArray(dataTypes)) { var types = []; for (var i=0; i= lvl) throw new Error('Cannot access property/index ' + up + ' levels up, current level is ' + lvl); return paths[lvl - up]; } if (up > lvl) throw new Error('Cannot access data ' + up + ' levels up, current level is ' + lvl); data = 'data' + ((lvl - up) || ''); if (!jsonPointer) return data; } var expr = data; var segments = jsonPointer.split('/'); for (var i=0; i { "use strict"; var KEYWORDS = [ 'multipleOf', 'maximum', 'exclusiveMaximum', 'minimum', 'exclusiveMinimum', 'maxLength', 'minLength', 'pattern', 'additionalItems', 'maxItems', 'minItems', 'uniqueItems', 'maxProperties', 'minProperties', 'required', 'additionalProperties', 'enum', 'format', 'const' ]; module.exports = function (metaSchema, keywordsJsonPointers) { for (var i=0; i { "use strict"; var metaSchema = __webpack_require__(40038); module.exports = { $id: 'https://github.com/ajv-validator/ajv/blob/master/lib/definition_schema.js', definitions: { simpleTypes: metaSchema.definitions.simpleTypes }, type: 'object', dependencies: { schema: ['validate'], $data: ['validate'], statements: ['inline'], valid: {not: {required: ['macro']}} }, properties: { type: metaSchema.properties.type, schema: {type: 'boolean'}, statements: {type: 'boolean'}, dependencies: { type: 'array', items: {type: 'string'} }, metaSchema: {type: 'object'}, modifying: {type: 'boolean'}, valid: {type: 'boolean'}, $data: {type: 'boolean'}, async: {type: 'boolean'}, errors: { anyOf: [ {type: 'boolean'}, {const: 'full'} ] } } }; /***/ }), /***/ 7404: /***/ ((module) => { "use strict"; module.exports = function generate__limit(it, $keyword, $ruleType) { var out = ' '; var $lvl = it.level; var $dataLvl = it.dataLevel; var $schema = it.schema[$keyword]; var $schemaPath = it.schemaPath + it.util.getProperty($keyword); var $errSchemaPath = it.errSchemaPath + '/' + $keyword; var $breakOnError = !it.opts.allErrors; var $errorKeyword; var $data = 'data' + ($dataLvl || ''); var $isData = it.opts.$data && $schema && $schema.$data, $schemaValue; if ($isData) { out += ' var schema' + ($lvl) + ' = ' + (it.util.getData($schema.$data, $dataLvl, it.dataPathArr)) + '; '; $schemaValue = 'schema' + $lvl; } else { $schemaValue = $schema; } var $isMax = $keyword == 'maximum', $exclusiveKeyword = $isMax ? 'exclusiveMaximum' : 'exclusiveMinimum', $schemaExcl = it.schema[$exclusiveKeyword], $isDataExcl = it.opts.$data && $schemaExcl && $schemaExcl.$data, $op = $isMax ? '<' : '>', $notOp = $isMax ? '>' : '<', $errorKeyword = undefined; if (!($isData || typeof $schema == 'number' || $schema === undefined)) { throw new Error($keyword + ' must be number'); } if (!($isDataExcl || $schemaExcl === undefined || typeof $schemaExcl == 'number' || typeof $schemaExcl == 'boolean')) { throw new Error($exclusiveKeyword + ' must be number or boolean'); } if ($isDataExcl) { var $schemaValueExcl = it.util.getData($schemaExcl.$data, $dataLvl, it.dataPathArr), $exclusive = 'exclusive' + $lvl, $exclType = 'exclType' + $lvl, $exclIsNumber = 'exclIsNumber' + $lvl, $opExpr = 'op' + $lvl, $opStr = '\' + ' + $opExpr + ' + \''; out += ' var schemaExcl' + ($lvl) + ' = ' + ($schemaValueExcl) + '; '; $schemaValueExcl = 'schemaExcl' + $lvl; out += ' var ' + ($exclusive) + '; var ' + ($exclType) + ' = typeof ' + ($schemaValueExcl) + '; if (' + ($exclType) + ' != \'boolean\' && ' + ($exclType) + ' != \'undefined\' && ' + ($exclType) + ' != \'number\') { '; var $errorKeyword = $exclusiveKeyword; var $$outStack = $$outStack || []; $$outStack.push(out); out = ''; /* istanbul ignore else */ if (it.createErrors !== false) { out += ' { keyword: \'' + ($errorKeyword || '_exclusiveLimit') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: {} '; if (it.opts.messages !== false) { out += ' , message: \'' + ($exclusiveKeyword) + ' should be boolean\' '; } if (it.opts.verbose) { out += ' , schema: validate.schema' + ($schemaPath) + ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' '; } out += ' } '; } else { out += ' {} '; } var __err = out; out = $$outStack.pop(); if (!it.compositeRule && $breakOnError) { /* istanbul ignore if */ if (it.async) { out += ' throw new ValidationError([' + (__err) + ']); '; } else { out += ' validate.errors = [' + (__err) + ']; return false; '; } } else { out += ' var err = ' + (__err) + '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; '; } out += ' } else if ( '; if ($isData) { out += ' (' + ($schemaValue) + ' !== undefined && typeof ' + ($schemaValue) + ' != \'number\') || '; } 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) + '=\'; '; if ($schema === undefined) { $errorKeyword = $exclusiveKeyword; $errSchemaPath = it.errSchemaPath + '/' + $exclusiveKeyword; $schemaValue = $schemaValueExcl; $isData = $isDataExcl; } } else { var $exclIsNumber = typeof $schemaExcl == 'number', $opStr = $op; if ($exclIsNumber && $isData) { var $opExpr = '\'' + $opStr + '\''; out += ' if ( '; if ($isData) { out += ' (' + ($schemaValue) + ' !== undefined && typeof ' + ($schemaValue) + ' != \'number\') || '; } out += ' ( ' + ($schemaValue) + ' === undefined || ' + ($schemaExcl) + ' ' + ($op) + '= ' + ($schemaValue) + ' ? ' + ($data) + ' ' + ($notOp) + '= ' + ($schemaExcl) + ' : ' + ($data) + ' ' + ($notOp) + ' ' + ($schemaValue) + ' ) || ' + ($data) + ' !== ' + ($data) + ') { '; } else { if ($exclIsNumber && $schema === undefined) { $exclusive = true; $errorKeyword = $exclusiveKeyword; $errSchemaPath = it.errSchemaPath + '/' + $exclusiveKeyword; $schemaValue = $schemaExcl; $notOp += '='; } else { if ($exclIsNumber) $schemaValue = Math[$isMax ? 'min' : 'max']($schemaExcl, $schema); if ($schemaExcl === ($exclIsNumber ? $schemaValue : true)) { $exclusive = true; $errorKeyword = $exclusiveKeyword; $errSchemaPath = it.errSchemaPath + '/' + $exclusiveKeyword; $notOp += '='; } else { $exclusive = false; $opStr += '='; } } var $opExpr = '\'' + $opStr + '\''; out += ' if ( '; if ($isData) { out += ' (' + ($schemaValue) + ' !== undefined && typeof ' + ($schemaValue) + ' != \'number\') || '; } out += ' ' + ($data) + ' ' + ($notOp) + ' ' + ($schemaValue) + ' || ' + ($data) + ' !== ' + ($data) + ') { '; } } $errorKeyword = $errorKeyword || $keyword; var $$outStack = $$outStack || []; $$outStack.push(out); out = ''; /* istanbul ignore else */ if (it.createErrors !== false) { out += ' { keyword: \'' + ($errorKeyword || '_limit') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { comparison: ' + ($opExpr) + ', limit: ' + ($schemaValue) + ', exclusive: ' + ($exclusive) + ' } '; if (it.opts.messages !== false) { out += ' , message: \'should be ' + ($opStr) + ' '; if ($isData) { out += '\' + ' + ($schemaValue); } else { out += '' + ($schemaValue) + '\''; } } if (it.opts.verbose) { out += ' , schema: '; if ($isData) { out += 'validate.schema' + ($schemaPath); } else { out += '' + ($schema); } out += ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' '; } out += ' } '; } else { out += ' {} '; } var __err = out; out = $$outStack.pop(); if (!it.compositeRule && $breakOnError) { /* istanbul ignore if */ if (it.async) { out += ' throw new ValidationError([' + (__err) + ']); '; } else { out += ' validate.errors = [' + (__err) + ']; return false; '; } } else { out += ' var err = ' + (__err) + '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; '; } out += ' } '; if ($breakOnError) { out += ' else { '; } return out; } /***/ }), /***/ 64683: /***/ ((module) => { "use strict"; module.exports = function generate__limitItems(it, $keyword, $ruleType) { var out = ' '; var $lvl = it.level; var $dataLvl = it.dataLevel; var $schema = it.schema[$keyword]; var $schemaPath = it.schemaPath + it.util.getProperty($keyword); var $errSchemaPath = it.errSchemaPath + '/' + $keyword; var $breakOnError = !it.opts.allErrors; var $errorKeyword; var $data = 'data' + ($dataLvl || ''); var $isData = it.opts.$data && $schema && $schema.$data, $schemaValue; if ($isData) { out += ' var schema' + ($lvl) + ' = ' + (it.util.getData($schema.$data, $dataLvl, it.dataPathArr)) + '; '; $schemaValue = 'schema' + $lvl; } else { $schemaValue = $schema; } if (!($isData || typeof $schema == 'number')) { throw new Error($keyword + ' must be number'); } var $op = $keyword == 'maxItems' ? '>' : '<'; out += 'if ( '; if ($isData) { out += ' (' + ($schemaValue) + ' !== undefined && typeof ' + ($schemaValue) + ' != \'number\') || '; } out += ' ' + ($data) + '.length ' + ($op) + ' ' + ($schemaValue) + ') { '; var $errorKeyword = $keyword; var $$outStack = $$outStack || []; $$outStack.push(out); out = ''; /* istanbul ignore else */ if (it.createErrors !== false) { out += ' { keyword: \'' + ($errorKeyword || '_limitItems') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { limit: ' + ($schemaValue) + ' } '; if (it.opts.messages !== false) { out += ' , message: \'should NOT have '; if ($keyword == 'maxItems') { out += 'more'; } else { out += 'fewer'; } out += ' than '; if ($isData) { out += '\' + ' + ($schemaValue) + ' + \''; } else { out += '' + ($schema); } out += ' items\' '; } if (it.opts.verbose) { out += ' , schema: '; if ($isData) { out += 'validate.schema' + ($schemaPath); } else { out += '' + ($schema); } out += ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' '; } out += ' } '; } else { out += ' {} '; } var __err = out; out = $$outStack.pop(); if (!it.compositeRule && $breakOnError) { /* istanbul ignore if */ if (it.async) { out += ' throw new ValidationError([' + (__err) + ']); '; } else { out += ' validate.errors = [' + (__err) + ']; return false; '; } } else { out += ' var err = ' + (__err) + '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; '; } out += '} '; if ($breakOnError) { out += ' else { '; } return out; } /***/ }), /***/ 52114: /***/ ((module) => { "use strict"; module.exports = function generate__limitLength(it, $keyword, $ruleType) { var out = ' '; var $lvl = it.level; var $dataLvl = it.dataLevel; var $schema = it.schema[$keyword]; var $schemaPath = it.schemaPath + it.util.getProperty($keyword); var $errSchemaPath = it.errSchemaPath + '/' + $keyword; var $breakOnError = !it.opts.allErrors; var $errorKeyword; var $data = 'data' + ($dataLvl || ''); var $isData = it.opts.$data && $schema && $schema.$data, $schemaValue; if ($isData) { out += ' var schema' + ($lvl) + ' = ' + (it.util.getData($schema.$data, $dataLvl, it.dataPathArr)) + '; '; $schemaValue = 'schema' + $lvl; } else { $schemaValue = $schema; } if (!($isData || typeof $schema == 'number')) { throw new Error($keyword + ' must be number'); } var $op = $keyword == 'maxLength' ? '>' : '<'; out += 'if ( '; if ($isData) { out += ' (' + ($schemaValue) + ' !== undefined && typeof ' + ($schemaValue) + ' != \'number\') || '; } if (it.opts.unicode === false) { out += ' ' + ($data) + '.length '; } else { out += ' ucs2length(' + ($data) + ') '; } out += ' ' + ($op) + ' ' + ($schemaValue) + ') { '; var $errorKeyword = $keyword; var $$outStack = $$outStack || []; $$outStack.push(out); out = ''; /* istanbul ignore else */ if (it.createErrors !== false) { out += ' { keyword: \'' + ($errorKeyword || '_limitLength') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { limit: ' + ($schemaValue) + ' } '; if (it.opts.messages !== false) { out += ' , message: \'should NOT be '; if ($keyword == 'maxLength') { out += 'longer'; } else { out += 'shorter'; } out += ' than '; if ($isData) { out += '\' + ' + ($schemaValue) + ' + \''; } else { out += '' + ($schema); } out += ' characters\' '; } if (it.opts.verbose) { out += ' , schema: '; if ($isData) { out += 'validate.schema' + ($schemaPath); } else { out += '' + ($schema); } out += ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' '; } out += ' } '; } else { out += ' {} '; } var __err = out; out = $$outStack.pop(); if (!it.compositeRule && $breakOnError) { /* istanbul ignore if */ if (it.async) { out += ' throw new ValidationError([' + (__err) + ']); '; } else { out += ' validate.errors = [' + (__err) + ']; return false; '; } } else { out += ' var err = ' + (__err) + '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; '; } out += '} '; if ($breakOnError) { out += ' else { '; } return out; } /***/ }), /***/ 71142: /***/ ((module) => { "use strict"; module.exports = function generate__limitProperties(it, $keyword, $ruleType) { var out = ' '; var $lvl = it.level; var $dataLvl = it.dataLevel; var $schema = it.schema[$keyword]; var $schemaPath = it.schemaPath + it.util.getProperty($keyword); var $errSchemaPath = it.errSchemaPath + '/' + $keyword; var $breakOnError = !it.opts.allErrors; var $errorKeyword; var $data = 'data' + ($dataLvl || ''); var $isData = it.opts.$data && $schema && $schema.$data, $schemaValue; if ($isData) { out += ' var schema' + ($lvl) + ' = ' + (it.util.getData($schema.$data, $dataLvl, it.dataPathArr)) + '; '; $schemaValue = 'schema' + $lvl; } else { $schemaValue = $schema; } if (!($isData || typeof $schema == 'number')) { throw new Error($keyword + ' must be number'); } var $op = $keyword == 'maxProperties' ? '>' : '<'; out += 'if ( '; if ($isData) { out += ' (' + ($schemaValue) + ' !== undefined && typeof ' + ($schemaValue) + ' != \'number\') || '; } out += ' Object.keys(' + ($data) + ').length ' + ($op) + ' ' + ($schemaValue) + ') { '; var $errorKeyword = $keyword; var $$outStack = $$outStack || []; $$outStack.push(out); out = ''; /* istanbul ignore else */ if (it.createErrors !== false) { out += ' { keyword: \'' + ($errorKeyword || '_limitProperties') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { limit: ' + ($schemaValue) + ' } '; if (it.opts.messages !== false) { out += ' , message: \'should NOT have '; if ($keyword == 'maxProperties') { out += 'more'; } else { out += 'fewer'; } out += ' than '; if ($isData) { out += '\' + ' + ($schemaValue) + ' + \''; } else { out += '' + ($schema); } out += ' properties\' '; } if (it.opts.verbose) { out += ' , schema: '; if ($isData) { out += 'validate.schema' + ($schemaPath); } else { out += '' + ($schema); } out += ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' '; } out += ' } '; } else { out += ' {} '; } var __err = out; out = $$outStack.pop(); if (!it.compositeRule && $breakOnError) { /* istanbul ignore if */ if (it.async) { out += ' throw new ValidationError([' + (__err) + ']); '; } else { out += ' validate.errors = [' + (__err) + ']; return false; '; } } else { out += ' var err = ' + (__err) + '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; '; } out += '} '; if ($breakOnError) { out += ' else { '; } return out; } /***/ }), /***/ 89443: /***/ ((module) => { "use strict"; module.exports = function generate_allOf(it, $keyword, $ruleType) { var out = ' '; var $schema = it.schema[$keyword]; var $schemaPath = it.schemaPath + it.util.getProperty($keyword); var $errSchemaPath = it.errSchemaPath + '/' + $keyword; var $breakOnError = !it.opts.allErrors; var $it = it.util.copy(it); var $closingBraces = ''; $it.level++; var $nextValid = 'valid' + $it.level; var $currentBaseId = $it.baseId, $allSchemasEmpty = true; var arr1 = $schema; if (arr1) { var $sch, $i = -1, l1 = arr1.length - 1; while ($i < l1) { $sch = arr1[$i += 1]; if ((it.opts.strictKeywords ? (typeof $sch == 'object' && Object.keys($sch).length > 0) || $sch === false : it.util.schemaHasRules($sch, it.RULES.all))) { $allSchemasEmpty = false; $it.schema = $sch; $it.schemaPath = $schemaPath + '[' + $i + ']'; $it.errSchemaPath = $errSchemaPath + '/' + $i; out += ' ' + (it.validate($it)) + ' '; $it.baseId = $currentBaseId; if ($breakOnError) { out += ' if (' + ($nextValid) + ') { '; $closingBraces += '}'; } } } } if ($breakOnError) { if ($allSchemasEmpty) { out += ' if (true) { '; } else { out += ' ' + ($closingBraces.slice(0, -1)) + ' '; } } return out; } /***/ }), /***/ 63093: /***/ ((module) => { "use strict"; module.exports = function generate_anyOf(it, $keyword, $ruleType) { var out = ' '; var $lvl = it.level; var $dataLvl = it.dataLevel; var $schema = it.schema[$keyword]; var $schemaPath = it.schemaPath + it.util.getProperty($keyword); var $errSchemaPath = it.errSchemaPath + '/' + $keyword; var $breakOnError = !it.opts.allErrors; var $data = 'data' + ($dataLvl || ''); var $valid = 'valid' + $lvl; var $errs = 'errs__' + $lvl; var $it = it.util.copy(it); var $closingBraces = ''; $it.level++; var $nextValid = 'valid' + $it.level; var $noEmptySchema = $schema.every(function($sch) { return (it.opts.strictKeywords ? (typeof $sch == 'object' && Object.keys($sch).length > 0) || $sch === false : it.util.schemaHasRules($sch, it.RULES.all)); }); if ($noEmptySchema) { var $currentBaseId = $it.baseId; out += ' var ' + ($errs) + ' = errors; var ' + ($valid) + ' = false; '; var $wasComposite = it.compositeRule; it.compositeRule = $it.compositeRule = true; var arr1 = $schema; if (arr1) { var $sch, $i = -1, l1 = arr1.length - 1; while ($i < l1) { $sch = arr1[$i += 1]; $it.schema = $sch; $it.schemaPath = $schemaPath + '[' + $i + ']'; $it.errSchemaPath = $errSchemaPath + '/' + $i; out += ' ' + (it.validate($it)) + ' '; $it.baseId = $currentBaseId; out += ' ' + ($valid) + ' = ' + ($valid) + ' || ' + ($nextValid) + '; if (!' + ($valid) + ') { '; $closingBraces += '}'; } } it.compositeRule = $it.compositeRule = $wasComposite; out += ' ' + ($closingBraces) + ' if (!' + ($valid) + ') { var err = '; /* istanbul ignore else */ if (it.createErrors !== false) { out += ' { keyword: \'' + ('anyOf') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: {} '; if (it.opts.messages !== false) { out += ' , message: \'should match some schema in anyOf\' '; } if (it.opts.verbose) { out += ' , schema: validate.schema' + ($schemaPath) + ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' '; } out += ' } '; } else { out += ' {} '; } out += '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; '; if (!it.compositeRule && $breakOnError) { /* istanbul ignore if */ if (it.async) { out += ' throw new ValidationError(vErrors); '; } else { out += ' validate.errors = vErrors; return false; '; } } out += ' } else { errors = ' + ($errs) + '; if (vErrors !== null) { if (' + ($errs) + ') vErrors.length = ' + ($errs) + '; else vErrors = null; } '; if (it.opts.allErrors) { out += ' } '; } } else { if ($breakOnError) { out += ' if (true) { '; } } return out; } /***/ }), /***/ 30134: /***/ ((module) => { "use strict"; module.exports = function generate_comment(it, $keyword, $ruleType) { var out = ' '; var $schema = it.schema[$keyword]; var $errSchemaPath = it.errSchemaPath + '/' + $keyword; var $breakOnError = !it.opts.allErrors; var $comment = it.util.toQuotedString($schema); if (it.opts.$comment === true) { out += ' console.log(' + ($comment) + ');'; } else if (typeof it.opts.$comment == 'function') { out += ' self._opts.$comment(' + ($comment) + ', ' + (it.util.toQuotedString($errSchemaPath)) + ', validate.root.schema);'; } return out; } /***/ }), /***/ 1661: /***/ ((module) => { "use strict"; module.exports = function generate_const(it, $keyword, $ruleType) { var out = ' '; var $lvl = it.level; var $dataLvl = it.dataLevel; var $schema = it.schema[$keyword]; var $schemaPath = it.schemaPath + it.util.getProperty($keyword); var $errSchemaPath = it.errSchemaPath + '/' + $keyword; var $breakOnError = !it.opts.allErrors; var $data = 'data' + ($dataLvl || ''); var $valid = 'valid' + $lvl; var $isData = it.opts.$data && $schema && $schema.$data, $schemaValue; if ($isData) { out += ' var schema' + ($lvl) + ' = ' + (it.util.getData($schema.$data, $dataLvl, it.dataPathArr)) + '; '; $schemaValue = 'schema' + $lvl; } else { $schemaValue = $schema; } if (!$isData) { out += ' var schema' + ($lvl) + ' = validate.schema' + ($schemaPath) + ';'; } out += 'var ' + ($valid) + ' = equal(' + ($data) + ', schema' + ($lvl) + '); if (!' + ($valid) + ') { '; var $$outStack = $$outStack || []; $$outStack.push(out); out = ''; /* istanbul ignore else */ if (it.createErrors !== false) { out += ' { keyword: \'' + ('const') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { allowedValue: schema' + ($lvl) + ' } '; if (it.opts.messages !== false) { out += ' , message: \'should be equal to constant\' '; } if (it.opts.verbose) { out += ' , schema: validate.schema' + ($schemaPath) + ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' '; } out += ' } '; } else { out += ' {} '; } var __err = out; out = $$outStack.pop(); if (!it.compositeRule && $breakOnError) { /* istanbul ignore if */ if (it.async) { out += ' throw new ValidationError([' + (__err) + ']); '; } else { out += ' validate.errors = [' + (__err) + ']; return false; '; } } else { out += ' var err = ' + (__err) + '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; '; } out += ' }'; if ($breakOnError) { out += ' else { '; } return out; } /***/ }), /***/ 55964: /***/ ((module) => { "use strict"; module.exports = function generate_contains(it, $keyword, $ruleType) { var out = ' '; var $lvl = it.level; var $dataLvl = it.dataLevel; var $schema = it.schema[$keyword]; var $schemaPath = it.schemaPath + it.util.getProperty($keyword); var $errSchemaPath = it.errSchemaPath + '/' + $keyword; var $breakOnError = !it.opts.allErrors; var $data = 'data' + ($dataLvl || ''); var $valid = 'valid' + $lvl; var $errs = 'errs__' + $lvl; var $it = it.util.copy(it); var $closingBraces = ''; $it.level++; var $nextValid = 'valid' + $it.level; var $idx = 'i' + $lvl, $dataNxt = $it.dataLevel = it.dataLevel + 1, $nextData = 'data' + $dataNxt, $currentBaseId = it.baseId, $nonEmptySchema = (it.opts.strictKeywords ? (typeof $schema == 'object' && Object.keys($schema).length > 0) || $schema === false : it.util.schemaHasRules($schema, it.RULES.all)); out += 'var ' + ($errs) + ' = errors;var ' + ($valid) + ';'; if ($nonEmptySchema) { var $wasComposite = it.compositeRule; it.compositeRule = $it.compositeRule = true; $it.schema = $schema; $it.schemaPath = $schemaPath; $it.errSchemaPath = $errSchemaPath; out += ' var ' + ($nextValid) + ' = false; for (var ' + ($idx) + ' = 0; ' + ($idx) + ' < ' + ($data) + '.length; ' + ($idx) + '++) { '; $it.errorPath = it.util.getPathExpr(it.errorPath, $idx, it.opts.jsonPointers, true); var $passData = $data + '[' + $idx + ']'; $it.dataPathArr[$dataNxt] = $idx; var $code = it.validate($it); $it.baseId = $currentBaseId; if (it.util.varOccurences($code, $nextData) < 2) { out += ' ' + (it.util.varReplace($code, $nextData, $passData)) + ' '; } else { out += ' var ' + ($nextData) + ' = ' + ($passData) + '; ' + ($code) + ' '; } out += ' if (' + ($nextValid) + ') break; } '; it.compositeRule = $it.compositeRule = $wasComposite; out += ' ' + ($closingBraces) + ' if (!' + ($nextValid) + ') {'; } else { out += ' if (' + ($data) + '.length == 0) {'; } var $$outStack = $$outStack || []; $$outStack.push(out); out = ''; /* istanbul ignore else */ if (it.createErrors !== false) { out += ' { keyword: \'' + ('contains') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: {} '; if (it.opts.messages !== false) { out += ' , message: \'should contain a valid item\' '; } if (it.opts.verbose) { out += ' , schema: validate.schema' + ($schemaPath) + ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' '; } out += ' } '; } else { out += ' {} '; } var __err = out; out = $$outStack.pop(); if (!it.compositeRule && $breakOnError) { /* istanbul ignore if */ if (it.async) { out += ' throw new ValidationError([' + (__err) + ']); '; } else { out += ' validate.errors = [' + (__err) + ']; return false; '; } } else { out += ' var err = ' + (__err) + '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; '; } out += ' } else { '; if ($nonEmptySchema) { out += ' errors = ' + ($errs) + '; if (vErrors !== null) { if (' + ($errs) + ') vErrors.length = ' + ($errs) + '; else vErrors = null; } '; } if (it.opts.allErrors) { out += ' } '; } return out; } /***/ }), /***/ 5912: /***/ ((module) => { "use strict"; module.exports = function generate_custom(it, $keyword, $ruleType) { var out = ' '; var $lvl = it.level; var $dataLvl = it.dataLevel; var $schema = it.schema[$keyword]; var $schemaPath = it.schemaPath + it.util.getProperty($keyword); var $errSchemaPath = it.errSchemaPath + '/' + $keyword; var $breakOnError = !it.opts.allErrors; var $errorKeyword; var $data = 'data' + ($dataLvl || ''); var $valid = 'valid' + $lvl; var $errs = 'errs__' + $lvl; var $isData = it.opts.$data && $schema && $schema.$data, $schemaValue; if ($isData) { out += ' var schema' + ($lvl) + ' = ' + (it.util.getData($schema.$data, $dataLvl, it.dataPathArr)) + '; '; $schemaValue = 'schema' + $lvl; } else { $schemaValue = $schema; } var $rule = this, $definition = 'definition' + $lvl, $rDef = $rule.definition, $closingBraces = ''; var $compile, $inline, $macro, $ruleValidate, $validateCode; if ($isData && $rDef.$data) { $validateCode = 'keywordValidate' + $lvl; var $validateSchema = $rDef.validateSchema; out += ' var ' + ($definition) + ' = RULES.custom[\'' + ($keyword) + '\'].definition; var ' + ($validateCode) + ' = ' + ($definition) + '.validate;'; } else { $ruleValidate = it.useCustomRule($rule, $schema, it.schema, it); if (!$ruleValidate) return; $schemaValue = 'validate.schema' + $schemaPath; $validateCode = $ruleValidate.code; $compile = $rDef.compile; $inline = $rDef.inline; $macro = $rDef.macro; } var $ruleErrs = $validateCode + '.errors', $i = 'i' + $lvl, $ruleErr = 'ruleErr' + $lvl, $asyncKeyword = $rDef.async; if ($asyncKeyword && !it.async) throw new Error('async keyword in sync schema'); if (!($inline || $macro)) { out += '' + ($ruleErrs) + ' = null;'; } out += 'var ' + ($errs) + ' = errors;var ' + ($valid) + ';'; if ($isData && $rDef.$data) { $closingBraces += '}'; out += ' if (' + ($schemaValue) + ' === undefined) { ' + ($valid) + ' = true; } else { '; if ($validateSchema) { $closingBraces += '}'; out += ' ' + ($valid) + ' = ' + ($definition) + '.validateSchema(' + ($schemaValue) + '); if (' + ($valid) + ') { '; } } if ($inline) { if ($rDef.statements) { out += ' ' + ($ruleValidate.validate) + ' '; } else { out += ' ' + ($valid) + ' = ' + ($ruleValidate.validate) + '; '; } } else if ($macro) { var $it = it.util.copy(it); var $closingBraces = ''; $it.level++; var $nextValid = 'valid' + $it.level; $it.schema = $ruleValidate.validate; $it.schemaPath = ''; var $wasComposite = it.compositeRule; it.compositeRule = $it.compositeRule = true; var $code = it.validate($it).replace(/validate\.schema/g, $validateCode); it.compositeRule = $it.compositeRule = $wasComposite; out += ' ' + ($code); } else { var $$outStack = $$outStack || []; $$outStack.push(out); out = ''; out += ' ' + ($validateCode) + '.call( '; if (it.opts.passContext) { out += 'this'; } else { out += 'self'; } if ($compile || $rDef.schema === false) { out += ' , ' + ($data) + ' '; } else { out += ' , ' + ($schemaValue) + ' , ' + ($data) + ' , validate.schema' + (it.schemaPath) + ' '; } out += ' , (dataPath || \'\')'; if (it.errorPath != '""') { out += ' + ' + (it.errorPath); } var $parentData = $dataLvl ? 'data' + (($dataLvl - 1) || '') : 'parentData', $parentDataProperty = $dataLvl ? it.dataPathArr[$dataLvl] : 'parentDataProperty'; out += ' , ' + ($parentData) + ' , ' + ($parentDataProperty) + ' , rootData ) '; var def_callRuleValidate = out; out = $$outStack.pop(); if ($rDef.errors === false) { out += ' ' + ($valid) + ' = '; if ($asyncKeyword) { out += 'await '; } out += '' + (def_callRuleValidate) + '; '; } else { if ($asyncKeyword) { $ruleErrs = 'customErrors' + $lvl; out += ' var ' + ($ruleErrs) + ' = null; try { ' + ($valid) + ' = await ' + (def_callRuleValidate) + '; } catch (e) { ' + ($valid) + ' = false; if (e instanceof ValidationError) ' + ($ruleErrs) + ' = e.errors; else throw e; } '; } else { out += ' ' + ($ruleErrs) + ' = null; ' + ($valid) + ' = ' + (def_callRuleValidate) + '; '; } } } if ($rDef.modifying) { out += ' if (' + ($parentData) + ') ' + ($data) + ' = ' + ($parentData) + '[' + ($parentDataProperty) + '];'; } out += '' + ($closingBraces); if ($rDef.valid) { if ($breakOnError) { out += ' if (true) { '; } } else { out += ' if ( '; if ($rDef.valid === undefined) { out += ' !'; if ($macro) { out += '' + ($nextValid); } else { out += '' + ($valid); } } else { out += ' ' + (!$rDef.valid) + ' '; } out += ') { '; $errorKeyword = $rule.keyword; var $$outStack = $$outStack || []; $$outStack.push(out); out = ''; var $$outStack = $$outStack || []; $$outStack.push(out); out = ''; /* istanbul ignore else */ if (it.createErrors !== false) { out += ' { keyword: \'' + ($errorKeyword || 'custom') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { keyword: \'' + ($rule.keyword) + '\' } '; if (it.opts.messages !== false) { out += ' , message: \'should pass "' + ($rule.keyword) + '" keyword validation\' '; } if (it.opts.verbose) { out += ' , schema: validate.schema' + ($schemaPath) + ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' '; } out += ' } '; } else { out += ' {} '; } var __err = out; out = $$outStack.pop(); if (!it.compositeRule && $breakOnError) { /* istanbul ignore if */ if (it.async) { out += ' throw new ValidationError([' + (__err) + ']); '; } else { out += ' validate.errors = [' + (__err) + ']; return false; '; } } else { out += ' var err = ' + (__err) + '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; '; } var def_customError = out; out = $$outStack.pop(); if ($inline) { if ($rDef.errors) { if ($rDef.errors != 'full') { out += ' for (var ' + ($i) + '=' + ($errs) + '; ' + ($i) + ' { "use strict"; module.exports = function generate_dependencies(it, $keyword, $ruleType) { var out = ' '; var $lvl = it.level; var $dataLvl = it.dataLevel; var $schema = it.schema[$keyword]; var $schemaPath = it.schemaPath + it.util.getProperty($keyword); var $errSchemaPath = it.errSchemaPath + '/' + $keyword; var $breakOnError = !it.opts.allErrors; var $data = 'data' + ($dataLvl || ''); var $errs = 'errs__' + $lvl; var $it = it.util.copy(it); var $closingBraces = ''; $it.level++; var $nextValid = 'valid' + $it.level; var $schemaDeps = {}, $propertyDeps = {}, $ownProperties = it.opts.ownProperties; for ($property in $schema) { if ($property == '__proto__') continue; var $sch = $schema[$property]; var $deps = Array.isArray($sch) ? $propertyDeps : $schemaDeps; $deps[$property] = $sch; } out += 'var ' + ($errs) + ' = errors;'; var $currentErrorPath = it.errorPath; out += 'var missing' + ($lvl) + ';'; for (var $property in $propertyDeps) { $deps = $propertyDeps[$property]; if ($deps.length) { out += ' if ( ' + ($data) + (it.util.getProperty($property)) + ' !== undefined '; if ($ownProperties) { out += ' && Object.prototype.hasOwnProperty.call(' + ($data) + ', \'' + (it.util.escapeQuotes($property)) + '\') '; } if ($breakOnError) { out += ' && ( '; var arr1 = $deps; if (arr1) { var $propertyKey, $i = -1, l1 = arr1.length - 1; while ($i < l1) { $propertyKey = arr1[$i += 1]; if ($i) { out += ' || '; } var $prop = it.util.getProperty($propertyKey), $useData = $data + $prop; out += ' ( ( ' + ($useData) + ' === undefined '; if ($ownProperties) { out += ' || ! Object.prototype.hasOwnProperty.call(' + ($data) + ', \'' + (it.util.escapeQuotes($propertyKey)) + '\') '; } out += ') && (missing' + ($lvl) + ' = ' + (it.util.toQuotedString(it.opts.jsonPointers ? $propertyKey : $prop)) + ') ) '; } } out += ')) { '; var $propertyPath = 'missing' + $lvl, $missingProperty = '\' + ' + $propertyPath + ' + \''; if (it.opts._errorDataPathProperty) { it.errorPath = it.opts.jsonPointers ? it.util.getPathExpr($currentErrorPath, $propertyPath, true) : $currentErrorPath + ' + ' + $propertyPath; } var $$outStack = $$outStack || []; $$outStack.push(out); out = ''; /* istanbul ignore else */ if (it.createErrors !== false) { out += ' { keyword: \'' + ('dependencies') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { property: \'' + (it.util.escapeQuotes($property)) + '\', missingProperty: \'' + ($missingProperty) + '\', depsCount: ' + ($deps.length) + ', deps: \'' + (it.util.escapeQuotes($deps.length == 1 ? $deps[0] : $deps.join(", "))) + '\' } '; if (it.opts.messages !== false) { out += ' , message: \'should have '; if ($deps.length == 1) { out += 'property ' + (it.util.escapeQuotes($deps[0])); } else { out += 'properties ' + (it.util.escapeQuotes($deps.join(", "))); } out += ' when property ' + (it.util.escapeQuotes($property)) + ' is present\' '; } if (it.opts.verbose) { out += ' , schema: validate.schema' + ($schemaPath) + ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' '; } out += ' } '; } else { out += ' {} '; } var __err = out; out = $$outStack.pop(); if (!it.compositeRule && $breakOnError) { /* istanbul ignore if */ if (it.async) { out += ' throw new ValidationError([' + (__err) + ']); '; } else { out += ' validate.errors = [' + (__err) + ']; return false; '; } } else { out += ' var err = ' + (__err) + '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; '; } } else { out += ' ) { '; var arr2 = $deps; if (arr2) { var $propertyKey, i2 = -1, l2 = arr2.length - 1; while (i2 < l2) { $propertyKey = arr2[i2 += 1]; var $prop = it.util.getProperty($propertyKey), $missingProperty = it.util.escapeQuotes($propertyKey), $useData = $data + $prop; if (it.opts._errorDataPathProperty) { it.errorPath = it.util.getPath($currentErrorPath, $propertyKey, it.opts.jsonPointers); } out += ' if ( ' + ($useData) + ' === undefined '; if ($ownProperties) { out += ' || ! Object.prototype.hasOwnProperty.call(' + ($data) + ', \'' + (it.util.escapeQuotes($propertyKey)) + '\') '; } out += ') { var err = '; /* istanbul ignore else */ if (it.createErrors !== false) { out += ' { keyword: \'' + ('dependencies') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { property: \'' + (it.util.escapeQuotes($property)) + '\', missingProperty: \'' + ($missingProperty) + '\', depsCount: ' + ($deps.length) + ', deps: \'' + (it.util.escapeQuotes($deps.length == 1 ? $deps[0] : $deps.join(", "))) + '\' } '; if (it.opts.messages !== false) { out += ' , message: \'should have '; if ($deps.length == 1) { out += 'property ' + (it.util.escapeQuotes($deps[0])); } else { out += 'properties ' + (it.util.escapeQuotes($deps.join(", "))); } out += ' when property ' + (it.util.escapeQuotes($property)) + ' is present\' '; } if (it.opts.verbose) { out += ' , schema: validate.schema' + ($schemaPath) + ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' '; } out += ' } '; } else { out += ' {} '; } out += '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; } '; } } } out += ' } '; if ($breakOnError) { $closingBraces += '}'; out += ' else { '; } } } it.errorPath = $currentErrorPath; var $currentBaseId = $it.baseId; for (var $property in $schemaDeps) { var $sch = $schemaDeps[$property]; if ((it.opts.strictKeywords ? (typeof $sch == 'object' && Object.keys($sch).length > 0) || $sch === false : it.util.schemaHasRules($sch, it.RULES.all))) { out += ' ' + ($nextValid) + ' = true; if ( ' + ($data) + (it.util.getProperty($property)) + ' !== undefined '; if ($ownProperties) { out += ' && Object.prototype.hasOwnProperty.call(' + ($data) + ', \'' + (it.util.escapeQuotes($property)) + '\') '; } out += ') { '; $it.schema = $sch; $it.schemaPath = $schemaPath + it.util.getProperty($property); $it.errSchemaPath = $errSchemaPath + '/' + it.util.escapeFragment($property); out += ' ' + (it.validate($it)) + ' '; $it.baseId = $currentBaseId; out += ' } '; if ($breakOnError) { out += ' if (' + ($nextValid) + ') { '; $closingBraces += '}'; } } } if ($breakOnError) { out += ' ' + ($closingBraces) + ' if (' + ($errs) + ' == errors) {'; } return out; } /***/ }), /***/ 10163: /***/ ((module) => { "use strict"; module.exports = function generate_enum(it, $keyword, $ruleType) { var out = ' '; var $lvl = it.level; var $dataLvl = it.dataLevel; var $schema = it.schema[$keyword]; var $schemaPath = it.schemaPath + it.util.getProperty($keyword); var $errSchemaPath = it.errSchemaPath + '/' + $keyword; var $breakOnError = !it.opts.allErrors; var $data = 'data' + ($dataLvl || ''); var $valid = 'valid' + $lvl; var $isData = it.opts.$data && $schema && $schema.$data, $schemaValue; if ($isData) { out += ' var schema' + ($lvl) + ' = ' + (it.util.getData($schema.$data, $dataLvl, it.dataPathArr)) + '; '; $schemaValue = 'schema' + $lvl; } else { $schemaValue = $schema; } var $i = 'i' + $lvl, $vSchema = 'schema' + $lvl; if (!$isData) { out += ' var ' + ($vSchema) + ' = validate.schema' + ($schemaPath) + ';'; } out += 'var ' + ($valid) + ';'; if ($isData) { out += ' if (schema' + ($lvl) + ' === undefined) ' + ($valid) + ' = true; else if (!Array.isArray(schema' + ($lvl) + ')) ' + ($valid) + ' = false; else {'; } out += '' + ($valid) + ' = false;for (var ' + ($i) + '=0; ' + ($i) + '<' + ($vSchema) + '.length; ' + ($i) + '++) if (equal(' + ($data) + ', ' + ($vSchema) + '[' + ($i) + '])) { ' + ($valid) + ' = true; break; }'; if ($isData) { out += ' } '; } out += ' if (!' + ($valid) + ') { '; var $$outStack = $$outStack || []; $$outStack.push(out); out = ''; /* istanbul ignore else */ if (it.createErrors !== false) { out += ' { keyword: \'' + ('enum') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { allowedValues: schema' + ($lvl) + ' } '; if (it.opts.messages !== false) { out += ' , message: \'should be equal to one of the allowed values\' '; } if (it.opts.verbose) { out += ' , schema: validate.schema' + ($schemaPath) + ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' '; } out += ' } '; } else { out += ' {} '; } var __err = out; out = $$outStack.pop(); if (!it.compositeRule && $breakOnError) { /* istanbul ignore if */ if (it.async) { out += ' throw new ValidationError([' + (__err) + ']); '; } else { out += ' validate.errors = [' + (__err) + ']; return false; '; } } else { out += ' var err = ' + (__err) + '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; '; } out += ' }'; if ($breakOnError) { out += ' else { '; } return out; } /***/ }), /***/ 63847: /***/ ((module) => { "use strict"; module.exports = function generate_format(it, $keyword, $ruleType) { var out = ' '; var $lvl = it.level; var $dataLvl = it.dataLevel; var $schema = it.schema[$keyword]; var $schemaPath = it.schemaPath + it.util.getProperty($keyword); var $errSchemaPath = it.errSchemaPath + '/' + $keyword; var $breakOnError = !it.opts.allErrors; var $data = 'data' + ($dataLvl || ''); if (it.opts.format === false) { if ($breakOnError) { out += ' if (true) { '; } return out; } var $isData = it.opts.$data && $schema && $schema.$data, $schemaValue; if ($isData) { out += ' var schema' + ($lvl) + ' = ' + (it.util.getData($schema.$data, $dataLvl, it.dataPathArr)) + '; '; $schemaValue = 'schema' + $lvl; } else { $schemaValue = $schema; } var $unknownFormats = it.opts.unknownFormats, $allowUnknown = Array.isArray($unknownFormats); if ($isData) { var $format = 'format' + $lvl, $isObject = 'isObject' + $lvl, $formatType = 'formatType' + $lvl; out += ' var ' + ($format) + ' = formats[' + ($schemaValue) + ']; var ' + ($isObject) + ' = typeof ' + ($format) + ' == \'object\' && !(' + ($format) + ' instanceof RegExp) && ' + ($format) + '.validate; var ' + ($formatType) + ' = ' + ($isObject) + ' && ' + ($format) + '.type || \'string\'; if (' + ($isObject) + ') { '; if (it.async) { out += ' var async' + ($lvl) + ' = ' + ($format) + '.async; '; } out += ' ' + ($format) + ' = ' + ($format) + '.validate; } if ( '; if ($isData) { out += ' (' + ($schemaValue) + ' !== undefined && typeof ' + ($schemaValue) + ' != \'string\') || '; } out += ' ('; if ($unknownFormats != 'ignore') { out += ' (' + ($schemaValue) + ' && !' + ($format) + ' '; if ($allowUnknown) { out += ' && self._opts.unknownFormats.indexOf(' + ($schemaValue) + ') == -1 '; } out += ') || '; } out += ' (' + ($format) + ' && ' + ($formatType) + ' == \'' + ($ruleType) + '\' && !(typeof ' + ($format) + ' == \'function\' ? '; if (it.async) { out += ' (async' + ($lvl) + ' ? await ' + ($format) + '(' + ($data) + ') : ' + ($format) + '(' + ($data) + ')) '; } else { out += ' ' + ($format) + '(' + ($data) + ') '; } out += ' : ' + ($format) + '.test(' + ($data) + '))))) {'; } else { var $format = it.formats[$schema]; if (!$format) { if ($unknownFormats == 'ignore') { it.logger.warn('unknown format "' + $schema + '" ignored in schema at path "' + it.errSchemaPath + '"'); if ($breakOnError) { out += ' if (true) { '; } return out; } else if ($allowUnknown && $unknownFormats.indexOf($schema) >= 0) { if ($breakOnError) { out += ' if (true) { '; } return out; } else { throw new Error('unknown format "' + $schema + '" is used in schema at path "' + it.errSchemaPath + '"'); } } var $isObject = typeof $format == 'object' && !($format instanceof RegExp) && $format.validate; var $formatType = $isObject && $format.type || 'string'; if ($isObject) { var $async = $format.async === true; $format = $format.validate; } if ($formatType != $ruleType) { if ($breakOnError) { out += ' if (true) { '; } return out; } if ($async) { if (!it.async) throw new Error('async format in sync schema'); var $formatRef = 'formats' + it.util.getProperty($schema) + '.validate'; out += ' if (!(await ' + ($formatRef) + '(' + ($data) + '))) { '; } else { out += ' if (! '; var $formatRef = 'formats' + it.util.getProperty($schema); if ($isObject) $formatRef += '.validate'; if (typeof $format == 'function') { out += ' ' + ($formatRef) + '(' + ($data) + ') '; } else { out += ' ' + ($formatRef) + '.test(' + ($data) + ') '; } out += ') { '; } } var $$outStack = $$outStack || []; $$outStack.push(out); out = ''; /* istanbul ignore else */ if (it.createErrors !== false) { out += ' { keyword: \'' + ('format') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { format: '; if ($isData) { out += '' + ($schemaValue); } else { out += '' + (it.util.toQuotedString($schema)); } out += ' } '; if (it.opts.messages !== false) { out += ' , message: \'should match format "'; if ($isData) { out += '\' + ' + ($schemaValue) + ' + \''; } else { out += '' + (it.util.escapeQuotes($schema)); } out += '"\' '; } if (it.opts.verbose) { out += ' , schema: '; if ($isData) { out += 'validate.schema' + ($schemaPath); } else { out += '' + (it.util.toQuotedString($schema)); } out += ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' '; } out += ' } '; } else { out += ' {} '; } var __err = out; out = $$outStack.pop(); if (!it.compositeRule && $breakOnError) { /* istanbul ignore if */ if (it.async) { out += ' throw new ValidationError([' + (__err) + ']); '; } else { out += ' validate.errors = [' + (__err) + ']; return false; '; } } else { out += ' var err = ' + (__err) + '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; '; } out += ' } '; if ($breakOnError) { out += ' else { '; } return out; } /***/ }), /***/ 80862: /***/ ((module) => { "use strict"; module.exports = function generate_if(it, $keyword, $ruleType) { var out = ' '; var $lvl = it.level; var $dataLvl = it.dataLevel; var $schema = it.schema[$keyword]; var $schemaPath = it.schemaPath + it.util.getProperty($keyword); var $errSchemaPath = it.errSchemaPath + '/' + $keyword; var $breakOnError = !it.opts.allErrors; var $data = 'data' + ($dataLvl || ''); var $valid = 'valid' + $lvl; var $errs = 'errs__' + $lvl; var $it = it.util.copy(it); $it.level++; var $nextValid = 'valid' + $it.level; var $thenSch = it.schema['then'], $elseSch = it.schema['else'], $thenPresent = $thenSch !== undefined && (it.opts.strictKeywords ? (typeof $thenSch == 'object' && Object.keys($thenSch).length > 0) || $thenSch === false : it.util.schemaHasRules($thenSch, it.RULES.all)), $elsePresent = $elseSch !== undefined && (it.opts.strictKeywords ? (typeof $elseSch == 'object' && Object.keys($elseSch).length > 0) || $elseSch === false : it.util.schemaHasRules($elseSch, it.RULES.all)), $currentBaseId = $it.baseId; if ($thenPresent || $elsePresent) { var $ifClause; $it.createErrors = false; $it.schema = $schema; $it.schemaPath = $schemaPath; $it.errSchemaPath = $errSchemaPath; out += ' var ' + ($errs) + ' = errors; var ' + ($valid) + ' = true; '; var $wasComposite = it.compositeRule; it.compositeRule = $it.compositeRule = true; out += ' ' + (it.validate($it)) + ' '; $it.baseId = $currentBaseId; $it.createErrors = true; out += ' errors = ' + ($errs) + '; if (vErrors !== null) { if (' + ($errs) + ') vErrors.length = ' + ($errs) + '; else vErrors = null; } '; it.compositeRule = $it.compositeRule = $wasComposite; if ($thenPresent) { out += ' if (' + ($nextValid) + ') { '; $it.schema = it.schema['then']; $it.schemaPath = it.schemaPath + '.then'; $it.errSchemaPath = it.errSchemaPath + '/then'; out += ' ' + (it.validate($it)) + ' '; $it.baseId = $currentBaseId; out += ' ' + ($valid) + ' = ' + ($nextValid) + '; '; if ($thenPresent && $elsePresent) { $ifClause = 'ifClause' + $lvl; out += ' var ' + ($ifClause) + ' = \'then\'; '; } else { $ifClause = '\'then\''; } out += ' } '; if ($elsePresent) { out += ' else { '; } } else { out += ' if (!' + ($nextValid) + ') { '; } if ($elsePresent) { $it.schema = it.schema['else']; $it.schemaPath = it.schemaPath + '.else'; $it.errSchemaPath = it.errSchemaPath + '/else'; out += ' ' + (it.validate($it)) + ' '; $it.baseId = $currentBaseId; out += ' ' + ($valid) + ' = ' + ($nextValid) + '; '; if ($thenPresent && $elsePresent) { $ifClause = 'ifClause' + $lvl; out += ' var ' + ($ifClause) + ' = \'else\'; '; } else { $ifClause = '\'else\''; } out += ' } '; } out += ' if (!' + ($valid) + ') { var err = '; /* istanbul ignore else */ if (it.createErrors !== false) { out += ' { keyword: \'' + ('if') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { failingKeyword: ' + ($ifClause) + ' } '; if (it.opts.messages !== false) { out += ' , message: \'should match "\' + ' + ($ifClause) + ' + \'" schema\' '; } if (it.opts.verbose) { out += ' , schema: validate.schema' + ($schemaPath) + ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' '; } out += ' } '; } else { out += ' {} '; } out += '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; '; if (!it.compositeRule && $breakOnError) { /* istanbul ignore if */ if (it.async) { out += ' throw new ValidationError(vErrors); '; } else { out += ' validate.errors = vErrors; return false; '; } } out += ' } '; if ($breakOnError) { out += ' else { '; } } else { if ($breakOnError) { out += ' if (true) { '; } } return out; } /***/ }), /***/ 85810: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; //all requires must be explicit because browserify won't work with dynamic requires module.exports = { '$ref': __webpack_require__(42393), allOf: __webpack_require__(89443), anyOf: __webpack_require__(63093), '$comment': __webpack_require__(30134), const: __webpack_require__(1661), contains: __webpack_require__(55964), dependencies: __webpack_require__(2591), 'enum': __webpack_require__(10163), format: __webpack_require__(63847), 'if': __webpack_require__(80862), items: __webpack_require__(54408), maximum: __webpack_require__(7404), minimum: __webpack_require__(7404), maxItems: __webpack_require__(64683), minItems: __webpack_require__(64683), maxLength: __webpack_require__(52114), minLength: __webpack_require__(52114), maxProperties: __webpack_require__(71142), minProperties: __webpack_require__(71142), multipleOf: __webpack_require__(39772), not: __webpack_require__(60750), oneOf: __webpack_require__(6106), pattern: __webpack_require__(13912), properties: __webpack_require__(52924), propertyNames: __webpack_require__(19195), required: __webpack_require__(8420), uniqueItems: __webpack_require__(24995), validate: __webpack_require__(49585) }; /***/ }), /***/ 54408: /***/ ((module) => { "use strict"; module.exports = function generate_items(it, $keyword, $ruleType) { var out = ' '; var $lvl = it.level; var $dataLvl = it.dataLevel; var $schema = it.schema[$keyword]; var $schemaPath = it.schemaPath + it.util.getProperty($keyword); var $errSchemaPath = it.errSchemaPath + '/' + $keyword; var $breakOnError = !it.opts.allErrors; var $data = 'data' + ($dataLvl || ''); var $valid = 'valid' + $lvl; var $errs = 'errs__' + $lvl; var $it = it.util.copy(it); var $closingBraces = ''; $it.level++; var $nextValid = 'valid' + $it.level; var $idx = 'i' + $lvl, $dataNxt = $it.dataLevel = it.dataLevel + 1, $nextData = 'data' + $dataNxt, $currentBaseId = it.baseId; out += 'var ' + ($errs) + ' = errors;var ' + ($valid) + ';'; if (Array.isArray($schema)) { var $additionalItems = it.schema.additionalItems; if ($additionalItems === false) { out += ' ' + ($valid) + ' = ' + ($data) + '.length <= ' + ($schema.length) + '; '; var $currErrSchemaPath = $errSchemaPath; $errSchemaPath = it.errSchemaPath + '/additionalItems'; out += ' if (!' + ($valid) + ') { '; var $$outStack = $$outStack || []; $$outStack.push(out); out = ''; /* istanbul ignore else */ if (it.createErrors !== false) { out += ' { keyword: \'' + ('additionalItems') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { limit: ' + ($schema.length) + ' } '; if (it.opts.messages !== false) { out += ' , message: \'should NOT have more than ' + ($schema.length) + ' items\' '; } if (it.opts.verbose) { out += ' , schema: false , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' '; } out += ' } '; } else { out += ' {} '; } var __err = out; out = $$outStack.pop(); if (!it.compositeRule && $breakOnError) { /* istanbul ignore if */ if (it.async) { out += ' throw new ValidationError([' + (__err) + ']); '; } else { out += ' validate.errors = [' + (__err) + ']; return false; '; } } else { out += ' var err = ' + (__err) + '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; '; } out += ' } '; $errSchemaPath = $currErrSchemaPath; if ($breakOnError) { $closingBraces += '}'; out += ' else { '; } } var arr1 = $schema; if (arr1) { var $sch, $i = -1, l1 = arr1.length - 1; while ($i < l1) { $sch = arr1[$i += 1]; if ((it.opts.strictKeywords ? (typeof $sch == 'object' && Object.keys($sch).length > 0) || $sch === false : it.util.schemaHasRules($sch, it.RULES.all))) { out += ' ' + ($nextValid) + ' = true; if (' + ($data) + '.length > ' + ($i) + ') { '; var $passData = $data + '[' + $i + ']'; $it.schema = $sch; $it.schemaPath = $schemaPath + '[' + $i + ']'; $it.errSchemaPath = $errSchemaPath + '/' + $i; $it.errorPath = it.util.getPathExpr(it.errorPath, $i, it.opts.jsonPointers, true); $it.dataPathArr[$dataNxt] = $i; var $code = it.validate($it); $it.baseId = $currentBaseId; if (it.util.varOccurences($code, $nextData) < 2) { out += ' ' + (it.util.varReplace($code, $nextData, $passData)) + ' '; } else { out += ' var ' + ($nextData) + ' = ' + ($passData) + '; ' + ($code) + ' '; } out += ' } '; if ($breakOnError) { out += ' if (' + ($nextValid) + ') { '; $closingBraces += '}'; } } } } if (typeof $additionalItems == 'object' && (it.opts.strictKeywords ? (typeof $additionalItems == 'object' && Object.keys($additionalItems).length > 0) || $additionalItems === false : it.util.schemaHasRules($additionalItems, it.RULES.all))) { $it.schema = $additionalItems; $it.schemaPath = it.schemaPath + '.additionalItems'; $it.errSchemaPath = it.errSchemaPath + '/additionalItems'; out += ' ' + ($nextValid) + ' = true; if (' + ($data) + '.length > ' + ($schema.length) + ') { for (var ' + ($idx) + ' = ' + ($schema.length) + '; ' + ($idx) + ' < ' + ($data) + '.length; ' + ($idx) + '++) { '; $it.errorPath = it.util.getPathExpr(it.errorPath, $idx, it.opts.jsonPointers, true); var $passData = $data + '[' + $idx + ']'; $it.dataPathArr[$dataNxt] = $idx; var $code = it.validate($it); $it.baseId = $currentBaseId; if (it.util.varOccurences($code, $nextData) < 2) { out += ' ' + (it.util.varReplace($code, $nextData, $passData)) + ' '; } else { out += ' var ' + ($nextData) + ' = ' + ($passData) + '; ' + ($code) + ' '; } if ($breakOnError) { out += ' if (!' + ($nextValid) + ') break; '; } out += ' } } '; if ($breakOnError) { out += ' if (' + ($nextValid) + ') { '; $closingBraces += '}'; } } } else if ((it.opts.strictKeywords ? (typeof $schema == 'object' && Object.keys($schema).length > 0) || $schema === false : it.util.schemaHasRules($schema, it.RULES.all))) { $it.schema = $schema; $it.schemaPath = $schemaPath; $it.errSchemaPath = $errSchemaPath; out += ' for (var ' + ($idx) + ' = ' + (0) + '; ' + ($idx) + ' < ' + ($data) + '.length; ' + ($idx) + '++) { '; $it.errorPath = it.util.getPathExpr(it.errorPath, $idx, it.opts.jsonPointers, true); var $passData = $data + '[' + $idx + ']'; $it.dataPathArr[$dataNxt] = $idx; var $code = it.validate($it); $it.baseId = $currentBaseId; if (it.util.varOccurences($code, $nextData) < 2) { out += ' ' + (it.util.varReplace($code, $nextData, $passData)) + ' '; } else { out += ' var ' + ($nextData) + ' = ' + ($passData) + '; ' + ($code) + ' '; } if ($breakOnError) { out += ' if (!' + ($nextValid) + ') break; '; } out += ' }'; } if ($breakOnError) { out += ' ' + ($closingBraces) + ' if (' + ($errs) + ' == errors) {'; } return out; } /***/ }), /***/ 39772: /***/ ((module) => { "use strict"; module.exports = function generate_multipleOf(it, $keyword, $ruleType) { var out = ' '; var $lvl = it.level; var $dataLvl = it.dataLevel; var $schema = it.schema[$keyword]; var $schemaPath = it.schemaPath + it.util.getProperty($keyword); var $errSchemaPath = it.errSchemaPath + '/' + $keyword; var $breakOnError = !it.opts.allErrors; var $data = 'data' + ($dataLvl || ''); var $isData = it.opts.$data && $schema && $schema.$data, $schemaValue; if ($isData) { out += ' var schema' + ($lvl) + ' = ' + (it.util.getData($schema.$data, $dataLvl, it.dataPathArr)) + '; '; $schemaValue = 'schema' + $lvl; } else { $schemaValue = $schema; } if (!($isData || typeof $schema == 'number')) { throw new Error($keyword + ' must be number'); } out += 'var division' + ($lvl) + ';if ('; if ($isData) { out += ' ' + ($schemaValue) + ' !== undefined && ( typeof ' + ($schemaValue) + ' != \'number\' || '; } out += ' (division' + ($lvl) + ' = ' + ($data) + ' / ' + ($schemaValue) + ', '; if (it.opts.multipleOfPrecision) { out += ' Math.abs(Math.round(division' + ($lvl) + ') - division' + ($lvl) + ') > 1e-' + (it.opts.multipleOfPrecision) + ' '; } else { out += ' division' + ($lvl) + ' !== parseInt(division' + ($lvl) + ') '; } out += ' ) '; if ($isData) { out += ' ) '; } out += ' ) { '; var $$outStack = $$outStack || []; $$outStack.push(out); out = ''; /* istanbul ignore else */ if (it.createErrors !== false) { out += ' { keyword: \'' + ('multipleOf') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { multipleOf: ' + ($schemaValue) + ' } '; if (it.opts.messages !== false) { out += ' , message: \'should be multiple of '; if ($isData) { out += '\' + ' + ($schemaValue); } else { out += '' + ($schemaValue) + '\''; } } if (it.opts.verbose) { out += ' , schema: '; if ($isData) { out += 'validate.schema' + ($schemaPath); } else { out += '' + ($schema); } out += ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' '; } out += ' } '; } else { out += ' {} '; } var __err = out; out = $$outStack.pop(); if (!it.compositeRule && $breakOnError) { /* istanbul ignore if */ if (it.async) { out += ' throw new ValidationError([' + (__err) + ']); '; } else { out += ' validate.errors = [' + (__err) + ']; return false; '; } } else { out += ' var err = ' + (__err) + '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; '; } out += '} '; if ($breakOnError) { out += ' else { '; } return out; } /***/ }), /***/ 60750: /***/ ((module) => { "use strict"; module.exports = function generate_not(it, $keyword, $ruleType) { var out = ' '; var $lvl = it.level; var $dataLvl = it.dataLevel; var $schema = it.schema[$keyword]; var $schemaPath = it.schemaPath + it.util.getProperty($keyword); var $errSchemaPath = it.errSchemaPath + '/' + $keyword; var $breakOnError = !it.opts.allErrors; var $data = 'data' + ($dataLvl || ''); var $errs = 'errs__' + $lvl; var $it = it.util.copy(it); $it.level++; var $nextValid = 'valid' + $it.level; if ((it.opts.strictKeywords ? (typeof $schema == 'object' && Object.keys($schema).length > 0) || $schema === false : it.util.schemaHasRules($schema, it.RULES.all))) { $it.schema = $schema; $it.schemaPath = $schemaPath; $it.errSchemaPath = $errSchemaPath; out += ' var ' + ($errs) + ' = errors; '; var $wasComposite = it.compositeRule; it.compositeRule = $it.compositeRule = true; $it.createErrors = false; var $allErrorsOption; if ($it.opts.allErrors) { $allErrorsOption = $it.opts.allErrors; $it.opts.allErrors = false; } out += ' ' + (it.validate($it)) + ' '; $it.createErrors = true; if ($allErrorsOption) $it.opts.allErrors = $allErrorsOption; it.compositeRule = $it.compositeRule = $wasComposite; out += ' if (' + ($nextValid) + ') { '; var $$outStack = $$outStack || []; $$outStack.push(out); out = ''; /* istanbul ignore else */ if (it.createErrors !== false) { out += ' { keyword: \'' + ('not') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: {} '; if (it.opts.messages !== false) { out += ' , message: \'should NOT be valid\' '; } if (it.opts.verbose) { out += ' , schema: validate.schema' + ($schemaPath) + ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' '; } out += ' } '; } else { out += ' {} '; } var __err = out; out = $$outStack.pop(); if (!it.compositeRule && $breakOnError) { /* istanbul ignore if */ if (it.async) { out += ' throw new ValidationError([' + (__err) + ']); '; } else { out += ' validate.errors = [' + (__err) + ']; return false; '; } } else { out += ' var err = ' + (__err) + '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; '; } out += ' } else { errors = ' + ($errs) + '; if (vErrors !== null) { if (' + ($errs) + ') vErrors.length = ' + ($errs) + '; else vErrors = null; } '; if (it.opts.allErrors) { out += ' } '; } } else { out += ' var err = '; /* istanbul ignore else */ if (it.createErrors !== false) { out += ' { keyword: \'' + ('not') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: {} '; if (it.opts.messages !== false) { out += ' , message: \'should NOT be valid\' '; } if (it.opts.verbose) { out += ' , schema: validate.schema' + ($schemaPath) + ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' '; } out += ' } '; } else { out += ' {} '; } out += '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; '; if ($breakOnError) { out += ' if (false) { '; } } return out; } /***/ }), /***/ 6106: /***/ ((module) => { "use strict"; module.exports = function generate_oneOf(it, $keyword, $ruleType) { var out = ' '; var $lvl = it.level; var $dataLvl = it.dataLevel; var $schema = it.schema[$keyword]; var $schemaPath = it.schemaPath + it.util.getProperty($keyword); var $errSchemaPath = it.errSchemaPath + '/' + $keyword; var $breakOnError = !it.opts.allErrors; var $data = 'data' + ($dataLvl || ''); var $valid = 'valid' + $lvl; var $errs = 'errs__' + $lvl; var $it = it.util.copy(it); var $closingBraces = ''; $it.level++; var $nextValid = 'valid' + $it.level; var $currentBaseId = $it.baseId, $prevValid = 'prevValid' + $lvl, $passingSchemas = 'passingSchemas' + $lvl; out += 'var ' + ($errs) + ' = errors , ' + ($prevValid) + ' = false , ' + ($valid) + ' = false , ' + ($passingSchemas) + ' = null; '; var $wasComposite = it.compositeRule; it.compositeRule = $it.compositeRule = true; var arr1 = $schema; if (arr1) { var $sch, $i = -1, l1 = arr1.length - 1; while ($i < l1) { $sch = arr1[$i += 1]; if ((it.opts.strictKeywords ? (typeof $sch == 'object' && Object.keys($sch).length > 0) || $sch === false : it.util.schemaHasRules($sch, it.RULES.all))) { $it.schema = $sch; $it.schemaPath = $schemaPath + '[' + $i + ']'; $it.errSchemaPath = $errSchemaPath + '/' + $i; out += ' ' + (it.validate($it)) + ' '; $it.baseId = $currentBaseId; } else { out += ' var ' + ($nextValid) + ' = true; '; } if ($i) { out += ' if (' + ($nextValid) + ' && ' + ($prevValid) + ') { ' + ($valid) + ' = false; ' + ($passingSchemas) + ' = [' + ($passingSchemas) + ', ' + ($i) + ']; } else { '; $closingBraces += '}'; } out += ' if (' + ($nextValid) + ') { ' + ($valid) + ' = ' + ($prevValid) + ' = true; ' + ($passingSchemas) + ' = ' + ($i) + '; }'; } } it.compositeRule = $it.compositeRule = $wasComposite; out += '' + ($closingBraces) + 'if (!' + ($valid) + ') { var err = '; /* istanbul ignore else */ if (it.createErrors !== false) { out += ' { keyword: \'' + ('oneOf') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { passingSchemas: ' + ($passingSchemas) + ' } '; if (it.opts.messages !== false) { out += ' , message: \'should match exactly one schema in oneOf\' '; } if (it.opts.verbose) { out += ' , schema: validate.schema' + ($schemaPath) + ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' '; } out += ' } '; } else { out += ' {} '; } out += '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; '; if (!it.compositeRule && $breakOnError) { /* istanbul ignore if */ if (it.async) { out += ' throw new ValidationError(vErrors); '; } else { out += ' validate.errors = vErrors; return false; '; } } out += '} else { errors = ' + ($errs) + '; if (vErrors !== null) { if (' + ($errs) + ') vErrors.length = ' + ($errs) + '; else vErrors = null; }'; if (it.opts.allErrors) { out += ' } '; } return out; } /***/ }), /***/ 13912: /***/ ((module) => { "use strict"; module.exports = function generate_pattern(it, $keyword, $ruleType) { var out = ' '; var $lvl = it.level; var $dataLvl = it.dataLevel; var $schema = it.schema[$keyword]; var $schemaPath = it.schemaPath + it.util.getProperty($keyword); var $errSchemaPath = it.errSchemaPath + '/' + $keyword; var $breakOnError = !it.opts.allErrors; var $data = 'data' + ($dataLvl || ''); var $isData = it.opts.$data && $schema && $schema.$data, $schemaValue; if ($isData) { out += ' var schema' + ($lvl) + ' = ' + (it.util.getData($schema.$data, $dataLvl, it.dataPathArr)) + '; '; $schemaValue = 'schema' + $lvl; } else { $schemaValue = $schema; } var $regexp = $isData ? '(new RegExp(' + $schemaValue + '))' : it.usePattern($schema); out += 'if ( '; if ($isData) { out += ' (' + ($schemaValue) + ' !== undefined && typeof ' + ($schemaValue) + ' != \'string\') || '; } out += ' !' + ($regexp) + '.test(' + ($data) + ') ) { '; var $$outStack = $$outStack || []; $$outStack.push(out); out = ''; /* istanbul ignore else */ if (it.createErrors !== false) { out += ' { keyword: \'' + ('pattern') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { pattern: '; if ($isData) { out += '' + ($schemaValue); } else { out += '' + (it.util.toQuotedString($schema)); } out += ' } '; if (it.opts.messages !== false) { out += ' , message: \'should match pattern "'; if ($isData) { out += '\' + ' + ($schemaValue) + ' + \''; } else { out += '' + (it.util.escapeQuotes($schema)); } out += '"\' '; } if (it.opts.verbose) { out += ' , schema: '; if ($isData) { out += 'validate.schema' + ($schemaPath); } else { out += '' + (it.util.toQuotedString($schema)); } out += ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' '; } out += ' } '; } else { out += ' {} '; } var __err = out; out = $$outStack.pop(); if (!it.compositeRule && $breakOnError) { /* istanbul ignore if */ if (it.async) { out += ' throw new ValidationError([' + (__err) + ']); '; } else { out += ' validate.errors = [' + (__err) + ']; return false; '; } } else { out += ' var err = ' + (__err) + '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; '; } out += '} '; if ($breakOnError) { out += ' else { '; } return out; } /***/ }), /***/ 52924: /***/ ((module) => { "use strict"; module.exports = function generate_properties(it, $keyword, $ruleType) { var out = ' '; var $lvl = it.level; var $dataLvl = it.dataLevel; var $schema = it.schema[$keyword]; var $schemaPath = it.schemaPath + it.util.getProperty($keyword); var $errSchemaPath = it.errSchemaPath + '/' + $keyword; var $breakOnError = !it.opts.allErrors; var $data = 'data' + ($dataLvl || ''); var $errs = 'errs__' + $lvl; var $it = it.util.copy(it); var $closingBraces = ''; $it.level++; var $nextValid = 'valid' + $it.level; var $key = 'key' + $lvl, $idx = 'idx' + $lvl, $dataNxt = $it.dataLevel = it.dataLevel + 1, $nextData = 'data' + $dataNxt, $dataProperties = 'dataProperties' + $lvl; var $schemaKeys = Object.keys($schema || {}).filter(notProto), $pProperties = it.schema.patternProperties || {}, $pPropertyKeys = Object.keys($pProperties).filter(notProto), $aProperties = it.schema.additionalProperties, $someProperties = $schemaKeys.length || $pPropertyKeys.length, $noAdditional = $aProperties === false, $additionalIsSchema = typeof $aProperties == 'object' && Object.keys($aProperties).length, $removeAdditional = it.opts.removeAdditional, $checkAdditional = $noAdditional || $additionalIsSchema || $removeAdditional, $ownProperties = it.opts.ownProperties, $currentBaseId = it.baseId; var $required = it.schema.required; if ($required && !(it.opts.$data && $required.$data) && $required.length < it.opts.loopRequired) { var $requiredHash = it.util.toHash($required); } function notProto(p) { return p !== '__proto__'; } out += 'var ' + ($errs) + ' = errors;var ' + ($nextValid) + ' = true;'; if ($ownProperties) { out += ' var ' + ($dataProperties) + ' = undefined;'; } if ($checkAdditional) { if ($ownProperties) { out += ' ' + ($dataProperties) + ' = ' + ($dataProperties) + ' || Object.keys(' + ($data) + '); for (var ' + ($idx) + '=0; ' + ($idx) + '<' + ($dataProperties) + '.length; ' + ($idx) + '++) { var ' + ($key) + ' = ' + ($dataProperties) + '[' + ($idx) + ']; '; } else { out += ' for (var ' + ($key) + ' in ' + ($data) + ') { '; } if ($someProperties) { out += ' var isAdditional' + ($lvl) + ' = !(false '; if ($schemaKeys.length) { if ($schemaKeys.length > 8) { out += ' || validate.schema' + ($schemaPath) + '.hasOwnProperty(' + ($key) + ') '; } else { var arr1 = $schemaKeys; if (arr1) { var $propertyKey, i1 = -1, l1 = arr1.length - 1; while (i1 < l1) { $propertyKey = arr1[i1 += 1]; out += ' || ' + ($key) + ' == ' + (it.util.toQuotedString($propertyKey)) + ' '; } } } } if ($pPropertyKeys.length) { var arr2 = $pPropertyKeys; if (arr2) { var $pProperty, $i = -1, l2 = arr2.length - 1; while ($i < l2) { $pProperty = arr2[$i += 1]; out += ' || ' + (it.usePattern($pProperty)) + '.test(' + ($key) + ') '; } } } out += ' ); if (isAdditional' + ($lvl) + ') { '; } if ($removeAdditional == 'all') { out += ' delete ' + ($data) + '[' + ($key) + ']; '; } else { var $currentErrorPath = it.errorPath; var $additionalProperty = '\' + ' + $key + ' + \''; if (it.opts._errorDataPathProperty) { it.errorPath = it.util.getPathExpr(it.errorPath, $key, it.opts.jsonPointers); } if ($noAdditional) { if ($removeAdditional) { out += ' delete ' + ($data) + '[' + ($key) + ']; '; } else { out += ' ' + ($nextValid) + ' = false; '; var $currErrSchemaPath = $errSchemaPath; $errSchemaPath = it.errSchemaPath + '/additionalProperties'; var $$outStack = $$outStack || []; $$outStack.push(out); out = ''; /* istanbul ignore else */ if (it.createErrors !== false) { out += ' { keyword: \'' + ('additionalProperties') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { additionalProperty: \'' + ($additionalProperty) + '\' } '; if (it.opts.messages !== false) { out += ' , message: \''; if (it.opts._errorDataPathProperty) { out += 'is an invalid additional property'; } else { out += 'should NOT have additional properties'; } out += '\' '; } if (it.opts.verbose) { out += ' , schema: false , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' '; } out += ' } '; } else { out += ' {} '; } var __err = out; out = $$outStack.pop(); if (!it.compositeRule && $breakOnError) { /* istanbul ignore if */ if (it.async) { out += ' throw new ValidationError([' + (__err) + ']); '; } else { out += ' validate.errors = [' + (__err) + ']; return false; '; } } else { out += ' var err = ' + (__err) + '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; '; } $errSchemaPath = $currErrSchemaPath; if ($breakOnError) { out += ' break; '; } } } else if ($additionalIsSchema) { if ($removeAdditional == 'failing') { out += ' var ' + ($errs) + ' = errors; '; var $wasComposite = it.compositeRule; it.compositeRule = $it.compositeRule = true; $it.schema = $aProperties; $it.schemaPath = it.schemaPath + '.additionalProperties'; $it.errSchemaPath = it.errSchemaPath + '/additionalProperties'; $it.errorPath = it.opts._errorDataPathProperty ? it.errorPath : it.util.getPathExpr(it.errorPath, $key, it.opts.jsonPointers); var $passData = $data + '[' + $key + ']'; $it.dataPathArr[$dataNxt] = $key; var $code = it.validate($it); $it.baseId = $currentBaseId; if (it.util.varOccurences($code, $nextData) < 2) { out += ' ' + (it.util.varReplace($code, $nextData, $passData)) + ' '; } else { out += ' var ' + ($nextData) + ' = ' + ($passData) + '; ' + ($code) + ' '; } out += ' if (!' + ($nextValid) + ') { errors = ' + ($errs) + '; if (validate.errors !== null) { if (errors) validate.errors.length = errors; else validate.errors = null; } delete ' + ($data) + '[' + ($key) + ']; } '; it.compositeRule = $it.compositeRule = $wasComposite; } else { $it.schema = $aProperties; $it.schemaPath = it.schemaPath + '.additionalProperties'; $it.errSchemaPath = it.errSchemaPath + '/additionalProperties'; $it.errorPath = it.opts._errorDataPathProperty ? it.errorPath : it.util.getPathExpr(it.errorPath, $key, it.opts.jsonPointers); var $passData = $data + '[' + $key + ']'; $it.dataPathArr[$dataNxt] = $key; var $code = it.validate($it); $it.baseId = $currentBaseId; if (it.util.varOccurences($code, $nextData) < 2) { out += ' ' + (it.util.varReplace($code, $nextData, $passData)) + ' '; } else { out += ' var ' + ($nextData) + ' = ' + ($passData) + '; ' + ($code) + ' '; } if ($breakOnError) { out += ' if (!' + ($nextValid) + ') break; '; } } } it.errorPath = $currentErrorPath; } if ($someProperties) { out += ' } '; } out += ' } '; if ($breakOnError) { out += ' if (' + ($nextValid) + ') { '; $closingBraces += '}'; } } var $useDefaults = it.opts.useDefaults && !it.compositeRule; if ($schemaKeys.length) { var arr3 = $schemaKeys; if (arr3) { var $propertyKey, i3 = -1, l3 = arr3.length - 1; while (i3 < l3) { $propertyKey = arr3[i3 += 1]; var $sch = $schema[$propertyKey]; if ((it.opts.strictKeywords ? (typeof $sch == 'object' && Object.keys($sch).length > 0) || $sch === false : it.util.schemaHasRules($sch, it.RULES.all))) { var $prop = it.util.getProperty($propertyKey), $passData = $data + $prop, $hasDefault = $useDefaults && $sch.default !== undefined; $it.schema = $sch; $it.schemaPath = $schemaPath + $prop; $it.errSchemaPath = $errSchemaPath + '/' + it.util.escapeFragment($propertyKey); $it.errorPath = it.util.getPath(it.errorPath, $propertyKey, it.opts.jsonPointers); $it.dataPathArr[$dataNxt] = it.util.toQuotedString($propertyKey); var $code = it.validate($it); $it.baseId = $currentBaseId; if (it.util.varOccurences($code, $nextData) < 2) { $code = it.util.varReplace($code, $nextData, $passData); var $useData = $passData; } else { var $useData = $nextData; out += ' var ' + ($nextData) + ' = ' + ($passData) + '; '; } if ($hasDefault) { out += ' ' + ($code) + ' '; } else { if ($requiredHash && $requiredHash[$propertyKey]) { out += ' if ( ' + ($useData) + ' === undefined '; if ($ownProperties) { out += ' || ! Object.prototype.hasOwnProperty.call(' + ($data) + ', \'' + (it.util.escapeQuotes($propertyKey)) + '\') '; } out += ') { ' + ($nextValid) + ' = false; '; var $currentErrorPath = it.errorPath, $currErrSchemaPath = $errSchemaPath, $missingProperty = it.util.escapeQuotes($propertyKey); if (it.opts._errorDataPathProperty) { it.errorPath = it.util.getPath($currentErrorPath, $propertyKey, it.opts.jsonPointers); } $errSchemaPath = it.errSchemaPath + '/required'; var $$outStack = $$outStack || []; $$outStack.push(out); out = ''; /* istanbul ignore else */ if (it.createErrors !== false) { out += ' { keyword: \'' + ('required') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { missingProperty: \'' + ($missingProperty) + '\' } '; if (it.opts.messages !== false) { out += ' , message: \''; if (it.opts._errorDataPathProperty) { out += 'is a required property'; } else { out += 'should have required property \\\'' + ($missingProperty) + '\\\''; } out += '\' '; } if (it.opts.verbose) { out += ' , schema: validate.schema' + ($schemaPath) + ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' '; } out += ' } '; } else { out += ' {} '; } var __err = out; out = $$outStack.pop(); if (!it.compositeRule && $breakOnError) { /* istanbul ignore if */ if (it.async) { out += ' throw new ValidationError([' + (__err) + ']); '; } else { out += ' validate.errors = [' + (__err) + ']; return false; '; } } else { out += ' var err = ' + (__err) + '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; '; } $errSchemaPath = $currErrSchemaPath; it.errorPath = $currentErrorPath; out += ' } else { '; } else { if ($breakOnError) { out += ' if ( ' + ($useData) + ' === undefined '; if ($ownProperties) { out += ' || ! Object.prototype.hasOwnProperty.call(' + ($data) + ', \'' + (it.util.escapeQuotes($propertyKey)) + '\') '; } out += ') { ' + ($nextValid) + ' = true; } else { '; } else { out += ' if (' + ($useData) + ' !== undefined '; if ($ownProperties) { out += ' && Object.prototype.hasOwnProperty.call(' + ($data) + ', \'' + (it.util.escapeQuotes($propertyKey)) + '\') '; } out += ' ) { '; } } out += ' ' + ($code) + ' } '; } } if ($breakOnError) { out += ' if (' + ($nextValid) + ') { '; $closingBraces += '}'; } } } } if ($pPropertyKeys.length) { var arr4 = $pPropertyKeys; if (arr4) { var $pProperty, i4 = -1, l4 = arr4.length - 1; while (i4 < l4) { $pProperty = arr4[i4 += 1]; var $sch = $pProperties[$pProperty]; if ((it.opts.strictKeywords ? (typeof $sch == 'object' && Object.keys($sch).length > 0) || $sch === false : it.util.schemaHasRules($sch, it.RULES.all))) { $it.schema = $sch; $it.schemaPath = it.schemaPath + '.patternProperties' + it.util.getProperty($pProperty); $it.errSchemaPath = it.errSchemaPath + '/patternProperties/' + it.util.escapeFragment($pProperty); if ($ownProperties) { out += ' ' + ($dataProperties) + ' = ' + ($dataProperties) + ' || Object.keys(' + ($data) + '); for (var ' + ($idx) + '=0; ' + ($idx) + '<' + ($dataProperties) + '.length; ' + ($idx) + '++) { var ' + ($key) + ' = ' + ($dataProperties) + '[' + ($idx) + ']; '; } else { out += ' for (var ' + ($key) + ' in ' + ($data) + ') { '; } out += ' if (' + (it.usePattern($pProperty)) + '.test(' + ($key) + ')) { '; $it.errorPath = it.util.getPathExpr(it.errorPath, $key, it.opts.jsonPointers); var $passData = $data + '[' + $key + ']'; $it.dataPathArr[$dataNxt] = $key; var $code = it.validate($it); $it.baseId = $currentBaseId; if (it.util.varOccurences($code, $nextData) < 2) { out += ' ' + (it.util.varReplace($code, $nextData, $passData)) + ' '; } else { out += ' var ' + ($nextData) + ' = ' + ($passData) + '; ' + ($code) + ' '; } if ($breakOnError) { out += ' if (!' + ($nextValid) + ') break; '; } out += ' } '; if ($breakOnError) { out += ' else ' + ($nextValid) + ' = true; '; } out += ' } '; if ($breakOnError) { out += ' if (' + ($nextValid) + ') { '; $closingBraces += '}'; } } } } } if ($breakOnError) { out += ' ' + ($closingBraces) + ' if (' + ($errs) + ' == errors) {'; } return out; } /***/ }), /***/ 19195: /***/ ((module) => { "use strict"; module.exports = function generate_propertyNames(it, $keyword, $ruleType) { var out = ' '; var $lvl = it.level; var $dataLvl = it.dataLevel; var $schema = it.schema[$keyword]; var $schemaPath = it.schemaPath + it.util.getProperty($keyword); var $errSchemaPath = it.errSchemaPath + '/' + $keyword; var $breakOnError = !it.opts.allErrors; var $data = 'data' + ($dataLvl || ''); var $errs = 'errs__' + $lvl; var $it = it.util.copy(it); var $closingBraces = ''; $it.level++; var $nextValid = 'valid' + $it.level; out += 'var ' + ($errs) + ' = errors;'; if ((it.opts.strictKeywords ? (typeof $schema == 'object' && Object.keys($schema).length > 0) || $schema === false : it.util.schemaHasRules($schema, it.RULES.all))) { $it.schema = $schema; $it.schemaPath = $schemaPath; $it.errSchemaPath = $errSchemaPath; var $key = 'key' + $lvl, $idx = 'idx' + $lvl, $i = 'i' + $lvl, $invalidName = '\' + ' + $key + ' + \'', $dataNxt = $it.dataLevel = it.dataLevel + 1, $nextData = 'data' + $dataNxt, $dataProperties = 'dataProperties' + $lvl, $ownProperties = it.opts.ownProperties, $currentBaseId = it.baseId; if ($ownProperties) { out += ' var ' + ($dataProperties) + ' = undefined; '; } if ($ownProperties) { out += ' ' + ($dataProperties) + ' = ' + ($dataProperties) + ' || Object.keys(' + ($data) + '); for (var ' + ($idx) + '=0; ' + ($idx) + '<' + ($dataProperties) + '.length; ' + ($idx) + '++) { var ' + ($key) + ' = ' + ($dataProperties) + '[' + ($idx) + ']; '; } else { out += ' for (var ' + ($key) + ' in ' + ($data) + ') { '; } out += ' var startErrs' + ($lvl) + ' = errors; '; var $passData = $key; var $wasComposite = it.compositeRule; it.compositeRule = $it.compositeRule = true; var $code = it.validate($it); $it.baseId = $currentBaseId; if (it.util.varOccurences($code, $nextData) < 2) { out += ' ' + (it.util.varReplace($code, $nextData, $passData)) + ' '; } else { out += ' var ' + ($nextData) + ' = ' + ($passData) + '; ' + ($code) + ' '; } it.compositeRule = $it.compositeRule = $wasComposite; out += ' if (!' + ($nextValid) + ') { for (var ' + ($i) + '=startErrs' + ($lvl) + '; ' + ($i) + ' { "use strict"; module.exports = function generate_ref(it, $keyword, $ruleType) { var out = ' '; var $lvl = it.level; var $dataLvl = it.dataLevel; var $schema = it.schema[$keyword]; var $errSchemaPath = it.errSchemaPath + '/' + $keyword; var $breakOnError = !it.opts.allErrors; var $data = 'data' + ($dataLvl || ''); var $valid = 'valid' + $lvl; var $async, $refCode; if ($schema == '#' || $schema == '#/') { if (it.isRoot) { $async = it.async; $refCode = 'validate'; } else { $async = it.root.schema.$async === true; $refCode = 'root.refVal[0]'; } } else { var $refVal = it.resolveRef(it.baseId, $schema, it.isRoot); if ($refVal === undefined) { var $message = it.MissingRefError.message(it.baseId, $schema); if (it.opts.missingRefs == 'fail') { it.logger.error($message); var $$outStack = $$outStack || []; $$outStack.push(out); out = ''; /* istanbul ignore else */ if (it.createErrors !== false) { out += ' { keyword: \'' + ('$ref') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { ref: \'' + (it.util.escapeQuotes($schema)) + '\' } '; if (it.opts.messages !== false) { out += ' , message: \'can\\\'t resolve reference ' + (it.util.escapeQuotes($schema)) + '\' '; } if (it.opts.verbose) { out += ' , schema: ' + (it.util.toQuotedString($schema)) + ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' '; } out += ' } '; } else { out += ' {} '; } var __err = out; out = $$outStack.pop(); if (!it.compositeRule && $breakOnError) { /* istanbul ignore if */ if (it.async) { out += ' throw new ValidationError([' + (__err) + ']); '; } else { out += ' validate.errors = [' + (__err) + ']; return false; '; } } else { out += ' var err = ' + (__err) + '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; '; } if ($breakOnError) { out += ' if (false) { '; } } else if (it.opts.missingRefs == 'ignore') { it.logger.warn($message); if ($breakOnError) { out += ' if (true) { '; } } else { throw new it.MissingRefError(it.baseId, $schema, $message); } } else if ($refVal.inline) { var $it = it.util.copy(it); $it.level++; var $nextValid = 'valid' + $it.level; $it.schema = $refVal.schema; $it.schemaPath = ''; $it.errSchemaPath = $schema; var $code = it.validate($it).replace(/validate\.schema/g, $refVal.code); out += ' ' + ($code) + ' '; if ($breakOnError) { out += ' if (' + ($nextValid) + ') { '; } } else { $async = $refVal.$async === true || (it.async && $refVal.$async !== false); $refCode = $refVal.code; } } if ($refCode) { var $$outStack = $$outStack || []; $$outStack.push(out); out = ''; if (it.opts.passContext) { out += ' ' + ($refCode) + '.call(this, '; } else { out += ' ' + ($refCode) + '( '; } out += ' ' + ($data) + ', (dataPath || \'\')'; if (it.errorPath != '""') { out += ' + ' + (it.errorPath); } var $parentData = $dataLvl ? 'data' + (($dataLvl - 1) || '') : 'parentData', $parentDataProperty = $dataLvl ? it.dataPathArr[$dataLvl] : 'parentDataProperty'; out += ' , ' + ($parentData) + ' , ' + ($parentDataProperty) + ', rootData) '; var __callValidate = out; out = $$outStack.pop(); if ($async) { if (!it.async) throw new Error('async schema referenced by sync schema'); if ($breakOnError) { out += ' var ' + ($valid) + '; '; } out += ' try { await ' + (__callValidate) + '; '; if ($breakOnError) { out += ' ' + ($valid) + ' = true; '; } out += ' } catch (e) { if (!(e instanceof ValidationError)) throw e; if (vErrors === null) vErrors = e.errors; else vErrors = vErrors.concat(e.errors); errors = vErrors.length; '; if ($breakOnError) { out += ' ' + ($valid) + ' = false; '; } out += ' } '; if ($breakOnError) { out += ' if (' + ($valid) + ') { '; } } else { out += ' if (!' + (__callValidate) + ') { if (vErrors === null) vErrors = ' + ($refCode) + '.errors; else vErrors = vErrors.concat(' + ($refCode) + '.errors); errors = vErrors.length; } '; if ($breakOnError) { out += ' else { '; } } } return out; } /***/ }), /***/ 8420: /***/ ((module) => { "use strict"; module.exports = function generate_required(it, $keyword, $ruleType) { var out = ' '; var $lvl = it.level; var $dataLvl = it.dataLevel; var $schema = it.schema[$keyword]; var $schemaPath = it.schemaPath + it.util.getProperty($keyword); var $errSchemaPath = it.errSchemaPath + '/' + $keyword; var $breakOnError = !it.opts.allErrors; var $data = 'data' + ($dataLvl || ''); var $valid = 'valid' + $lvl; var $isData = it.opts.$data && $schema && $schema.$data, $schemaValue; if ($isData) { out += ' var schema' + ($lvl) + ' = ' + (it.util.getData($schema.$data, $dataLvl, it.dataPathArr)) + '; '; $schemaValue = 'schema' + $lvl; } else { $schemaValue = $schema; } var $vSchema = 'schema' + $lvl; if (!$isData) { if ($schema.length < it.opts.loopRequired && it.schema.properties && Object.keys(it.schema.properties).length) { var $required = []; var arr1 = $schema; if (arr1) { var $property, i1 = -1, l1 = arr1.length - 1; while (i1 < l1) { $property = arr1[i1 += 1]; var $propertySch = it.schema.properties[$property]; if (!($propertySch && (it.opts.strictKeywords ? (typeof $propertySch == 'object' && Object.keys($propertySch).length > 0) || $propertySch === false : it.util.schemaHasRules($propertySch, it.RULES.all)))) { $required[$required.length] = $property; } } } } else { var $required = $schema; } } if ($isData || $required.length) { var $currentErrorPath = it.errorPath, $loopRequired = $isData || $required.length >= it.opts.loopRequired, $ownProperties = it.opts.ownProperties; if ($breakOnError) { out += ' var missing' + ($lvl) + '; '; if ($loopRequired) { if (!$isData) { out += ' var ' + ($vSchema) + ' = validate.schema' + ($schemaPath) + '; '; } var $i = 'i' + $lvl, $propertyPath = 'schema' + $lvl + '[' + $i + ']', $missingProperty = '\' + ' + $propertyPath + ' + \''; if (it.opts._errorDataPathProperty) { it.errorPath = it.util.getPathExpr($currentErrorPath, $propertyPath, it.opts.jsonPointers); } out += ' var ' + ($valid) + ' = true; '; if ($isData) { out += ' if (schema' + ($lvl) + ' === undefined) ' + ($valid) + ' = true; else if (!Array.isArray(schema' + ($lvl) + ')) ' + ($valid) + ' = false; else {'; } out += ' for (var ' + ($i) + ' = 0; ' + ($i) + ' < ' + ($vSchema) + '.length; ' + ($i) + '++) { ' + ($valid) + ' = ' + ($data) + '[' + ($vSchema) + '[' + ($i) + ']] !== undefined '; if ($ownProperties) { out += ' && Object.prototype.hasOwnProperty.call(' + ($data) + ', ' + ($vSchema) + '[' + ($i) + ']) '; } out += '; if (!' + ($valid) + ') break; } '; if ($isData) { out += ' } '; } out += ' if (!' + ($valid) + ') { '; var $$outStack = $$outStack || []; $$outStack.push(out); out = ''; /* istanbul ignore else */ if (it.createErrors !== false) { out += ' { keyword: \'' + ('required') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { missingProperty: \'' + ($missingProperty) + '\' } '; if (it.opts.messages !== false) { out += ' , message: \''; if (it.opts._errorDataPathProperty) { out += 'is a required property'; } else { out += 'should have required property \\\'' + ($missingProperty) + '\\\''; } out += '\' '; } if (it.opts.verbose) { out += ' , schema: validate.schema' + ($schemaPath) + ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' '; } out += ' } '; } else { out += ' {} '; } var __err = out; out = $$outStack.pop(); if (!it.compositeRule && $breakOnError) { /* istanbul ignore if */ if (it.async) { out += ' throw new ValidationError([' + (__err) + ']); '; } else { out += ' validate.errors = [' + (__err) + ']; return false; '; } } else { out += ' var err = ' + (__err) + '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; '; } out += ' } else { '; } else { out += ' if ( '; var arr2 = $required; if (arr2) { var $propertyKey, $i = -1, l2 = arr2.length - 1; while ($i < l2) { $propertyKey = arr2[$i += 1]; if ($i) { out += ' || '; } var $prop = it.util.getProperty($propertyKey), $useData = $data + $prop; out += ' ( ( ' + ($useData) + ' === undefined '; if ($ownProperties) { out += ' || ! Object.prototype.hasOwnProperty.call(' + ($data) + ', \'' + (it.util.escapeQuotes($propertyKey)) + '\') '; } out += ') && (missing' + ($lvl) + ' = ' + (it.util.toQuotedString(it.opts.jsonPointers ? $propertyKey : $prop)) + ') ) '; } } out += ') { '; var $propertyPath = 'missing' + $lvl, $missingProperty = '\' + ' + $propertyPath + ' + \''; if (it.opts._errorDataPathProperty) { it.errorPath = it.opts.jsonPointers ? it.util.getPathExpr($currentErrorPath, $propertyPath, true) : $currentErrorPath + ' + ' + $propertyPath; } var $$outStack = $$outStack || []; $$outStack.push(out); out = ''; /* istanbul ignore else */ if (it.createErrors !== false) { out += ' { keyword: \'' + ('required') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { missingProperty: \'' + ($missingProperty) + '\' } '; if (it.opts.messages !== false) { out += ' , message: \''; if (it.opts._errorDataPathProperty) { out += 'is a required property'; } else { out += 'should have required property \\\'' + ($missingProperty) + '\\\''; } out += '\' '; } if (it.opts.verbose) { out += ' , schema: validate.schema' + ($schemaPath) + ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' '; } out += ' } '; } else { out += ' {} '; } var __err = out; out = $$outStack.pop(); if (!it.compositeRule && $breakOnError) { /* istanbul ignore if */ if (it.async) { out += ' throw new ValidationError([' + (__err) + ']); '; } else { out += ' validate.errors = [' + (__err) + ']; return false; '; } } else { out += ' var err = ' + (__err) + '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; '; } out += ' } else { '; } } else { if ($loopRequired) { if (!$isData) { out += ' var ' + ($vSchema) + ' = validate.schema' + ($schemaPath) + '; '; } var $i = 'i' + $lvl, $propertyPath = 'schema' + $lvl + '[' + $i + ']', $missingProperty = '\' + ' + $propertyPath + ' + \''; if (it.opts._errorDataPathProperty) { it.errorPath = it.util.getPathExpr($currentErrorPath, $propertyPath, it.opts.jsonPointers); } if ($isData) { out += ' if (' + ($vSchema) + ' && !Array.isArray(' + ($vSchema) + ')) { var err = '; /* istanbul ignore else */ if (it.createErrors !== false) { out += ' { keyword: \'' + ('required') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { missingProperty: \'' + ($missingProperty) + '\' } '; if (it.opts.messages !== false) { out += ' , message: \''; if (it.opts._errorDataPathProperty) { out += 'is a required property'; } else { out += 'should have required property \\\'' + ($missingProperty) + '\\\''; } out += '\' '; } if (it.opts.verbose) { out += ' , schema: validate.schema' + ($schemaPath) + ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' '; } out += ' } '; } else { out += ' {} '; } out += '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; } else if (' + ($vSchema) + ' !== undefined) { '; } out += ' for (var ' + ($i) + ' = 0; ' + ($i) + ' < ' + ($vSchema) + '.length; ' + ($i) + '++) { if (' + ($data) + '[' + ($vSchema) + '[' + ($i) + ']] === undefined '; if ($ownProperties) { out += ' || ! Object.prototype.hasOwnProperty.call(' + ($data) + ', ' + ($vSchema) + '[' + ($i) + ']) '; } out += ') { var err = '; /* istanbul ignore else */ if (it.createErrors !== false) { out += ' { keyword: \'' + ('required') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { missingProperty: \'' + ($missingProperty) + '\' } '; if (it.opts.messages !== false) { out += ' , message: \''; if (it.opts._errorDataPathProperty) { out += 'is a required property'; } else { out += 'should have required property \\\'' + ($missingProperty) + '\\\''; } out += '\' '; } if (it.opts.verbose) { out += ' , schema: validate.schema' + ($schemaPath) + ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' '; } out += ' } '; } else { out += ' {} '; } out += '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; } } '; if ($isData) { out += ' } '; } } else { var arr3 = $required; if (arr3) { var $propertyKey, i3 = -1, l3 = arr3.length - 1; while (i3 < l3) { $propertyKey = arr3[i3 += 1]; var $prop = it.util.getProperty($propertyKey), $missingProperty = it.util.escapeQuotes($propertyKey), $useData = $data + $prop; if (it.opts._errorDataPathProperty) { it.errorPath = it.util.getPath($currentErrorPath, $propertyKey, it.opts.jsonPointers); } out += ' if ( ' + ($useData) + ' === undefined '; if ($ownProperties) { out += ' || ! Object.prototype.hasOwnProperty.call(' + ($data) + ', \'' + (it.util.escapeQuotes($propertyKey)) + '\') '; } out += ') { var err = '; /* istanbul ignore else */ if (it.createErrors !== false) { out += ' { keyword: \'' + ('required') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { missingProperty: \'' + ($missingProperty) + '\' } '; if (it.opts.messages !== false) { out += ' , message: \''; if (it.opts._errorDataPathProperty) { out += 'is a required property'; } else { out += 'should have required property \\\'' + ($missingProperty) + '\\\''; } out += '\' '; } if (it.opts.verbose) { out += ' , schema: validate.schema' + ($schemaPath) + ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' '; } out += ' } '; } else { out += ' {} '; } out += '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; } '; } } } } it.errorPath = $currentErrorPath; } else if ($breakOnError) { out += ' if (true) {'; } return out; } /***/ }), /***/ 24995: /***/ ((module) => { "use strict"; module.exports = function generate_uniqueItems(it, $keyword, $ruleType) { var out = ' '; var $lvl = it.level; var $dataLvl = it.dataLevel; var $schema = it.schema[$keyword]; var $schemaPath = it.schemaPath + it.util.getProperty($keyword); var $errSchemaPath = it.errSchemaPath + '/' + $keyword; var $breakOnError = !it.opts.allErrors; var $data = 'data' + ($dataLvl || ''); var $valid = 'valid' + $lvl; var $isData = it.opts.$data && $schema && $schema.$data, $schemaValue; if ($isData) { out += ' var schema' + ($lvl) + ' = ' + (it.util.getData($schema.$data, $dataLvl, it.dataPathArr)) + '; '; $schemaValue = 'schema' + $lvl; } else { $schemaValue = $schema; } if (($schema || $isData) && it.opts.uniqueItems !== false) { if ($isData) { out += ' var ' + ($valid) + '; if (' + ($schemaValue) + ' === false || ' + ($schemaValue) + ' === undefined) ' + ($valid) + ' = true; else if (typeof ' + ($schemaValue) + ' != \'boolean\') ' + ($valid) + ' = false; else { '; } out += ' var i = ' + ($data) + '.length , ' + ($valid) + ' = true , j; if (i > 1) { '; var $itemType = it.schema.items && it.schema.items.type, $typeIsArray = Array.isArray($itemType); if (!$itemType || $itemType == 'object' || $itemType == 'array' || ($typeIsArray && ($itemType.indexOf('object') >= 0 || $itemType.indexOf('array') >= 0))) { out += ' outer: for (;i--;) { for (j = i; j--;) { if (equal(' + ($data) + '[i], ' + ($data) + '[j])) { ' + ($valid) + ' = false; break outer; } } } '; } else { out += ' var itemIndices = {}, item; for (;i--;) { var item = ' + ($data) + '[i]; '; var $method = 'checkDataType' + ($typeIsArray ? 's' : ''); out += ' if (' + (it.util[$method]($itemType, 'item', it.opts.strictNumbers, true)) + ') continue; '; if ($typeIsArray) { out += ' if (typeof item == \'string\') item = \'"\' + item; '; } out += ' if (typeof itemIndices[item] == \'number\') { ' + ($valid) + ' = false; j = itemIndices[item]; break; } itemIndices[item] = i; } '; } out += ' } '; if ($isData) { out += ' } '; } out += ' if (!' + ($valid) + ') { '; var $$outStack = $$outStack || []; $$outStack.push(out); out = ''; /* istanbul ignore else */ if (it.createErrors !== false) { out += ' { keyword: \'' + ('uniqueItems') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { i: i, j: j } '; if (it.opts.messages !== false) { out += ' , message: \'should NOT have duplicate items (items ## \' + j + \' and \' + i + \' are identical)\' '; } if (it.opts.verbose) { out += ' , schema: '; if ($isData) { out += 'validate.schema' + ($schemaPath); } else { out += '' + ($schema); } out += ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' '; } out += ' } '; } else { out += ' {} '; } var __err = out; out = $$outStack.pop(); if (!it.compositeRule && $breakOnError) { /* istanbul ignore if */ if (it.async) { out += ' throw new ValidationError([' + (__err) + ']); '; } else { out += ' validate.errors = [' + (__err) + ']; return false; '; } } else { out += ' var err = ' + (__err) + '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; '; } out += ' } '; if ($breakOnError) { out += ' else { '; } } else { if ($breakOnError) { out += ' if (true) { '; } } return out; } /***/ }), /***/ 49585: /***/ ((module) => { "use strict"; module.exports = function generate_validate(it, $keyword, $ruleType) { var out = ''; var $async = it.schema.$async === true, $refKeywords = it.util.schemaHasRulesExcept(it.schema, it.RULES.all, '$ref'), $id = it.self._getId(it.schema); if (it.opts.strictKeywords) { var $unknownKwd = it.util.schemaUnknownRules(it.schema, it.RULES.keywords); if ($unknownKwd) { var $keywordsMsg = 'unknown keyword: ' + $unknownKwd; if (it.opts.strictKeywords === 'log') it.logger.warn($keywordsMsg); else throw new Error($keywordsMsg); } } if (it.isTop) { out += ' var validate = '; if ($async) { it.async = true; out += 'async '; } out += 'function(data, dataPath, parentData, parentDataProperty, rootData) { \'use strict\'; '; if ($id && (it.opts.sourceCode || it.opts.processCode)) { out += ' ' + ('/\*# sourceURL=' + $id + ' */') + ' '; } } if (typeof it.schema == 'boolean' || !($refKeywords || it.schema.$ref)) { var $keyword = 'false schema'; var $lvl = it.level; var $dataLvl = it.dataLevel; var $schema = it.schema[$keyword]; var $schemaPath = it.schemaPath + it.util.getProperty($keyword); var $errSchemaPath = it.errSchemaPath + '/' + $keyword; var $breakOnError = !it.opts.allErrors; var $errorKeyword; var $data = 'data' + ($dataLvl || ''); var $valid = 'valid' + $lvl; if (it.schema === false) { if (it.isTop) { $breakOnError = true; } else { out += ' var ' + ($valid) + ' = false; '; } var $$outStack = $$outStack || []; $$outStack.push(out); out = ''; /* istanbul ignore else */ if (it.createErrors !== false) { out += ' { keyword: \'' + ($errorKeyword || 'false schema') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: {} '; if (it.opts.messages !== false) { out += ' , message: \'boolean schema is false\' '; } if (it.opts.verbose) { out += ' , schema: false , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' '; } out += ' } '; } else { out += ' {} '; } var __err = out; out = $$outStack.pop(); if (!it.compositeRule && $breakOnError) { /* istanbul ignore if */ if (it.async) { out += ' throw new ValidationError([' + (__err) + ']); '; } else { out += ' validate.errors = [' + (__err) + ']; return false; '; } } else { out += ' var err = ' + (__err) + '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; '; } } else { if (it.isTop) { if ($async) { out += ' return data; '; } else { out += ' validate.errors = null; return true; '; } } else { out += ' var ' + ($valid) + ' = true; '; } } if (it.isTop) { out += ' }; return validate; '; } return out; } if (it.isTop) { var $top = it.isTop, $lvl = it.level = 0, $dataLvl = it.dataLevel = 0, $data = 'data'; it.rootId = it.resolve.fullPath(it.self._getId(it.root.schema)); it.baseId = it.baseId || it.rootId; delete it.isTop; it.dataPathArr = [""]; if (it.schema.default !== undefined && it.opts.useDefaults && it.opts.strictDefaults) { var $defaultMsg = 'default is ignored in the schema root'; if (it.opts.strictDefaults === 'log') it.logger.warn($defaultMsg); else throw new Error($defaultMsg); } out += ' var vErrors = null; '; out += ' var errors = 0; '; out += ' if (rootData === undefined) rootData = data; '; } else { var $lvl = it.level, $dataLvl = it.dataLevel, $data = 'data' + ($dataLvl || ''); if ($id) it.baseId = it.resolve.url(it.baseId, $id); if ($async && !it.async) throw new Error('async schema in sync schema'); out += ' var errs_' + ($lvl) + ' = errors;'; } var $valid = 'valid' + $lvl, $breakOnError = !it.opts.allErrors, $closingBraces1 = '', $closingBraces2 = ''; var $errorKeyword; var $typeSchema = it.schema.type, $typeIsArray = Array.isArray($typeSchema); if ($typeSchema && it.opts.nullable && it.schema.nullable === true) { if ($typeIsArray) { if ($typeSchema.indexOf('null') == -1) $typeSchema = $typeSchema.concat('null'); } else if ($typeSchema != 'null') { $typeSchema = [$typeSchema, 'null']; $typeIsArray = true; } } if ($typeIsArray && $typeSchema.length == 1) { $typeSchema = $typeSchema[0]; $typeIsArray = false; } if (it.schema.$ref && $refKeywords) { if (it.opts.extendRefs == 'fail') { throw new Error('$ref: validation keywords used in schema at path "' + it.errSchemaPath + '" (see option extendRefs)'); } else if (it.opts.extendRefs !== true) { $refKeywords = false; it.logger.warn('$ref: keywords ignored in schema at path "' + it.errSchemaPath + '"'); } } if (it.schema.$comment && it.opts.$comment) { out += ' ' + (it.RULES.all.$comment.code(it, '$comment')); } if ($typeSchema) { if (it.opts.coerceTypes) { var $coerceToTypes = it.util.coerceToTypes(it.opts.coerceTypes, $typeSchema); } var $rulesGroup = it.RULES.types[$typeSchema]; if ($coerceToTypes || $typeIsArray || $rulesGroup === true || ($rulesGroup && !$shouldUseGroup($rulesGroup))) { var $schemaPath = it.schemaPath + '.type', $errSchemaPath = it.errSchemaPath + '/type'; var $schemaPath = it.schemaPath + '.type', $errSchemaPath = it.errSchemaPath + '/type', $method = $typeIsArray ? 'checkDataTypes' : 'checkDataType'; out += ' if (' + (it.util[$method]($typeSchema, $data, it.opts.strictNumbers, true)) + ') { '; if ($coerceToTypes) { var $dataType = 'dataType' + $lvl, $coerced = 'coerced' + $lvl; out += ' var ' + ($dataType) + ' = typeof ' + ($data) + '; var ' + ($coerced) + ' = undefined; '; if (it.opts.coerceTypes == 'array') { 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) + '; } '; } out += ' if (' + ($coerced) + ' !== undefined) ; '; var arr1 = $coerceToTypes; if (arr1) { var $type, $i = -1, l1 = arr1.length - 1; while ($i < l1) { $type = arr1[$i += 1]; if ($type == 'string') { out += ' else if (' + ($dataType) + ' == \'number\' || ' + ($dataType) + ' == \'boolean\') ' + ($coerced) + ' = \'\' + ' + ($data) + '; else if (' + ($data) + ' === null) ' + ($coerced) + ' = \'\'; '; } else if ($type == 'number' || $type == 'integer') { out += ' else if (' + ($dataType) + ' == \'boolean\' || ' + ($data) + ' === null || (' + ($dataType) + ' == \'string\' && ' + ($data) + ' && ' + ($data) + ' == +' + ($data) + ' '; if ($type == 'integer') { out += ' && !(' + ($data) + ' % 1)'; } out += ')) ' + ($coerced) + ' = +' + ($data) + '; '; } else if ($type == 'boolean') { out += ' else if (' + ($data) + ' === \'false\' || ' + ($data) + ' === 0 || ' + ($data) + ' === null) ' + ($coerced) + ' = false; else if (' + ($data) + ' === \'true\' || ' + ($data) + ' === 1) ' + ($coerced) + ' = true; '; } else if ($type == 'null') { out += ' else if (' + ($data) + ' === \'\' || ' + ($data) + ' === 0 || ' + ($data) + ' === false) ' + ($coerced) + ' = null; '; } else if (it.opts.coerceTypes == 'array' && $type == 'array') { out += ' else if (' + ($dataType) + ' == \'string\' || ' + ($dataType) + ' == \'number\' || ' + ($dataType) + ' == \'boolean\' || ' + ($data) + ' == null) ' + ($coerced) + ' = [' + ($data) + ']; '; } } } out += ' else { '; var $$outStack = $$outStack || []; $$outStack.push(out); out = ''; /* istanbul ignore else */ if (it.createErrors !== false) { out += ' { keyword: \'' + ($errorKeyword || 'type') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { type: \''; if ($typeIsArray) { out += '' + ($typeSchema.join(",")); } else { out += '' + ($typeSchema); } out += '\' } '; if (it.opts.messages !== false) { out += ' , message: \'should be '; if ($typeIsArray) { out += '' + ($typeSchema.join(",")); } else { out += '' + ($typeSchema); } out += '\' '; } if (it.opts.verbose) { out += ' , schema: validate.schema' + ($schemaPath) + ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' '; } out += ' } '; } else { out += ' {} '; } var __err = out; out = $$outStack.pop(); if (!it.compositeRule && $breakOnError) { /* istanbul ignore if */ if (it.async) { out += ' throw new ValidationError([' + (__err) + ']); '; } else { out += ' validate.errors = [' + (__err) + ']; return false; '; } } else { out += ' var err = ' + (__err) + '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; '; } out += ' } if (' + ($coerced) + ' !== undefined) { '; var $parentData = $dataLvl ? 'data' + (($dataLvl - 1) || '') : 'parentData', $parentDataProperty = $dataLvl ? it.dataPathArr[$dataLvl] : 'parentDataProperty'; out += ' ' + ($data) + ' = ' + ($coerced) + '; '; if (!$dataLvl) { out += 'if (' + ($parentData) + ' !== undefined)'; } out += ' ' + ($parentData) + '[' + ($parentDataProperty) + '] = ' + ($coerced) + '; } '; } else { var $$outStack = $$outStack || []; $$outStack.push(out); out = ''; /* istanbul ignore else */ if (it.createErrors !== false) { out += ' { keyword: \'' + ($errorKeyword || 'type') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { type: \''; if ($typeIsArray) { out += '' + ($typeSchema.join(",")); } else { out += '' + ($typeSchema); } out += '\' } '; if (it.opts.messages !== false) { out += ' , message: \'should be '; if ($typeIsArray) { out += '' + ($typeSchema.join(",")); } else { out += '' + ($typeSchema); } out += '\' '; } if (it.opts.verbose) { out += ' , schema: validate.schema' + ($schemaPath) + ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' '; } out += ' } '; } else { out += ' {} '; } var __err = out; out = $$outStack.pop(); if (!it.compositeRule && $breakOnError) { /* istanbul ignore if */ if (it.async) { out += ' throw new ValidationError([' + (__err) + ']); '; } else { out += ' validate.errors = [' + (__err) + ']; return false; '; } } else { out += ' var err = ' + (__err) + '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; '; } } out += ' } '; } } if (it.schema.$ref && !$refKeywords) { out += ' ' + (it.RULES.all.$ref.code(it, '$ref')) + ' '; if ($breakOnError) { out += ' } if (errors === '; if ($top) { out += '0'; } else { out += 'errs_' + ($lvl); } out += ') { '; $closingBraces2 += '}'; } } else { var arr2 = it.RULES; if (arr2) { var $rulesGroup, i2 = -1, l2 = arr2.length - 1; while (i2 < l2) { $rulesGroup = arr2[i2 += 1]; if ($shouldUseGroup($rulesGroup)) { if ($rulesGroup.type) { out += ' if (' + (it.util.checkDataType($rulesGroup.type, $data, it.opts.strictNumbers)) + ') { '; } if (it.opts.useDefaults) { if ($rulesGroup.type == 'object' && it.schema.properties) { var $schema = it.schema.properties, $schemaKeys = Object.keys($schema); var arr3 = $schemaKeys; if (arr3) { var $propertyKey, i3 = -1, l3 = arr3.length - 1; while (i3 < l3) { $propertyKey = arr3[i3 += 1]; var $sch = $schema[$propertyKey]; if ($sch.default !== undefined) { var $passData = $data + it.util.getProperty($propertyKey); if (it.compositeRule) { if (it.opts.strictDefaults) { var $defaultMsg = 'default is ignored for: ' + $passData; if (it.opts.strictDefaults === 'log') it.logger.warn($defaultMsg); else throw new Error($defaultMsg); } } else { out += ' if (' + ($passData) + ' === undefined '; if (it.opts.useDefaults == 'empty') { out += ' || ' + ($passData) + ' === null || ' + ($passData) + ' === \'\' '; } out += ' ) ' + ($passData) + ' = '; if (it.opts.useDefaults == 'shared') { out += ' ' + (it.useDefault($sch.default)) + ' '; } else { out += ' ' + (JSON.stringify($sch.default)) + ' '; } out += '; '; } } } } } else if ($rulesGroup.type == 'array' && Array.isArray(it.schema.items)) { var arr4 = it.schema.items; if (arr4) { var $sch, $i = -1, l4 = arr4.length - 1; while ($i < l4) { $sch = arr4[$i += 1]; if ($sch.default !== undefined) { var $passData = $data + '[' + $i + ']'; if (it.compositeRule) { if (it.opts.strictDefaults) { var $defaultMsg = 'default is ignored for: ' + $passData; if (it.opts.strictDefaults === 'log') it.logger.warn($defaultMsg); else throw new Error($defaultMsg); } } else { out += ' if (' + ($passData) + ' === undefined '; if (it.opts.useDefaults == 'empty') { out += ' || ' + ($passData) + ' === null || ' + ($passData) + ' === \'\' '; } out += ' ) ' + ($passData) + ' = '; if (it.opts.useDefaults == 'shared') { out += ' ' + (it.useDefault($sch.default)) + ' '; } else { out += ' ' + (JSON.stringify($sch.default)) + ' '; } out += '; '; } } } } } } var arr5 = $rulesGroup.rules; if (arr5) { var $rule, i5 = -1, l5 = arr5.length - 1; while (i5 < l5) { $rule = arr5[i5 += 1]; if ($shouldUseRule($rule)) { var $code = $rule.code(it, $rule.keyword, $rulesGroup.type); if ($code) { out += ' ' + ($code) + ' '; if ($breakOnError) { $closingBraces1 += '}'; } } } } } if ($breakOnError) { out += ' ' + ($closingBraces1) + ' '; $closingBraces1 = ''; } if ($rulesGroup.type) { out += ' } '; if ($typeSchema && $typeSchema === $rulesGroup.type && !$coerceToTypes) { out += ' else { '; var $schemaPath = it.schemaPath + '.type', $errSchemaPath = it.errSchemaPath + '/type'; var $$outStack = $$outStack || []; $$outStack.push(out); out = ''; /* istanbul ignore else */ if (it.createErrors !== false) { out += ' { keyword: \'' + ($errorKeyword || 'type') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { type: \''; if ($typeIsArray) { out += '' + ($typeSchema.join(",")); } else { out += '' + ($typeSchema); } out += '\' } '; if (it.opts.messages !== false) { out += ' , message: \'should be '; if ($typeIsArray) { out += '' + ($typeSchema.join(",")); } else { out += '' + ($typeSchema); } out += '\' '; } if (it.opts.verbose) { out += ' , schema: validate.schema' + ($schemaPath) + ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' '; } out += ' } '; } else { out += ' {} '; } var __err = out; out = $$outStack.pop(); if (!it.compositeRule && $breakOnError) { /* istanbul ignore if */ if (it.async) { out += ' throw new ValidationError([' + (__err) + ']); '; } else { out += ' validate.errors = [' + (__err) + ']; return false; '; } } else { out += ' var err = ' + (__err) + '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; '; } out += ' } '; } } if ($breakOnError) { out += ' if (errors === '; if ($top) { out += '0'; } else { out += 'errs_' + ($lvl); } out += ') { '; $closingBraces2 += '}'; } } } } } if ($breakOnError) { out += ' ' + ($closingBraces2) + ' '; } if ($top) { if ($async) { out += ' if (errors === 0) return data; '; out += ' else throw new ValidationError(vErrors); '; } else { out += ' validate.errors = vErrors; '; out += ' return errors === 0; '; } out += ' }; return validate;'; } else { out += ' var ' + ($valid) + ' = errors === errs_' + ($lvl) + ';'; } function $shouldUseGroup($rulesGroup) { var rules = $rulesGroup.rules; for (var i = 0; i < rules.length; i++) if ($shouldUseRule(rules[i])) return true; } function $shouldUseRule($rule) { return it.schema[$rule.keyword] !== undefined || ($rule.implements && $ruleImplementsSomeKeyword($rule)); } function $ruleImplementsSomeKeyword($rule) { var impl = $rule.implements; for (var i = 0; i < impl.length; i++) if (it.schema[impl[i]] !== undefined) return true; } return out; } /***/ }), /***/ 53297: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; var IDENTIFIER = /^[a-z_$][a-z0-9_$-]*$/i; var customRuleCode = __webpack_require__(5912); var definitionSchema = __webpack_require__(10458); module.exports = { add: addKeyword, get: getKeyword, remove: removeKeyword, validate: validateKeyword }; /** * Define custom keyword * @this Ajv * @param {String} keyword custom keyword, should be unique (including different from all standard, custom and macro keywords). * @param {Object} definition keyword definition object with properties `type` (type(s) which the keyword applies to), `validate` or `compile`. * @return {Ajv} this for method chaining */ function addKeyword(keyword, definition) { /* jshint validthis: true */ /* eslint no-shadow: 0 */ var RULES = this.RULES; if (RULES.keywords[keyword]) throw new Error('Keyword ' + keyword + ' is already defined'); if (!IDENTIFIER.test(keyword)) throw new Error('Keyword ' + keyword + ' is not a valid identifier'); if (definition) { this.validateKeyword(definition, true); var dataType = definition.type; if (Array.isArray(dataType)) { for (var i=0; i { // Copyright 2011 Mark Cavage All rights reserved. module.exports = { newInvalidAsn1Error: function (msg) { var e = new Error(); e.name = 'InvalidAsn1Error'; e.message = msg || ''; return e; } }; /***/ }), /***/ 194: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { // Copyright 2011 Mark Cavage All rights reserved. var errors = __webpack_require__(99348); var types = __webpack_require__(42473); var Reader = __webpack_require__(20290); var Writer = __webpack_require__(43200); // --- Exports module.exports = { Reader: Reader, Writer: Writer }; for (var t in types) { if (types.hasOwnProperty(t)) module.exports[t] = types[t]; } for (var e in errors) { if (errors.hasOwnProperty(e)) module.exports[e] = errors[e]; } /***/ }), /***/ 20290: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { // Copyright 2011 Mark Cavage All rights reserved. var assert = __webpack_require__(42357); var Buffer = __webpack_require__(15118).Buffer; var ASN1 = __webpack_require__(42473); var errors = __webpack_require__(99348); // --- Globals var newInvalidAsn1Error = errors.newInvalidAsn1Error; // --- API function Reader(data) { if (!data || !Buffer.isBuffer(data)) throw new TypeError('data must be a node Buffer'); this._buf = data; this._size = data.length; // These hold the "current" state this._len = 0; this._offset = 0; } Object.defineProperty(Reader.prototype, 'length', { enumerable: true, get: function () { return (this._len); } }); Object.defineProperty(Reader.prototype, 'offset', { enumerable: true, get: function () { return (this._offset); } }); Object.defineProperty(Reader.prototype, 'remain', { get: function () { return (this._size - this._offset); } }); Object.defineProperty(Reader.prototype, 'buffer', { get: function () { return (this._buf.slice(this._offset)); } }); /** * Reads a single byte and advances offset; you can pass in `true` to make this * a "peek" operation (i.e., get the byte, but don't advance the offset). * * @param {Boolean} peek true means don't move offset. * @return {Number} the next byte, null if not enough data. */ Reader.prototype.readByte = function (peek) { if (this._size - this._offset < 1) return null; var b = this._buf[this._offset] & 0xff; if (!peek) this._offset += 1; return b; }; Reader.prototype.peek = function () { return this.readByte(true); }; /** * Reads a (potentially) variable length off the BER buffer. This call is * not really meant to be called directly, as callers have to manipulate * the internal buffer afterwards. * * As a result of this call, you can call `Reader.length`, until the * next thing called that does a readLength. * * @return {Number} the amount of offset to advance the buffer. * @throws {InvalidAsn1Error} on bad ASN.1 */ Reader.prototype.readLength = function (offset) { if (offset === undefined) offset = this._offset; if (offset >= this._size) return null; var lenB = this._buf[offset++] & 0xff; if (lenB === null) return null; if ((lenB & 0x80) === 0x80) { lenB &= 0x7f; if (lenB === 0) throw newInvalidAsn1Error('Indefinite length not supported'); if (lenB > 4) throw newInvalidAsn1Error('encoding too long'); if (this._size - offset < lenB) return null; this._len = 0; for (var i = 0; i < lenB; i++) this._len = (this._len << 8) + (this._buf[offset++] & 0xff); } else { // Wasn't a variable length this._len = lenB; } return offset; }; /** * Parses the next sequence in this BER buffer. * * To get the length of the sequence, call `Reader.length`. * * @return {Number} the sequence's tag. */ Reader.prototype.readSequence = function (tag) { var seq = this.peek(); if (seq === null) return null; if (tag !== undefined && tag !== seq) throw newInvalidAsn1Error('Expected 0x' + tag.toString(16) + ': got 0x' + seq.toString(16)); var o = this.readLength(this._offset + 1); // stored in `length` if (o === null) return null; this._offset = o; return seq; }; Reader.prototype.readInt = function () { return this._readTag(ASN1.Integer); }; Reader.prototype.readBoolean = function () { return (this._readTag(ASN1.Boolean) === 0 ? false : true); }; Reader.prototype.readEnumeration = function () { return this._readTag(ASN1.Enumeration); }; Reader.prototype.readString = function (tag, retbuf) { if (!tag) tag = ASN1.OctetString; var b = this.peek(); if (b === null) return null; if (b !== tag) throw newInvalidAsn1Error('Expected 0x' + tag.toString(16) + ': got 0x' + b.toString(16)); var o = this.readLength(this._offset + 1); // stored in `length` if (o === null) return null; if (this.length > this._size - o) return null; this._offset = o; if (this.length === 0) return retbuf ? Buffer.alloc(0) : ''; var str = this._buf.slice(this._offset, this._offset + this.length); this._offset += this.length; return retbuf ? str : str.toString('utf8'); }; Reader.prototype.readOID = function (tag) { if (!tag) tag = ASN1.OID; var b = this.readString(tag, true); if (b === null) return null; var values = []; var value = 0; for (var i = 0; i < b.length; i++) { var byte = b[i] & 0xff; value <<= 7; value += byte & 0x7f; if ((byte & 0x80) === 0) { values.push(value); value = 0; } } value = values.shift(); values.unshift(value % 40); values.unshift((value / 40) >> 0); return values.join('.'); }; Reader.prototype._readTag = function (tag) { assert.ok(tag !== undefined); var b = this.peek(); if (b === null) return null; if (b !== tag) throw newInvalidAsn1Error('Expected 0x' + tag.toString(16) + ': got 0x' + b.toString(16)); var o = this.readLength(this._offset + 1); // stored in `length` if (o === null) return null; if (this.length > 4) throw newInvalidAsn1Error('Integer too long: ' + this.length); if (this.length > this._size - o) return null; this._offset = o; var fb = this._buf[this._offset]; var value = 0; for (var i = 0; i < this.length; i++) { value <<= 8; value |= (this._buf[this._offset++] & 0xff); } if ((fb & 0x80) === 0x80 && i !== 4) value -= (1 << (i * 8)); return value >> 0; }; // --- Exported API module.exports = Reader; /***/ }), /***/ 42473: /***/ ((module) => { // Copyright 2011 Mark Cavage All rights reserved. module.exports = { EOC: 0, Boolean: 1, Integer: 2, BitString: 3, OctetString: 4, Null: 5, OID: 6, ObjectDescriptor: 7, External: 8, Real: 9, // float Enumeration: 10, PDV: 11, Utf8String: 12, RelativeOID: 13, Sequence: 16, Set: 17, NumericString: 18, PrintableString: 19, T61String: 20, VideotexString: 21, IA5String: 22, UTCTime: 23, GeneralizedTime: 24, GraphicString: 25, VisibleString: 26, GeneralString: 28, UniversalString: 29, CharacterString: 30, BMPString: 31, Constructor: 32, Context: 128 }; /***/ }), /***/ 43200: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { // Copyright 2011 Mark Cavage All rights reserved. var assert = __webpack_require__(42357); var Buffer = __webpack_require__(15118).Buffer; var ASN1 = __webpack_require__(42473); var errors = __webpack_require__(99348); // --- Globals var newInvalidAsn1Error = errors.newInvalidAsn1Error; var DEFAULT_OPTS = { size: 1024, growthFactor: 8 }; // --- Helpers function merge(from, to) { assert.ok(from); assert.equal(typeof (from), 'object'); assert.ok(to); assert.equal(typeof (to), 'object'); var keys = Object.getOwnPropertyNames(from); keys.forEach(function (key) { if (to[key]) return; var value = Object.getOwnPropertyDescriptor(from, key); Object.defineProperty(to, key, value); }); return to; } // --- API function Writer(options) { options = merge(DEFAULT_OPTS, options || {}); this._buf = Buffer.alloc(options.size || 1024); this._size = this._buf.length; this._offset = 0; this._options = options; // A list of offsets in the buffer where we need to insert // sequence tag/len pairs. this._seq = []; } Object.defineProperty(Writer.prototype, 'buffer', { get: function () { if (this._seq.length) throw newInvalidAsn1Error(this._seq.length + ' unended sequence(s)'); return (this._buf.slice(0, this._offset)); } }); Writer.prototype.writeByte = function (b) { if (typeof (b) !== 'number') throw new TypeError('argument must be a Number'); this._ensure(1); this._buf[this._offset++] = b; }; Writer.prototype.writeInt = function (i, tag) { if (typeof (i) !== 'number') throw new TypeError('argument must be a Number'); if (typeof (tag) !== 'number') tag = ASN1.Integer; var sz = 4; while ((((i & 0xff800000) === 0) || ((i & 0xff800000) === 0xff800000 >> 0)) && (sz > 1)) { sz--; i <<= 8; } if (sz > 4) throw newInvalidAsn1Error('BER ints cannot be > 0xffffffff'); this._ensure(2 + sz); this._buf[this._offset++] = tag; this._buf[this._offset++] = sz; while (sz-- > 0) { this._buf[this._offset++] = ((i & 0xff000000) >>> 24); i <<= 8; } }; Writer.prototype.writeNull = function () { this.writeByte(ASN1.Null); this.writeByte(0x00); }; Writer.prototype.writeEnumeration = function (i, tag) { if (typeof (i) !== 'number') throw new TypeError('argument must be a Number'); if (typeof (tag) !== 'number') tag = ASN1.Enumeration; return this.writeInt(i, tag); }; Writer.prototype.writeBoolean = function (b, tag) { if (typeof (b) !== 'boolean') throw new TypeError('argument must be a Boolean'); if (typeof (tag) !== 'number') tag = ASN1.Boolean; this._ensure(3); this._buf[this._offset++] = tag; this._buf[this._offset++] = 0x01; this._buf[this._offset++] = b ? 0xff : 0x00; }; Writer.prototype.writeString = function (s, tag) { if (typeof (s) !== 'string') throw new TypeError('argument must be a string (was: ' + typeof (s) + ')'); if (typeof (tag) !== 'number') tag = ASN1.OctetString; var len = Buffer.byteLength(s); this.writeByte(tag); this.writeLength(len); if (len) { this._ensure(len); this._buf.write(s, this._offset); this._offset += len; } }; Writer.prototype.writeBuffer = function (buf, tag) { if (typeof (tag) !== 'number') throw new TypeError('tag must be a number'); if (!Buffer.isBuffer(buf)) throw new TypeError('argument must be a buffer'); this.writeByte(tag); this.writeLength(buf.length); this._ensure(buf.length); buf.copy(this._buf, this._offset, 0, buf.length); this._offset += buf.length; }; Writer.prototype.writeStringArray = function (strings) { if ((!strings instanceof Array)) throw new TypeError('argument must be an Array[String]'); var self = this; strings.forEach(function (s) { self.writeString(s); }); }; // This is really to solve DER cases, but whatever for now Writer.prototype.writeOID = function (s, tag) { if (typeof (s) !== 'string') throw new TypeError('argument must be a string'); if (typeof (tag) !== 'number') tag = ASN1.OID; if (!/^([0-9]+\.){3,}[0-9]+$/.test(s)) throw new Error('argument is not a valid OID string'); function encodeOctet(bytes, octet) { if (octet < 128) { bytes.push(octet); } else if (octet < 16384) { bytes.push((octet >>> 7) | 0x80); bytes.push(octet & 0x7F); } else if (octet < 2097152) { bytes.push((octet >>> 14) | 0x80); bytes.push(((octet >>> 7) | 0x80) & 0xFF); bytes.push(octet & 0x7F); } else if (octet < 268435456) { bytes.push((octet >>> 21) | 0x80); bytes.push(((octet >>> 14) | 0x80) & 0xFF); bytes.push(((octet >>> 7) | 0x80) & 0xFF); bytes.push(octet & 0x7F); } else { bytes.push(((octet >>> 28) | 0x80) & 0xFF); bytes.push(((octet >>> 21) | 0x80) & 0xFF); bytes.push(((octet >>> 14) | 0x80) & 0xFF); bytes.push(((octet >>> 7) | 0x80) & 0xFF); bytes.push(octet & 0x7F); } } var tmp = s.split('.'); var bytes = []; bytes.push(parseInt(tmp[0], 10) * 40 + parseInt(tmp[1], 10)); tmp.slice(2).forEach(function (b) { encodeOctet(bytes, parseInt(b, 10)); }); var self = this; this._ensure(2 + bytes.length); this.writeByte(tag); this.writeLength(bytes.length); bytes.forEach(function (b) { self.writeByte(b); }); }; Writer.prototype.writeLength = function (len) { if (typeof (len) !== 'number') throw new TypeError('argument must be a Number'); this._ensure(4); if (len <= 0x7f) { this._buf[this._offset++] = len; } else if (len <= 0xff) { this._buf[this._offset++] = 0x81; this._buf[this._offset++] = len; } else if (len <= 0xffff) { this._buf[this._offset++] = 0x82; this._buf[this._offset++] = len >> 8; this._buf[this._offset++] = len; } else if (len <= 0xffffff) { this._buf[this._offset++] = 0x83; this._buf[this._offset++] = len >> 16; this._buf[this._offset++] = len >> 8; this._buf[this._offset++] = len; } else { throw newInvalidAsn1Error('Length too long (> 4 bytes)'); } }; Writer.prototype.startSequence = function (tag) { if (typeof (tag) !== 'number') tag = ASN1.Sequence | ASN1.Constructor; this.writeByte(tag); this._seq.push(this._offset); this._ensure(3); this._offset += 3; }; Writer.prototype.endSequence = function () { var seq = this._seq.pop(); var start = seq + 3; var len = this._offset - start; if (len <= 0x7f) { this._shift(start, len, -2); this._buf[seq] = len; } else if (len <= 0xff) { this._shift(start, len, -1); this._buf[seq] = 0x81; this._buf[seq + 1] = len; } else if (len <= 0xffff) { this._buf[seq] = 0x82; this._buf[seq + 1] = len >> 8; this._buf[seq + 2] = len; } else if (len <= 0xffffff) { this._shift(start, len, 1); this._buf[seq] = 0x83; this._buf[seq + 1] = len >> 16; this._buf[seq + 2] = len >> 8; this._buf[seq + 3] = len; } else { throw newInvalidAsn1Error('Sequence too long'); } }; Writer.prototype._shift = function (start, len, shift) { assert.ok(start !== undefined); assert.ok(len !== undefined); assert.ok(shift); this._buf.copy(this._buf, start + shift, start, start + len); this._offset += shift; }; Writer.prototype._ensure = function (len) { assert.ok(len); if (this._size - this._offset < len) { var sz = this._size * this._options.growthFactor; if (sz - this._offset < len) sz += len; var buf = Buffer.alloc(sz); this._buf.copy(buf, 0, 0, this._offset); this._buf = buf; this._size = sz; } }; // --- Exported API module.exports = Writer; /***/ }), /***/ 80970: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { // Copyright 2011 Mark Cavage All rights reserved. // If you have no idea what ASN.1 or BER is, see this: // ftp://ftp.rsa.com/pub/pkcs/ascii/layman.asc var Ber = __webpack_require__(194); // --- Exported API module.exports = { Ber: Ber, BerReader: Ber.Reader, BerWriter: Ber.Writer }; /***/ }), /***/ 66631: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { // Copyright (c) 2012, Mark Cavage. All rights reserved. // Copyright 2015 Joyent, Inc. var assert = __webpack_require__(42357); var Stream = __webpack_require__(92413).Stream; var util = __webpack_require__(31669); ///--- Globals /* JSSTYLED */ var 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}$/; ///--- Internal function _capitalize(str) { return (str.charAt(0).toUpperCase() + str.slice(1)); } function _toss(name, expected, oper, arg, actual) { throw new assert.AssertionError({ message: util.format('%s (%s) is required', name, expected), actual: (actual === undefined) ? typeof (arg) : actual(arg), expected: expected, operator: oper || '===', stackStartFunction: _toss.caller }); } function _getClass(arg) { return (Object.prototype.toString.call(arg).slice(8, -1)); } function noop() { // Why even bother with asserts? } ///--- Exports var types = { bool: { check: function (arg) { return typeof (arg) === 'boolean'; } }, func: { check: function (arg) { return typeof (arg) === 'function'; } }, string: { check: function (arg) { return typeof (arg) === 'string'; } }, object: { check: function (arg) { return typeof (arg) === 'object' && arg !== null; } }, number: { check: function (arg) { return typeof (arg) === 'number' && !isNaN(arg); } }, finite: { check: function (arg) { return typeof (arg) === 'number' && !isNaN(arg) && isFinite(arg); } }, buffer: { check: function (arg) { return Buffer.isBuffer(arg); }, operator: 'Buffer.isBuffer' }, array: { check: function (arg) { return Array.isArray(arg); }, operator: 'Array.isArray' }, stream: { check: function (arg) { return arg instanceof Stream; }, operator: 'instanceof', actual: _getClass }, date: { check: function (arg) { return arg instanceof Date; }, operator: 'instanceof', actual: _getClass }, regexp: { check: function (arg) { return arg instanceof RegExp; }, operator: 'instanceof', actual: _getClass }, uuid: { check: function (arg) { return typeof (arg) === 'string' && UUID_REGEXP.test(arg); }, operator: 'isUUID' } }; function _setExports(ndebug) { var keys = Object.keys(types); var out; /* re-export standard assert */ if (process.env.NODE_NDEBUG) { out = noop; } else { out = function (arg, msg) { if (!arg) { _toss(msg, 'true', arg); } }; } /* standard checks */ keys.forEach(function (k) { if (ndebug) { out[k] = noop; return; } var type = types[k]; out[k] = function (arg, msg) { if (!type.check(arg)) { _toss(msg, k, type.operator, arg, type.actual); } }; }); /* optional checks */ keys.forEach(function (k) { var name = 'optional' + _capitalize(k); if (ndebug) { out[name] = noop; return; } var type = types[k]; out[name] = function (arg, msg) { if (arg === undefined || arg === null) { return; } if (!type.check(arg)) { _toss(msg, k, type.operator, arg, type.actual); } }; }); /* arrayOf checks */ keys.forEach(function (k) { var name = 'arrayOf' + _capitalize(k); if (ndebug) { out[name] = noop; return; } var type = types[k]; var expected = '[' + k + ']'; out[name] = function (arg, msg) { if (!Array.isArray(arg)) { _toss(msg, expected, type.operator, arg, type.actual); } var i; for (i = 0; i < arg.length; i++) { if (!type.check(arg[i])) { _toss(msg, expected, type.operator, arg, type.actual); } } }; }); /* optionalArrayOf checks */ keys.forEach(function (k) { var name = 'optionalArrayOf' + _capitalize(k); if (ndebug) { out[name] = noop; return; } var type = types[k]; var expected = '[' + k + ']'; out[name] = function (arg, msg) { if (arg === undefined || arg === null) { return; } if (!Array.isArray(arg)) { _toss(msg, expected, type.operator, arg, type.actual); } var i; for (i = 0; i < arg.length; i++) { if (!type.check(arg[i])) { _toss(msg, expected, type.operator, arg, type.actual); } } }; }); /* re-export built-in assertions */ Object.keys(assert).forEach(function (k) { if (k === 'AssertionError') { out[k] = assert[k]; return; } if (ndebug) { out[k] = noop; return; } out[k] = assert[k]; }); /* export ourselves (for unit tests _only_) */ out._setExports = _setExports; return out; } module.exports = _setExports(process.env.NODE_NDEBUG); /***/ }), /***/ 56964: /***/ ((module) => { "use strict"; function Queue(options) { if (!(this instanceof Queue)) { return new Queue(options); } options = options || {}; this.concurrency = options.concurrency || Infinity; this.pending = 0; this.jobs = []; this.cbs = []; this._done = done.bind(this); } var arrayAddMethods = [ 'push', 'unshift', 'splice' ]; arrayAddMethods.forEach(function(method) { Queue.prototype[method] = function() { var methodResult = Array.prototype[method].apply(this.jobs, arguments); this._run(); return methodResult; }; }); Object.defineProperty(Queue.prototype, 'length', { get: function() { return this.pending + this.jobs.length; } }); Queue.prototype._run = function() { if (this.pending === this.concurrency) { return; } if (this.jobs.length) { var job = this.jobs.shift(); this.pending++; job(this._done); this._run(); } if (this.pending === 0) { while (this.cbs.length !== 0) { var cb = this.cbs.pop(); process.nextTick(cb); } } }; Queue.prototype.onDone = function(cb) { if (typeof cb === 'function') { this.cbs.push(cb); this._run(); } }; function done() { this.pending--; this._run(); } module.exports = Queue; /***/ }), /***/ 14812: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { module.exports = { parallel : __webpack_require__(8210), serial : __webpack_require__(50445), serialOrdered : __webpack_require__(3578) }; /***/ }), /***/ 1700: /***/ ((module) => { // API module.exports = abort; /** * Aborts leftover active jobs * * @param {object} state - current state object */ function abort(state) { Object.keys(state.jobs).forEach(clean.bind(state)); // reset leftover jobs state.jobs = {}; } /** * Cleans up leftover job by invoking abort function for the provided job id * * @this state * @param {string|number} key - job id to abort */ function clean(key) { if (typeof this.jobs[key] == 'function') { this.jobs[key](); } } /***/ }), /***/ 72794: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { var defer = __webpack_require__(15295); // API module.exports = async; /** * Runs provided callback asynchronously * even if callback itself is not * * @param {function} callback - callback to invoke * @returns {function} - augmented callback */ function async(callback) { var isAsync = false; // check if async happened defer(function() { isAsync = true; }); return function async_callback(err, result) { if (isAsync) { callback(err, result); } else { defer(function nextTick_callback() { callback(err, result); }); } }; } /***/ }), /***/ 15295: /***/ ((module) => { module.exports = defer; /** * Runs provided function on next iteration of the event loop * * @param {function} fn - function to run */ function defer(fn) { var nextTick = typeof setImmediate == 'function' ? setImmediate : ( typeof process == 'object' && typeof process.nextTick == 'function' ? process.nextTick : null ); if (nextTick) { nextTick(fn); } else { setTimeout(fn, 0); } } /***/ }), /***/ 9023: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { var async = __webpack_require__(72794) , abort = __webpack_require__(1700) ; // API module.exports = iterate; /** * Iterates over each job object * * @param {array|object} list - array or object (named list) to iterate over * @param {function} iterator - iterator to run * @param {object} state - current job status * @param {function} callback - invoked when all elements processed */ function iterate(list, iterator, state, callback) { // store current index var key = state['keyedList'] ? state['keyedList'][state.index] : state.index; state.jobs[key] = runJob(iterator, key, list[key], function(error, output) { // don't repeat yourself // skip secondary callbacks if (!(key in state.jobs)) { return; } // clean up jobs delete state.jobs[key]; if (error) { // don't process rest of the results // stop still active jobs // and reset the list abort(state); } else { state.results[key] = output; } // return salvaged results callback(error, state.results); }); } /** * Runs iterator over provided job element * * @param {function} iterator - iterator to invoke * @param {string|number} key - key/index of the element in the list of jobs * @param {mixed} item - job description * @param {function} callback - invoked after iterator is done with the job * @returns {function|mixed} - job abort function or something else */ function runJob(iterator, key, item, callback) { var aborter; // allow shortcut if iterator expects only two arguments if (iterator.length == 2) { aborter = iterator(item, async(callback)); } // otherwise go with full three arguments else { aborter = iterator(item, key, async(callback)); } return aborter; } /***/ }), /***/ 42474: /***/ ((module) => { // API module.exports = state; /** * Creates initial state object * for iteration over list * * @param {array|object} list - list to iterate over * @param {function|null} sortMethod - function to use for keys sort, * or `null` to keep them as is * @returns {object} - initial state object */ function state(list, sortMethod) { var isNamedList = !Array.isArray(list) , initState = { index : 0, keyedList: isNamedList || sortMethod ? Object.keys(list) : null, jobs : {}, results : isNamedList ? {} : [], size : isNamedList ? Object.keys(list).length : list.length } ; if (sortMethod) { // sort array keys based on it's values // sort object's keys just on own merit initState.keyedList.sort(isNamedList ? sortMethod : function(a, b) { return sortMethod(list[a], list[b]); }); } return initState; } /***/ }), /***/ 37942: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { var abort = __webpack_require__(1700) , async = __webpack_require__(72794) ; // API module.exports = terminator; /** * Terminates jobs in the attached state context * * @this AsyncKitState# * @param {function} callback - final callback to invoke after termination */ function terminator(callback) { if (!Object.keys(this.jobs).length) { return; } // fast forward iteration index this.index = this.size; // abort jobs abort(this); // send back results we have so far async(callback)(null, this.results); } /***/ }), /***/ 8210: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { var iterate = __webpack_require__(9023) , initState = __webpack_require__(42474) , terminator = __webpack_require__(37942) ; // Public API module.exports = parallel; /** * Runs iterator over provided array elements in parallel * * @param {array|object} list - array or object (named list) to iterate over * @param {function} iterator - iterator to run * @param {function} callback - invoked when all elements processed * @returns {function} - jobs terminator */ function parallel(list, iterator, callback) { var state = initState(list); while (state.index < (state['keyedList'] || list).length) { iterate(list, iterator, state, function(error, result) { if (error) { callback(error, result); return; } // looks like it's the last one if (Object.keys(state.jobs).length === 0) { callback(null, state.results); return; } }); state.index++; } return terminator.bind(state, callback); } /***/ }), /***/ 50445: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { var serialOrdered = __webpack_require__(3578); // Public API module.exports = serial; /** * Runs iterator over provided array elements in series * * @param {array|object} list - array or object (named list) to iterate over * @param {function} iterator - iterator to run * @param {function} callback - invoked when all elements processed * @returns {function} - jobs terminator */ function serial(list, iterator, callback) { return serialOrdered(list, iterator, null, callback); } /***/ }), /***/ 3578: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { var iterate = __webpack_require__(9023) , initState = __webpack_require__(42474) , terminator = __webpack_require__(37942) ; // Public API module.exports = serialOrdered; // sorting helpers module.exports.ascending = ascending; module.exports.descending = descending; /** * Runs iterator over provided sorted array elements in series * * @param {array|object} list - array or object (named list) to iterate over * @param {function} iterator - iterator to run * @param {function} sortMethod - custom sort function * @param {function} callback - invoked when all elements processed * @returns {function} - jobs terminator */ function serialOrdered(list, iterator, sortMethod, callback) { var state = initState(list, sortMethod); iterate(list, iterator, state, function iteratorHandler(error, result) { if (error) { callback(error, result); return; } state.index++; // are we there yet? if (state.index < (state['keyedList'] || list).length) { iterate(list, iterator, state, iteratorHandler); return; } // done here callback(null, state.results); }); return terminator.bind(state, callback); } /* * -- Sort methods */ /** * sort helper to sort array elements in ascending order * * @param {mixed} a - an item to compare * @param {mixed} b - an item to compare * @returns {number} - comparison result */ function ascending(a, b) { return a < b ? -1 : a > b ? 1 : 0; } /** * sort helper to sort array elements in descending order * * @param {mixed} a - an item to compare * @param {mixed} b - an item to compare * @returns {number} - comparison result */ function descending(a, b) { return -1 * ascending(a, b); } /***/ }), /***/ 20940: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { __webpack_require__(73639); var AWS = __webpack_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; apiLoader.services['accessanalyzer'] = {}; AWS.AccessAnalyzer = Service.defineService('accessanalyzer', ['2019-11-01']); Object.defineProperty(apiLoader.services['accessanalyzer'], '2019-11-01', { get: function get() { var model = __webpack_require__(24955); model.paginators = __webpack_require__(7997)/* .pagination */ .o; return model; }, enumerable: true, configurable: true }); module.exports = AWS.AccessAnalyzer; /***/ }), /***/ 30838: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { __webpack_require__(73639); var AWS = __webpack_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; apiLoader.services['acm'] = {}; AWS.ACM = Service.defineService('acm', ['2015-12-08']); Object.defineProperty(apiLoader.services['acm'], '2015-12-08', { get: function get() { var model = __webpack_require__(22335); model.paginators = __webpack_require__(63763)/* .pagination */ .o; model.waiters = __webpack_require__(12336)/* .waiters */ .V; return model; }, enumerable: true, configurable: true }); module.exports = AWS.ACM; /***/ }), /***/ 18450: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { __webpack_require__(73639); var AWS = __webpack_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; apiLoader.services['acmpca'] = {}; AWS.ACMPCA = Service.defineService('acmpca', ['2017-08-22']); Object.defineProperty(apiLoader.services['acmpca'], '2017-08-22', { get: function get() { var model = __webpack_require__(2794); model.paginators = __webpack_require__(92031)/* .pagination */ .o; model.waiters = __webpack_require__(50728)/* .waiters */ .V; return model; }, enumerable: true, configurable: true }); module.exports = AWS.ACMPCA; /***/ }), /***/ 14578: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { __webpack_require__(73639); var AWS = __webpack_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; apiLoader.services['alexaforbusiness'] = {}; AWS.AlexaForBusiness = Service.defineService('alexaforbusiness', ['2017-11-09']); Object.defineProperty(apiLoader.services['alexaforbusiness'], '2017-11-09', { get: function get() { var model = __webpack_require__(4946); model.paginators = __webpack_require__(74967)/* .pagination */ .o; return model; }, enumerable: true, configurable: true }); module.exports = AWS.AlexaForBusiness; /***/ }), /***/ 26296: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { __webpack_require__(73639); module.exports = { ACM: __webpack_require__(30838), APIGateway: __webpack_require__(91759), ApplicationAutoScaling: __webpack_require__(25598), AppStream: __webpack_require__(21730), AutoScaling: __webpack_require__(31652), Batch: __webpack_require__(10000), Budgets: __webpack_require__(43923), CloudDirectory: __webpack_require__(56231), CloudFormation: __webpack_require__(74643), CloudFront: __webpack_require__(48058), CloudHSM: __webpack_require__(10569), CloudSearch: __webpack_require__(72321), CloudSearchDomain: __webpack_require__(64072), CloudTrail: __webpack_require__(65512), CloudWatch: __webpack_require__(6763), CloudWatchEvents: __webpack_require__(38124), CloudWatchLogs: __webpack_require__(96693), CodeBuild: __webpack_require__(60450), CodeCommit: __webpack_require__(71323), CodeDeploy: __webpack_require__(54599), CodePipeline: __webpack_require__(22938), CognitoIdentity: __webpack_require__(58291), CognitoIdentityServiceProvider: __webpack_require__(31379), CognitoSync: __webpack_require__(74770), ConfigService: __webpack_require__(34061), CUR: __webpack_require__(5026), DataPipeline: __webpack_require__(65688), DeviceFarm: __webpack_require__(26272), DirectConnect: __webpack_require__(73783), DirectoryService: __webpack_require__(83908), Discovery: __webpack_require__(81690), DMS: __webpack_require__(69868), DynamoDB: __webpack_require__(14347), DynamoDBStreams: __webpack_require__(88090), EC2: __webpack_require__(7778), ECR: __webpack_require__(15211), ECS: __webpack_require__(16615), EFS: __webpack_require__(34375), ElastiCache: __webpack_require__(81065), ElasticBeanstalk: __webpack_require__(14897), ELB: __webpack_require__(10907), ELBv2: __webpack_require__(44311), EMR: __webpack_require__(50470), ES: __webpack_require__(84462), ElasticTranscoder: __webpack_require__(40745), Firehose: __webpack_require__(92831), GameLift: __webpack_require__(8085), Glacier: __webpack_require__(63249), Health: __webpack_require__(21834), IAM: __webpack_require__(50058), ImportExport: __webpack_require__(6769), Inspector: __webpack_require__(89439), Iot: __webpack_require__(98392), IotData: __webpack_require__(6564), Kinesis: __webpack_require__(49876), KinesisAnalytics: __webpack_require__(90042), KMS: __webpack_require__(56782), Lambda: __webpack_require__(13321), LexRuntime: __webpack_require__(62716), Lightsail: __webpack_require__(22718), MachineLearning: __webpack_require__(82907), MarketplaceCommerceAnalytics: __webpack_require__(4540), MarketplaceMetering: __webpack_require__(39297), MTurk: __webpack_require__(5615), MobileAnalytics: __webpack_require__(66690), OpsWorks: __webpack_require__(75691), OpsWorksCM: __webpack_require__(80388), Organizations: __webpack_require__(44670), Pinpoint: __webpack_require__(18388), Polly: __webpack_require__(97332), RDS: __webpack_require__(71578), Redshift: __webpack_require__(84853), Rekognition: __webpack_require__(65470), ResourceGroupsTaggingAPI: __webpack_require__(7385), Route53: __webpack_require__(44968), Route53Domains: __webpack_require__(51994), S3: __webpack_require__(83256), S3Control: __webpack_require__(99817), ServiceCatalog: __webpack_require__(822), SES: __webpack_require__(46816), Shield: __webpack_require__(20271), SimpleDB: __webpack_require__(10120), SMS: __webpack_require__(57719), Snowball: __webpack_require__(510), SNS: __webpack_require__(28581), SQS: __webpack_require__(63172), SSM: __webpack_require__(83380), StorageGateway: __webpack_require__(89190), StepFunctions: __webpack_require__(8136), STS: __webpack_require__(57513), Support: __webpack_require__(1099), SWF: __webpack_require__(32327), XRay: __webpack_require__(41548), WAF: __webpack_require__(72742), WAFRegional: __webpack_require__(23153), WorkDocs: __webpack_require__(38835), WorkSpaces: __webpack_require__(25513), CodeStar: __webpack_require__(98336), LexModelBuildingService: __webpack_require__(37397), MarketplaceEntitlementService: __webpack_require__(53707), Athena: __webpack_require__(29434), Greengrass: __webpack_require__(20690), DAX: __webpack_require__(71398), MigrationHub: __webpack_require__(14688), CloudHSMV2: __webpack_require__(70889), Glue: __webpack_require__(31658), Mobile: __webpack_require__(39782), Pricing: __webpack_require__(92765), CostExplorer: __webpack_require__(79523), MediaConvert: __webpack_require__(57220), MediaLive: __webpack_require__(7509), MediaPackage: __webpack_require__(91620), MediaStore: __webpack_require__(83748), MediaStoreData: __webpack_require__(98703), AppSync: __webpack_require__(12402), GuardDuty: __webpack_require__(40755), MQ: __webpack_require__(23093), Comprehend: __webpack_require__(62878), IoTJobsDataPlane: __webpack_require__(42332), KinesisVideoArchivedMedia: __webpack_require__(5580), KinesisVideoMedia: __webpack_require__(81308), KinesisVideo: __webpack_require__(89927), SageMakerRuntime: __webpack_require__(85044), SageMaker: __webpack_require__(77657), Translate: __webpack_require__(72544), ResourceGroups: __webpack_require__(58756), AlexaForBusiness: __webpack_require__(14578), Cloud9: __webpack_require__(85473), ServerlessApplicationRepository: __webpack_require__(62402), ServiceDiscovery: __webpack_require__(91569), WorkMail: __webpack_require__(38374), AutoScalingPlans: __webpack_require__(2554), TranscribeService: __webpack_require__(75811), Connect: __webpack_require__(13879), ACMPCA: __webpack_require__(18450), FMS: __webpack_require__(11316), SecretsManager: __webpack_require__(85131), IoTAnalytics: __webpack_require__(67409), IoT1ClickDevicesService: __webpack_require__(39474), IoT1ClickProjects: __webpack_require__(4686), PI: __webpack_require__(15505), Neptune: __webpack_require__(30047), MediaTailor: __webpack_require__(99658), EKS: __webpack_require__(23337), Macie: __webpack_require__(86427), DLM: __webpack_require__(24958), Signer: __webpack_require__(71596), Chime: __webpack_require__(84646), PinpointEmail: __webpack_require__(83060), RAM: __webpack_require__(94394), Route53Resolver: __webpack_require__(25894), PinpointSMSVoice: __webpack_require__(46605), QuickSight: __webpack_require__(29898), RDSDataService: __webpack_require__(30147), Amplify: __webpack_require__(38090), DataSync: __webpack_require__(15472), RoboMaker: __webpack_require__(18068), Transfer: __webpack_require__(51585), GlobalAccelerator: __webpack_require__(19306), ComprehendMedical: __webpack_require__(32349), KinesisAnalyticsV2: __webpack_require__(74631), MediaConnect: __webpack_require__(67639), FSx: __webpack_require__(60642), SecurityHub: __webpack_require__(21550), AppMesh: __webpack_require__(69226), LicenseManager: __webpack_require__(34693), Kafka: __webpack_require__(56775), ApiGatewayManagementApi: __webpack_require__(31762), ApiGatewayV2: __webpack_require__(44987), DocDB: __webpack_require__(55129), Backup: __webpack_require__(82455), WorkLink: __webpack_require__(48579), Textract: __webpack_require__(58523), ManagedBlockchain: __webpack_require__(85143), MediaPackageVod: __webpack_require__(14962), GroundStation: __webpack_require__(80494), IoTThingsGraph: __webpack_require__(58905), IoTEvents: __webpack_require__(88065), IoTEventsData: __webpack_require__(56973), Personalize: __webpack_require__(33696), PersonalizeEvents: __webpack_require__(88170), PersonalizeRuntime: __webpack_require__(66184), ApplicationInsights: __webpack_require__(83972), ServiceQuotas: __webpack_require__(57800), EC2InstanceConnect: __webpack_require__(92209), EventBridge: __webpack_require__(898), LakeFormation: __webpack_require__(6726), ForecastService: __webpack_require__(12942), ForecastQueryService: __webpack_require__(36822), QLDB: __webpack_require__(71266), QLDBSession: __webpack_require__(55423), WorkMailMessageFlow: __webpack_require__(67025), CodeStarNotifications: __webpack_require__(15141), SavingsPlans: __webpack_require__(62825), SSO: __webpack_require__(71096), SSOOIDC: __webpack_require__(49870), MarketplaceCatalog: __webpack_require__(2609), DataExchange: __webpack_require__(11024), SESV2: __webpack_require__(20142), MigrationHubConfig: __webpack_require__(62658), ConnectParticipant: __webpack_require__(94198), AppConfig: __webpack_require__(78606), IoTSecureTunneling: __webpack_require__(98562), WAFV2: __webpack_require__(50353), ElasticInference: __webpack_require__(37708), Imagebuilder: __webpack_require__(57511), Schemas: __webpack_require__(55713), AccessAnalyzer: __webpack_require__(20940), CodeGuruReviewer: __webpack_require__(60070), CodeGuruProfiler: __webpack_require__(65704), ComputeOptimizer: __webpack_require__(64459), FraudDetector: __webpack_require__(99830), Kendra: __webpack_require__(66122), NetworkManager: __webpack_require__(37610), Outposts: __webpack_require__(27551), AugmentedAIRuntime: __webpack_require__(33960), EBS: __webpack_require__(62837), KinesisVideoSignalingChannels: __webpack_require__(12710), Detective: __webpack_require__(60674), CodeStarconnections: __webpack_require__(78270), Synthetics: __webpack_require__(25910), IoTSiteWise: __webpack_require__(89690), Macie2: __webpack_require__(57330), CodeArtifact: __webpack_require__(91983), Honeycode: __webpack_require__(38889), IVS: __webpack_require__(67701), Braket: __webpack_require__(35429), IdentityStore: __webpack_require__(60222), Appflow: __webpack_require__(60844), RedshiftData: __webpack_require__(203), SSOAdmin: __webpack_require__(66644), TimestreamQuery: __webpack_require__(24529), TimestreamWrite: __webpack_require__(1573), S3Outposts: __webpack_require__(90493), DataBrew: __webpack_require__(35846), ServiceCatalogAppRegistry: __webpack_require__(79068), NetworkFirewall: __webpack_require__(84626), MWAA: __webpack_require__(32712), AmplifyBackend: __webpack_require__(2806), AppIntegrations: __webpack_require__(85479), ConnectContactLens: __webpack_require__(41847), DevOpsGuru: __webpack_require__(90673), ECRPUBLIC: __webpack_require__(90244), LookoutVision: __webpack_require__(65046), SageMakerFeatureStoreRuntime: __webpack_require__(67644), CustomerProfiles: __webpack_require__(28379), AuditManager: __webpack_require__(20472), EMRcontainers: __webpack_require__(49984), HealthLake: __webpack_require__(64254), SagemakerEdge: __webpack_require__(38966), Amp: __webpack_require__(96881), GreengrassV2: __webpack_require__(45126), IotDeviceAdvisor: __webpack_require__(97569), IoTFleetHub: __webpack_require__(42513), IoTWireless: __webpack_require__(8226), Location: __webpack_require__(44594), WellArchitected: __webpack_require__(86263), LexModelsV2: __webpack_require__(27254), LexRuntimeV2: __webpack_require__(33855), Fis: __webpack_require__(73003), LookoutMetrics: __webpack_require__(78708), Mgn: __webpack_require__(41339), LookoutEquipment: __webpack_require__(21843) }; /***/ }), /***/ 96881: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { __webpack_require__(73639); var AWS = __webpack_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; apiLoader.services['amp'] = {}; AWS.Amp = Service.defineService('amp', ['2020-08-01']); Object.defineProperty(apiLoader.services['amp'], '2020-08-01', { get: function get() { var model = __webpack_require__(36184); model.paginators = __webpack_require__(7850)/* .pagination */ .o; return model; }, enumerable: true, configurable: true }); module.exports = AWS.Amp; /***/ }), /***/ 38090: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { __webpack_require__(73639); var AWS = __webpack_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; apiLoader.services['amplify'] = {}; AWS.Amplify = Service.defineService('amplify', ['2017-07-25']); Object.defineProperty(apiLoader.services['amplify'], '2017-07-25', { get: function get() { var model = __webpack_require__(59237); model.paginators = __webpack_require__(89594)/* .pagination */ .o; return model; }, enumerable: true, configurable: true }); module.exports = AWS.Amplify; /***/ }), /***/ 2806: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { __webpack_require__(73639); var AWS = __webpack_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; apiLoader.services['amplifybackend'] = {}; AWS.AmplifyBackend = Service.defineService('amplifybackend', ['2020-08-11']); Object.defineProperty(apiLoader.services['amplifybackend'], '2020-08-11', { get: function get() { var model = __webpack_require__(70211); model.paginators = __webpack_require__(72426)/* .pagination */ .o; return model; }, enumerable: true, configurable: true }); module.exports = AWS.AmplifyBackend; /***/ }), /***/ 91759: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { __webpack_require__(73639); var AWS = __webpack_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; apiLoader.services['apigateway'] = {}; AWS.APIGateway = Service.defineService('apigateway', ['2015-07-09']); __webpack_require__(4338); Object.defineProperty(apiLoader.services['apigateway'], '2015-07-09', { get: function get() { var model = __webpack_require__(33895); model.paginators = __webpack_require__(61271)/* .pagination */ .o; return model; }, enumerable: true, configurable: true }); module.exports = AWS.APIGateway; /***/ }), /***/ 31762: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { __webpack_require__(73639); var AWS = __webpack_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; apiLoader.services['apigatewaymanagementapi'] = {}; AWS.ApiGatewayManagementApi = Service.defineService('apigatewaymanagementapi', ['2018-11-29']); Object.defineProperty(apiLoader.services['apigatewaymanagementapi'], '2018-11-29', { get: function get() { var model = __webpack_require__(31775); model.paginators = __webpack_require__(19890)/* .pagination */ .o; return model; }, enumerable: true, configurable: true }); module.exports = AWS.ApiGatewayManagementApi; /***/ }), /***/ 44987: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { __webpack_require__(73639); var AWS = __webpack_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; apiLoader.services['apigatewayv2'] = {}; AWS.ApiGatewayV2 = Service.defineService('apigatewayv2', ['2018-11-29']); Object.defineProperty(apiLoader.services['apigatewayv2'], '2018-11-29', { get: function get() { var model = __webpack_require__(18767); model.paginators = __webpack_require__(96828)/* .pagination */ .o; return model; }, enumerable: true, configurable: true }); module.exports = AWS.ApiGatewayV2; /***/ }), /***/ 78606: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { __webpack_require__(73639); var AWS = __webpack_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; apiLoader.services['appconfig'] = {}; AWS.AppConfig = Service.defineService('appconfig', ['2019-10-09']); Object.defineProperty(apiLoader.services['appconfig'], '2019-10-09', { get: function get() { var model = __webpack_require__(5832); model.paginators = __webpack_require__(38388)/* .pagination */ .o; return model; }, enumerable: true, configurable: true }); module.exports = AWS.AppConfig; /***/ }), /***/ 60844: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { __webpack_require__(73639); var AWS = __webpack_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; apiLoader.services['appflow'] = {}; AWS.Appflow = Service.defineService('appflow', ['2020-08-23']); Object.defineProperty(apiLoader.services['appflow'], '2020-08-23', { get: function get() { var model = __webpack_require__(63769); model.paginators = __webpack_require__(3505)/* .pagination */ .o; return model; }, enumerable: true, configurable: true }); module.exports = AWS.Appflow; /***/ }), /***/ 85479: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { __webpack_require__(73639); var AWS = __webpack_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; apiLoader.services['appintegrations'] = {}; AWS.AppIntegrations = Service.defineService('appintegrations', ['2020-07-29']); Object.defineProperty(apiLoader.services['appintegrations'], '2020-07-29', { get: function get() { var model = __webpack_require__(26469); model.paginators = __webpack_require__(74824)/* .pagination */ .o; return model; }, enumerable: true, configurable: true }); module.exports = AWS.AppIntegrations; /***/ }), /***/ 25598: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { __webpack_require__(73639); var AWS = __webpack_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; apiLoader.services['applicationautoscaling'] = {}; AWS.ApplicationAutoScaling = Service.defineService('applicationautoscaling', ['2016-02-06']); Object.defineProperty(apiLoader.services['applicationautoscaling'], '2016-02-06', { get: function get() { var model = __webpack_require__(14452); model.paginators = __webpack_require__(11157)/* .pagination */ .o; return model; }, enumerable: true, configurable: true }); module.exports = AWS.ApplicationAutoScaling; /***/ }), /***/ 83972: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { __webpack_require__(73639); var AWS = __webpack_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; apiLoader.services['applicationinsights'] = {}; AWS.ApplicationInsights = Service.defineService('applicationinsights', ['2018-11-25']); Object.defineProperty(apiLoader.services['applicationinsights'], '2018-11-25', { get: function get() { var model = __webpack_require__(48728); model.paginators = __webpack_require__(9986)/* .pagination */ .o; return model; }, enumerable: true, configurable: true }); module.exports = AWS.ApplicationInsights; /***/ }), /***/ 69226: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { __webpack_require__(73639); var AWS = __webpack_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; apiLoader.services['appmesh'] = {}; AWS.AppMesh = Service.defineService('appmesh', ['2018-10-01', '2018-10-01*', '2019-01-25']); Object.defineProperty(apiLoader.services['appmesh'], '2018-10-01', { get: function get() { var model = __webpack_require__(4710); model.paginators = __webpack_require__(74196)/* .pagination */ .o; return model; }, enumerable: true, configurable: true }); Object.defineProperty(apiLoader.services['appmesh'], '2019-01-25', { get: function get() { var model = __webpack_require__(99818); model.paginators = __webpack_require__(9865)/* .pagination */ .o; return model; }, enumerable: true, configurable: true }); module.exports = AWS.AppMesh; /***/ }), /***/ 21730: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { __webpack_require__(73639); var AWS = __webpack_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; apiLoader.services['appstream'] = {}; AWS.AppStream = Service.defineService('appstream', ['2016-12-01']); Object.defineProperty(apiLoader.services['appstream'], '2016-12-01', { get: function get() { var model = __webpack_require__(12513); model.paginators = __webpack_require__(81915)/* .pagination */ .o; model.waiters = __webpack_require__(98407)/* .waiters */ .V; return model; }, enumerable: true, configurable: true }); module.exports = AWS.AppStream; /***/ }), /***/ 12402: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { __webpack_require__(73639); var AWS = __webpack_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; apiLoader.services['appsync'] = {}; AWS.AppSync = Service.defineService('appsync', ['2017-07-25']); Object.defineProperty(apiLoader.services['appsync'], '2017-07-25', { get: function get() { var model = __webpack_require__(3651); model.paginators = __webpack_require__(93930)/* .pagination */ .o; return model; }, enumerable: true, configurable: true }); module.exports = AWS.AppSync; /***/ }), /***/ 29434: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { __webpack_require__(73639); var AWS = __webpack_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; apiLoader.services['athena'] = {}; AWS.Athena = Service.defineService('athena', ['2017-05-18']); Object.defineProperty(apiLoader.services['athena'], '2017-05-18', { get: function get() { var model = __webpack_require__(19898); model.paginators = __webpack_require__(23135)/* .pagination */ .o; return model; }, enumerable: true, configurable: true }); module.exports = AWS.Athena; /***/ }), /***/ 20472: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { __webpack_require__(73639); var AWS = __webpack_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; apiLoader.services['auditmanager'] = {}; AWS.AuditManager = Service.defineService('auditmanager', ['2017-07-25']); Object.defineProperty(apiLoader.services['auditmanager'], '2017-07-25', { get: function get() { var model = __webpack_require__(66702); model.paginators = __webpack_require__(99387)/* .pagination */ .o; return model; }, enumerable: true, configurable: true }); module.exports = AWS.AuditManager; /***/ }), /***/ 33960: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { __webpack_require__(73639); var AWS = __webpack_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; apiLoader.services['augmentedairuntime'] = {}; AWS.AugmentedAIRuntime = Service.defineService('augmentedairuntime', ['2019-11-07']); Object.defineProperty(apiLoader.services['augmentedairuntime'], '2019-11-07', { get: function get() { var model = __webpack_require__(60302); model.paginators = __webpack_require__(58181)/* .pagination */ .o; return model; }, enumerable: true, configurable: true }); module.exports = AWS.AugmentedAIRuntime; /***/ }), /***/ 31652: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { __webpack_require__(73639); var AWS = __webpack_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; apiLoader.services['autoscaling'] = {}; AWS.AutoScaling = Service.defineService('autoscaling', ['2011-01-01']); Object.defineProperty(apiLoader.services['autoscaling'], '2011-01-01', { get: function get() { var model = __webpack_require__(68489); model.paginators = __webpack_require__(38676)/* .pagination */ .o; return model; }, enumerable: true, configurable: true }); module.exports = AWS.AutoScaling; /***/ }), /***/ 2554: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { __webpack_require__(73639); var AWS = __webpack_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; apiLoader.services['autoscalingplans'] = {}; AWS.AutoScalingPlans = Service.defineService('autoscalingplans', ['2018-01-06']); Object.defineProperty(apiLoader.services['autoscalingplans'], '2018-01-06', { get: function get() { var model = __webpack_require__(95300); model.paginators = __webpack_require__(4511)/* .pagination */ .o; return model; }, enumerable: true, configurable: true }); module.exports = AWS.AutoScalingPlans; /***/ }), /***/ 82455: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { __webpack_require__(73639); var AWS = __webpack_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; apiLoader.services['backup'] = {}; AWS.Backup = Service.defineService('backup', ['2018-11-15']); Object.defineProperty(apiLoader.services['backup'], '2018-11-15', { get: function get() { var model = __webpack_require__(65918); model.paginators = __webpack_require__(61080)/* .pagination */ .o; return model; }, enumerable: true, configurable: true }); module.exports = AWS.Backup; /***/ }), /***/ 10000: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { __webpack_require__(73639); var AWS = __webpack_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; apiLoader.services['batch'] = {}; AWS.Batch = Service.defineService('batch', ['2016-08-10']); Object.defineProperty(apiLoader.services['batch'], '2016-08-10', { get: function get() { var model = __webpack_require__(97171); model.paginators = __webpack_require__(27755)/* .pagination */ .o; return model; }, enumerable: true, configurable: true }); module.exports = AWS.Batch; /***/ }), /***/ 35429: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { __webpack_require__(73639); var AWS = __webpack_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; apiLoader.services['braket'] = {}; AWS.Braket = Service.defineService('braket', ['2019-09-01']); Object.defineProperty(apiLoader.services['braket'], '2019-09-01', { get: function get() { var model = __webpack_require__(44714); model.paginators = __webpack_require__(60058)/* .pagination */ .o; return model; }, enumerable: true, configurable: true }); module.exports = AWS.Braket; /***/ }), /***/ 43923: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { __webpack_require__(73639); var AWS = __webpack_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; apiLoader.services['budgets'] = {}; AWS.Budgets = Service.defineService('budgets', ['2016-10-20']); Object.defineProperty(apiLoader.services['budgets'], '2016-10-20', { get: function get() { var model = __webpack_require__(47942); model.paginators = __webpack_require__(64219)/* .pagination */ .o; return model; }, enumerable: true, configurable: true }); module.exports = AWS.Budgets; /***/ }), /***/ 84646: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { __webpack_require__(73639); var AWS = __webpack_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; apiLoader.services['chime'] = {}; AWS.Chime = Service.defineService('chime', ['2018-05-01']); Object.defineProperty(apiLoader.services['chime'], '2018-05-01', { get: function get() { var model = __webpack_require__(55823); model.paginators = __webpack_require__(6307)/* .pagination */ .o; return model; }, enumerable: true, configurable: true }); module.exports = AWS.Chime; /***/ }), /***/ 85473: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { __webpack_require__(73639); var AWS = __webpack_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; apiLoader.services['cloud9'] = {}; AWS.Cloud9 = Service.defineService('cloud9', ['2017-09-23']); Object.defineProperty(apiLoader.services['cloud9'], '2017-09-23', { get: function get() { var model = __webpack_require__(90697); model.paginators = __webpack_require__(79426)/* .pagination */ .o; return model; }, enumerable: true, configurable: true }); module.exports = AWS.Cloud9; /***/ }), /***/ 56231: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { __webpack_require__(73639); var AWS = __webpack_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; apiLoader.services['clouddirectory'] = {}; AWS.CloudDirectory = Service.defineService('clouddirectory', ['2016-05-10', '2016-05-10*', '2017-01-11']); Object.defineProperty(apiLoader.services['clouddirectory'], '2016-05-10', { get: function get() { var model = __webpack_require__(87301); model.paginators = __webpack_require__(72446)/* .pagination */ .o; return model; }, enumerable: true, configurable: true }); Object.defineProperty(apiLoader.services['clouddirectory'], '2017-01-11', { get: function get() { var model = __webpack_require__(79943); model.paginators = __webpack_require__(20410)/* .pagination */ .o; return model; }, enumerable: true, configurable: true }); module.exports = AWS.CloudDirectory; /***/ }), /***/ 74643: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { __webpack_require__(73639); var AWS = __webpack_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; apiLoader.services['cloudformation'] = {}; AWS.CloudFormation = Service.defineService('cloudformation', ['2010-05-15']); Object.defineProperty(apiLoader.services['cloudformation'], '2010-05-15', { get: function get() { var model = __webpack_require__(50980); model.paginators = __webpack_require__(43078)/* .pagination */ .o; model.waiters = __webpack_require__(11714)/* .waiters */ .V; return model; }, enumerable: true, configurable: true }); module.exports = AWS.CloudFormation; /***/ }), /***/ 48058: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { __webpack_require__(73639); var AWS = __webpack_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; apiLoader.services['cloudfront'] = {}; AWS.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']); __webpack_require__(95483); Object.defineProperty(apiLoader.services['cloudfront'], '2016-11-25', { get: function get() { var model = __webpack_require__(81977); model.paginators = __webpack_require__(12819)/* .pagination */ .o; model.waiters = __webpack_require__(52832)/* .waiters */ .V; return model; }, enumerable: true, configurable: true }); Object.defineProperty(apiLoader.services['cloudfront'], '2017-03-25', { get: function get() { var model = __webpack_require__(38288); model.paginators = __webpack_require__(19896)/* .pagination */ .o; model.waiters = __webpack_require__(43589)/* .waiters */ .V; return model; }, enumerable: true, configurable: true }); Object.defineProperty(apiLoader.services['cloudfront'], '2017-10-30', { get: function get() { var model = __webpack_require__(62352); model.paginators = __webpack_require__(94430)/* .pagination */ .o; model.waiters = __webpack_require__(36502)/* .waiters */ .V; return model; }, enumerable: true, configurable: true }); Object.defineProperty(apiLoader.services['cloudfront'], '2018-06-18', { get: function get() { var model = __webpack_require__(59976); model.paginators = __webpack_require__(43510)/* .pagination */ .o; model.waiters = __webpack_require__(67512)/* .waiters */ .V; return model; }, enumerable: true, configurable: true }); Object.defineProperty(apiLoader.services['cloudfront'], '2018-11-05', { get: function get() { var model = __webpack_require__(2861); model.paginators = __webpack_require__(94484)/* .pagination */ .o; model.waiters = __webpack_require__(94992)/* .waiters */ .V; return model; }, enumerable: true, configurable: true }); Object.defineProperty(apiLoader.services['cloudfront'], '2019-03-26', { get: function get() { var model = __webpack_require__(22621); model.paginators = __webpack_require__(49289)/* .pagination */ .o; model.waiters = __webpack_require__(89078)/* .waiters */ .V; return model; }, enumerable: true, configurable: true }); Object.defineProperty(apiLoader.services['cloudfront'], '2020-05-31', { get: function get() { var model = __webpack_require__(44946); model.paginators = __webpack_require__(92022)/* .pagination */ .o; model.waiters = __webpack_require__(83035)/* .waiters */ .V; return model; }, enumerable: true, configurable: true }); module.exports = AWS.CloudFront; /***/ }), /***/ 10569: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { __webpack_require__(73639); var AWS = __webpack_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; apiLoader.services['cloudhsm'] = {}; AWS.CloudHSM = Service.defineService('cloudhsm', ['2014-05-30']); Object.defineProperty(apiLoader.services['cloudhsm'], '2014-05-30', { get: function get() { var model = __webpack_require__(59717); model.paginators = __webpack_require__(26512)/* .pagination */ .o; return model; }, enumerable: true, configurable: true }); module.exports = AWS.CloudHSM; /***/ }), /***/ 70889: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { __webpack_require__(73639); var AWS = __webpack_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; apiLoader.services['cloudhsmv2'] = {}; AWS.CloudHSMV2 = Service.defineService('cloudhsmv2', ['2017-04-28']); Object.defineProperty(apiLoader.services['cloudhsmv2'], '2017-04-28', { get: function get() { var model = __webpack_require__(19362); model.paginators = __webpack_require__(96674)/* .pagination */ .o; return model; }, enumerable: true, configurable: true }); module.exports = AWS.CloudHSMV2; /***/ }), /***/ 72321: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { __webpack_require__(73639); var AWS = __webpack_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; apiLoader.services['cloudsearch'] = {}; AWS.CloudSearch = Service.defineService('cloudsearch', ['2011-02-01', '2013-01-01']); Object.defineProperty(apiLoader.services['cloudsearch'], '2011-02-01', { get: function get() { var model = __webpack_require__(4999); model.paginators = __webpack_require__(74483)/* .pagination */ .o; return model; }, enumerable: true, configurable: true }); Object.defineProperty(apiLoader.services['cloudsearch'], '2013-01-01', { get: function get() { var model = __webpack_require__(93200); model.paginators = __webpack_require__(82352)/* .pagination */ .o; return model; }, enumerable: true, configurable: true }); module.exports = AWS.CloudSearch; /***/ }), /***/ 64072: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { __webpack_require__(73639); var AWS = __webpack_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; apiLoader.services['cloudsearchdomain'] = {}; AWS.CloudSearchDomain = Service.defineService('cloudsearchdomain', ['2013-01-01']); __webpack_require__(48571); Object.defineProperty(apiLoader.services['cloudsearchdomain'], '2013-01-01', { get: function get() { var model = __webpack_require__(56588); return model; }, enumerable: true, configurable: true }); module.exports = AWS.CloudSearchDomain; /***/ }), /***/ 65512: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { __webpack_require__(73639); var AWS = __webpack_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; apiLoader.services['cloudtrail'] = {}; AWS.CloudTrail = Service.defineService('cloudtrail', ['2013-11-01']); Object.defineProperty(apiLoader.services['cloudtrail'], '2013-11-01', { get: function get() { var model = __webpack_require__(90967); model.paginators = __webpack_require__(78414)/* .pagination */ .o; return model; }, enumerable: true, configurable: true }); module.exports = AWS.CloudTrail; /***/ }), /***/ 6763: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { __webpack_require__(73639); var AWS = __webpack_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; apiLoader.services['cloudwatch'] = {}; AWS.CloudWatch = Service.defineService('cloudwatch', ['2010-08-01']); Object.defineProperty(apiLoader.services['cloudwatch'], '2010-08-01', { get: function get() { var model = __webpack_require__(12505); model.paginators = __webpack_require__(16758)/* .pagination */ .o; model.waiters = __webpack_require__(4112)/* .waiters */ .V; return model; }, enumerable: true, configurable: true }); module.exports = AWS.CloudWatch; /***/ }), /***/ 38124: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { __webpack_require__(73639); var AWS = __webpack_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; apiLoader.services['cloudwatchevents'] = {}; AWS.CloudWatchEvents = Service.defineService('cloudwatchevents', ['2014-02-03*', '2015-10-07']); Object.defineProperty(apiLoader.services['cloudwatchevents'], '2015-10-07', { get: function get() { var model = __webpack_require__(2845); model.paginators = __webpack_require__(96939)/* .pagination */ .o; return model; }, enumerable: true, configurable: true }); module.exports = AWS.CloudWatchEvents; /***/ }), /***/ 96693: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { __webpack_require__(73639); var AWS = __webpack_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; apiLoader.services['cloudwatchlogs'] = {}; AWS.CloudWatchLogs = Service.defineService('cloudwatchlogs', ['2014-03-28']); Object.defineProperty(apiLoader.services['cloudwatchlogs'], '2014-03-28', { get: function get() { var model = __webpack_require__(69022); model.paginators = __webpack_require__(26273)/* .pagination */ .o; return model; }, enumerable: true, configurable: true }); module.exports = AWS.CloudWatchLogs; /***/ }), /***/ 91983: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { __webpack_require__(73639); var AWS = __webpack_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; apiLoader.services['codeartifact'] = {}; AWS.CodeArtifact = Service.defineService('codeartifact', ['2018-09-22']); Object.defineProperty(apiLoader.services['codeartifact'], '2018-09-22', { get: function get() { var model = __webpack_require__(26175); model.paginators = __webpack_require__(21307)/* .pagination */ .o; return model; }, enumerable: true, configurable: true }); module.exports = AWS.CodeArtifact; /***/ }), /***/ 60450: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { __webpack_require__(73639); var AWS = __webpack_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; apiLoader.services['codebuild'] = {}; AWS.CodeBuild = Service.defineService('codebuild', ['2016-10-06']); Object.defineProperty(apiLoader.services['codebuild'], '2016-10-06', { get: function get() { var model = __webpack_require__(32310); model.paginators = __webpack_require__(10589)/* .pagination */ .o; return model; }, enumerable: true, configurable: true }); module.exports = AWS.CodeBuild; /***/ }), /***/ 71323: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { __webpack_require__(73639); var AWS = __webpack_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; apiLoader.services['codecommit'] = {}; AWS.CodeCommit = Service.defineService('codecommit', ['2015-04-13']); Object.defineProperty(apiLoader.services['codecommit'], '2015-04-13', { get: function get() { var model = __webpack_require__(2091); model.paginators = __webpack_require__(11742)/* .pagination */ .o; return model; }, enumerable: true, configurable: true }); module.exports = AWS.CodeCommit; /***/ }), /***/ 54599: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { __webpack_require__(73639); var AWS = __webpack_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; apiLoader.services['codedeploy'] = {}; AWS.CodeDeploy = Service.defineService('codedeploy', ['2014-10-06']); Object.defineProperty(apiLoader.services['codedeploy'], '2014-10-06', { get: function get() { var model = __webpack_require__(33531); model.paginators = __webpack_require__(63203)/* .pagination */ .o; model.waiters = __webpack_require__(56338)/* .waiters */ .V; return model; }, enumerable: true, configurable: true }); module.exports = AWS.CodeDeploy; /***/ }), /***/ 65704: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { __webpack_require__(73639); var AWS = __webpack_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; apiLoader.services['codeguruprofiler'] = {}; AWS.CodeGuruProfiler = Service.defineService('codeguruprofiler', ['2019-07-18']); Object.defineProperty(apiLoader.services['codeguruprofiler'], '2019-07-18', { get: function get() { var model = __webpack_require__(55790); model.paginators = __webpack_require__(14789)/* .pagination */ .o; return model; }, enumerable: true, configurable: true }); module.exports = AWS.CodeGuruProfiler; /***/ }), /***/ 60070: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { __webpack_require__(73639); var AWS = __webpack_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; apiLoader.services['codegurureviewer'] = {}; AWS.CodeGuruReviewer = Service.defineService('codegurureviewer', ['2019-09-19']); Object.defineProperty(apiLoader.services['codegurureviewer'], '2019-09-19', { get: function get() { var model = __webpack_require__(16420); model.paginators = __webpack_require__(89571)/* .pagination */ .o; return model; }, enumerable: true, configurable: true }); module.exports = AWS.CodeGuruReviewer; /***/ }), /***/ 22938: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { __webpack_require__(73639); var AWS = __webpack_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; apiLoader.services['codepipeline'] = {}; AWS.CodePipeline = Service.defineService('codepipeline', ['2015-07-09']); Object.defineProperty(apiLoader.services['codepipeline'], '2015-07-09', { get: function get() { var model = __webpack_require__(92486); model.paginators = __webpack_require__(38160)/* .pagination */ .o; return model; }, enumerable: true, configurable: true }); module.exports = AWS.CodePipeline; /***/ }), /***/ 98336: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { __webpack_require__(73639); var AWS = __webpack_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; apiLoader.services['codestar'] = {}; AWS.CodeStar = Service.defineService('codestar', ['2017-04-19']); Object.defineProperty(apiLoader.services['codestar'], '2017-04-19', { get: function get() { var model = __webpack_require__(71626); model.paginators = __webpack_require__(78653)/* .pagination */ .o; return model; }, enumerable: true, configurable: true }); module.exports = AWS.CodeStar; /***/ }), /***/ 78270: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { __webpack_require__(73639); var AWS = __webpack_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; apiLoader.services['codestarconnections'] = {}; AWS.CodeStarconnections = Service.defineService('codestarconnections', ['2019-12-01']); Object.defineProperty(apiLoader.services['codestarconnections'], '2019-12-01', { get: function get() { var model = __webpack_require__(81568); model.paginators = __webpack_require__(7656)/* .pagination */ .o; return model; }, enumerable: true, configurable: true }); module.exports = AWS.CodeStarconnections; /***/ }), /***/ 15141: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { __webpack_require__(73639); var AWS = __webpack_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; apiLoader.services['codestarnotifications'] = {}; AWS.CodeStarNotifications = Service.defineService('codestarnotifications', ['2019-10-15']); Object.defineProperty(apiLoader.services['codestarnotifications'], '2019-10-15', { get: function get() { var model = __webpack_require__(41964); model.paginators = __webpack_require__(5741)/* .pagination */ .o; return model; }, enumerable: true, configurable: true }); module.exports = AWS.CodeStarNotifications; /***/ }), /***/ 58291: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { __webpack_require__(73639); var AWS = __webpack_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; apiLoader.services['cognitoidentity'] = {}; AWS.CognitoIdentity = Service.defineService('cognitoidentity', ['2014-06-30']); Object.defineProperty(apiLoader.services['cognitoidentity'], '2014-06-30', { get: function get() { var model = __webpack_require__(26102); model.paginators = __webpack_require__(80796)/* .pagination */ .o; return model; }, enumerable: true, configurable: true }); module.exports = AWS.CognitoIdentity; /***/ }), /***/ 31379: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { __webpack_require__(73639); var AWS = __webpack_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; apiLoader.services['cognitoidentityserviceprovider'] = {}; AWS.CognitoIdentityServiceProvider = Service.defineService('cognitoidentityserviceprovider', ['2016-04-18']); Object.defineProperty(apiLoader.services['cognitoidentityserviceprovider'], '2016-04-18', { get: function get() { var model = __webpack_require__(60923); model.paginators = __webpack_require__(32568)/* .pagination */ .o; return model; }, enumerable: true, configurable: true }); module.exports = AWS.CognitoIdentityServiceProvider; /***/ }), /***/ 74770: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { __webpack_require__(73639); var AWS = __webpack_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; apiLoader.services['cognitosync'] = {}; AWS.CognitoSync = Service.defineService('cognitosync', ['2014-06-30']); Object.defineProperty(apiLoader.services['cognitosync'], '2014-06-30', { get: function get() { var model = __webpack_require__(91406); model.paginators = __webpack_require__(23418)/* .pagination */ .o; return model; }, enumerable: true, configurable: true }); module.exports = AWS.CognitoSync; /***/ }), /***/ 62878: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { __webpack_require__(73639); var AWS = __webpack_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; apiLoader.services['comprehend'] = {}; AWS.Comprehend = Service.defineService('comprehend', ['2017-11-27']); Object.defineProperty(apiLoader.services['comprehend'], '2017-11-27', { get: function get() { var model = __webpack_require__(71004); model.paginators = __webpack_require__(70341)/* .pagination */ .o; return model; }, enumerable: true, configurable: true }); module.exports = AWS.Comprehend; /***/ }), /***/ 32349: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { __webpack_require__(73639); var AWS = __webpack_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; apiLoader.services['comprehendmedical'] = {}; AWS.ComprehendMedical = Service.defineService('comprehendmedical', ['2018-10-30']); Object.defineProperty(apiLoader.services['comprehendmedical'], '2018-10-30', { get: function get() { var model = __webpack_require__(65085); model.paginators = __webpack_require__(89772)/* .pagination */ .o; return model; }, enumerable: true, configurable: true }); module.exports = AWS.ComprehendMedical; /***/ }), /***/ 64459: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { __webpack_require__(73639); var AWS = __webpack_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; apiLoader.services['computeoptimizer'] = {}; AWS.ComputeOptimizer = Service.defineService('computeoptimizer', ['2019-11-01']); Object.defineProperty(apiLoader.services['computeoptimizer'], '2019-11-01', { get: function get() { var model = __webpack_require__(559); model.paginators = __webpack_require__(16060)/* .pagination */ .o; return model; }, enumerable: true, configurable: true }); module.exports = AWS.ComputeOptimizer; /***/ }), /***/ 34061: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { __webpack_require__(73639); var AWS = __webpack_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; apiLoader.services['configservice'] = {}; AWS.ConfigService = Service.defineService('configservice', ['2014-11-12']); Object.defineProperty(apiLoader.services['configservice'], '2014-11-12', { get: function get() { var model = __webpack_require__(85031); model.paginators = __webpack_require__(55050)/* .pagination */ .o; return model; }, enumerable: true, configurable: true }); module.exports = AWS.ConfigService; /***/ }), /***/ 13879: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { __webpack_require__(73639); var AWS = __webpack_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; apiLoader.services['connect'] = {}; AWS.Connect = Service.defineService('connect', ['2017-08-08']); Object.defineProperty(apiLoader.services['connect'], '2017-08-08', { get: function get() { var model = __webpack_require__(13649); model.paginators = __webpack_require__(35649)/* .pagination */ .o; return model; }, enumerable: true, configurable: true }); module.exports = AWS.Connect; /***/ }), /***/ 41847: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { __webpack_require__(73639); var AWS = __webpack_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; apiLoader.services['connectcontactlens'] = {}; AWS.ConnectContactLens = Service.defineService('connectcontactlens', ['2020-08-21']); Object.defineProperty(apiLoader.services['connectcontactlens'], '2020-08-21', { get: function get() { var model = __webpack_require__(86739); model.paginators = __webpack_require__(49692)/* .pagination */ .o; return model; }, enumerable: true, configurable: true }); module.exports = AWS.ConnectContactLens; /***/ }), /***/ 94198: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { __webpack_require__(73639); var AWS = __webpack_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; apiLoader.services['connectparticipant'] = {}; AWS.ConnectParticipant = Service.defineService('connectparticipant', ['2018-09-07']); Object.defineProperty(apiLoader.services['connectparticipant'], '2018-09-07', { get: function get() { var model = __webpack_require__(46788); model.paginators = __webpack_require__(2813)/* .pagination */ .o; return model; }, enumerable: true, configurable: true }); module.exports = AWS.ConnectParticipant; /***/ }), /***/ 79523: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { __webpack_require__(73639); var AWS = __webpack_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; apiLoader.services['costexplorer'] = {}; AWS.CostExplorer = Service.defineService('costexplorer', ['2017-10-25']); Object.defineProperty(apiLoader.services['costexplorer'], '2017-10-25', { get: function get() { var model = __webpack_require__(86565); model.paginators = __webpack_require__(94382)/* .pagination */ .o; return model; }, enumerable: true, configurable: true }); module.exports = AWS.CostExplorer; /***/ }), /***/ 5026: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { __webpack_require__(73639); var AWS = __webpack_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; apiLoader.services['cur'] = {}; AWS.CUR = Service.defineService('cur', ['2017-01-06']); Object.defineProperty(apiLoader.services['cur'], '2017-01-06', { get: function get() { var model = __webpack_require__(4138); model.paginators = __webpack_require__(29271)/* .pagination */ .o; return model; }, enumerable: true, configurable: true }); module.exports = AWS.CUR; /***/ }), /***/ 28379: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { __webpack_require__(73639); var AWS = __webpack_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; apiLoader.services['customerprofiles'] = {}; AWS.CustomerProfiles = Service.defineService('customerprofiles', ['2020-08-15']); Object.defineProperty(apiLoader.services['customerprofiles'], '2020-08-15', { get: function get() { var model = __webpack_require__(39734); model.paginators = __webpack_require__(35003)/* .pagination */ .o; return model; }, enumerable: true, configurable: true }); module.exports = AWS.CustomerProfiles; /***/ }), /***/ 35846: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { __webpack_require__(73639); var AWS = __webpack_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; apiLoader.services['databrew'] = {}; AWS.DataBrew = Service.defineService('databrew', ['2017-07-25']); Object.defineProperty(apiLoader.services['databrew'], '2017-07-25', { get: function get() { var model = __webpack_require__(42529); model.paginators = __webpack_require__(91224)/* .pagination */ .o; return model; }, enumerable: true, configurable: true }); module.exports = AWS.DataBrew; /***/ }), /***/ 11024: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { __webpack_require__(73639); var AWS = __webpack_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; apiLoader.services['dataexchange'] = {}; AWS.DataExchange = Service.defineService('dataexchange', ['2017-07-25']); Object.defineProperty(apiLoader.services['dataexchange'], '2017-07-25', { get: function get() { var model = __webpack_require__(25676); model.paginators = __webpack_require__(44399)/* .pagination */ .o; return model; }, enumerable: true, configurable: true }); module.exports = AWS.DataExchange; /***/ }), /***/ 65688: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { __webpack_require__(73639); var AWS = __webpack_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; apiLoader.services['datapipeline'] = {}; AWS.DataPipeline = Service.defineService('datapipeline', ['2012-10-29']); Object.defineProperty(apiLoader.services['datapipeline'], '2012-10-29', { get: function get() { var model = __webpack_require__(9547); model.paginators = __webpack_require__(48471)/* .pagination */ .o; return model; }, enumerable: true, configurable: true }); module.exports = AWS.DataPipeline; /***/ }), /***/ 15472: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { __webpack_require__(73639); var AWS = __webpack_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; apiLoader.services['datasync'] = {}; AWS.DataSync = Service.defineService('datasync', ['2018-11-09']); Object.defineProperty(apiLoader.services['datasync'], '2018-11-09', { get: function get() { var model = __webpack_require__(37374); model.paginators = __webpack_require__(18448)/* .pagination */ .o; return model; }, enumerable: true, configurable: true }); module.exports = AWS.DataSync; /***/ }), /***/ 71398: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { __webpack_require__(73639); var AWS = __webpack_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; apiLoader.services['dax'] = {}; AWS.DAX = Service.defineService('dax', ['2017-04-19']); Object.defineProperty(apiLoader.services['dax'], '2017-04-19', { get: function get() { var model = __webpack_require__(97287); model.paginators = __webpack_require__(15791)/* .pagination */ .o; return model; }, enumerable: true, configurable: true }); module.exports = AWS.DAX; /***/ }), /***/ 60674: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { __webpack_require__(73639); var AWS = __webpack_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; apiLoader.services['detective'] = {}; AWS.Detective = Service.defineService('detective', ['2018-10-26']); Object.defineProperty(apiLoader.services['detective'], '2018-10-26', { get: function get() { var model = __webpack_require__(38107); model.paginators = __webpack_require__(26554)/* .pagination */ .o; return model; }, enumerable: true, configurable: true }); module.exports = AWS.Detective; /***/ }), /***/ 26272: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { __webpack_require__(73639); var AWS = __webpack_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; apiLoader.services['devicefarm'] = {}; AWS.DeviceFarm = Service.defineService('devicefarm', ['2015-06-23']); Object.defineProperty(apiLoader.services['devicefarm'], '2015-06-23', { get: function get() { var model = __webpack_require__(87206); model.paginators = __webpack_require__(85524)/* .pagination */ .o; return model; }, enumerable: true, configurable: true }); module.exports = AWS.DeviceFarm; /***/ }), /***/ 90673: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { __webpack_require__(73639); var AWS = __webpack_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; apiLoader.services['devopsguru'] = {}; AWS.DevOpsGuru = Service.defineService('devopsguru', ['2020-12-01']); Object.defineProperty(apiLoader.services['devopsguru'], '2020-12-01', { get: function get() { var model = __webpack_require__(82176); model.paginators = __webpack_require__(91556)/* .pagination */ .o; return model; }, enumerable: true, configurable: true }); module.exports = AWS.DevOpsGuru; /***/ }), /***/ 73783: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { __webpack_require__(73639); var AWS = __webpack_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; apiLoader.services['directconnect'] = {}; AWS.DirectConnect = Service.defineService('directconnect', ['2012-10-25']); Object.defineProperty(apiLoader.services['directconnect'], '2012-10-25', { get: function get() { var model = __webpack_require__(49177); model.paginators = __webpack_require__(57373)/* .pagination */ .o; return model; }, enumerable: true, configurable: true }); module.exports = AWS.DirectConnect; /***/ }), /***/ 83908: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { __webpack_require__(73639); var AWS = __webpack_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; apiLoader.services['directoryservice'] = {}; AWS.DirectoryService = Service.defineService('directoryservice', ['2015-04-16']); Object.defineProperty(apiLoader.services['directoryservice'], '2015-04-16', { get: function get() { var model = __webpack_require__(3174); model.paginators = __webpack_require__(1714)/* .pagination */ .o; return model; }, enumerable: true, configurable: true }); module.exports = AWS.DirectoryService; /***/ }), /***/ 81690: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { __webpack_require__(73639); var AWS = __webpack_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; apiLoader.services['discovery'] = {}; AWS.Discovery = Service.defineService('discovery', ['2015-11-01']); Object.defineProperty(apiLoader.services['discovery'], '2015-11-01', { get: function get() { var model = __webpack_require__(32400); model.paginators = __webpack_require__(54052)/* .pagination */ .o; return model; }, enumerable: true, configurable: true }); module.exports = AWS.Discovery; /***/ }), /***/ 24958: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { __webpack_require__(73639); var AWS = __webpack_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; apiLoader.services['dlm'] = {}; AWS.DLM = Service.defineService('dlm', ['2018-01-12']); Object.defineProperty(apiLoader.services['dlm'], '2018-01-12', { get: function get() { var model = __webpack_require__(19210); model.paginators = __webpack_require__(69943)/* .pagination */ .o; return model; }, enumerable: true, configurable: true }); module.exports = AWS.DLM; /***/ }), /***/ 69868: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { __webpack_require__(73639); var AWS = __webpack_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; apiLoader.services['dms'] = {}; AWS.DMS = Service.defineService('dms', ['2016-01-01']); Object.defineProperty(apiLoader.services['dms'], '2016-01-01', { get: function get() { var model = __webpack_require__(85765); model.paginators = __webpack_require__(170)/* .pagination */ .o; model.waiters = __webpack_require__(31491)/* .waiters */ .V; return model; }, enumerable: true, configurable: true }); module.exports = AWS.DMS; /***/ }), /***/ 55129: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { __webpack_require__(73639); var AWS = __webpack_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; apiLoader.services['docdb'] = {}; AWS.DocDB = Service.defineService('docdb', ['2014-10-31']); __webpack_require__(59050); Object.defineProperty(apiLoader.services['docdb'], '2014-10-31', { get: function get() { var model = __webpack_require__(78804); model.paginators = __webpack_require__(97929)/* .pagination */ .o; model.waiters = __webpack_require__(61159)/* .waiters */ .V; return model; }, enumerable: true, configurable: true }); module.exports = AWS.DocDB; /***/ }), /***/ 14347: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { __webpack_require__(73639); var AWS = __webpack_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; apiLoader.services['dynamodb'] = {}; AWS.DynamoDB = Service.defineService('dynamodb', ['2011-12-05', '2012-08-10']); __webpack_require__(17101); Object.defineProperty(apiLoader.services['dynamodb'], '2011-12-05', { get: function get() { var model = __webpack_require__(59225); model.paginators = __webpack_require__(30867)/* .pagination */ .o; model.waiters = __webpack_require__(15606)/* .waiters */ .V; return model; }, enumerable: true, configurable: true }); Object.defineProperty(apiLoader.services['dynamodb'], '2012-08-10', { get: function get() { var model = __webpack_require__(10198); model.paginators = __webpack_require__(79199)/* .pagination */ .o; model.waiters = __webpack_require__(13814)/* .waiters */ .V; return model; }, enumerable: true, configurable: true }); module.exports = AWS.DynamoDB; /***/ }), /***/ 88090: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { __webpack_require__(73639); var AWS = __webpack_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; apiLoader.services['dynamodbstreams'] = {}; AWS.DynamoDBStreams = Service.defineService('dynamodbstreams', ['2012-08-10']); Object.defineProperty(apiLoader.services['dynamodbstreams'], '2012-08-10', { get: function get() { var model = __webpack_require__(69705); model.paginators = __webpack_require__(18467)/* .pagination */ .o; return model; }, enumerable: true, configurable: true }); module.exports = AWS.DynamoDBStreams; /***/ }), /***/ 62837: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { __webpack_require__(73639); var AWS = __webpack_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; apiLoader.services['ebs'] = {}; AWS.EBS = Service.defineService('ebs', ['2019-11-02']); Object.defineProperty(apiLoader.services['ebs'], '2019-11-02', { get: function get() { var model = __webpack_require__(67263); model.paginators = __webpack_require__(94934)/* .pagination */ .o; return model; }, enumerable: true, configurable: true }); module.exports = AWS.EBS; /***/ }), /***/ 7778: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { __webpack_require__(73639); var AWS = __webpack_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; apiLoader.services['ec2'] = {}; AWS.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']); __webpack_require__(92501); Object.defineProperty(apiLoader.services['ec2'], '2016-11-15', { get: function get() { var model = __webpack_require__(8893); model.paginators = __webpack_require__(32127)/* .pagination */ .o; model.waiters = __webpack_require__(90157)/* .waiters */ .V; return model; }, enumerable: true, configurable: true }); module.exports = AWS.EC2; /***/ }), /***/ 92209: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { __webpack_require__(73639); var AWS = __webpack_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; apiLoader.services['ec2instanceconnect'] = {}; AWS.EC2InstanceConnect = Service.defineService('ec2instanceconnect', ['2018-04-02']); Object.defineProperty(apiLoader.services['ec2instanceconnect'], '2018-04-02', { get: function get() { var model = __webpack_require__(14703); model.paginators = __webpack_require__(73353)/* .pagination */ .o; return model; }, enumerable: true, configurable: true }); module.exports = AWS.EC2InstanceConnect; /***/ }), /***/ 15211: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { __webpack_require__(73639); var AWS = __webpack_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; apiLoader.services['ecr'] = {}; AWS.ECR = Service.defineService('ecr', ['2015-09-21']); Object.defineProperty(apiLoader.services['ecr'], '2015-09-21', { get: function get() { var model = __webpack_require__(80948); model.paginators = __webpack_require__(66855)/* .pagination */ .o; model.waiters = __webpack_require__(69800)/* .waiters */ .V; return model; }, enumerable: true, configurable: true }); module.exports = AWS.ECR; /***/ }), /***/ 90244: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { __webpack_require__(73639); var AWS = __webpack_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; apiLoader.services['ecrpublic'] = {}; AWS.ECRPUBLIC = Service.defineService('ecrpublic', ['2020-10-30']); Object.defineProperty(apiLoader.services['ecrpublic'], '2020-10-30', { get: function get() { var model = __webpack_require__(82416); model.paginators = __webpack_require__(41518)/* .pagination */ .o; return model; }, enumerable: true, configurable: true }); module.exports = AWS.ECRPUBLIC; /***/ }), /***/ 16615: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { __webpack_require__(73639); var AWS = __webpack_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; apiLoader.services['ecs'] = {}; AWS.ECS = Service.defineService('ecs', ['2014-11-13']); Object.defineProperty(apiLoader.services['ecs'], '2014-11-13', { get: function get() { var model = __webpack_require__(68155); model.paginators = __webpack_require__(33629)/* .pagination */ .o; model.waiters = __webpack_require__(54199)/* .waiters */ .V; return model; }, enumerable: true, configurable: true }); module.exports = AWS.ECS; /***/ }), /***/ 34375: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { __webpack_require__(73639); var AWS = __webpack_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; apiLoader.services['efs'] = {}; AWS.EFS = Service.defineService('efs', ['2015-02-01']); Object.defineProperty(apiLoader.services['efs'], '2015-02-01', { get: function get() { var model = __webpack_require__(54989); model.paginators = __webpack_require__(73750)/* .pagination */ .o; return model; }, enumerable: true, configurable: true }); module.exports = AWS.EFS; /***/ }), /***/ 23337: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { __webpack_require__(73639); var AWS = __webpack_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; apiLoader.services['eks'] = {}; AWS.EKS = Service.defineService('eks', ['2017-11-01']); Object.defineProperty(apiLoader.services['eks'], '2017-11-01', { get: function get() { var model = __webpack_require__(7766); model.paginators = __webpack_require__(17233)/* .pagination */ .o; model.waiters = __webpack_require__(11545)/* .waiters */ .V; return model; }, enumerable: true, configurable: true }); module.exports = AWS.EKS; /***/ }), /***/ 81065: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { __webpack_require__(73639); var AWS = __webpack_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; apiLoader.services['elasticache'] = {}; AWS.ElastiCache = Service.defineService('elasticache', ['2012-11-15*', '2014-03-24*', '2014-07-15*', '2014-09-30*', '2015-02-02']); Object.defineProperty(apiLoader.services['elasticache'], '2015-02-02', { get: function get() { var model = __webpack_require__(78248); model.paginators = __webpack_require__(47954)/* .pagination */ .o; model.waiters = __webpack_require__(35402)/* .waiters */ .V; return model; }, enumerable: true, configurable: true }); module.exports = AWS.ElastiCache; /***/ }), /***/ 14897: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { __webpack_require__(73639); var AWS = __webpack_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; apiLoader.services['elasticbeanstalk'] = {}; AWS.ElasticBeanstalk = Service.defineService('elasticbeanstalk', ['2010-12-01']); Object.defineProperty(apiLoader.services['elasticbeanstalk'], '2010-12-01', { get: function get() { var model = __webpack_require__(26770); model.paginators = __webpack_require__(14282)/* .pagination */ .o; model.waiters = __webpack_require__(125)/* .waiters */ .V; return model; }, enumerable: true, configurable: true }); module.exports = AWS.ElasticBeanstalk; /***/ }), /***/ 37708: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { __webpack_require__(73639); var AWS = __webpack_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; apiLoader.services['elasticinference'] = {}; AWS.ElasticInference = Service.defineService('elasticinference', ['2017-07-25']); Object.defineProperty(apiLoader.services['elasticinference'], '2017-07-25', { get: function get() { var model = __webpack_require__(76263); model.paginators = __webpack_require__(73815)/* .pagination */ .o; return model; }, enumerable: true, configurable: true }); module.exports = AWS.ElasticInference; /***/ }), /***/ 40745: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { __webpack_require__(73639); var AWS = __webpack_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; apiLoader.services['elastictranscoder'] = {}; AWS.ElasticTranscoder = Service.defineService('elastictranscoder', ['2012-09-25']); Object.defineProperty(apiLoader.services['elastictranscoder'], '2012-09-25', { get: function get() { var model = __webpack_require__(45610); model.paginators = __webpack_require__(35370)/* .pagination */ .o; model.waiters = __webpack_require__(13314)/* .waiters */ .V; return model; }, enumerable: true, configurable: true }); module.exports = AWS.ElasticTranscoder; /***/ }), /***/ 10907: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { __webpack_require__(73639); var AWS = __webpack_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; apiLoader.services['elb'] = {}; AWS.ELB = Service.defineService('elb', ['2012-06-01']); Object.defineProperty(apiLoader.services['elb'], '2012-06-01', { get: function get() { var model = __webpack_require__(16234); model.paginators = __webpack_require__(87921)/* .pagination */ .o; model.waiters = __webpack_require__(41073)/* .waiters */ .V; return model; }, enumerable: true, configurable: true }); module.exports = AWS.ELB; /***/ }), /***/ 44311: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { __webpack_require__(73639); var AWS = __webpack_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; apiLoader.services['elbv2'] = {}; AWS.ELBv2 = Service.defineService('elbv2', ['2015-12-01']); Object.defineProperty(apiLoader.services['elbv2'], '2015-12-01', { get: function get() { var model = __webpack_require__(95067); model.paginators = __webpack_require__(49154)/* .pagination */ .o; model.waiters = __webpack_require__(14244)/* .waiters */ .V; return model; }, enumerable: true, configurable: true }); module.exports = AWS.ELBv2; /***/ }), /***/ 50470: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { __webpack_require__(73639); var AWS = __webpack_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; apiLoader.services['emr'] = {}; AWS.EMR = Service.defineService('emr', ['2009-03-31']); Object.defineProperty(apiLoader.services['emr'], '2009-03-31', { get: function get() { var model = __webpack_require__(61812); model.paginators = __webpack_require__(45852)/* .pagination */ .o; model.waiters = __webpack_require__(70234)/* .waiters */ .V; return model; }, enumerable: true, configurable: true }); module.exports = AWS.EMR; /***/ }), /***/ 49984: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { __webpack_require__(73639); var AWS = __webpack_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; apiLoader.services['emrcontainers'] = {}; AWS.EMRcontainers = Service.defineService('emrcontainers', ['2020-10-01']); Object.defineProperty(apiLoader.services['emrcontainers'], '2020-10-01', { get: function get() { var model = __webpack_require__(96210); model.paginators = __webpack_require__(83173)/* .pagination */ .o; return model; }, enumerable: true, configurable: true }); module.exports = AWS.EMRcontainers; /***/ }), /***/ 84462: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { __webpack_require__(73639); var AWS = __webpack_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; apiLoader.services['es'] = {}; AWS.ES = Service.defineService('es', ['2015-01-01']); Object.defineProperty(apiLoader.services['es'], '2015-01-01', { get: function get() { var model = __webpack_require__(69235); model.paginators = __webpack_require__(5589)/* .pagination */ .o; return model; }, enumerable: true, configurable: true }); module.exports = AWS.ES; /***/ }), /***/ 898: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { __webpack_require__(73639); var AWS = __webpack_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; apiLoader.services['eventbridge'] = {}; AWS.EventBridge = Service.defineService('eventbridge', ['2015-10-07']); Object.defineProperty(apiLoader.services['eventbridge'], '2015-10-07', { get: function get() { var model = __webpack_require__(16181); model.paginators = __webpack_require__(41745)/* .pagination */ .o; return model; }, enumerable: true, configurable: true }); module.exports = AWS.EventBridge; /***/ }), /***/ 92831: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { __webpack_require__(73639); var AWS = __webpack_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; apiLoader.services['firehose'] = {}; AWS.Firehose = Service.defineService('firehose', ['2015-08-04']); Object.defineProperty(apiLoader.services['firehose'], '2015-08-04', { get: function get() { var model = __webpack_require__(53370); model.paginators = __webpack_require__(16459)/* .pagination */ .o; return model; }, enumerable: true, configurable: true }); module.exports = AWS.Firehose; /***/ }), /***/ 73003: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { __webpack_require__(73639); var AWS = __webpack_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; apiLoader.services['fis'] = {}; AWS.Fis = Service.defineService('fis', ['2020-12-01']); Object.defineProperty(apiLoader.services['fis'], '2020-12-01', { get: function get() { var model = __webpack_require__(75416); model.paginators = __webpack_require__(703)/* .pagination */ .o; return model; }, enumerable: true, configurable: true }); module.exports = AWS.Fis; /***/ }), /***/ 11316: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { __webpack_require__(73639); var AWS = __webpack_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; apiLoader.services['fms'] = {}; AWS.FMS = Service.defineService('fms', ['2018-01-01']); Object.defineProperty(apiLoader.services['fms'], '2018-01-01', { get: function get() { var model = __webpack_require__(86359); model.paginators = __webpack_require__(47569)/* .pagination */ .o; return model; }, enumerable: true, configurable: true }); module.exports = AWS.FMS; /***/ }), /***/ 36822: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { __webpack_require__(73639); var AWS = __webpack_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; apiLoader.services['forecastqueryservice'] = {}; AWS.ForecastQueryService = Service.defineService('forecastqueryservice', ['2018-06-26']); Object.defineProperty(apiLoader.services['forecastqueryservice'], '2018-06-26', { get: function get() { var model = __webpack_require__(6430); model.paginators = __webpack_require__(30372)/* .pagination */ .o; return model; }, enumerable: true, configurable: true }); module.exports = AWS.ForecastQueryService; /***/ }), /***/ 12942: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { __webpack_require__(73639); var AWS = __webpack_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; apiLoader.services['forecastservice'] = {}; AWS.ForecastService = Service.defineService('forecastservice', ['2018-06-26']); Object.defineProperty(apiLoader.services['forecastservice'], '2018-06-26', { get: function get() { var model = __webpack_require__(55586); model.paginators = __webpack_require__(83052)/* .pagination */ .o; return model; }, enumerable: true, configurable: true }); module.exports = AWS.ForecastService; /***/ }), /***/ 99830: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { __webpack_require__(73639); var AWS = __webpack_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; apiLoader.services['frauddetector'] = {}; AWS.FraudDetector = Service.defineService('frauddetector', ['2019-11-15']); Object.defineProperty(apiLoader.services['frauddetector'], '2019-11-15', { get: function get() { var model = __webpack_require__(93807); model.paginators = __webpack_require__(32681)/* .pagination */ .o; return model; }, enumerable: true, configurable: true }); module.exports = AWS.FraudDetector; /***/ }), /***/ 60642: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { __webpack_require__(73639); var AWS = __webpack_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; apiLoader.services['fsx'] = {}; AWS.FSx = Service.defineService('fsx', ['2018-03-01']); Object.defineProperty(apiLoader.services['fsx'], '2018-03-01', { get: function get() { var model = __webpack_require__(85233); model.paginators = __webpack_require__(8719)/* .pagination */ .o; return model; }, enumerable: true, configurable: true }); module.exports = AWS.FSx; /***/ }), /***/ 8085: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { __webpack_require__(73639); var AWS = __webpack_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; apiLoader.services['gamelift'] = {}; AWS.GameLift = Service.defineService('gamelift', ['2015-10-01']); Object.defineProperty(apiLoader.services['gamelift'], '2015-10-01', { get: function get() { var model = __webpack_require__(71658); model.paginators = __webpack_require__(32274)/* .pagination */ .o; return model; }, enumerable: true, configurable: true }); module.exports = AWS.GameLift; /***/ }), /***/ 63249: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { __webpack_require__(73639); var AWS = __webpack_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; apiLoader.services['glacier'] = {}; AWS.Glacier = Service.defineService('glacier', ['2012-06-01']); __webpack_require__(14472); Object.defineProperty(apiLoader.services['glacier'], '2012-06-01', { get: function get() { var model = __webpack_require__(47563); model.paginators = __webpack_require__(77100)/* .pagination */ .o; model.waiters = __webpack_require__(81219)/* .waiters */ .V; return model; }, enumerable: true, configurable: true }); module.exports = AWS.Glacier; /***/ }), /***/ 19306: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { __webpack_require__(73639); var AWS = __webpack_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; apiLoader.services['globalaccelerator'] = {}; AWS.GlobalAccelerator = Service.defineService('globalaccelerator', ['2018-08-08']); Object.defineProperty(apiLoader.services['globalaccelerator'], '2018-08-08', { get: function get() { var model = __webpack_require__(5157); model.paginators = __webpack_require__(9696)/* .pagination */ .o; return model; }, enumerable: true, configurable: true }); module.exports = AWS.GlobalAccelerator; /***/ }), /***/ 31658: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { __webpack_require__(73639); var AWS = __webpack_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; apiLoader.services['glue'] = {}; AWS.Glue = Service.defineService('glue', ['2017-03-31']); Object.defineProperty(apiLoader.services['glue'], '2017-03-31', { get: function get() { var model = __webpack_require__(91789); model.paginators = __webpack_require__(14005)/* .pagination */ .o; return model; }, enumerable: true, configurable: true }); module.exports = AWS.Glue; /***/ }), /***/ 20690: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { __webpack_require__(73639); var AWS = __webpack_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; apiLoader.services['greengrass'] = {}; AWS.Greengrass = Service.defineService('greengrass', ['2017-06-07']); Object.defineProperty(apiLoader.services['greengrass'], '2017-06-07', { get: function get() { var model = __webpack_require__(25031); return model; }, enumerable: true, configurable: true }); module.exports = AWS.Greengrass; /***/ }), /***/ 45126: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { __webpack_require__(73639); var AWS = __webpack_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; apiLoader.services['greengrassv2'] = {}; AWS.GreengrassV2 = Service.defineService('greengrassv2', ['2020-11-30']); Object.defineProperty(apiLoader.services['greengrassv2'], '2020-11-30', { get: function get() { var model = __webpack_require__(22710); model.paginators = __webpack_require__(94180)/* .pagination */ .o; return model; }, enumerable: true, configurable: true }); module.exports = AWS.GreengrassV2; /***/ }), /***/ 80494: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { __webpack_require__(73639); var AWS = __webpack_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; apiLoader.services['groundstation'] = {}; AWS.GroundStation = Service.defineService('groundstation', ['2019-05-23']); Object.defineProperty(apiLoader.services['groundstation'], '2019-05-23', { get: function get() { var model = __webpack_require__(78309); model.paginators = __webpack_require__(76938)/* .pagination */ .o; return model; }, enumerable: true, configurable: true }); module.exports = AWS.GroundStation; /***/ }), /***/ 40755: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { __webpack_require__(73639); var AWS = __webpack_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; apiLoader.services['guardduty'] = {}; AWS.GuardDuty = Service.defineService('guardduty', ['2017-11-28']); Object.defineProperty(apiLoader.services['guardduty'], '2017-11-28', { get: function get() { var model = __webpack_require__(89297); model.paginators = __webpack_require__(69484)/* .pagination */ .o; return model; }, enumerable: true, configurable: true }); module.exports = AWS.GuardDuty; /***/ }), /***/ 21834: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { __webpack_require__(73639); var AWS = __webpack_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; apiLoader.services['health'] = {}; AWS.Health = Service.defineService('health', ['2016-08-04']); Object.defineProperty(apiLoader.services['health'], '2016-08-04', { get: function get() { var model = __webpack_require__(88191); model.paginators = __webpack_require__(87844)/* .pagination */ .o; return model; }, enumerable: true, configurable: true }); module.exports = AWS.Health; /***/ }), /***/ 64254: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { __webpack_require__(73639); var AWS = __webpack_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; apiLoader.services['healthlake'] = {}; AWS.HealthLake = Service.defineService('healthlake', ['2017-07-01']); Object.defineProperty(apiLoader.services['healthlake'], '2017-07-01', { get: function get() { var model = __webpack_require__(78700); model.paginators = __webpack_require__(31590)/* .pagination */ .o; return model; }, enumerable: true, configurable: true }); module.exports = AWS.HealthLake; /***/ }), /***/ 38889: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { __webpack_require__(73639); var AWS = __webpack_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; apiLoader.services['honeycode'] = {}; AWS.Honeycode = Service.defineService('honeycode', ['2020-03-01']); Object.defineProperty(apiLoader.services['honeycode'], '2020-03-01', { get: function get() { var model = __webpack_require__(77536); model.paginators = __webpack_require__(83349)/* .pagination */ .o; return model; }, enumerable: true, configurable: true }); module.exports = AWS.Honeycode; /***/ }), /***/ 50058: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { __webpack_require__(73639); var AWS = __webpack_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; apiLoader.services['iam'] = {}; AWS.IAM = Service.defineService('iam', ['2010-05-08']); Object.defineProperty(apiLoader.services['iam'], '2010-05-08', { get: function get() { var model = __webpack_require__(46818); model.paginators = __webpack_require__(49015)/* .pagination */ .o; model.waiters = __webpack_require__(48986)/* .waiters */ .V; return model; }, enumerable: true, configurable: true }); module.exports = AWS.IAM; /***/ }), /***/ 60222: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { __webpack_require__(73639); var AWS = __webpack_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; apiLoader.services['identitystore'] = {}; AWS.IdentityStore = Service.defineService('identitystore', ['2020-06-15']); Object.defineProperty(apiLoader.services['identitystore'], '2020-06-15', { get: function get() { var model = __webpack_require__(14536); model.paginators = __webpack_require__(96554)/* .pagination */ .o; return model; }, enumerable: true, configurable: true }); module.exports = AWS.IdentityStore; /***/ }), /***/ 57511: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { __webpack_require__(73639); var AWS = __webpack_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; apiLoader.services['imagebuilder'] = {}; AWS.Imagebuilder = Service.defineService('imagebuilder', ['2019-12-02']); Object.defineProperty(apiLoader.services['imagebuilder'], '2019-12-02', { get: function get() { var model = __webpack_require__(79595); model.paginators = __webpack_require__(57060)/* .pagination */ .o; return model; }, enumerable: true, configurable: true }); module.exports = AWS.Imagebuilder; /***/ }), /***/ 6769: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { __webpack_require__(73639); var AWS = __webpack_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; apiLoader.services['importexport'] = {}; AWS.ImportExport = Service.defineService('importexport', ['2010-06-01']); Object.defineProperty(apiLoader.services['importexport'], '2010-06-01', { get: function get() { var model = __webpack_require__(85415); model.paginators = __webpack_require__(60069)/* .pagination */ .o; return model; }, enumerable: true, configurable: true }); module.exports = AWS.ImportExport; /***/ }), /***/ 89439: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { __webpack_require__(73639); var AWS = __webpack_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; apiLoader.services['inspector'] = {}; AWS.Inspector = Service.defineService('inspector', ['2015-08-18*', '2016-02-16']); Object.defineProperty(apiLoader.services['inspector'], '2016-02-16', { get: function get() { var model = __webpack_require__(92652); model.paginators = __webpack_require__(98432)/* .pagination */ .o; return model; }, enumerable: true, configurable: true }); module.exports = AWS.Inspector; /***/ }), /***/ 98392: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { __webpack_require__(73639); var AWS = __webpack_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; apiLoader.services['iot'] = {}; AWS.Iot = Service.defineService('iot', ['2015-05-28']); Object.defineProperty(apiLoader.services['iot'], '2015-05-28', { get: function get() { var model = __webpack_require__(47091); model.paginators = __webpack_require__(39946)/* .pagination */ .o; return model; }, enumerable: true, configurable: true }); module.exports = AWS.Iot; /***/ }), /***/ 39474: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { __webpack_require__(73639); var AWS = __webpack_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; apiLoader.services['iot1clickdevicesservice'] = {}; AWS.IoT1ClickDevicesService = Service.defineService('iot1clickdevicesservice', ['2018-05-14']); Object.defineProperty(apiLoader.services['iot1clickdevicesservice'], '2018-05-14', { get: function get() { var model = __webpack_require__(69668); return model; }, enumerable: true, configurable: true }); module.exports = AWS.IoT1ClickDevicesService; /***/ }), /***/ 4686: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { __webpack_require__(73639); var AWS = __webpack_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; apiLoader.services['iot1clickprojects'] = {}; AWS.IoT1ClickProjects = Service.defineService('iot1clickprojects', ['2018-05-14']); Object.defineProperty(apiLoader.services['iot1clickprojects'], '2018-05-14', { get: function get() { var model = __webpack_require__(66389); model.paginators = __webpack_require__(42078)/* .pagination */ .o; return model; }, enumerable: true, configurable: true }); module.exports = AWS.IoT1ClickProjects; /***/ }), /***/ 67409: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { __webpack_require__(73639); var AWS = __webpack_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; apiLoader.services['iotanalytics'] = {}; AWS.IoTAnalytics = Service.defineService('iotanalytics', ['2017-11-27']); Object.defineProperty(apiLoader.services['iotanalytics'], '2017-11-27', { get: function get() { var model = __webpack_require__(87696); model.paginators = __webpack_require__(58536)/* .pagination */ .o; return model; }, enumerable: true, configurable: true }); module.exports = AWS.IoTAnalytics; /***/ }), /***/ 6564: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { __webpack_require__(73639); var AWS = __webpack_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; apiLoader.services['iotdata'] = {}; AWS.IotData = Service.defineService('iotdata', ['2015-05-28']); __webpack_require__(27062); Object.defineProperty(apiLoader.services['iotdata'], '2015-05-28', { get: function get() { var model = __webpack_require__(94126); model.paginators = __webpack_require__(6435)/* .pagination */ .o; return model; }, enumerable: true, configurable: true }); module.exports = AWS.IotData; /***/ }), /***/ 97569: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { __webpack_require__(73639); var AWS = __webpack_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; apiLoader.services['iotdeviceadvisor'] = {}; AWS.IotDeviceAdvisor = Service.defineService('iotdeviceadvisor', ['2020-09-18']); Object.defineProperty(apiLoader.services['iotdeviceadvisor'], '2020-09-18', { get: function get() { var model = __webpack_require__(19317); model.paginators = __webpack_require__(9465)/* .pagination */ .o; return model; }, enumerable: true, configurable: true }); module.exports = AWS.IotDeviceAdvisor; /***/ }), /***/ 88065: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { __webpack_require__(73639); var AWS = __webpack_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; apiLoader.services['iotevents'] = {}; AWS.IoTEvents = Service.defineService('iotevents', ['2018-07-27']); Object.defineProperty(apiLoader.services['iotevents'], '2018-07-27', { get: function get() { var model = __webpack_require__(55666); model.paginators = __webpack_require__(13523)/* .pagination */ .o; return model; }, enumerable: true, configurable: true }); module.exports = AWS.IoTEvents; /***/ }), /***/ 56973: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { __webpack_require__(73639); var AWS = __webpack_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; apiLoader.services['ioteventsdata'] = {}; AWS.IoTEventsData = Service.defineService('ioteventsdata', ['2018-10-23']); Object.defineProperty(apiLoader.services['ioteventsdata'], '2018-10-23', { get: function get() { var model = __webpack_require__(14647); model.paginators = __webpack_require__(12541)/* .pagination */ .o; return model; }, enumerable: true, configurable: true }); module.exports = AWS.IoTEventsData; /***/ }), /***/ 42513: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { __webpack_require__(73639); var AWS = __webpack_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; apiLoader.services['iotfleethub'] = {}; AWS.IoTFleetHub = Service.defineService('iotfleethub', ['2020-11-03']); Object.defineProperty(apiLoader.services['iotfleethub'], '2020-11-03', { get: function get() { var model = __webpack_require__(53518); model.paginators = __webpack_require__(90350)/* .pagination */ .o; return model; }, enumerable: true, configurable: true }); module.exports = AWS.IoTFleetHub; /***/ }), /***/ 42332: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { __webpack_require__(73639); var AWS = __webpack_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; apiLoader.services['iotjobsdataplane'] = {}; AWS.IoTJobsDataPlane = Service.defineService('iotjobsdataplane', ['2017-09-29']); Object.defineProperty(apiLoader.services['iotjobsdataplane'], '2017-09-29', { get: function get() { var model = __webpack_require__(27052); model.paginators = __webpack_require__(87653)/* .pagination */ .o; return model; }, enumerable: true, configurable: true }); module.exports = AWS.IoTJobsDataPlane; /***/ }), /***/ 98562: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { __webpack_require__(73639); var AWS = __webpack_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; apiLoader.services['iotsecuretunneling'] = {}; AWS.IoTSecureTunneling = Service.defineService('iotsecuretunneling', ['2018-10-05']); Object.defineProperty(apiLoader.services['iotsecuretunneling'], '2018-10-05', { get: function get() { var model = __webpack_require__(47810); model.paginators = __webpack_require__(16978)/* .pagination */ .o; return model; }, enumerable: true, configurable: true }); module.exports = AWS.IoTSecureTunneling; /***/ }), /***/ 89690: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { __webpack_require__(73639); var AWS = __webpack_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; apiLoader.services['iotsitewise'] = {}; AWS.IoTSiteWise = Service.defineService('iotsitewise', ['2019-12-02']); Object.defineProperty(apiLoader.services['iotsitewise'], '2019-12-02', { get: function get() { var model = __webpack_require__(94166); model.paginators = __webpack_require__(81755)/* .pagination */ .o; model.waiters = __webpack_require__(4197)/* .waiters */ .V; return model; }, enumerable: true, configurable: true }); module.exports = AWS.IoTSiteWise; /***/ }), /***/ 58905: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { __webpack_require__(73639); var AWS = __webpack_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; apiLoader.services['iotthingsgraph'] = {}; AWS.IoTThingsGraph = Service.defineService('iotthingsgraph', ['2018-09-06']); Object.defineProperty(apiLoader.services['iotthingsgraph'], '2018-09-06', { get: function get() { var model = __webpack_require__(6038); model.paginators = __webpack_require__(91296)/* .pagination */ .o; return model; }, enumerable: true, configurable: true }); module.exports = AWS.IoTThingsGraph; /***/ }), /***/ 8226: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { __webpack_require__(73639); var AWS = __webpack_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; apiLoader.services['iotwireless'] = {}; AWS.IoTWireless = Service.defineService('iotwireless', ['2020-11-22']); Object.defineProperty(apiLoader.services['iotwireless'], '2020-11-22', { get: function get() { var model = __webpack_require__(44396); model.paginators = __webpack_require__(31164)/* .pagination */ .o; return model; }, enumerable: true, configurable: true }); module.exports = AWS.IoTWireless; /***/ }), /***/ 67701: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { __webpack_require__(73639); var AWS = __webpack_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; apiLoader.services['ivs'] = {}; AWS.IVS = Service.defineService('ivs', ['2020-07-14']); Object.defineProperty(apiLoader.services['ivs'], '2020-07-14', { get: function get() { var model = __webpack_require__(41816); model.paginators = __webpack_require__(38184)/* .pagination */ .o; return model; }, enumerable: true, configurable: true }); module.exports = AWS.IVS; /***/ }), /***/ 56775: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { __webpack_require__(73639); var AWS = __webpack_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; apiLoader.services['kafka'] = {}; AWS.Kafka = Service.defineService('kafka', ['2018-11-14']); Object.defineProperty(apiLoader.services['kafka'], '2018-11-14', { get: function get() { var model = __webpack_require__(52315); model.paginators = __webpack_require__(71066)/* .pagination */ .o; return model; }, enumerable: true, configurable: true }); module.exports = AWS.Kafka; /***/ }), /***/ 66122: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { __webpack_require__(73639); var AWS = __webpack_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; apiLoader.services['kendra'] = {}; AWS.Kendra = Service.defineService('kendra', ['2019-02-03']); Object.defineProperty(apiLoader.services['kendra'], '2019-02-03', { get: function get() { var model = __webpack_require__(61785); model.paginators = __webpack_require__(31633)/* .pagination */ .o; return model; }, enumerable: true, configurable: true }); module.exports = AWS.Kendra; /***/ }), /***/ 49876: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { __webpack_require__(73639); var AWS = __webpack_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; apiLoader.services['kinesis'] = {}; AWS.Kinesis = Service.defineService('kinesis', ['2013-12-02']); Object.defineProperty(apiLoader.services['kinesis'], '2013-12-02', { get: function get() { var model = __webpack_require__(74556); model.paginators = __webpack_require__(38540)/* .pagination */ .o; model.waiters = __webpack_require__(80745)/* .waiters */ .V; return model; }, enumerable: true, configurable: true }); module.exports = AWS.Kinesis; /***/ }), /***/ 90042: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { __webpack_require__(73639); var AWS = __webpack_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; apiLoader.services['kinesisanalytics'] = {}; AWS.KinesisAnalytics = Service.defineService('kinesisanalytics', ['2015-08-14']); Object.defineProperty(apiLoader.services['kinesisanalytics'], '2015-08-14', { get: function get() { var model = __webpack_require__(91105); model.paginators = __webpack_require__(18363)/* .pagination */ .o; return model; }, enumerable: true, configurable: true }); module.exports = AWS.KinesisAnalytics; /***/ }), /***/ 74631: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { __webpack_require__(73639); var AWS = __webpack_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; apiLoader.services['kinesisanalyticsv2'] = {}; AWS.KinesisAnalyticsV2 = Service.defineService('kinesisanalyticsv2', ['2018-05-23']); Object.defineProperty(apiLoader.services['kinesisanalyticsv2'], '2018-05-23', { get: function get() { var model = __webpack_require__(70128); model.paginators = __webpack_require__(6842)/* .pagination */ .o; return model; }, enumerable: true, configurable: true }); module.exports = AWS.KinesisAnalyticsV2; /***/ }), /***/ 89927: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { __webpack_require__(73639); var AWS = __webpack_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; apiLoader.services['kinesisvideo'] = {}; AWS.KinesisVideo = Service.defineService('kinesisvideo', ['2017-09-30']); Object.defineProperty(apiLoader.services['kinesisvideo'], '2017-09-30', { get: function get() { var model = __webpack_require__(28189); model.paginators = __webpack_require__(15191)/* .pagination */ .o; return model; }, enumerable: true, configurable: true }); module.exports = AWS.KinesisVideo; /***/ }), /***/ 5580: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { __webpack_require__(73639); var AWS = __webpack_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; apiLoader.services['kinesisvideoarchivedmedia'] = {}; AWS.KinesisVideoArchivedMedia = Service.defineService('kinesisvideoarchivedmedia', ['2017-09-30']); Object.defineProperty(apiLoader.services['kinesisvideoarchivedmedia'], '2017-09-30', { get: function get() { var model = __webpack_require__(64288); model.paginators = __webpack_require__(78514)/* .pagination */ .o; return model; }, enumerable: true, configurable: true }); module.exports = AWS.KinesisVideoArchivedMedia; /***/ }), /***/ 81308: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { __webpack_require__(73639); var AWS = __webpack_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; apiLoader.services['kinesisvideomedia'] = {}; AWS.KinesisVideoMedia = Service.defineService('kinesisvideomedia', ['2017-09-30']); Object.defineProperty(apiLoader.services['kinesisvideomedia'], '2017-09-30', { get: function get() { var model = __webpack_require__(97818); model.paginators = __webpack_require__(16923)/* .pagination */ .o; return model; }, enumerable: true, configurable: true }); module.exports = AWS.KinesisVideoMedia; /***/ }), /***/ 12710: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { __webpack_require__(73639); var AWS = __webpack_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; apiLoader.services['kinesisvideosignalingchannels'] = {}; AWS.KinesisVideoSignalingChannels = Service.defineService('kinesisvideosignalingchannels', ['2019-12-04']); Object.defineProperty(apiLoader.services['kinesisvideosignalingchannels'], '2019-12-04', { get: function get() { var model = __webpack_require__(58849); model.paginators = __webpack_require__(10473)/* .pagination */ .o; return model; }, enumerable: true, configurable: true }); module.exports = AWS.KinesisVideoSignalingChannels; /***/ }), /***/ 56782: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { __webpack_require__(73639); var AWS = __webpack_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; apiLoader.services['kms'] = {}; AWS.KMS = Service.defineService('kms', ['2014-11-01']); Object.defineProperty(apiLoader.services['kms'], '2014-11-01', { get: function get() { var model = __webpack_require__(60611); model.paginators = __webpack_require__(97690)/* .pagination */ .o; return model; }, enumerable: true, configurable: true }); module.exports = AWS.KMS; /***/ }), /***/ 6726: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { __webpack_require__(73639); var AWS = __webpack_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; apiLoader.services['lakeformation'] = {}; AWS.LakeFormation = Service.defineService('lakeformation', ['2017-03-31']); Object.defineProperty(apiLoader.services['lakeformation'], '2017-03-31', { get: function get() { var model = __webpack_require__(65408); model.paginators = __webpack_require__(89923)/* .pagination */ .o; return model; }, enumerable: true, configurable: true }); module.exports = AWS.LakeFormation; /***/ }), /***/ 13321: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { __webpack_require__(73639); var AWS = __webpack_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; apiLoader.services['lambda'] = {}; AWS.Lambda = Service.defineService('lambda', ['2014-11-11', '2015-03-31']); __webpack_require__(8452); Object.defineProperty(apiLoader.services['lambda'], '2014-11-11', { get: function get() { var model = __webpack_require__(63935); model.paginators = __webpack_require__(86208)/* .pagination */ .o; return model; }, enumerable: true, configurable: true }); Object.defineProperty(apiLoader.services['lambda'], '2015-03-31', { get: function get() { var model = __webpack_require__(50409); model.paginators = __webpack_require__(98920)/* .pagination */ .o; model.waiters = __webpack_require__(37582)/* .waiters */ .V; return model; }, enumerable: true, configurable: true }); module.exports = AWS.Lambda; /***/ }), /***/ 37397: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { __webpack_require__(73639); var AWS = __webpack_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; apiLoader.services['lexmodelbuildingservice'] = {}; AWS.LexModelBuildingService = Service.defineService('lexmodelbuildingservice', ['2017-04-19']); Object.defineProperty(apiLoader.services['lexmodelbuildingservice'], '2017-04-19', { get: function get() { var model = __webpack_require__(57942); model.paginators = __webpack_require__(34148)/* .pagination */ .o; return model; }, enumerable: true, configurable: true }); module.exports = AWS.LexModelBuildingService; /***/ }), /***/ 27254: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { __webpack_require__(73639); var AWS = __webpack_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; apiLoader.services['lexmodelsv2'] = {}; AWS.LexModelsV2 = Service.defineService('lexmodelsv2', ['2020-08-07']); __webpack_require__(22922); Object.defineProperty(apiLoader.services['lexmodelsv2'], '2020-08-07', { get: function get() { var model = __webpack_require__(28033); model.paginators = __webpack_require__(20751)/* .pagination */ .o; return model; }, enumerable: true, configurable: true }); module.exports = AWS.LexModelsV2; /***/ }), /***/ 62716: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { __webpack_require__(73639); var AWS = __webpack_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; apiLoader.services['lexruntime'] = {}; AWS.LexRuntime = Service.defineService('lexruntime', ['2016-11-28']); Object.defineProperty(apiLoader.services['lexruntime'], '2016-11-28', { get: function get() { var model = __webpack_require__(28098); model.paginators = __webpack_require__(17108)/* .pagination */ .o; return model; }, enumerable: true, configurable: true }); module.exports = AWS.LexRuntime; /***/ }), /***/ 33855: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { __webpack_require__(73639); var AWS = __webpack_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; apiLoader.services['lexruntimev2'] = {}; AWS.LexRuntimeV2 = Service.defineService('lexruntimev2', ['2020-08-07']); Object.defineProperty(apiLoader.services['lexruntimev2'], '2020-08-07', { get: function get() { var model = __webpack_require__(72007); model.paginators = __webpack_require__(88199)/* .pagination */ .o; return model; }, enumerable: true, configurable: true }); module.exports = AWS.LexRuntimeV2; /***/ }), /***/ 34693: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { __webpack_require__(73639); var AWS = __webpack_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; apiLoader.services['licensemanager'] = {}; AWS.LicenseManager = Service.defineService('licensemanager', ['2018-08-01']); Object.defineProperty(apiLoader.services['licensemanager'], '2018-08-01', { get: function get() { var model = __webpack_require__(58445); model.paginators = __webpack_require__(73736)/* .pagination */ .o; return model; }, enumerable: true, configurable: true }); module.exports = AWS.LicenseManager; /***/ }), /***/ 22718: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { __webpack_require__(73639); var AWS = __webpack_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; apiLoader.services['lightsail'] = {}; AWS.Lightsail = Service.defineService('lightsail', ['2016-11-28']); Object.defineProperty(apiLoader.services['lightsail'], '2016-11-28', { get: function get() { var model = __webpack_require__(59034); model.paginators = __webpack_require__(96768)/* .pagination */ .o; return model; }, enumerable: true, configurable: true }); module.exports = AWS.Lightsail; /***/ }), /***/ 44594: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { __webpack_require__(73639); var AWS = __webpack_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; apiLoader.services['location'] = {}; AWS.Location = Service.defineService('location', ['2020-11-19']); Object.defineProperty(apiLoader.services['location'], '2020-11-19', { get: function get() { var model = __webpack_require__(77371); model.paginators = __webpack_require__(23890)/* .pagination */ .o; return model; }, enumerable: true, configurable: true }); module.exports = AWS.Location; /***/ }), /***/ 21843: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { __webpack_require__(73639); var AWS = __webpack_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; apiLoader.services['lookoutequipment'] = {}; AWS.LookoutEquipment = Service.defineService('lookoutequipment', ['2020-12-15']); Object.defineProperty(apiLoader.services['lookoutequipment'], '2020-12-15', { get: function get() { var model = __webpack_require__(31015); model.paginators = __webpack_require__(93065)/* .pagination */ .o; return model; }, enumerable: true, configurable: true }); module.exports = AWS.LookoutEquipment; /***/ }), /***/ 78708: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { __webpack_require__(73639); var AWS = __webpack_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; apiLoader.services['lookoutmetrics'] = {}; AWS.LookoutMetrics = Service.defineService('lookoutmetrics', ['2017-07-25']); __webpack_require__(64605); Object.defineProperty(apiLoader.services['lookoutmetrics'], '2017-07-25', { get: function get() { var model = __webpack_require__(57300); model.paginators = __webpack_require__(86272)/* .pagination */ .o; return model; }, enumerable: true, configurable: true }); module.exports = AWS.LookoutMetrics; /***/ }), /***/ 65046: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { __webpack_require__(73639); var AWS = __webpack_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; apiLoader.services['lookoutvision'] = {}; AWS.LookoutVision = Service.defineService('lookoutvision', ['2020-11-20']); Object.defineProperty(apiLoader.services['lookoutvision'], '2020-11-20', { get: function get() { var model = __webpack_require__(43317); model.paginators = __webpack_require__(34273)/* .pagination */ .o; return model; }, enumerable: true, configurable: true }); module.exports = AWS.LookoutVision; /***/ }), /***/ 82907: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { __webpack_require__(73639); var AWS = __webpack_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; apiLoader.services['machinelearning'] = {}; AWS.MachineLearning = Service.defineService('machinelearning', ['2014-12-12']); __webpack_require__(19174); Object.defineProperty(apiLoader.services['machinelearning'], '2014-12-12', { get: function get() { var model = __webpack_require__(41946); model.paginators = __webpack_require__(11688)/* .pagination */ .o; model.waiters = __webpack_require__(92349)/* .waiters */ .V; return model; }, enumerable: true, configurable: true }); module.exports = AWS.MachineLearning; /***/ }), /***/ 86427: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { __webpack_require__(73639); var AWS = __webpack_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; apiLoader.services['macie'] = {}; AWS.Macie = Service.defineService('macie', ['2017-12-19']); Object.defineProperty(apiLoader.services['macie'], '2017-12-19', { get: function get() { var model = __webpack_require__(27101); model.paginators = __webpack_require__(9057)/* .pagination */ .o; return model; }, enumerable: true, configurable: true }); module.exports = AWS.Macie; /***/ }), /***/ 57330: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { __webpack_require__(73639); var AWS = __webpack_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; apiLoader.services['macie2'] = {}; AWS.Macie2 = Service.defineService('macie2', ['2020-01-01']); Object.defineProperty(apiLoader.services['macie2'], '2020-01-01', { get: function get() { var model = __webpack_require__(27105); model.paginators = __webpack_require__(93284)/* .pagination */ .o; return model; }, enumerable: true, configurable: true }); module.exports = AWS.Macie2; /***/ }), /***/ 85143: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { __webpack_require__(73639); var AWS = __webpack_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; apiLoader.services['managedblockchain'] = {}; AWS.ManagedBlockchain = Service.defineService('managedblockchain', ['2018-09-24']); Object.defineProperty(apiLoader.services['managedblockchain'], '2018-09-24', { get: function get() { var model = __webpack_require__(70690); model.paginators = __webpack_require__(45932)/* .pagination */ .o; return model; }, enumerable: true, configurable: true }); module.exports = AWS.ManagedBlockchain; /***/ }), /***/ 2609: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { __webpack_require__(73639); var AWS = __webpack_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; apiLoader.services['marketplacecatalog'] = {}; AWS.MarketplaceCatalog = Service.defineService('marketplacecatalog', ['2018-09-17']); Object.defineProperty(apiLoader.services['marketplacecatalog'], '2018-09-17', { get: function get() { var model = __webpack_require__(15560); model.paginators = __webpack_require__(23129)/* .pagination */ .o; return model; }, enumerable: true, configurable: true }); module.exports = AWS.MarketplaceCatalog; /***/ }), /***/ 4540: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { __webpack_require__(73639); var AWS = __webpack_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; apiLoader.services['marketplacecommerceanalytics'] = {}; AWS.MarketplaceCommerceAnalytics = Service.defineService('marketplacecommerceanalytics', ['2015-07-01']); Object.defineProperty(apiLoader.services['marketplacecommerceanalytics'], '2015-07-01', { get: function get() { var model = __webpack_require__(30768); model.paginators = __webpack_require__(88266)/* .pagination */ .o; return model; }, enumerable: true, configurable: true }); module.exports = AWS.MarketplaceCommerceAnalytics; /***/ }), /***/ 53707: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { __webpack_require__(73639); var AWS = __webpack_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; apiLoader.services['marketplaceentitlementservice'] = {}; AWS.MarketplaceEntitlementService = Service.defineService('marketplaceentitlementservice', ['2017-01-11']); Object.defineProperty(apiLoader.services['marketplaceentitlementservice'], '2017-01-11', { get: function get() { var model = __webpack_require__(23864); model.paginators = __webpack_require__(98218)/* .pagination */ .o; return model; }, enumerable: true, configurable: true }); module.exports = AWS.MarketplaceEntitlementService; /***/ }), /***/ 39297: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { __webpack_require__(73639); var AWS = __webpack_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; apiLoader.services['marketplacemetering'] = {}; AWS.MarketplaceMetering = Service.defineService('marketplacemetering', ['2016-01-14']); Object.defineProperty(apiLoader.services['marketplacemetering'], '2016-01-14', { get: function get() { var model = __webpack_require__(150); model.paginators = __webpack_require__(34742)/* .pagination */ .o; return model; }, enumerable: true, configurable: true }); module.exports = AWS.MarketplaceMetering; /***/ }), /***/ 67639: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { __webpack_require__(73639); var AWS = __webpack_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; apiLoader.services['mediaconnect'] = {}; AWS.MediaConnect = Service.defineService('mediaconnect', ['2018-11-14']); Object.defineProperty(apiLoader.services['mediaconnect'], '2018-11-14', { get: function get() { var model = __webpack_require__(38828); model.paginators = __webpack_require__(52701)/* .pagination */ .o; model.waiters = __webpack_require__(69547)/* .waiters */ .V; return model; }, enumerable: true, configurable: true }); module.exports = AWS.MediaConnect; /***/ }), /***/ 57220: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { __webpack_require__(73639); var AWS = __webpack_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; apiLoader.services['mediaconvert'] = {}; AWS.MediaConvert = Service.defineService('mediaconvert', ['2017-08-29']); Object.defineProperty(apiLoader.services['mediaconvert'], '2017-08-29', { get: function get() { var model = __webpack_require__(95103); model.paginators = __webpack_require__(12236)/* .pagination */ .o; return model; }, enumerable: true, configurable: true }); module.exports = AWS.MediaConvert; /***/ }), /***/ 7509: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { __webpack_require__(73639); var AWS = __webpack_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; apiLoader.services['medialive'] = {}; AWS.MediaLive = Service.defineService('medialive', ['2017-10-14']); Object.defineProperty(apiLoader.services['medialive'], '2017-10-14', { get: function get() { var model = __webpack_require__(71020); model.paginators = __webpack_require__(45939)/* .pagination */ .o; model.waiters = __webpack_require__(77702)/* .waiters */ .V; return model; }, enumerable: true, configurable: true }); module.exports = AWS.MediaLive; /***/ }), /***/ 91620: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { __webpack_require__(73639); var AWS = __webpack_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; apiLoader.services['mediapackage'] = {}; AWS.MediaPackage = Service.defineService('mediapackage', ['2017-10-12']); Object.defineProperty(apiLoader.services['mediapackage'], '2017-10-12', { get: function get() { var model = __webpack_require__(3524); model.paginators = __webpack_require__(28168)/* .pagination */ .o; return model; }, enumerable: true, configurable: true }); module.exports = AWS.MediaPackage; /***/ }), /***/ 14962: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { __webpack_require__(73639); var AWS = __webpack_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; apiLoader.services['mediapackagevod'] = {}; AWS.MediaPackageVod = Service.defineService('mediapackagevod', ['2018-11-07']); Object.defineProperty(apiLoader.services['mediapackagevod'], '2018-11-07', { get: function get() { var model = __webpack_require__(62182); model.paginators = __webpack_require__(9108)/* .pagination */ .o; return model; }, enumerable: true, configurable: true }); module.exports = AWS.MediaPackageVod; /***/ }), /***/ 83748: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { __webpack_require__(73639); var AWS = __webpack_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; apiLoader.services['mediastore'] = {}; AWS.MediaStore = Service.defineService('mediastore', ['2017-09-01']); Object.defineProperty(apiLoader.services['mediastore'], '2017-09-01', { get: function get() { var model = __webpack_require__(86331); model.paginators = __webpack_require__(85011)/* .pagination */ .o; return model; }, enumerable: true, configurable: true }); module.exports = AWS.MediaStore; /***/ }), /***/ 98703: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { __webpack_require__(73639); var AWS = __webpack_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; apiLoader.services['mediastoredata'] = {}; AWS.MediaStoreData = Service.defineService('mediastoredata', ['2017-09-01']); Object.defineProperty(apiLoader.services['mediastoredata'], '2017-09-01', { get: function get() { var model = __webpack_require__(78855); model.paginators = __webpack_require__(12340)/* .pagination */ .o; return model; }, enumerable: true, configurable: true }); module.exports = AWS.MediaStoreData; /***/ }), /***/ 99658: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { __webpack_require__(73639); var AWS = __webpack_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; apiLoader.services['mediatailor'] = {}; AWS.MediaTailor = Service.defineService('mediatailor', ['2018-04-23']); Object.defineProperty(apiLoader.services['mediatailor'], '2018-04-23', { get: function get() { var model = __webpack_require__(32863); model.paginators = __webpack_require__(76134)/* .pagination */ .o; return model; }, enumerable: true, configurable: true }); module.exports = AWS.MediaTailor; /***/ }), /***/ 41339: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { __webpack_require__(73639); var AWS = __webpack_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; apiLoader.services['mgn'] = {}; AWS.Mgn = Service.defineService('mgn', ['2020-02-26']); Object.defineProperty(apiLoader.services['mgn'], '2020-02-26', { get: function get() { var model = __webpack_require__(96297); model.paginators = __webpack_require__(36566)/* .pagination */ .o; return model; }, enumerable: true, configurable: true }); module.exports = AWS.Mgn; /***/ }), /***/ 14688: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { __webpack_require__(73639); var AWS = __webpack_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; apiLoader.services['migrationhub'] = {}; AWS.MigrationHub = Service.defineService('migrationhub', ['2017-05-31']); Object.defineProperty(apiLoader.services['migrationhub'], '2017-05-31', { get: function get() { var model = __webpack_require__(51639); model.paginators = __webpack_require__(63013)/* .pagination */ .o; return model; }, enumerable: true, configurable: true }); module.exports = AWS.MigrationHub; /***/ }), /***/ 62658: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { __webpack_require__(73639); var AWS = __webpack_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; apiLoader.services['migrationhubconfig'] = {}; AWS.MigrationHubConfig = Service.defineService('migrationhubconfig', ['2019-06-30']); Object.defineProperty(apiLoader.services['migrationhubconfig'], '2019-06-30', { get: function get() { var model = __webpack_require__(89101); model.paginators = __webpack_require__(59977)/* .pagination */ .o; return model; }, enumerable: true, configurable: true }); module.exports = AWS.MigrationHubConfig; /***/ }), /***/ 39782: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { __webpack_require__(73639); var AWS = __webpack_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; apiLoader.services['mobile'] = {}; AWS.Mobile = Service.defineService('mobile', ['2017-07-01']); Object.defineProperty(apiLoader.services['mobile'], '2017-07-01', { get: function get() { var model = __webpack_require__(44027); model.paginators = __webpack_require__(81940)/* .pagination */ .o; return model; }, enumerable: true, configurable: true }); module.exports = AWS.Mobile; /***/ }), /***/ 66690: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { __webpack_require__(73639); var AWS = __webpack_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; apiLoader.services['mobileanalytics'] = {}; AWS.MobileAnalytics = Service.defineService('mobileanalytics', ['2014-06-05']); Object.defineProperty(apiLoader.services['mobileanalytics'], '2014-06-05', { get: function get() { var model = __webpack_require__(40634); return model; }, enumerable: true, configurable: true }); module.exports = AWS.MobileAnalytics; /***/ }), /***/ 23093: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { __webpack_require__(73639); var AWS = __webpack_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; apiLoader.services['mq'] = {}; AWS.MQ = Service.defineService('mq', ['2017-11-27']); Object.defineProperty(apiLoader.services['mq'], '2017-11-27', { get: function get() { var model = __webpack_require__(73219); model.paginators = __webpack_require__(59835)/* .pagination */ .o; return model; }, enumerable: true, configurable: true }); module.exports = AWS.MQ; /***/ }), /***/ 5615: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { __webpack_require__(73639); var AWS = __webpack_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; apiLoader.services['mturk'] = {}; AWS.MTurk = Service.defineService('mturk', ['2017-01-17']); Object.defineProperty(apiLoader.services['mturk'], '2017-01-17', { get: function get() { var model = __webpack_require__(55676); model.paginators = __webpack_require__(51396)/* .pagination */ .o; return model; }, enumerable: true, configurable: true }); module.exports = AWS.MTurk; /***/ }), /***/ 32712: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { __webpack_require__(73639); var AWS = __webpack_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; apiLoader.services['mwaa'] = {}; AWS.MWAA = Service.defineService('mwaa', ['2020-07-01']); Object.defineProperty(apiLoader.services['mwaa'], '2020-07-01', { get: function get() { var model = __webpack_require__(3499); model.paginators = __webpack_require__(30606)/* .pagination */ .o; return model; }, enumerable: true, configurable: true }); module.exports = AWS.MWAA; /***/ }), /***/ 30047: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { __webpack_require__(73639); var AWS = __webpack_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; apiLoader.services['neptune'] = {}; AWS.Neptune = Service.defineService('neptune', ['2014-10-31']); __webpack_require__(73090); Object.defineProperty(apiLoader.services['neptune'], '2014-10-31', { get: function get() { var model = __webpack_require__(44749); model.paginators = __webpack_require__(36058)/* .pagination */ .o; model.waiters = __webpack_require__(83629)/* .waiters */ .V; return model; }, enumerable: true, configurable: true }); module.exports = AWS.Neptune; /***/ }), /***/ 84626: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { __webpack_require__(73639); var AWS = __webpack_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; apiLoader.services['networkfirewall'] = {}; AWS.NetworkFirewall = Service.defineService('networkfirewall', ['2020-11-12']); Object.defineProperty(apiLoader.services['networkfirewall'], '2020-11-12', { get: function get() { var model = __webpack_require__(71930); model.paginators = __webpack_require__(50334)/* .pagination */ .o; return model; }, enumerable: true, configurable: true }); module.exports = AWS.NetworkFirewall; /***/ }), /***/ 37610: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { __webpack_require__(73639); var AWS = __webpack_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; apiLoader.services['networkmanager'] = {}; AWS.NetworkManager = Service.defineService('networkmanager', ['2019-07-05']); Object.defineProperty(apiLoader.services['networkmanager'], '2019-07-05', { get: function get() { var model = __webpack_require__(11902); model.paginators = __webpack_require__(91477)/* .pagination */ .o; return model; }, enumerable: true, configurable: true }); module.exports = AWS.NetworkManager; /***/ }), /***/ 75691: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { __webpack_require__(73639); var AWS = __webpack_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; apiLoader.services['opsworks'] = {}; AWS.OpsWorks = Service.defineService('opsworks', ['2013-02-18']); Object.defineProperty(apiLoader.services['opsworks'], '2013-02-18', { get: function get() { var model = __webpack_require__(95315); model.paginators = __webpack_require__(63589)/* .pagination */ .o; model.waiters = __webpack_require__(8700)/* .waiters */ .V; return model; }, enumerable: true, configurable: true }); module.exports = AWS.OpsWorks; /***/ }), /***/ 80388: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { __webpack_require__(73639); var AWS = __webpack_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; apiLoader.services['opsworkscm'] = {}; AWS.OpsWorksCM = Service.defineService('opsworkscm', ['2016-11-01']); Object.defineProperty(apiLoader.services['opsworkscm'], '2016-11-01', { get: function get() { var model = __webpack_require__(25033); model.paginators = __webpack_require__(68422)/* .pagination */ .o; model.waiters = __webpack_require__(89353)/* .waiters */ .V; return model; }, enumerable: true, configurable: true }); module.exports = AWS.OpsWorksCM; /***/ }), /***/ 44670: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { __webpack_require__(73639); var AWS = __webpack_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; apiLoader.services['organizations'] = {}; AWS.Organizations = Service.defineService('organizations', ['2016-11-28']); Object.defineProperty(apiLoader.services['organizations'], '2016-11-28', { get: function get() { var model = __webpack_require__(28258); model.paginators = __webpack_require__(70916)/* .pagination */ .o; return model; }, enumerable: true, configurable: true }); module.exports = AWS.Organizations; /***/ }), /***/ 27551: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { __webpack_require__(73639); var AWS = __webpack_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; apiLoader.services['outposts'] = {}; AWS.Outposts = Service.defineService('outposts', ['2019-12-03']); Object.defineProperty(apiLoader.services['outposts'], '2019-12-03', { get: function get() { var model = __webpack_require__(79304); model.paginators = __webpack_require__(91740)/* .pagination */ .o; return model; }, enumerable: true, configurable: true }); module.exports = AWS.Outposts; /***/ }), /***/ 33696: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { __webpack_require__(73639); var AWS = __webpack_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; apiLoader.services['personalize'] = {}; AWS.Personalize = Service.defineService('personalize', ['2018-05-22']); Object.defineProperty(apiLoader.services['personalize'], '2018-05-22', { get: function get() { var model = __webpack_require__(16402); model.paginators = __webpack_require__(76828)/* .pagination */ .o; return model; }, enumerable: true, configurable: true }); module.exports = AWS.Personalize; /***/ }), /***/ 88170: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { __webpack_require__(73639); var AWS = __webpack_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; apiLoader.services['personalizeevents'] = {}; AWS.PersonalizeEvents = Service.defineService('personalizeevents', ['2018-03-22']); Object.defineProperty(apiLoader.services['personalizeevents'], '2018-03-22', { get: function get() { var model = __webpack_require__(8792); model.paginators = __webpack_require__(52110)/* .pagination */ .o; return model; }, enumerable: true, configurable: true }); module.exports = AWS.PersonalizeEvents; /***/ }), /***/ 66184: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { __webpack_require__(73639); var AWS = __webpack_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; apiLoader.services['personalizeruntime'] = {}; AWS.PersonalizeRuntime = Service.defineService('personalizeruntime', ['2018-05-22']); Object.defineProperty(apiLoader.services['personalizeruntime'], '2018-05-22', { get: function get() { var model = __webpack_require__(86682); model.paginators = __webpack_require__(32049)/* .pagination */ .o; return model; }, enumerable: true, configurable: true }); module.exports = AWS.PersonalizeRuntime; /***/ }), /***/ 15505: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { __webpack_require__(73639); var AWS = __webpack_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; apiLoader.services['pi'] = {}; AWS.PI = Service.defineService('pi', ['2018-02-27']); Object.defineProperty(apiLoader.services['pi'], '2018-02-27', { get: function get() { var model = __webpack_require__(38006); model.paginators = __webpack_require__(75147)/* .pagination */ .o; return model; }, enumerable: true, configurable: true }); module.exports = AWS.PI; /***/ }), /***/ 18388: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { __webpack_require__(73639); var AWS = __webpack_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; apiLoader.services['pinpoint'] = {}; AWS.Pinpoint = Service.defineService('pinpoint', ['2016-12-01']); Object.defineProperty(apiLoader.services['pinpoint'], '2016-12-01', { get: function get() { var model = __webpack_require__(73536); return model; }, enumerable: true, configurable: true }); module.exports = AWS.Pinpoint; /***/ }), /***/ 83060: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { __webpack_require__(73639); var AWS = __webpack_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; apiLoader.services['pinpointemail'] = {}; AWS.PinpointEmail = Service.defineService('pinpointemail', ['2018-07-26']); Object.defineProperty(apiLoader.services['pinpointemail'], '2018-07-26', { get: function get() { var model = __webpack_require__(42680); model.paginators = __webpack_require__(58107)/* .pagination */ .o; return model; }, enumerable: true, configurable: true }); module.exports = AWS.PinpointEmail; /***/ }), /***/ 46605: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { __webpack_require__(73639); var AWS = __webpack_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; apiLoader.services['pinpointsmsvoice'] = {}; AWS.PinpointSMSVoice = Service.defineService('pinpointsmsvoice', ['2018-09-05']); Object.defineProperty(apiLoader.services['pinpointsmsvoice'], '2018-09-05', { get: function get() { var model = __webpack_require__(6641); return model; }, enumerable: true, configurable: true }); module.exports = AWS.PinpointSMSVoice; /***/ }), /***/ 97332: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { __webpack_require__(73639); var AWS = __webpack_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; apiLoader.services['polly'] = {}; AWS.Polly = Service.defineService('polly', ['2016-06-10']); __webpack_require__(53199); Object.defineProperty(apiLoader.services['polly'], '2016-06-10', { get: function get() { var model = __webpack_require__(58020); model.paginators = __webpack_require__(28573)/* .pagination */ .o; return model; }, enumerable: true, configurable: true }); module.exports = AWS.Polly; /***/ }), /***/ 92765: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { __webpack_require__(73639); var AWS = __webpack_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; apiLoader.services['pricing'] = {}; AWS.Pricing = Service.defineService('pricing', ['2017-10-15']); Object.defineProperty(apiLoader.services['pricing'], '2017-10-15', { get: function get() { var model = __webpack_require__(19792); model.paginators = __webpack_require__(45992)/* .pagination */ .o; return model; }, enumerable: true, configurable: true }); module.exports = AWS.Pricing; /***/ }), /***/ 71266: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { __webpack_require__(73639); var AWS = __webpack_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; apiLoader.services['qldb'] = {}; AWS.QLDB = Service.defineService('qldb', ['2019-01-02']); Object.defineProperty(apiLoader.services['qldb'], '2019-01-02', { get: function get() { var model = __webpack_require__(52675); model.paginators = __webpack_require__(4367)/* .pagination */ .o; return model; }, enumerable: true, configurable: true }); module.exports = AWS.QLDB; /***/ }), /***/ 55423: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { __webpack_require__(73639); var AWS = __webpack_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; apiLoader.services['qldbsession'] = {}; AWS.QLDBSession = Service.defineService('qldbsession', ['2019-07-11']); Object.defineProperty(apiLoader.services['qldbsession'], '2019-07-11', { get: function get() { var model = __webpack_require__(67426); model.paginators = __webpack_require__(96527)/* .pagination */ .o; return model; }, enumerable: true, configurable: true }); module.exports = AWS.QLDBSession; /***/ }), /***/ 29898: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { __webpack_require__(73639); var AWS = __webpack_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; apiLoader.services['quicksight'] = {}; AWS.QuickSight = Service.defineService('quicksight', ['2018-04-01']); Object.defineProperty(apiLoader.services['quicksight'], '2018-04-01', { get: function get() { var model = __webpack_require__(6807); model.paginators = __webpack_require__(81489)/* .pagination */ .o; return model; }, enumerable: true, configurable: true }); module.exports = AWS.QuickSight; /***/ }), /***/ 94394: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { __webpack_require__(73639); var AWS = __webpack_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; apiLoader.services['ram'] = {}; AWS.RAM = Service.defineService('ram', ['2018-01-04']); Object.defineProperty(apiLoader.services['ram'], '2018-01-04', { get: function get() { var model = __webpack_require__(83728); model.paginators = __webpack_require__(83147)/* .pagination */ .o; return model; }, enumerable: true, configurable: true }); module.exports = AWS.RAM; /***/ }), /***/ 71578: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { __webpack_require__(73639); var AWS = __webpack_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; apiLoader.services['rds'] = {}; AWS.RDS = Service.defineService('rds', ['2013-01-10', '2013-02-12', '2013-09-09', '2014-09-01', '2014-09-01*', '2014-10-31']); __webpack_require__(71928); Object.defineProperty(apiLoader.services['rds'], '2013-01-10', { get: function get() { var model = __webpack_require__(56144); model.paginators = __webpack_require__(76660)/* .pagination */ .o; return model; }, enumerable: true, configurable: true }); Object.defineProperty(apiLoader.services['rds'], '2013-02-12', { get: function get() { var model = __webpack_require__(15633); model.paginators = __webpack_require__(37654)/* .pagination */ .o; return model; }, enumerable: true, configurable: true }); Object.defineProperty(apiLoader.services['rds'], '2013-09-09', { get: function get() { var model = __webpack_require__(53439); model.paginators = __webpack_require__(17223)/* .pagination */ .o; model.waiters = __webpack_require__(60967)/* .waiters */ .V; return model; }, enumerable: true, configurable: true }); Object.defineProperty(apiLoader.services['rds'], '2014-09-01', { get: function get() { var model = __webpack_require__(72333); model.paginators = __webpack_require__(86022)/* .pagination */ .o; return model; }, enumerable: true, configurable: true }); Object.defineProperty(apiLoader.services['rds'], '2014-10-31', { get: function get() { var model = __webpack_require__(6210); model.paginators = __webpack_require__(60972)/* .pagination */ .o; model.waiters = __webpack_require__(6606)/* .waiters */ .V; return model; }, enumerable: true, configurable: true }); module.exports = AWS.RDS; /***/ }), /***/ 30147: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { __webpack_require__(73639); var AWS = __webpack_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; apiLoader.services['rdsdataservice'] = {}; AWS.RDSDataService = Service.defineService('rdsdataservice', ['2018-08-01']); __webpack_require__(64070); Object.defineProperty(apiLoader.services['rdsdataservice'], '2018-08-01', { get: function get() { var model = __webpack_require__(4983); model.paginators = __webpack_require__(99015)/* .pagination */ .o; return model; }, enumerable: true, configurable: true }); module.exports = AWS.RDSDataService; /***/ }), /***/ 84853: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { __webpack_require__(73639); var AWS = __webpack_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; apiLoader.services['redshift'] = {}; AWS.Redshift = Service.defineService('redshift', ['2012-12-01']); Object.defineProperty(apiLoader.services['redshift'], '2012-12-01', { get: function get() { var model = __webpack_require__(17066); model.paginators = __webpack_require__(7755)/* .pagination */ .o; model.waiters = __webpack_require__(91400)/* .waiters */ .V; return model; }, enumerable: true, configurable: true }); module.exports = AWS.Redshift; /***/ }), /***/ 203: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { __webpack_require__(73639); var AWS = __webpack_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; apiLoader.services['redshiftdata'] = {}; AWS.RedshiftData = Service.defineService('redshiftdata', ['2019-12-20']); Object.defineProperty(apiLoader.services['redshiftdata'], '2019-12-20', { get: function get() { var model = __webpack_require__(34805); model.paginators = __webpack_require__(28484)/* .pagination */ .o; return model; }, enumerable: true, configurable: true }); module.exports = AWS.RedshiftData; /***/ }), /***/ 65470: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { __webpack_require__(73639); var AWS = __webpack_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; apiLoader.services['rekognition'] = {}; AWS.Rekognition = Service.defineService('rekognition', ['2016-06-27']); Object.defineProperty(apiLoader.services['rekognition'], '2016-06-27', { get: function get() { var model = __webpack_require__(65852); model.paginators = __webpack_require__(49860)/* .pagination */ .o; model.waiters = __webpack_require__(19491)/* .waiters */ .V; return model; }, enumerable: true, configurable: true }); module.exports = AWS.Rekognition; /***/ }), /***/ 58756: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { __webpack_require__(73639); var AWS = __webpack_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; apiLoader.services['resourcegroups'] = {}; AWS.ResourceGroups = Service.defineService('resourcegroups', ['2017-11-27']); Object.defineProperty(apiLoader.services['resourcegroups'], '2017-11-27', { get: function get() { var model = __webpack_require__(28629); model.paginators = __webpack_require__(71378)/* .pagination */ .o; return model; }, enumerable: true, configurable: true }); module.exports = AWS.ResourceGroups; /***/ }), /***/ 7385: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { __webpack_require__(73639); var AWS = __webpack_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; apiLoader.services['resourcegroupstaggingapi'] = {}; AWS.ResourceGroupsTaggingAPI = Service.defineService('resourcegroupstaggingapi', ['2017-01-26']); Object.defineProperty(apiLoader.services['resourcegroupstaggingapi'], '2017-01-26', { get: function get() { var model = __webpack_require__(83914); model.paginators = __webpack_require__(64865)/* .pagination */ .o; return model; }, enumerable: true, configurable: true }); module.exports = AWS.ResourceGroupsTaggingAPI; /***/ }), /***/ 18068: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { __webpack_require__(73639); var AWS = __webpack_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; apiLoader.services['robomaker'] = {}; AWS.RoboMaker = Service.defineService('robomaker', ['2018-06-29']); Object.defineProperty(apiLoader.services['robomaker'], '2018-06-29', { get: function get() { var model = __webpack_require__(36854); model.paginators = __webpack_require__(52592)/* .pagination */ .o; return model; }, enumerable: true, configurable: true }); module.exports = AWS.RoboMaker; /***/ }), /***/ 44968: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { __webpack_require__(73639); var AWS = __webpack_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; apiLoader.services['route53'] = {}; AWS.Route53 = Service.defineService('route53', ['2013-04-01']); __webpack_require__(69627); Object.defineProperty(apiLoader.services['route53'], '2013-04-01', { get: function get() { var model = __webpack_require__(91499); model.paginators = __webpack_require__(54519)/* .pagination */ .o; model.waiters = __webpack_require__(4628)/* .waiters */ .V; return model; }, enumerable: true, configurable: true }); module.exports = AWS.Route53; /***/ }), /***/ 51994: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { __webpack_require__(73639); var AWS = __webpack_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; apiLoader.services['route53domains'] = {}; AWS.Route53Domains = Service.defineService('route53domains', ['2014-05-15']); Object.defineProperty(apiLoader.services['route53domains'], '2014-05-15', { get: function get() { var model = __webpack_require__(6535); model.paginators = __webpack_require__(26777)/* .pagination */ .o; return model; }, enumerable: true, configurable: true }); module.exports = AWS.Route53Domains; /***/ }), /***/ 25894: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { __webpack_require__(73639); var AWS = __webpack_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; apiLoader.services['route53resolver'] = {}; AWS.Route53Resolver = Service.defineService('route53resolver', ['2018-04-01']); Object.defineProperty(apiLoader.services['route53resolver'], '2018-04-01', { get: function get() { var model = __webpack_require__(99309); model.paginators = __webpack_require__(21261)/* .pagination */ .o; return model; }, enumerable: true, configurable: true }); module.exports = AWS.Route53Resolver; /***/ }), /***/ 83256: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { __webpack_require__(73639); var AWS = __webpack_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; apiLoader.services['s3'] = {}; AWS.S3 = Service.defineService('s3', ['2006-03-01']); __webpack_require__(26543); Object.defineProperty(apiLoader.services['s3'], '2006-03-01', { get: function get() { var model = __webpack_require__(32581); model.paginators = __webpack_require__(53175)/* .pagination */ .o; model.waiters = __webpack_require__(44494)/* .waiters */ .V; return model; }, enumerable: true, configurable: true }); module.exports = AWS.S3; /***/ }), /***/ 99817: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { __webpack_require__(73639); var AWS = __webpack_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; apiLoader.services['s3control'] = {}; AWS.S3Control = Service.defineService('s3control', ['2018-08-20']); __webpack_require__(71207); Object.defineProperty(apiLoader.services['s3control'], '2018-08-20', { get: function get() { var model = __webpack_require__(52092); model.paginators = __webpack_require__(62498)/* .pagination */ .o; return model; }, enumerable: true, configurable: true }); module.exports = AWS.S3Control; /***/ }), /***/ 90493: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { __webpack_require__(73639); var AWS = __webpack_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; apiLoader.services['s3outposts'] = {}; AWS.S3Outposts = Service.defineService('s3outposts', ['2017-07-25']); Object.defineProperty(apiLoader.services['s3outposts'], '2017-07-25', { get: function get() { var model = __webpack_require__(90331); model.paginators = __webpack_require__(8746)/* .pagination */ .o; return model; }, enumerable: true, configurable: true }); module.exports = AWS.S3Outposts; /***/ }), /***/ 77657: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { __webpack_require__(73639); var AWS = __webpack_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; apiLoader.services['sagemaker'] = {}; AWS.SageMaker = Service.defineService('sagemaker', ['2017-07-24']); Object.defineProperty(apiLoader.services['sagemaker'], '2017-07-24', { get: function get() { var model = __webpack_require__(20227); model.paginators = __webpack_require__(44955)/* .pagination */ .o; model.waiters = __webpack_require__(50026)/* .waiters */ .V; return model; }, enumerable: true, configurable: true }); module.exports = AWS.SageMaker; /***/ }), /***/ 38966: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { __webpack_require__(73639); var AWS = __webpack_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; apiLoader.services['sagemakeredge'] = {}; AWS.SagemakerEdge = Service.defineService('sagemakeredge', ['2020-09-23']); Object.defineProperty(apiLoader.services['sagemakeredge'], '2020-09-23', { get: function get() { var model = __webpack_require__(48750); model.paginators = __webpack_require__(2769)/* .pagination */ .o; return model; }, enumerable: true, configurable: true }); module.exports = AWS.SagemakerEdge; /***/ }), /***/ 67644: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { __webpack_require__(73639); var AWS = __webpack_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; apiLoader.services['sagemakerfeaturestoreruntime'] = {}; AWS.SageMakerFeatureStoreRuntime = Service.defineService('sagemakerfeaturestoreruntime', ['2020-07-01']); Object.defineProperty(apiLoader.services['sagemakerfeaturestoreruntime'], '2020-07-01', { get: function get() { var model = __webpack_require__(98420); model.paginators = __webpack_require__(45590)/* .pagination */ .o; return model; }, enumerable: true, configurable: true }); module.exports = AWS.SageMakerFeatureStoreRuntime; /***/ }), /***/ 85044: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { __webpack_require__(73639); var AWS = __webpack_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; apiLoader.services['sagemakerruntime'] = {}; AWS.SageMakerRuntime = Service.defineService('sagemakerruntime', ['2017-05-13']); Object.defineProperty(apiLoader.services['sagemakerruntime'], '2017-05-13', { get: function get() { var model = __webpack_require__(82783); model.paginators = __webpack_require__(17272)/* .pagination */ .o; return model; }, enumerable: true, configurable: true }); module.exports = AWS.SageMakerRuntime; /***/ }), /***/ 62825: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { __webpack_require__(73639); var AWS = __webpack_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; apiLoader.services['savingsplans'] = {}; AWS.SavingsPlans = Service.defineService('savingsplans', ['2019-06-28']); Object.defineProperty(apiLoader.services['savingsplans'], '2019-06-28', { get: function get() { var model = __webpack_require__(2810); model.paginators = __webpack_require__(56794)/* .pagination */ .o; return model; }, enumerable: true, configurable: true }); module.exports = AWS.SavingsPlans; /***/ }), /***/ 55713: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { __webpack_require__(73639); var AWS = __webpack_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; apiLoader.services['schemas'] = {}; AWS.Schemas = Service.defineService('schemas', ['2019-12-02']); Object.defineProperty(apiLoader.services['schemas'], '2019-12-02', { get: function get() { var model = __webpack_require__(85225); model.paginators = __webpack_require__(50738)/* .pagination */ .o; model.waiters = __webpack_require__(34671)/* .waiters */ .V; return model; }, enumerable: true, configurable: true }); module.exports = AWS.Schemas; /***/ }), /***/ 85131: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { __webpack_require__(73639); var AWS = __webpack_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; apiLoader.services['secretsmanager'] = {}; AWS.SecretsManager = Service.defineService('secretsmanager', ['2017-10-17']); Object.defineProperty(apiLoader.services['secretsmanager'], '2017-10-17', { get: function get() { var model = __webpack_require__(97209); model.paginators = __webpack_require__(38503)/* .pagination */ .o; return model; }, enumerable: true, configurable: true }); module.exports = AWS.SecretsManager; /***/ }), /***/ 21550: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { __webpack_require__(73639); var AWS = __webpack_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; apiLoader.services['securityhub'] = {}; AWS.SecurityHub = Service.defineService('securityhub', ['2018-10-26']); Object.defineProperty(apiLoader.services['securityhub'], '2018-10-26', { get: function get() { var model = __webpack_require__(40359); model.paginators = __webpack_require__(27612)/* .pagination */ .o; return model; }, enumerable: true, configurable: true }); module.exports = AWS.SecurityHub; /***/ }), /***/ 62402: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { __webpack_require__(73639); var AWS = __webpack_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; apiLoader.services['serverlessapplicationrepository'] = {}; AWS.ServerlessApplicationRepository = Service.defineService('serverlessapplicationrepository', ['2017-09-08']); Object.defineProperty(apiLoader.services['serverlessapplicationrepository'], '2017-09-08', { get: function get() { var model = __webpack_require__(8591); model.paginators = __webpack_require__(96164)/* .pagination */ .o; return model; }, enumerable: true, configurable: true }); module.exports = AWS.ServerlessApplicationRepository; /***/ }), /***/ 822: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { __webpack_require__(73639); var AWS = __webpack_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; apiLoader.services['servicecatalog'] = {}; AWS.ServiceCatalog = Service.defineService('servicecatalog', ['2015-12-10']); Object.defineProperty(apiLoader.services['servicecatalog'], '2015-12-10', { get: function get() { var model = __webpack_require__(80503); model.paginators = __webpack_require__(71855)/* .pagination */ .o; return model; }, enumerable: true, configurable: true }); module.exports = AWS.ServiceCatalog; /***/ }), /***/ 79068: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { __webpack_require__(73639); var AWS = __webpack_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; apiLoader.services['servicecatalogappregistry'] = {}; AWS.ServiceCatalogAppRegistry = Service.defineService('servicecatalogappregistry', ['2020-06-24']); Object.defineProperty(apiLoader.services['servicecatalogappregistry'], '2020-06-24', { get: function get() { var model = __webpack_require__(47635); model.paginators = __webpack_require__(67278)/* .pagination */ .o; return model; }, enumerable: true, configurable: true }); module.exports = AWS.ServiceCatalogAppRegistry; /***/ }), /***/ 91569: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { __webpack_require__(73639); var AWS = __webpack_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; apiLoader.services['servicediscovery'] = {}; AWS.ServiceDiscovery = Service.defineService('servicediscovery', ['2017-03-14']); Object.defineProperty(apiLoader.services['servicediscovery'], '2017-03-14', { get: function get() { var model = __webpack_require__(20459); model.paginators = __webpack_require__(19834)/* .pagination */ .o; return model; }, enumerable: true, configurable: true }); module.exports = AWS.ServiceDiscovery; /***/ }), /***/ 57800: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { __webpack_require__(73639); var AWS = __webpack_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; apiLoader.services['servicequotas'] = {}; AWS.ServiceQuotas = Service.defineService('servicequotas', ['2019-06-24']); Object.defineProperty(apiLoader.services['servicequotas'], '2019-06-24', { get: function get() { var model = __webpack_require__(14304); model.paginators = __webpack_require__(90635)/* .pagination */ .o; return model; }, enumerable: true, configurable: true }); module.exports = AWS.ServiceQuotas; /***/ }), /***/ 46816: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { __webpack_require__(73639); var AWS = __webpack_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; apiLoader.services['ses'] = {}; AWS.SES = Service.defineService('ses', ['2010-12-01']); Object.defineProperty(apiLoader.services['ses'], '2010-12-01', { get: function get() { var model = __webpack_require__(87825); model.paginators = __webpack_require__(61348)/* .pagination */ .o; model.waiters = __webpack_require__(84476)/* .waiters */ .V; return model; }, enumerable: true, configurable: true }); module.exports = AWS.SES; /***/ }), /***/ 20142: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { __webpack_require__(73639); var AWS = __webpack_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; apiLoader.services['sesv2'] = {}; AWS.SESV2 = Service.defineService('sesv2', ['2019-09-27']); Object.defineProperty(apiLoader.services['sesv2'], '2019-09-27', { get: function get() { var model = __webpack_require__(32530); model.paginators = __webpack_require__(39567)/* .pagination */ .o; return model; }, enumerable: true, configurable: true }); module.exports = AWS.SESV2; /***/ }), /***/ 20271: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { __webpack_require__(73639); var AWS = __webpack_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; apiLoader.services['shield'] = {}; AWS.Shield = Service.defineService('shield', ['2016-06-02']); Object.defineProperty(apiLoader.services['shield'], '2016-06-02', { get: function get() { var model = __webpack_require__(78621); model.paginators = __webpack_require__(75743)/* .pagination */ .o; return model; }, enumerable: true, configurable: true }); module.exports = AWS.Shield; /***/ }), /***/ 71596: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { __webpack_require__(73639); var AWS = __webpack_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; apiLoader.services['signer'] = {}; AWS.Signer = Service.defineService('signer', ['2017-08-25']); Object.defineProperty(apiLoader.services['signer'], '2017-08-25', { get: function get() { var model = __webpack_require__(21884); model.paginators = __webpack_require__(69839)/* .pagination */ .o; model.waiters = __webpack_require__(61331)/* .waiters */ .V; return model; }, enumerable: true, configurable: true }); module.exports = AWS.Signer; /***/ }), /***/ 10120: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { __webpack_require__(73639); var AWS = __webpack_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; apiLoader.services['simpledb'] = {}; AWS.SimpleDB = Service.defineService('simpledb', ['2009-04-15']); Object.defineProperty(apiLoader.services['simpledb'], '2009-04-15', { get: function get() { var model = __webpack_require__(96016); model.paginators = __webpack_require__(73820)/* .pagination */ .o; return model; }, enumerable: true, configurable: true }); module.exports = AWS.SimpleDB; /***/ }), /***/ 57719: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { __webpack_require__(73639); var AWS = __webpack_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; apiLoader.services['sms'] = {}; AWS.SMS = Service.defineService('sms', ['2016-10-24']); Object.defineProperty(apiLoader.services['sms'], '2016-10-24', { get: function get() { var model = __webpack_require__(51530); model.paginators = __webpack_require__(72874)/* .pagination */ .o; return model; }, enumerable: true, configurable: true }); module.exports = AWS.SMS; /***/ }), /***/ 510: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { __webpack_require__(73639); var AWS = __webpack_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; apiLoader.services['snowball'] = {}; AWS.Snowball = Service.defineService('snowball', ['2016-06-30']); Object.defineProperty(apiLoader.services['snowball'], '2016-06-30', { get: function get() { var model = __webpack_require__(41624); model.paginators = __webpack_require__(14147)/* .pagination */ .o; return model; }, enumerable: true, configurable: true }); module.exports = AWS.Snowball; /***/ }), /***/ 28581: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { __webpack_require__(73639); var AWS = __webpack_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; apiLoader.services['sns'] = {}; AWS.SNS = Service.defineService('sns', ['2010-03-31']); Object.defineProperty(apiLoader.services['sns'], '2010-03-31', { get: function get() { var model = __webpack_require__(86384); model.paginators = __webpack_require__(92788)/* .pagination */ .o; return model; }, enumerable: true, configurable: true }); module.exports = AWS.SNS; /***/ }), /***/ 63172: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { __webpack_require__(73639); var AWS = __webpack_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; apiLoader.services['sqs'] = {}; AWS.SQS = Service.defineService('sqs', ['2012-11-05']); __webpack_require__(94571); Object.defineProperty(apiLoader.services['sqs'], '2012-11-05', { get: function get() { var model = __webpack_require__(31635); model.paginators = __webpack_require__(48324)/* .pagination */ .o; return model; }, enumerable: true, configurable: true }); module.exports = AWS.SQS; /***/ }), /***/ 83380: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { __webpack_require__(73639); var AWS = __webpack_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; apiLoader.services['ssm'] = {}; AWS.SSM = Service.defineService('ssm', ['2014-11-06']); Object.defineProperty(apiLoader.services['ssm'], '2014-11-06', { get: function get() { var model = __webpack_require__(7667); model.paginators = __webpack_require__(84951)/* .pagination */ .o; model.waiters = __webpack_require__(80315)/* .waiters */ .V; return model; }, enumerable: true, configurable: true }); module.exports = AWS.SSM; /***/ }), /***/ 71096: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { __webpack_require__(73639); var AWS = __webpack_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; apiLoader.services['sso'] = {}; AWS.SSO = Service.defineService('sso', ['2019-06-10']); Object.defineProperty(apiLoader.services['sso'], '2019-06-10', { get: function get() { var model = __webpack_require__(77888); model.paginators = __webpack_require__(18046)/* .pagination */ .o; return model; }, enumerable: true, configurable: true }); module.exports = AWS.SSO; /***/ }), /***/ 66644: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { __webpack_require__(73639); var AWS = __webpack_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; apiLoader.services['ssoadmin'] = {}; AWS.SSOAdmin = Service.defineService('ssoadmin', ['2020-07-20']); Object.defineProperty(apiLoader.services['ssoadmin'], '2020-07-20', { get: function get() { var model = __webpack_require__(93165); model.paginators = __webpack_require__(61022)/* .pagination */ .o; return model; }, enumerable: true, configurable: true }); module.exports = AWS.SSOAdmin; /***/ }), /***/ 49870: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { __webpack_require__(73639); var AWS = __webpack_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; apiLoader.services['ssooidc'] = {}; AWS.SSOOIDC = Service.defineService('ssooidc', ['2019-06-10']); Object.defineProperty(apiLoader.services['ssooidc'], '2019-06-10', { get: function get() { var model = __webpack_require__(43979); model.paginators = __webpack_require__(16125)/* .pagination */ .o; return model; }, enumerable: true, configurable: true }); module.exports = AWS.SSOOIDC; /***/ }), /***/ 8136: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { __webpack_require__(73639); var AWS = __webpack_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; apiLoader.services['stepfunctions'] = {}; AWS.StepFunctions = Service.defineService('stepfunctions', ['2016-11-23']); Object.defineProperty(apiLoader.services['stepfunctions'], '2016-11-23', { get: function get() { var model = __webpack_require__(58492); model.paginators = __webpack_require__(95424)/* .pagination */ .o; return model; }, enumerable: true, configurable: true }); module.exports = AWS.StepFunctions; /***/ }), /***/ 89190: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { __webpack_require__(73639); var AWS = __webpack_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; apiLoader.services['storagegateway'] = {}; AWS.StorageGateway = Service.defineService('storagegateway', ['2013-06-30']); Object.defineProperty(apiLoader.services['storagegateway'], '2013-06-30', { get: function get() { var model = __webpack_require__(33480); model.paginators = __webpack_require__(6062)/* .pagination */ .o; return model; }, enumerable: true, configurable: true }); module.exports = AWS.StorageGateway; /***/ }), /***/ 57513: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { __webpack_require__(73639); var AWS = __webpack_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; apiLoader.services['sts'] = {}; AWS.STS = Service.defineService('sts', ['2011-06-15']); __webpack_require__(91055); Object.defineProperty(apiLoader.services['sts'], '2011-06-15', { get: function get() { var model = __webpack_require__(18976); model.paginators = __webpack_require__(82952)/* .pagination */ .o; return model; }, enumerable: true, configurable: true }); module.exports = AWS.STS; /***/ }), /***/ 1099: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { __webpack_require__(73639); var AWS = __webpack_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; apiLoader.services['support'] = {}; AWS.Support = Service.defineService('support', ['2013-04-15']); Object.defineProperty(apiLoader.services['support'], '2013-04-15', { get: function get() { var model = __webpack_require__(77180); model.paginators = __webpack_require__(83878)/* .pagination */ .o; return model; }, enumerable: true, configurable: true }); module.exports = AWS.Support; /***/ }), /***/ 32327: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { __webpack_require__(73639); var AWS = __webpack_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; apiLoader.services['swf'] = {}; AWS.SWF = Service.defineService('swf', ['2012-01-25']); __webpack_require__(31987); Object.defineProperty(apiLoader.services['swf'], '2012-01-25', { get: function get() { var model = __webpack_require__(4974); model.paginators = __webpack_require__(65798)/* .pagination */ .o; return model; }, enumerable: true, configurable: true }); module.exports = AWS.SWF; /***/ }), /***/ 25910: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { __webpack_require__(73639); var AWS = __webpack_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; apiLoader.services['synthetics'] = {}; AWS.Synthetics = Service.defineService('synthetics', ['2017-10-11']); Object.defineProperty(apiLoader.services['synthetics'], '2017-10-11', { get: function get() { var model = __webpack_require__(82853); model.paginators = __webpack_require__(27742)/* .pagination */ .o; return model; }, enumerable: true, configurable: true }); module.exports = AWS.Synthetics; /***/ }), /***/ 58523: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { __webpack_require__(73639); var AWS = __webpack_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; apiLoader.services['textract'] = {}; AWS.Textract = Service.defineService('textract', ['2018-06-27']); Object.defineProperty(apiLoader.services['textract'], '2018-06-27', { get: function get() { var model = __webpack_require__(66368); model.paginators = __webpack_require__(75909)/* .pagination */ .o; return model; }, enumerable: true, configurable: true }); module.exports = AWS.Textract; /***/ }), /***/ 24529: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { __webpack_require__(73639); var AWS = __webpack_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; apiLoader.services['timestreamquery'] = {}; AWS.TimestreamQuery = Service.defineService('timestreamquery', ['2018-11-01']); Object.defineProperty(apiLoader.services['timestreamquery'], '2018-11-01', { get: function get() { var model = __webpack_require__(27578); model.paginators = __webpack_require__(99094)/* .pagination */ .o; return model; }, enumerable: true, configurable: true }); module.exports = AWS.TimestreamQuery; /***/ }), /***/ 1573: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { __webpack_require__(73639); var AWS = __webpack_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; apiLoader.services['timestreamwrite'] = {}; AWS.TimestreamWrite = Service.defineService('timestreamwrite', ['2018-11-01']); Object.defineProperty(apiLoader.services['timestreamwrite'], '2018-11-01', { get: function get() { var model = __webpack_require__(79095); model.paginators = __webpack_require__(50262)/* .pagination */ .o; return model; }, enumerable: true, configurable: true }); module.exports = AWS.TimestreamWrite; /***/ }), /***/ 75811: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { __webpack_require__(73639); var AWS = __webpack_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; apiLoader.services['transcribeservice'] = {}; AWS.TranscribeService = Service.defineService('transcribeservice', ['2017-10-26']); Object.defineProperty(apiLoader.services['transcribeservice'], '2017-10-26', { get: function get() { var model = __webpack_require__(10903); model.paginators = __webpack_require__(92036)/* .pagination */ .o; return model; }, enumerable: true, configurable: true }); module.exports = AWS.TranscribeService; /***/ }), /***/ 51585: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { __webpack_require__(73639); var AWS = __webpack_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; apiLoader.services['transfer'] = {}; AWS.Transfer = Service.defineService('transfer', ['2018-11-05']); Object.defineProperty(apiLoader.services['transfer'], '2018-11-05', { get: function get() { var model = __webpack_require__(42419); model.paginators = __webpack_require__(70586)/* .pagination */ .o; return model; }, enumerable: true, configurable: true }); module.exports = AWS.Transfer; /***/ }), /***/ 72544: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { __webpack_require__(73639); var AWS = __webpack_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; apiLoader.services['translate'] = {}; AWS.Translate = Service.defineService('translate', ['2017-07-01']); Object.defineProperty(apiLoader.services['translate'], '2017-07-01', { get: function get() { var model = __webpack_require__(12983); model.paginators = __webpack_require__(85886)/* .pagination */ .o; return model; }, enumerable: true, configurable: true }); module.exports = AWS.Translate; /***/ }), /***/ 72742: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { __webpack_require__(73639); var AWS = __webpack_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; apiLoader.services['waf'] = {}; AWS.WAF = Service.defineService('waf', ['2015-08-24']); Object.defineProperty(apiLoader.services['waf'], '2015-08-24', { get: function get() { var model = __webpack_require__(93997); model.paginators = __webpack_require__(45770)/* .pagination */ .o; return model; }, enumerable: true, configurable: true }); module.exports = AWS.WAF; /***/ }), /***/ 23153: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { __webpack_require__(73639); var AWS = __webpack_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; apiLoader.services['wafregional'] = {}; AWS.WAFRegional = Service.defineService('wafregional', ['2016-11-28']); Object.defineProperty(apiLoader.services['wafregional'], '2016-11-28', { get: function get() { var model = __webpack_require__(72867); model.paginators = __webpack_require__(68917)/* .pagination */ .o; return model; }, enumerable: true, configurable: true }); module.exports = AWS.WAFRegional; /***/ }), /***/ 50353: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { __webpack_require__(73639); var AWS = __webpack_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; apiLoader.services['wafv2'] = {}; AWS.WAFV2 = Service.defineService('wafv2', ['2019-07-29']); Object.defineProperty(apiLoader.services['wafv2'], '2019-07-29', { get: function get() { var model = __webpack_require__(27916); model.paginators = __webpack_require__(51265)/* .pagination */ .o; return model; }, enumerable: true, configurable: true }); module.exports = AWS.WAFV2; /***/ }), /***/ 86263: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { __webpack_require__(73639); var AWS = __webpack_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; apiLoader.services['wellarchitected'] = {}; AWS.WellArchitected = Service.defineService('wellarchitected', ['2020-03-31']); Object.defineProperty(apiLoader.services['wellarchitected'], '2020-03-31', { get: function get() { var model = __webpack_require__(5684); model.paginators = __webpack_require__(47645)/* .pagination */ .o; return model; }, enumerable: true, configurable: true }); module.exports = AWS.WellArchitected; /***/ }), /***/ 38835: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { __webpack_require__(73639); var AWS = __webpack_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; apiLoader.services['workdocs'] = {}; AWS.WorkDocs = Service.defineService('workdocs', ['2016-05-01']); Object.defineProperty(apiLoader.services['workdocs'], '2016-05-01', { get: function get() { var model = __webpack_require__(12789); model.paginators = __webpack_require__(20074)/* .pagination */ .o; return model; }, enumerable: true, configurable: true }); module.exports = AWS.WorkDocs; /***/ }), /***/ 48579: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { __webpack_require__(73639); var AWS = __webpack_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; apiLoader.services['worklink'] = {}; AWS.WorkLink = Service.defineService('worklink', ['2018-09-25']); Object.defineProperty(apiLoader.services['worklink'], '2018-09-25', { get: function get() { var model = __webpack_require__(44786); model.paginators = __webpack_require__(88012)/* .pagination */ .o; return model; }, enumerable: true, configurable: true }); module.exports = AWS.WorkLink; /***/ }), /***/ 38374: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { __webpack_require__(73639); var AWS = __webpack_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; apiLoader.services['workmail'] = {}; AWS.WorkMail = Service.defineService('workmail', ['2017-10-01']); Object.defineProperty(apiLoader.services['workmail'], '2017-10-01', { get: function get() { var model = __webpack_require__(31611); model.paginators = __webpack_require__(64931)/* .pagination */ .o; return model; }, enumerable: true, configurable: true }); module.exports = AWS.WorkMail; /***/ }), /***/ 67025: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { __webpack_require__(73639); var AWS = __webpack_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; apiLoader.services['workmailmessageflow'] = {}; AWS.WorkMailMessageFlow = Service.defineService('workmailmessageflow', ['2019-05-01']); Object.defineProperty(apiLoader.services['workmailmessageflow'], '2019-05-01', { get: function get() { var model = __webpack_require__(15648); model.paginators = __webpack_require__(88532)/* .pagination */ .o; return model; }, enumerable: true, configurable: true }); module.exports = AWS.WorkMailMessageFlow; /***/ }), /***/ 25513: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { __webpack_require__(73639); var AWS = __webpack_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; apiLoader.services['workspaces'] = {}; AWS.WorkSpaces = Service.defineService('workspaces', ['2015-04-08']); Object.defineProperty(apiLoader.services['workspaces'], '2015-04-08', { get: function get() { var model = __webpack_require__(66372); model.paginators = __webpack_require__(37567)/* .pagination */ .o; return model; }, enumerable: true, configurable: true }); module.exports = AWS.WorkSpaces; /***/ }), /***/ 41548: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { __webpack_require__(73639); var AWS = __webpack_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; apiLoader.services['xray'] = {}; AWS.XRay = Service.defineService('xray', ['2016-04-12']); Object.defineProperty(apiLoader.services['xray'], '2016-04-12', { get: function get() { var model = __webpack_require__(37289); model.paginators = __webpack_require__(83127)/* .pagination */ .o; return model; }, enumerable: true, configurable: true }); module.exports = AWS.XRay; /***/ }), /***/ 52793: /***/ ((module) => { function apiLoader(svc, version) { if (!apiLoader.services.hasOwnProperty(svc)) { throw new Error('InvalidService: Failed to load api for ' + svc); } return apiLoader.services[svc][version]; } /** * @api private * * This member of AWS.apiLoader is private, but changing it will necessitate a * change to ../scripts/services-table-generator.ts */ apiLoader.services = {}; /** * @api private */ module.exports = apiLoader; /***/ }), /***/ 71786: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { __webpack_require__(73639); var AWS = __webpack_require__(28437); // Load all service classes __webpack_require__(26296); /** * @api private */ module.exports = AWS; /***/ }), /***/ 93260: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { var AWS = __webpack_require__(28437), url = AWS.util.url, crypto = AWS.util.crypto.lib, base64Encode = AWS.util.base64.encode, inherit = AWS.util.inherit; var queryEncode = function (string) { var replacements = { '+': '-', '=': '_', '/': '~' }; return string.replace(/[\+=\/]/g, function (match) { return replacements[match]; }); }; var signPolicy = function (policy, privateKey) { var sign = crypto.createSign('RSA-SHA1'); sign.write(policy); return queryEncode(sign.sign(privateKey, 'base64')); }; var signWithCannedPolicy = function (url, expires, keyPairId, privateKey) { var policy = JSON.stringify({ Statement: [ { Resource: url, Condition: { DateLessThan: { 'AWS:EpochTime': expires } } } ] }); return { Expires: expires, 'Key-Pair-Id': keyPairId, Signature: signPolicy(policy.toString(), privateKey) }; }; var signWithCustomPolicy = function (policy, keyPairId, privateKey) { policy = policy.replace(/\s/mg, ''); return { Policy: queryEncode(base64Encode(policy)), 'Key-Pair-Id': keyPairId, Signature: signPolicy(policy, privateKey) }; }; var determineScheme = function (url) { var parts = url.split('://'); if (parts.length < 2) { throw new Error('Invalid URL.'); } return parts[0].replace('*', ''); }; var getRtmpUrl = function (rtmpUrl) { var parsed = url.parse(rtmpUrl); return parsed.path.replace(/^\//, '') + (parsed.hash || ''); }; var getResource = function (url) { switch (determineScheme(url)) { case 'http': case 'https': return url; case 'rtmp': return getRtmpUrl(url); default: throw new Error('Invalid URI scheme. Scheme must be one of' + ' http, https, or rtmp'); } }; var handleError = function (err, callback) { if (!callback || typeof callback !== 'function') { throw err; } callback(err); }; var handleSuccess = function (result, callback) { if (!callback || typeof callback !== 'function') { return result; } callback(null, result); }; AWS.CloudFront.Signer = inherit({ /** * A signer object can be used to generate signed URLs and cookies for granting * access to content on restricted CloudFront distributions. * * @see http://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/PrivateContent.html * * @param keyPairId [String] (Required) The ID of the CloudFront key pair * being used. * @param privateKey [String] (Required) A private key in RSA format. */ constructor: function Signer(keyPairId, privateKey) { if (keyPairId === void 0 || privateKey === void 0) { throw new Error('A key pair ID and private key are required'); } this.keyPairId = keyPairId; this.privateKey = privateKey; }, /** * Create a signed Amazon CloudFront Cookie. * * @param options [Object] The options to create a signed cookie. * @option options url [String] The URL to which the signature will grant * access. Required unless you pass in a full * policy. * @option options expires [Number] A Unix UTC timestamp indicating when the * signature should expire. Required unless you * pass in a full policy. * @option options policy [String] A CloudFront JSON policy. Required unless * you pass in a url and an expiry time. * * @param cb [Function] if a callback is provided, this function will * pass the hash as the second parameter (after the error parameter) to * the callback function. * * @return [Object] if called synchronously (with no callback), returns the * signed cookie parameters. * @return [null] nothing is returned if a callback is provided. */ getSignedCookie: function (options, cb) { var signatureHash = 'policy' in options ? signWithCustomPolicy(options.policy, this.keyPairId, this.privateKey) : signWithCannedPolicy(options.url, options.expires, this.keyPairId, this.privateKey); var cookieHash = {}; for (var key in signatureHash) { if (Object.prototype.hasOwnProperty.call(signatureHash, key)) { cookieHash['CloudFront-' + key] = signatureHash[key]; } } return handleSuccess(cookieHash, cb); }, /** * Create a signed Amazon CloudFront URL. * * Keep in mind that URLs meant for use in media/flash players may have * different requirements for URL formats (e.g. some require that the * extension be removed, some require the file name to be prefixed * - mp4:, some require you to add "/cfx/st" into your URL). * * @param options [Object] The options to create a signed URL. * @option options url [String] The URL to which the signature will grant * access. Any query params included with * the URL should be encoded. Required. * @option options expires [Number] A Unix UTC timestamp indicating when the * signature should expire. Required unless you * pass in a full policy. * @option options policy [String] A CloudFront JSON policy. Required unless * you pass in a url and an expiry time. * * @param cb [Function] if a callback is provided, this function will * pass the URL as the second parameter (after the error parameter) to * the callback function. * * @return [String] if called synchronously (with no callback), returns the * signed URL. * @return [null] nothing is returned if a callback is provided. */ getSignedUrl: function (options, cb) { try { var resource = getResource(options.url); } catch (err) { return handleError(err, cb); } var parsedUrl = url.parse(options.url, true), signatureHash = Object.prototype.hasOwnProperty.call(options, 'policy') ? signWithCustomPolicy(options.policy, this.keyPairId, this.privateKey) : signWithCannedPolicy(resource, options.expires, this.keyPairId, this.privateKey); parsedUrl.search = null; for (var key in signatureHash) { if (Object.prototype.hasOwnProperty.call(signatureHash, key)) { parsedUrl.query[key] = signatureHash[key]; } } try { var signedUrl = determineScheme(options.url) === 'rtmp' ? getRtmpUrl(url.format(parsedUrl)) : url.format(parsedUrl); } catch (err) { return handleError(err, cb); } return handleSuccess(signedUrl, cb); } }); /** * @api private */ module.exports = AWS.CloudFront.Signer; /***/ }), /***/ 38110: /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => { var AWS = __webpack_require__(28437); __webpack_require__(53819); __webpack_require__(36965); var PromisesDependency; /** * The main configuration class used by all service objects to set * the region, credentials, and other options for requests. * * By default, credentials and region settings are left unconfigured. * This should be configured by the application before using any * AWS service APIs. * * In order to set global configuration options, properties should * be assigned to the global {AWS.config} object. * * @see AWS.config * * @!group General Configuration Options * * @!attribute credentials * @return [AWS.Credentials] the AWS credentials to sign requests with. * * @!attribute region * @example Set the global region setting to us-west-2 * AWS.config.update({region: 'us-west-2'}); * @return [AWS.Credentials] The region to send service requests to. * @see http://docs.amazonwebservices.com/general/latest/gr/rande.html * A list of available endpoints for each AWS service * * @!attribute maxRetries * @return [Integer] the maximum amount of retries to perform for a * service request. By default this value is calculated by the specific * service object that the request is being made to. * * @!attribute maxRedirects * @return [Integer] the maximum amount of redirects to follow for a * service request. Defaults to 10. * * @!attribute paramValidation * @return [Boolean|map] whether input parameters should be validated against * the operation description before sending the request. Defaults to true. * Pass a map to enable any of the following specific validation features: * * * **min** [Boolean] — Validates that a value meets the min * constraint. This is enabled by default when paramValidation is set * to `true`. * * **max** [Boolean] — Validates that a value meets the max * constraint. * * **pattern** [Boolean] — Validates that a string value matches a * regular expression. * * **enum** [Boolean] — Validates that a string value matches one * of the allowable enum values. * * @!attribute computeChecksums * @return [Boolean] whether to compute checksums for payload bodies when * the service accepts it (currently supported in S3 only). * * @!attribute convertResponseTypes * @return [Boolean] whether types are converted when parsing response data. * Currently only supported for JSON based services. Turning this off may * improve performance on large response payloads. Defaults to `true`. * * @!attribute correctClockSkew * @return [Boolean] whether to apply a clock skew correction and retry * requests that fail because of an skewed client clock. Defaults to * `false`. * * @!attribute sslEnabled * @return [Boolean] whether SSL is enabled for requests * * @!attribute s3ForcePathStyle * @return [Boolean] whether to force path style URLs for S3 objects * * @!attribute s3BucketEndpoint * @note Setting this configuration option requires an `endpoint` to be * provided explicitly to the service constructor. * @return [Boolean] whether the provided endpoint addresses an individual * bucket (false if it addresses the root API endpoint). * * @!attribute s3DisableBodySigning * @return [Boolean] whether to disable S3 body signing when using signature version `v4`. * Body signing can only be disabled when using https. Defaults to `true`. * * @!attribute s3UsEast1RegionalEndpoint * @return ['legacy'|'regional'] when region is set to 'us-east-1', whether to send s3 * request to global endpoints or 'us-east-1' regional endpoints. This config is only * applicable to S3 client; * Defaults to 'legacy' * @!attribute s3UseArnRegion * @return [Boolean] whether to override the request region with the region inferred * from requested resource's ARN. Only available for S3 buckets * Defaults to `true` * * @!attribute useAccelerateEndpoint * @note This configuration option is only compatible with S3 while accessing * dns-compatible buckets. * @return [Boolean] Whether to use the Accelerate endpoint with the S3 service. * Defaults to `false`. * * @!attribute retryDelayOptions * @example Set the base retry delay for all services to 300 ms * AWS.config.update({retryDelayOptions: {base: 300}}); * // Delays with maxRetries = 3: 300, 600, 1200 * @example Set a custom backoff function to provide delay values on retries * AWS.config.update({retryDelayOptions: {customBackoff: function(retryCount, err) { * // returns delay in ms * }}}); * @return [map] A set of options to configure the retry delay on retryable errors. * Currently supported options are: * * * **base** [Integer] — The base number of milliseconds to use in the * exponential backoff for operation retries. Defaults to 100 ms for all services except * DynamoDB, where it defaults to 50ms. * * * **customBackoff ** [function] — A custom function that accepts a * retry count and error and returns the amount of time to delay in * milliseconds. If the result is a non-zero negative value, no further * retry attempts will be made. The `base` option will be ignored if this * option is supplied. The function is only called for retryable errors. * * @!attribute httpOptions * @return [map] A set of options to pass to the low-level HTTP request. * Currently supported options are: * * * **proxy** [String] — the URL to proxy requests through * * **agent** [http.Agent, https.Agent] — the Agent object to perform * HTTP requests with. Used for connection pooling. Note that for * SSL connections, a special Agent object is used in order to enable * peer certificate verification. This feature is only supported in the * Node.js environment. * * **connectTimeout** [Integer] — Sets the socket to timeout after * failing to establish a connection with the server after * `connectTimeout` milliseconds. This timeout has no effect once a socket * connection has been established. * * **timeout** [Integer] — The number of milliseconds a request can * take before automatically being terminated. * Defaults to two minutes (120000). * * **xhrAsync** [Boolean] — Whether the SDK will send asynchronous * HTTP requests. Used in the browser environment only. Set to false to * send requests synchronously. Defaults to true (async on). * * **xhrWithCredentials** [Boolean] — Sets the "withCredentials" * property of an XMLHttpRequest object. Used in the browser environment * only. Defaults to false. * @!attribute logger * @return [#write,#log] an object that responds to .write() (like a stream) * or .log() (like the console object) in order to log information about * requests * * @!attribute systemClockOffset * @return [Number] an offset value in milliseconds to apply to all signing * times. Use this to compensate for clock skew when your system may be * out of sync with the service time. Note that this configuration option * can only be applied to the global `AWS.config` object and cannot be * overridden in service-specific configuration. Defaults to 0 milliseconds. * * @!attribute signatureVersion * @return [String] the signature version to sign requests with (overriding * the API configuration). Possible values are: 'v2', 'v3', 'v4'. * * @!attribute signatureCache * @return [Boolean] whether the signature to sign requests with (overriding * the API configuration) is cached. Only applies to the signature version 'v4'. * Defaults to `true`. * * @!attribute endpointDiscoveryEnabled * @return [Boolean|undefined] whether to call operations with endpoints * given by service dynamically. Setting this config to `true` will enable * endpoint discovery for all applicable operations. Setting it to `false` * will explicitly disable endpoint discovery even though operations that * require endpoint discovery will presumably fail. Leaving it to * `undefined` means SDK only do endpoint discovery when it's required. * Defaults to `undefined` * * @!attribute endpointCacheSize * @return [Number] the size of the global cache storing endpoints from endpoint * discovery operations. Once endpoint cache is created, updating this setting * cannot change existing cache size. * Defaults to 1000 * * @!attribute hostPrefixEnabled * @return [Boolean] whether to marshal request parameters to the prefix of * hostname. Defaults to `true`. * * @!attribute stsRegionalEndpoints * @return ['legacy'|'regional'] whether to send sts request to global endpoints or * regional endpoints. * Defaults to 'legacy' */ AWS.Config = AWS.util.inherit({ /** * @!endgroup */ /** * Creates a new configuration object. This is the object that passes * option data along to service requests, including credentials, security, * region information, and some service specific settings. * * @example Creating a new configuration object with credentials and region * var config = new AWS.Config({ * accessKeyId: 'AKID', secretAccessKey: 'SECRET', region: 'us-west-2' * }); * @option options accessKeyId [String] your AWS access key ID. * @option options secretAccessKey [String] your AWS secret access key. * @option options sessionToken [AWS.Credentials] the optional AWS * session token to sign requests with. * @option options credentials [AWS.Credentials] the AWS credentials * to sign requests with. You can either specify this object, or * specify the accessKeyId and secretAccessKey options directly. * @option options credentialProvider [AWS.CredentialProviderChain] the * provider chain used to resolve credentials if no static `credentials` * property is set. * @option options region [String] the region to send service requests to. * See {region} for more information. * @option options maxRetries [Integer] the maximum amount of retries to * attempt with a request. See {maxRetries} for more information. * @option options maxRedirects [Integer] the maximum amount of redirects to * follow with a request. See {maxRedirects} for more information. * @option options sslEnabled [Boolean] whether to enable SSL for * requests. * @option options paramValidation [Boolean|map] whether input parameters * should be validated against the operation description before sending * the request. Defaults to true. Pass a map to enable any of the * following specific validation features: * * * **min** [Boolean] — Validates that a value meets the min * constraint. This is enabled by default when paramValidation is set * to `true`. * * **max** [Boolean] — Validates that a value meets the max * constraint. * * **pattern** [Boolean] — Validates that a string value matches a * regular expression. * * **enum** [Boolean] — Validates that a string value matches one * of the allowable enum values. * @option options computeChecksums [Boolean] whether to compute checksums * for payload bodies when the service accepts it (currently supported * in S3 only) * @option options convertResponseTypes [Boolean] whether types are converted * when parsing response data. Currently only supported for JSON based * services. Turning this off may improve performance on large response * payloads. Defaults to `true`. * @option options correctClockSkew [Boolean] whether to apply a clock skew * correction and retry requests that fail because of an skewed client * clock. Defaults to `false`. * @option options s3ForcePathStyle [Boolean] whether to force path * style URLs for S3 objects. * @option options s3BucketEndpoint [Boolean] whether the provided endpoint * addresses an individual bucket (false if it addresses the root API * endpoint). Note that setting this configuration option requires an * `endpoint` to be provided explicitly to the service constructor. * @option options s3DisableBodySigning [Boolean] whether S3 body signing * should be disabled when using signature version `v4`. Body signing * can only be disabled when using https. Defaults to `true`. * @option options s3UsEast1RegionalEndpoint ['legacy'|'regional'] when region * is set to 'us-east-1', whether to send s3 request to global endpoints or * 'us-east-1' regional endpoints. This config is only applicable to S3 client. * Defaults to `legacy` * @option options s3UseArnRegion [Boolean] whether to override the request region * with the region inferred from requested resource's ARN. Only available for S3 buckets * Defaults to `true` * * @option options retryDelayOptions [map] A set of options to configure * the retry delay on retryable errors. Currently supported options are: * * * **base** [Integer] — The base number of milliseconds to use in the * exponential backoff for operation retries. Defaults to 100 ms for all * services except DynamoDB, where it defaults to 50ms. * * **customBackoff ** [function] — A custom function that accepts a * retry count and error and returns the amount of time to delay in * milliseconds. If the result is a non-zero negative value, no further * retry attempts will be made. The `base` option will be ignored if this * option is supplied. The function is only called for retryable errors. * @option options httpOptions [map] A set of options to pass to the low-level * HTTP request. Currently supported options are: * * * **proxy** [String] — the URL to proxy requests through * * **agent** [http.Agent, https.Agent] — the Agent object to perform * HTTP requests with. Used for connection pooling. Defaults to the global * agent (`http.globalAgent`) for non-SSL connections. Note that for * SSL connections, a special Agent object is used in order to enable * peer certificate verification. This feature is only available in the * Node.js environment. * * **connectTimeout** [Integer] — Sets the socket to timeout after * failing to establish a connection with the server after * `connectTimeout` milliseconds. This timeout has no effect once a socket * connection has been established. * * **timeout** [Integer] — Sets the socket to timeout after timeout * milliseconds of inactivity on the socket. Defaults to two minutes * (120000). * * **xhrAsync** [Boolean] — Whether the SDK will send asynchronous * HTTP requests. Used in the browser environment only. Set to false to * send requests synchronously. Defaults to true (async on). * * **xhrWithCredentials** [Boolean] — Sets the "withCredentials" * property of an XMLHttpRequest object. Used in the browser environment * only. Defaults to false. * @option options apiVersion [String, Date] a String in YYYY-MM-DD format * (or a date) that represents the latest possible API version that can be * used in all services (unless overridden by `apiVersions`). Specify * 'latest' to use the latest possible version. * @option options apiVersions [map] a map of service * identifiers (the lowercase service class name) with the API version to * use when instantiating a service. Specify 'latest' for each individual * that can use the latest available version. * @option options logger [#write,#log] an object that responds to .write() * (like a stream) or .log() (like the console object) in order to log * information about requests * @option options systemClockOffset [Number] an offset value in milliseconds * to apply to all signing times. Use this to compensate for clock skew * when your system may be out of sync with the service time. Note that * this configuration option can only be applied to the global `AWS.config` * object and cannot be overridden in service-specific configuration. * Defaults to 0 milliseconds. * @option options signatureVersion [String] the signature version to sign * requests with (overriding the API configuration). Possible values are: * 'v2', 'v3', 'v4'. * @option options signatureCache [Boolean] whether the signature to sign * requests with (overriding the API configuration) is cached. Only applies * to the signature version 'v4'. Defaults to `true`. * @option options dynamoDbCrc32 [Boolean] whether to validate the CRC32 * checksum of HTTP response bodies returned by DynamoDB. Default: `true`. * @option options useAccelerateEndpoint [Boolean] Whether to use the * S3 Transfer Acceleration endpoint with the S3 service. Default: `false`. * @option options clientSideMonitoring [Boolean] whether to collect and * publish this client's performance metrics of all its API requests. * @option options endpointDiscoveryEnabled [Boolean|undefined] whether to * call operations with endpoints given by service dynamically. Setting this * config to `true` will enable endpoint discovery for all applicable operations. * Setting it to `false` will explicitly disable endpoint discovery even though * operations that require endpoint discovery will presumably fail. Leaving it * to `undefined` means SDK will only do endpoint discovery when it's required. * Defaults to `undefined` * @option options endpointCacheSize [Number] the size of the global cache storing * endpoints from endpoint discovery operations. Once endpoint cache is created, * updating this setting cannot change existing cache size. * Defaults to 1000 * @option options hostPrefixEnabled [Boolean] whether to marshal request * parameters to the prefix of hostname. * Defaults to `true`. * @option options stsRegionalEndpoints ['legacy'|'regional'] whether to send sts request * to global endpoints or regional endpoints. * Defaults to 'legacy'. */ constructor: function Config(options) { if (options === undefined) options = {}; options = this.extractCredentials(options); AWS.util.each.call(this, this.keys, function (key, value) { this.set(key, options[key], value); }); }, /** * @!group Managing Credentials */ /** * Loads credentials from the configuration object. This is used internally * by the SDK to ensure that refreshable {Credentials} objects are properly * refreshed and loaded when sending a request. If you want to ensure that * your credentials are loaded prior to a request, you can use this method * directly to provide accurate credential data stored in the object. * * @note If you configure the SDK with static or environment credentials, * the credential data should already be present in {credentials} attribute. * This method is primarily necessary to load credentials from asynchronous * sources, or sources that can refresh credentials periodically. * @example Getting your access key * AWS.config.getCredentials(function(err) { * if (err) console.log(err.stack); // credentials not loaded * else console.log("Access Key:", AWS.config.credentials.accessKeyId); * }) * @callback callback function(err) * Called when the {credentials} have been properly set on the configuration * object. * * @param err [Error] if this is set, credentials were not successfully * loaded and this error provides information why. * @see credentials * @see Credentials */ getCredentials: function getCredentials(callback) { var self = this; function finish(err) { callback(err, err ? null : self.credentials); } function credError(msg, err) { return new AWS.util.error(err || new Error(), { code: 'CredentialsError', message: msg, name: 'CredentialsError' }); } function getAsyncCredentials() { self.credentials.get(function(err) { if (err) { var msg = 'Could not load credentials from ' + self.credentials.constructor.name; err = credError(msg, err); } finish(err); }); } function getStaticCredentials() { var err = null; if (!self.credentials.accessKeyId || !self.credentials.secretAccessKey) { err = credError('Missing credentials'); } finish(err); } if (self.credentials) { if (typeof self.credentials.get === 'function') { getAsyncCredentials(); } else { // static credentials getStaticCredentials(); } } else if (self.credentialProvider) { self.credentialProvider.resolve(function(err, creds) { if (err) { err = credError('Could not load credentials from any providers', err); } self.credentials = creds; finish(err); }); } else { finish(credError('No credentials to load')); } }, /** * @!group Loading and Setting Configuration Options */ /** * @overload update(options, allowUnknownKeys = false) * Updates the current configuration object with new options. * * @example Update maxRetries property of a configuration object * config.update({maxRetries: 10}); * @param [Object] options a map of option keys and values. * @param [Boolean] allowUnknownKeys whether unknown keys can be set on * the configuration object. Defaults to `false`. * @see constructor */ update: function update(options, allowUnknownKeys) { allowUnknownKeys = allowUnknownKeys || false; options = this.extractCredentials(options); AWS.util.each.call(this, options, function (key, value) { if (allowUnknownKeys || Object.prototype.hasOwnProperty.call(this.keys, key) || AWS.Service.hasService(key)) { this.set(key, value); } }); }, /** * Loads configuration data from a JSON file into this config object. * @note Loading configuration will reset all existing configuration * on the object. * @!macro nobrowser * @param path [String] the path relative to your process's current * working directory to load configuration from. * @return [AWS.Config] the same configuration object */ loadFromPath: function loadFromPath(path) { this.clear(); var options = JSON.parse(AWS.util.readFileSync(path)); var fileSystemCreds = new AWS.FileSystemCredentials(path); var chain = new AWS.CredentialProviderChain(); chain.providers.unshift(fileSystemCreds); chain.resolve(function (err, creds) { if (err) throw err; else options.credentials = creds; }); this.constructor(options); return this; }, /** * Clears configuration data on this object * * @api private */ clear: function clear() { /*jshint forin:false */ AWS.util.each.call(this, this.keys, function (key) { delete this[key]; }); // reset credential provider this.set('credentials', undefined); this.set('credentialProvider', undefined); }, /** * Sets a property on the configuration object, allowing for a * default value * @api private */ set: function set(property, value, defaultValue) { if (value === undefined) { if (defaultValue === undefined) { defaultValue = this.keys[property]; } if (typeof defaultValue === 'function') { this[property] = defaultValue.call(this); } else { this[property] = defaultValue; } } else if (property === 'httpOptions' && this[property]) { // deep merge httpOptions this[property] = AWS.util.merge(this[property], value); } else { this[property] = value; } }, /** * All of the keys with their default values. * * @constant * @api private */ keys: { credentials: null, credentialProvider: null, region: null, logger: null, apiVersions: {}, apiVersion: null, endpoint: undefined, httpOptions: { timeout: 120000 }, maxRetries: undefined, maxRedirects: 10, paramValidation: true, sslEnabled: true, s3ForcePathStyle: false, s3BucketEndpoint: false, s3DisableBodySigning: true, s3UsEast1RegionalEndpoint: 'legacy', s3UseArnRegion: undefined, computeChecksums: true, convertResponseTypes: true, correctClockSkew: false, customUserAgent: null, dynamoDbCrc32: true, systemClockOffset: 0, signatureVersion: null, signatureCache: true, retryDelayOptions: {}, useAccelerateEndpoint: false, clientSideMonitoring: false, endpointDiscoveryEnabled: undefined, endpointCacheSize: 1000, hostPrefixEnabled: true, stsRegionalEndpoints: 'legacy' }, /** * Extracts accessKeyId, secretAccessKey and sessionToken * from a configuration hash. * * @api private */ extractCredentials: function extractCredentials(options) { if (options.accessKeyId && options.secretAccessKey) { options = AWS.util.copy(options); options.credentials = new AWS.Credentials(options); } return options; }, /** * Sets the promise dependency the SDK will use wherever Promises are returned. * Passing `null` will force the SDK to use native Promises if they are available. * If native Promises are not available, passing `null` will have no effect. * @param [Constructor] dep A reference to a Promise constructor */ setPromisesDependency: function setPromisesDependency(dep) { PromisesDependency = dep; // if null was passed in, we should try to use native promises if (dep === null && typeof Promise === 'function') { PromisesDependency = Promise; } var constructors = [AWS.Request, AWS.Credentials, AWS.CredentialProviderChain]; if (AWS.S3) { constructors.push(AWS.S3); if (AWS.S3.ManagedUpload) { constructors.push(AWS.S3.ManagedUpload); } } AWS.util.addPromises(constructors, PromisesDependency); }, /** * Gets the promise dependency set by `AWS.config.setPromisesDependency`. */ getPromisesDependency: function getPromisesDependency() { return PromisesDependency; } }); /** * @return [AWS.Config] The global configuration object singleton instance * @readonly * @see AWS.Config */ AWS.config = new AWS.Config(); /***/ }), /***/ 85566: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { var AWS = __webpack_require__(28437); /** * @api private */ function validateRegionalEndpointsFlagValue(configValue, errorOptions) { if (typeof configValue !== 'string') return undefined; else if (['legacy', 'regional'].indexOf(configValue.toLowerCase()) >= 0) { return configValue.toLowerCase(); } else { throw AWS.util.error(new Error(), errorOptions); } } /** * Resolve the configuration value for regional endpoint from difference sources: client * config, environmental variable, shared config file. Value can be case-insensitive * 'legacy' or 'reginal'. * @param originalConfig user-supplied config object to resolve * @param options a map of config property names from individual configuration source * - env: name of environmental variable that refers to the config * - sharedConfig: name of shared configuration file property that refers to the config * - clientConfig: name of client configuration property that refers to the config * * @api private */ function resolveRegionalEndpointsFlag(originalConfig, options) { originalConfig = originalConfig || {}; //validate config value var resolved; if (originalConfig[options.clientConfig]) { resolved = validateRegionalEndpointsFlagValue(originalConfig[options.clientConfig], { code: 'InvalidConfiguration', message: 'invalid "' + options.clientConfig + '" configuration. Expect "legacy" ' + ' or "regional". Got "' + originalConfig[options.clientConfig] + '".' }); if (resolved) return resolved; } if (!AWS.util.isNode()) return resolved; //validate environmental variable if (Object.prototype.hasOwnProperty.call(process.env, options.env)) { var envFlag = process.env[options.env]; resolved = validateRegionalEndpointsFlagValue(envFlag, { code: 'InvalidEnvironmentalVariable', message: 'invalid ' + options.env + ' environmental variable. Expect "legacy" ' + ' or "regional". Got "' + process.env[options.env] + '".' }); if (resolved) return resolved; } //validate shared config file var profile = {}; try { var profiles = AWS.util.getProfilesFromSharedConfig(AWS.util.iniLoader); profile = profiles[process.env.AWS_PROFILE || AWS.util.defaultProfile]; } catch (e) {}; if (profile && Object.prototype.hasOwnProperty.call(profile, options.sharedConfig)) { var fileFlag = profile[options.sharedConfig]; resolved = validateRegionalEndpointsFlagValue(fileFlag, { code: 'InvalidConfiguration', message: 'invalid ' + options.sharedConfig + ' profile config. Expect "legacy" ' + ' or "regional". Got "' + profile[options.sharedConfig] + '".' }); if (resolved) return resolved; } return resolved; } module.exports = resolveRegionalEndpointsFlag; /***/ }), /***/ 28437: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { /** * The main AWS namespace */ var AWS = { util: __webpack_require__(77985) }; /** * @api private * @!macro [new] nobrowser * @note This feature is not supported in the browser environment of the SDK. */ var _hidden = {}; _hidden.toString(); // hack to parse macro /** * @api private */ module.exports = AWS; AWS.util.update(AWS, { /** * @constant */ VERSION: '2.889.0', /** * @api private */ Signers: {}, /** * @api private */ Protocol: { Json: __webpack_require__(30083), Query: __webpack_require__(90761), Rest: __webpack_require__(98200), RestJson: __webpack_require__(5883), RestXml: __webpack_require__(15143) }, /** * @api private */ XML: { Builder: __webpack_require__(23546), Parser: null // conditionally set based on environment }, /** * @api private */ JSON: { Builder: __webpack_require__(47495), Parser: __webpack_require__(5474) }, /** * @api private */ Model: { Api: __webpack_require__(17657), Operation: __webpack_require__(28083), Shape: __webpack_require__(71349), Paginator: __webpack_require__(45938), ResourceWaiter: __webpack_require__(41368) }, /** * @api private */ apiLoader: __webpack_require__(52793), /** * @api private */ EndpointCache: __webpack_require__(96323)/* .EndpointCache */ .$ }); __webpack_require__(55948); __webpack_require__(68903); __webpack_require__(38110); __webpack_require__(1556); __webpack_require__(54995); __webpack_require__(78652); __webpack_require__(58743); __webpack_require__(39925); __webpack_require__(9897); __webpack_require__(99127); /** * @readonly * @return [AWS.SequentialExecutor] a collection of global event listeners that * are attached to every sent request. * @see AWS.Request AWS.Request for a list of events to listen for * @example Logging the time taken to send a request * AWS.events.on('send', function startSend(resp) { * resp.startTime = new Date().getTime(); * }).on('complete', function calculateTime(resp) { * var time = (new Date().getTime() - resp.startTime) / 1000; * console.log('Request took ' + time + ' seconds'); * }); * * new AWS.S3().listBuckets(); // prints 'Request took 0.285 seconds' */ AWS.events = new AWS.SequentialExecutor(); //create endpoint cache lazily AWS.util.memoizedProperty(AWS, 'endpointCache', function() { return new AWS.EndpointCache(AWS.config.endpointCacheSize); }, true); /***/ }), /***/ 53819: /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => { var AWS = __webpack_require__(28437); /** * Represents your AWS security credentials, specifically the * {accessKeyId}, {secretAccessKey}, and optional {sessionToken}. * Creating a `Credentials` object allows you to pass around your * security information to configuration and service objects. * * Note that this class typically does not need to be constructed manually, * as the {AWS.Config} and {AWS.Service} classes both accept simple * options hashes with the three keys. These structures will be converted * into Credentials objects automatically. * * ## Expiring and Refreshing Credentials * * Occasionally credentials can expire in the middle of a long-running * application. In this case, the SDK will automatically attempt to * refresh the credentials from the storage location if the Credentials * class implements the {refresh} method. * * If you are implementing a credential storage location, you * will want to create a subclass of the `Credentials` class and * override the {refresh} method. This method allows credentials to be * retrieved from the backing store, be it a file system, database, or * some network storage. The method should reset the credential attributes * on the object. * * @!attribute expired * @return [Boolean] whether the credentials have been expired and * require a refresh. Used in conjunction with {expireTime}. * @!attribute expireTime * @return [Date] a time when credentials should be considered expired. Used * in conjunction with {expired}. * @!attribute accessKeyId * @return [String] the AWS access key ID * @!attribute secretAccessKey * @return [String] the AWS secret access key * @!attribute sessionToken * @return [String] an optional AWS session token */ AWS.Credentials = AWS.util.inherit({ /** * A credentials object can be created using positional arguments or an options * hash. * * @overload AWS.Credentials(accessKeyId, secretAccessKey, sessionToken=null) * Creates a Credentials object with a given set of credential information * as positional arguments. * @param accessKeyId [String] the AWS access key ID * @param secretAccessKey [String] the AWS secret access key * @param sessionToken [String] the optional AWS session token * @example Create a credentials object with AWS credentials * var creds = new AWS.Credentials('akid', 'secret', 'session'); * @overload AWS.Credentials(options) * Creates a Credentials object with a given set of credential information * as an options hash. * @option options accessKeyId [String] the AWS access key ID * @option options secretAccessKey [String] the AWS secret access key * @option options sessionToken [String] the optional AWS session token * @example Create a credentials object with AWS credentials * var creds = new AWS.Credentials({ * accessKeyId: 'akid', secretAccessKey: 'secret', sessionToken: 'session' * }); */ constructor: function Credentials() { // hide secretAccessKey from being displayed with util.inspect AWS.util.hideProperties(this, ['secretAccessKey']); this.expired = false; this.expireTime = null; this.refreshCallbacks = []; if (arguments.length === 1 && typeof arguments[0] === 'object') { var creds = arguments[0].credentials || arguments[0]; this.accessKeyId = creds.accessKeyId; this.secretAccessKey = creds.secretAccessKey; this.sessionToken = creds.sessionToken; } else { this.accessKeyId = arguments[0]; this.secretAccessKey = arguments[1]; this.sessionToken = arguments[2]; } }, /** * @return [Integer] the number of seconds before {expireTime} during which * the credentials will be considered expired. */ expiryWindow: 15, /** * @return [Boolean] whether the credentials object should call {refresh} * @note Subclasses should override this method to provide custom refresh * logic. */ needsRefresh: function needsRefresh() { var currentTime = AWS.util.date.getDate().getTime(); var adjustedTime = new Date(currentTime + this.expiryWindow * 1000); if (this.expireTime && adjustedTime > this.expireTime) { return true; } else { return this.expired || !this.accessKeyId || !this.secretAccessKey; } }, /** * Gets the existing credentials, refreshing them if they are not yet loaded * or have expired. Users should call this method before using {refresh}, * as this will not attempt to reload credentials when they are already * loaded into the object. * * @callback callback function(err) * When this callback is called with no error, it means either credentials * do not need to be refreshed or refreshed credentials information has * been loaded into the object (as the `accessKeyId`, `secretAccessKey`, * and `sessionToken` properties). * @param err [Error] if an error occurred, this value will be filled */ get: function get(callback) { var self = this; if (this.needsRefresh()) { this.refresh(function(err) { if (!err) self.expired = false; // reset expired flag if (callback) callback(err); }); } else if (callback) { callback(); } }, /** * @!method getPromise() * Returns a 'thenable' promise. * Gets the existing credentials, refreshing them if they are not yet loaded * or have expired. Users should call this method before using {refresh}, * as this will not attempt to reload credentials when they are already * loaded into the object. * * Two callbacks can be provided to the `then` method on the returned promise. * The first callback will be called if the promise is fulfilled, and the second * callback will be called if the promise is rejected. * @callback fulfilledCallback function() * Called if the promise is fulfilled. When this callback is called, it * means either credentials do not need to be refreshed or refreshed * credentials information has been loaded into the object (as the * `accessKeyId`, `secretAccessKey`, and `sessionToken` properties). * @callback rejectedCallback function(err) * Called if the promise is rejected. * @param err [Error] if an error occurred, this value will be filled * @return [Promise] A promise that represents the state of the `get` call. * @example Calling the `getPromise` method. * var promise = credProvider.getPromise(); * promise.then(function() { ... }, function(err) { ... }); */ /** * @!method refreshPromise() * Returns a 'thenable' promise. * Refreshes the credentials. Users should call {get} before attempting * to forcibly refresh credentials. * * Two callbacks can be provided to the `then` method on the returned promise. * The first callback will be called if the promise is fulfilled, and the second * callback will be called if the promise is rejected. * @callback fulfilledCallback function() * Called if the promise is fulfilled. When this callback is called, it * means refreshed credentials information has been loaded into the object * (as the `accessKeyId`, `secretAccessKey`, and `sessionToken` properties). * @callback rejectedCallback function(err) * Called if the promise is rejected. * @param err [Error] if an error occurred, this value will be filled * @return [Promise] A promise that represents the state of the `refresh` call. * @example Calling the `refreshPromise` method. * var promise = credProvider.refreshPromise(); * promise.then(function() { ... }, function(err) { ... }); */ /** * Refreshes the credentials. Users should call {get} before attempting * to forcibly refresh credentials. * * @callback callback function(err) * When this callback is called with no error, it means refreshed * credentials information has been loaded into the object (as the * `accessKeyId`, `secretAccessKey`, and `sessionToken` properties). * @param err [Error] if an error occurred, this value will be filled * @note Subclasses should override this class to reset the * {accessKeyId}, {secretAccessKey} and optional {sessionToken} * on the credentials object and then call the callback with * any error information. * @see get */ refresh: function refresh(callback) { this.expired = false; callback(); }, /** * @api private * @param callback */ coalesceRefresh: function coalesceRefresh(callback, sync) { var self = this; if (self.refreshCallbacks.push(callback) === 1) { self.load(function onLoad(err) { AWS.util.arrayEach(self.refreshCallbacks, function(callback) { if (sync) { callback(err); } else { // callback could throw, so defer to ensure all callbacks are notified AWS.util.defer(function () { callback(err); }); } }); self.refreshCallbacks.length = 0; }); } }, /** * @api private * @param callback */ load: function load(callback) { callback(); } }); /** * @api private */ AWS.Credentials.addPromisesToClass = function addPromisesToClass(PromiseDependency) { this.prototype.getPromise = AWS.util.promisifyMethod('get', PromiseDependency); this.prototype.refreshPromise = AWS.util.promisifyMethod('refresh', PromiseDependency); }; /** * @api private */ AWS.Credentials.deletePromisesFromClass = function deletePromisesFromClass() { delete this.prototype.getPromise; delete this.prototype.refreshPromise; }; AWS.util.addPromises(AWS.Credentials); /***/ }), /***/ 44694: /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => { var AWS = __webpack_require__(28437); var STS = __webpack_require__(57513); /** * Represents temporary credentials retrieved from {AWS.STS}. Without any * extra parameters, credentials will be fetched from the * {AWS.STS.getSessionToken} operation. If an IAM role is provided, the * {AWS.STS.assumeRole} operation will be used to fetch credentials for the * role instead. * * AWS.ChainableTemporaryCredentials differs from AWS.TemporaryCredentials in * the way masterCredentials and refreshes are handled. * AWS.ChainableTemporaryCredentials refreshes expired credentials using the * masterCredentials passed by the user to support chaining of STS credentials. * However, AWS.TemporaryCredentials recursively collapses the masterCredentials * during instantiation, precluding the ability to refresh credentials which * require intermediate, temporary credentials. * * For example, if the application should use RoleA, which must be assumed from * RoleB, and the environment provides credentials which can assume RoleB, then * AWS.ChainableTemporaryCredentials must be used to support refreshing the * temporary credentials for RoleA: * * ```javascript * var roleACreds = new AWS.ChainableTemporaryCredentials({ * params: {RoleArn: 'RoleA'}, * masterCredentials: new AWS.ChainableTemporaryCredentials({ * params: {RoleArn: 'RoleB'}, * masterCredentials: new AWS.EnvironmentCredentials('AWS') * }) * }); * ``` * * If AWS.TemporaryCredentials had been used in the previous example, * `roleACreds` would fail to refresh because `roleACreds` would * use the environment credentials for the AssumeRole request. * * Another difference is that AWS.ChainableTemporaryCredentials creates the STS * service instance during instantiation while AWS.TemporaryCredentials creates * the STS service instance during the first refresh. Creating the service * instance during instantiation effectively captures the master credentials * from the global config, so that subsequent changes to the global config do * not affect the master credentials used to refresh the temporary credentials. * * This allows an instance of AWS.ChainableTemporaryCredentials to be assigned * to AWS.config.credentials: * * ```javascript * var envCreds = new AWS.EnvironmentCredentials('AWS'); * AWS.config.credentials = envCreds; * // masterCredentials will be envCreds * AWS.config.credentials = new AWS.ChainableTemporaryCredentials({ * params: {RoleArn: '...'} * }); * ``` * * Similarly, to use the CredentialProviderChain's default providers as the * master credentials, simply create a new instance of * AWS.ChainableTemporaryCredentials: * * ```javascript * AWS.config.credentials = new ChainableTemporaryCredentials({ * params: {RoleArn: '...'} * }); * ``` * * @!attribute service * @return [AWS.STS] the STS service instance used to * get and refresh temporary credentials from AWS STS. * @note (see constructor) */ AWS.ChainableTemporaryCredentials = AWS.util.inherit(AWS.Credentials, { /** * Creates a new temporary credentials object. * * @param options [map] a set of options * @option options params [map] ({}) a map of options that are passed to the * {AWS.STS.assumeRole} or {AWS.STS.getSessionToken} operations. * If a `RoleArn` parameter is passed in, credentials will be based on the * IAM role. If a `SerialNumber` parameter is passed in, {tokenCodeFn} must * also be passed in or an error will be thrown. * @option options masterCredentials [AWS.Credentials] the master credentials * used to get and refresh temporary credentials from AWS STS. By default, * AWS.config.credentials or AWS.config.credentialProvider will be used. * @option options tokenCodeFn [Function] (null) Function to provide * `TokenCode`, if `SerialNumber` is provided for profile in {params}. Function * is called with value of `SerialNumber` and `callback`, and should provide * the `TokenCode` or an error to the callback in the format * `callback(err, token)`. * @example Creating a new credentials object for generic temporary credentials * AWS.config.credentials = new AWS.ChainableTemporaryCredentials(); * @example Creating a new credentials object for an IAM role * AWS.config.credentials = new AWS.ChainableTemporaryCredentials({ * params: { * RoleArn: 'arn:aws:iam::1234567890:role/TemporaryCredentials' * } * }); * @see AWS.STS.assumeRole * @see AWS.STS.getSessionToken */ constructor: function ChainableTemporaryCredentials(options) { AWS.Credentials.call(this); options = options || {}; this.errorCode = 'ChainableTemporaryCredentialsProviderFailure'; this.expired = true; this.tokenCodeFn = null; var params = AWS.util.copy(options.params) || {}; if (params.RoleArn) { params.RoleSessionName = params.RoleSessionName || 'temporary-credentials'; } if (params.SerialNumber) { if (!options.tokenCodeFn || (typeof options.tokenCodeFn !== 'function')) { throw new AWS.util.error( new Error('tokenCodeFn must be a function when params.SerialNumber is given'), {code: this.errorCode} ); } else { this.tokenCodeFn = options.tokenCodeFn; } } var config = AWS.util.merge( { params: params, credentials: options.masterCredentials || AWS.config.credentials }, options.stsConfig || {} ); this.service = new STS(config); }, /** * Refreshes credentials using {AWS.STS.assumeRole} or * {AWS.STS.getSessionToken}, depending on whether an IAM role ARN was passed * to the credentials {constructor}. * * @callback callback function(err) * Called when the STS service responds (or fails). When * this callback is called with no error, it means that the credentials * information has been loaded into the object (as the `accessKeyId`, * `secretAccessKey`, and `sessionToken` properties). * @param err [Error] if an error occurred, this value will be filled * @see AWS.Credentials.get */ refresh: function refresh(callback) { this.coalesceRefresh(callback || AWS.util.fn.callback); }, /** * @api private * @param callback */ load: function load(callback) { var self = this; var operation = self.service.config.params.RoleArn ? 'assumeRole' : 'getSessionToken'; this.getTokenCode(function (err, tokenCode) { var params = {}; if (err) { callback(err); return; } if (tokenCode) { params.TokenCode = tokenCode; } self.service[operation](params, function (err, data) { if (!err) { self.service.credentialsFrom(data, self); } callback(err); }); }); }, /** * @api private */ getTokenCode: function getTokenCode(callback) { var self = this; if (this.tokenCodeFn) { this.tokenCodeFn(this.service.config.params.SerialNumber, function (err, token) { if (err) { var message = err; if (err instanceof Error) { message = err.message; } callback( AWS.util.error( new Error('Error fetching MFA token: ' + message), { code: self.errorCode} ) ); return; } callback(null, token); }); } else { callback(null); } } }); /***/ }), /***/ 3498: /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => { var AWS = __webpack_require__(28437); var CognitoIdentity = __webpack_require__(58291); var STS = __webpack_require__(57513); /** * Represents credentials retrieved from STS Web Identity Federation using * the Amazon Cognito Identity service. * * By default this provider gets credentials using the * {AWS.CognitoIdentity.getCredentialsForIdentity} service operation, which * requires either an `IdentityId` or an `IdentityPoolId` (Amazon Cognito * Identity Pool ID), which is used to call {AWS.CognitoIdentity.getId} to * obtain an `IdentityId`. If the identity or identity pool is not configured in * the Amazon Cognito Console to use IAM roles with the appropriate permissions, * then additionally a `RoleArn` is required containing the ARN of the IAM trust * policy for the Amazon Cognito role that the user will log into. If a `RoleArn` * is provided, then this provider gets credentials using the * {AWS.STS.assumeRoleWithWebIdentity} service operation, after first getting an * Open ID token from {AWS.CognitoIdentity.getOpenIdToken}. * * In addition, if this credential provider is used to provide authenticated * login, the `Logins` map may be set to the tokens provided by the respective * identity providers. See {constructor} for an example on creating a credentials * object with proper property values. * * ## Refreshing Credentials from Identity Service * * In addition to AWS credentials expiring after a given amount of time, the * login token from the identity provider will also expire. Once this token * expires, it will not be usable to refresh AWS credentials, and another * token will be needed. The SDK does not manage refreshing of the token value, * but this can be done through a "refresh token" supported by most identity * providers. Consult the documentation for the identity provider for refreshing * tokens. Once the refreshed token is acquired, you should make sure to update * this new token in the credentials object's {params} property. The following * code will update the WebIdentityToken, assuming you have retrieved an updated * token from the identity provider: * * ```javascript * AWS.config.credentials.params.Logins['graph.facebook.com'] = updatedToken; * ``` * * Future calls to `credentials.refresh()` will now use the new token. * * @!attribute params * @return [map] the map of params passed to * {AWS.CognitoIdentity.getId}, * {AWS.CognitoIdentity.getOpenIdToken}, and * {AWS.STS.assumeRoleWithWebIdentity}. To update the token, set the * `params.WebIdentityToken` property. * @!attribute data * @return [map] the raw data response from the call to * {AWS.CognitoIdentity.getCredentialsForIdentity}, or * {AWS.STS.assumeRoleWithWebIdentity}. Use this if you want to get * access to other properties from the response. * @!attribute identityId * @return [String] the Cognito ID returned by the last call to * {AWS.CognitoIdentity.getOpenIdToken}. This ID represents the actual * final resolved identity ID from Amazon Cognito. */ AWS.CognitoIdentityCredentials = AWS.util.inherit(AWS.Credentials, { /** * @api private */ localStorageKey: { id: 'aws.cognito.identity-id.', providers: 'aws.cognito.identity-providers.' }, /** * Creates a new credentials object. * @example Creating a new credentials object * AWS.config.credentials = new AWS.CognitoIdentityCredentials({ * * // either IdentityPoolId or IdentityId is required * // See the IdentityPoolId param for AWS.CognitoIdentity.getID (linked below) * // See the IdentityId param for AWS.CognitoIdentity.getCredentialsForIdentity * // or AWS.CognitoIdentity.getOpenIdToken (linked below) * IdentityPoolId: 'us-east-1:1699ebc0-7900-4099-b910-2df94f52a030', * IdentityId: 'us-east-1:128d0a74-c82f-4553-916d-90053e4a8b0f' * * // optional, only necessary when the identity pool is not configured * // to use IAM roles in the Amazon Cognito Console * // See the RoleArn param for AWS.STS.assumeRoleWithWebIdentity (linked below) * RoleArn: 'arn:aws:iam::1234567890:role/MYAPP-CognitoIdentity', * * // optional tokens, used for authenticated login * // See the Logins param for AWS.CognitoIdentity.getID (linked below) * Logins: { * 'graph.facebook.com': 'FBTOKEN', * 'www.amazon.com': 'AMAZONTOKEN', * 'accounts.google.com': 'GOOGLETOKEN', * 'api.twitter.com': 'TWITTERTOKEN', * 'www.digits.com': 'DIGITSTOKEN' * }, * * // optional name, defaults to web-identity * // See the RoleSessionName param for AWS.STS.assumeRoleWithWebIdentity (linked below) * RoleSessionName: 'web', * * // optional, only necessary when application runs in a browser * // and multiple users are signed in at once, used for caching * LoginId: 'example@gmail.com' * * }, { * // optionally provide configuration to apply to the underlying service clients * // if configuration is not provided, then configuration will be pulled from AWS.config * * // region should match the region your identity pool is located in * region: 'us-east-1', * * // specify timeout options * httpOptions: { * timeout: 100 * } * }); * @see AWS.CognitoIdentity.getId * @see AWS.CognitoIdentity.getCredentialsForIdentity * @see AWS.STS.assumeRoleWithWebIdentity * @see AWS.CognitoIdentity.getOpenIdToken * @see AWS.Config * @note If a region is not provided in the global AWS.config, or * specified in the `clientConfig` to the CognitoIdentityCredentials * constructor, you may encounter a 'Missing credentials in config' error * when calling making a service call. */ constructor: function CognitoIdentityCredentials(params, clientConfig) { AWS.Credentials.call(this); this.expired = true; this.params = params; this.data = null; this._identityId = null; this._clientConfig = AWS.util.copy(clientConfig || {}); this.loadCachedId(); var self = this; Object.defineProperty(this, 'identityId', { get: function() { self.loadCachedId(); return self._identityId || self.params.IdentityId; }, set: function(identityId) { self._identityId = identityId; } }); }, /** * Refreshes credentials using {AWS.CognitoIdentity.getCredentialsForIdentity}, * or {AWS.STS.assumeRoleWithWebIdentity}. * * @callback callback function(err) * Called when the STS service responds (or fails). When * this callback is called with no error, it means that the credentials * information has been loaded into the object (as the `accessKeyId`, * `secretAccessKey`, and `sessionToken` properties). * @param err [Error] if an error occurred, this value will be filled * @see AWS.Credentials.get */ refresh: function refresh(callback) { this.coalesceRefresh(callback || AWS.util.fn.callback); }, /** * @api private * @param callback */ load: function load(callback) { var self = this; self.createClients(); self.data = null; self._identityId = null; self.getId(function(err) { if (!err) { if (!self.params.RoleArn) { self.getCredentialsForIdentity(callback); } else { self.getCredentialsFromSTS(callback); } } else { self.clearIdOnNotAuthorized(err); callback(err); } }); }, /** * Clears the cached Cognito ID associated with the currently configured * identity pool ID. Use this to manually invalidate your cache if * the identity pool ID was deleted. */ clearCachedId: function clearCache() { this._identityId = null; delete this.params.IdentityId; var poolId = this.params.IdentityPoolId; var loginId = this.params.LoginId || ''; delete this.storage[this.localStorageKey.id + poolId + loginId]; delete this.storage[this.localStorageKey.providers + poolId + loginId]; }, /** * @api private */ clearIdOnNotAuthorized: function clearIdOnNotAuthorized(err) { var self = this; if (err.code == 'NotAuthorizedException') { self.clearCachedId(); } }, /** * Retrieves a Cognito ID, loading from cache if it was already retrieved * on this device. * * @callback callback function(err, identityId) * @param err [Error, null] an error object if the call failed or null if * it succeeded. * @param identityId [String, null] if successful, the callback will return * the Cognito ID. * @note If not loaded explicitly, the Cognito ID is loaded and stored in * localStorage in the browser environment of a device. * @api private */ getId: function getId(callback) { var self = this; if (typeof self.params.IdentityId === 'string') { return callback(null, self.params.IdentityId); } self.cognito.getId(function(err, data) { if (!err && data.IdentityId) { self.params.IdentityId = data.IdentityId; callback(null, data.IdentityId); } else { callback(err); } }); }, /** * @api private */ loadCredentials: function loadCredentials(data, credentials) { if (!data || !credentials) return; credentials.expired = false; credentials.accessKeyId = data.Credentials.AccessKeyId; credentials.secretAccessKey = data.Credentials.SecretKey; credentials.sessionToken = data.Credentials.SessionToken; credentials.expireTime = data.Credentials.Expiration; }, /** * @api private */ getCredentialsForIdentity: function getCredentialsForIdentity(callback) { var self = this; self.cognito.getCredentialsForIdentity(function(err, data) { if (!err) { self.cacheId(data); self.data = data; self.loadCredentials(self.data, self); } else { self.clearIdOnNotAuthorized(err); } callback(err); }); }, /** * @api private */ getCredentialsFromSTS: function getCredentialsFromSTS(callback) { var self = this; self.cognito.getOpenIdToken(function(err, data) { if (!err) { self.cacheId(data); self.params.WebIdentityToken = data.Token; self.webIdentityCredentials.refresh(function(webErr) { if (!webErr) { self.data = self.webIdentityCredentials.data; self.sts.credentialsFrom(self.data, self); } callback(webErr); }); } else { self.clearIdOnNotAuthorized(err); callback(err); } }); }, /** * @api private */ loadCachedId: function loadCachedId() { var self = this; // in the browser we source default IdentityId from localStorage if (AWS.util.isBrowser() && !self.params.IdentityId) { var id = self.getStorage('id'); if (id && self.params.Logins) { var actualProviders = Object.keys(self.params.Logins); var cachedProviders = (self.getStorage('providers') || '').split(','); // only load ID if at least one provider used this ID before var intersect = cachedProviders.filter(function(n) { return actualProviders.indexOf(n) !== -1; }); if (intersect.length !== 0) { self.params.IdentityId = id; } } else if (id) { self.params.IdentityId = id; } } }, /** * @api private */ createClients: function() { var clientConfig = this._clientConfig; this.webIdentityCredentials = this.webIdentityCredentials || new AWS.WebIdentityCredentials(this.params, clientConfig); if (!this.cognito) { var cognitoConfig = AWS.util.merge({}, clientConfig); cognitoConfig.params = this.params; this.cognito = new CognitoIdentity(cognitoConfig); } this.sts = this.sts || new STS(clientConfig); }, /** * @api private */ cacheId: function cacheId(data) { this._identityId = data.IdentityId; this.params.IdentityId = this._identityId; // cache this IdentityId in browser localStorage if possible if (AWS.util.isBrowser()) { this.setStorage('id', data.IdentityId); if (this.params.Logins) { this.setStorage('providers', Object.keys(this.params.Logins).join(',')); } } }, /** * @api private */ getStorage: function getStorage(key) { return this.storage[this.localStorageKey[key] + this.params.IdentityPoolId + (this.params.LoginId || '')]; }, /** * @api private */ setStorage: function setStorage(key, val) { try { this.storage[this.localStorageKey[key] + this.params.IdentityPoolId + (this.params.LoginId || '')] = val; } catch (_) {} }, /** * @api private */ storage: (function() { try { var storage = AWS.util.isBrowser() && window.localStorage !== null && typeof window.localStorage === 'object' ? window.localStorage : {}; // Test set/remove which would throw an error in Safari's private browsing storage['aws.test-storage'] = 'foobar'; delete storage['aws.test-storage']; return storage; } catch (_) { return {}; } })() }); /***/ }), /***/ 36965: /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => { var AWS = __webpack_require__(28437); /** * Creates a credential provider chain that searches for AWS credentials * in a list of credential providers specified by the {providers} property. * * By default, the chain will use the {defaultProviders} to resolve credentials. * These providers will look in the environment using the * {AWS.EnvironmentCredentials} class with the 'AWS' and 'AMAZON' prefixes. * * ## Setting Providers * * Each provider in the {providers} list should be a function that returns * a {AWS.Credentials} object, or a hardcoded credentials object. The function * form allows for delayed execution of the credential construction. * * ## Resolving Credentials from a Chain * * Call {resolve} to return the first valid credential object that can be * loaded by the provider chain. * * For example, to resolve a chain with a custom provider that checks a file * on disk after the set of {defaultProviders}: * * ```javascript * var diskProvider = new AWS.FileSystemCredentials('./creds.json'); * var chain = new AWS.CredentialProviderChain(); * chain.providers.push(diskProvider); * chain.resolve(); * ``` * * The above code will return the `diskProvider` object if the * file contains credentials and the `defaultProviders` do not contain * any credential settings. * * @!attribute providers * @return [Array] * a list of credentials objects or functions that return credentials * objects. If the provider is a function, the function will be * executed lazily when the provider needs to be checked for valid * credentials. By default, this object will be set to the * {defaultProviders}. * @see defaultProviders */ AWS.CredentialProviderChain = AWS.util.inherit(AWS.Credentials, { /** * Creates a new CredentialProviderChain with a default set of providers * specified by {defaultProviders}. */ constructor: function CredentialProviderChain(providers) { if (providers) { this.providers = providers; } else { this.providers = AWS.CredentialProviderChain.defaultProviders.slice(0); } this.resolveCallbacks = []; }, /** * @!method resolvePromise() * Returns a 'thenable' promise. * Resolves the provider chain by searching for the first set of * credentials in {providers}. * * Two callbacks can be provided to the `then` method on the returned promise. * The first callback will be called if the promise is fulfilled, and the second * callback will be called if the promise is rejected. * @callback fulfilledCallback function(credentials) * Called if the promise is fulfilled and the provider resolves the chain * to a credentials object * @param credentials [AWS.Credentials] the credentials object resolved * by the provider chain. * @callback rejectedCallback function(error) * Called if the promise is rejected. * @param err [Error] the error object returned if no credentials are found. * @return [Promise] A promise that represents the state of the `resolve` method call. * @example Calling the `resolvePromise` method. * var promise = chain.resolvePromise(); * promise.then(function(credentials) { ... }, function(err) { ... }); */ /** * Resolves the provider chain by searching for the first set of * credentials in {providers}. * * @callback callback function(err, credentials) * Called when the provider resolves the chain to a credentials object * or null if no credentials can be found. * * @param err [Error] the error object returned if no credentials are * found. * @param credentials [AWS.Credentials] the credentials object resolved * by the provider chain. * @return [AWS.CredentialProviderChain] the provider, for chaining. */ resolve: function resolve(callback) { var self = this; if (self.providers.length === 0) { callback(new Error('No providers')); return self; } if (self.resolveCallbacks.push(callback) === 1) { var index = 0; var providers = self.providers.slice(0); function resolveNext(err, creds) { if ((!err && creds) || index === providers.length) { AWS.util.arrayEach(self.resolveCallbacks, function (callback) { callback(err, creds); }); self.resolveCallbacks.length = 0; return; } var provider = providers[index++]; if (typeof provider === 'function') { creds = provider.call(); } else { creds = provider; } if (creds.get) { creds.get(function (getErr) { resolveNext(getErr, getErr ? null : creds); }); } else { resolveNext(null, creds); } } resolveNext(); } return self; } }); /** * The default set of providers used by a vanilla CredentialProviderChain. * * In the browser: * * ```javascript * AWS.CredentialProviderChain.defaultProviders = [] * ``` * * In Node.js: * * ```javascript * AWS.CredentialProviderChain.defaultProviders = [ * function () { return new AWS.EnvironmentCredentials('AWS'); }, * function () { return new AWS.EnvironmentCredentials('AMAZON'); }, * function () { return new AWS.SharedIniFileCredentials(); }, * function () { return new AWS.ECSCredentials(); }, * function () { return new AWS.ProcessCredentials(); }, * function () { return new AWS.TokenFileWebIdentityCredentials(); }, * function () { return new AWS.EC2MetadataCredentials() } * ] * ``` */ AWS.CredentialProviderChain.defaultProviders = []; /** * @api private */ AWS.CredentialProviderChain.addPromisesToClass = function addPromisesToClass(PromiseDependency) { this.prototype.resolvePromise = AWS.util.promisifyMethod('resolve', PromiseDependency); }; /** * @api private */ AWS.CredentialProviderChain.deletePromisesFromClass = function deletePromisesFromClass() { delete this.prototype.resolvePromise; }; AWS.util.addPromises(AWS.CredentialProviderChain); /***/ }), /***/ 73379: /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => { var AWS = __webpack_require__(28437); __webpack_require__(25768); /** * Represents credentials received from the metadata service on an EC2 instance. * * By default, this class will connect to the metadata service using * {AWS.MetadataService} and attempt to load any available credentials. If it * can connect, and credentials are available, these will be used with zero * configuration. * * This credentials class will by default timeout after 1 second of inactivity * and retry 3 times. * If your requests to the EC2 metadata service are timing out, you can increase * these values by configuring them directly: * * ```javascript * AWS.config.credentials = new AWS.EC2MetadataCredentials({ * httpOptions: { timeout: 5000 }, // 5 second timeout * maxRetries: 10, // retry 10 times * retryDelayOptions: { base: 200 } // see AWS.Config for information * }); * * If your requests are timing out in connecting to the metadata service, such * as when testing on a development machine, you can use the connectTimeout * option, specified in milliseconds, which also defaults to 1 second. * ``` * * @see AWS.Config.retryDelayOptions * * @!macro nobrowser */ AWS.EC2MetadataCredentials = AWS.util.inherit(AWS.Credentials, { constructor: function EC2MetadataCredentials(options) { AWS.Credentials.call(this); options = options ? AWS.util.copy(options) : {}; options = AWS.util.merge( {maxRetries: this.defaultMaxRetries}, options); if (!options.httpOptions) options.httpOptions = {}; options.httpOptions = AWS.util.merge( {timeout: this.defaultTimeout, connectTimeout: this.defaultConnectTimeout}, options.httpOptions); this.metadataService = new AWS.MetadataService(options); this.metadata = {}; }, /** * @api private */ defaultTimeout: 1000, /** * @api private */ defaultConnectTimeout: 1000, /** * @api private */ defaultMaxRetries: 3, /** * Loads the credentials from the instance metadata service * * @callback callback function(err) * Called when the instance metadata service responds (or fails). When * this callback is called with no error, it means that the credentials * information has been loaded into the object (as the `accessKeyId`, * `secretAccessKey`, and `sessionToken` properties). * @param err [Error] if an error occurred, this value will be filled * @see get */ refresh: function refresh(callback) { this.coalesceRefresh(callback || AWS.util.fn.callback); }, /** * @api private * @param callback */ load: function load(callback) { var self = this; self.metadataService.loadCredentials(function(err, creds) { if (!err) { var currentTime = AWS.util.date.getDate(); var expireTime = new Date(creds.Expiration); if (expireTime < currentTime) { err = AWS.util.error( new Error('EC2 Instance Metadata Serivce provided expired credentials'), { code: 'EC2MetadataCredentialsProviderFailure' } ); } else { self.expired = false; self.metadata = creds; self.accessKeyId = creds.AccessKeyId; self.secretAccessKey = creds.SecretAccessKey; self.sessionToken = creds.Token; self.expireTime = expireTime; } } callback(err); }); } }); /***/ }), /***/ 10645: /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => { var AWS = __webpack_require__(28437); /** * Represents credentials received from relative URI specified in the ECS container. * * This class will request refreshable credentials from the relative URI * specified by the AWS_CONTAINER_CREDENTIALS_RELATIVE_URI or the * AWS_CONTAINER_CREDENTIALS_FULL_URI environment variable. If valid credentials * are returned in the response, these will be used with zero configuration. * * This credentials class will by default timeout after 1 second of inactivity * and retry 3 times. * If your requests to the relative URI are timing out, you can increase * the value by configuring them directly: * * ```javascript * AWS.config.credentials = new AWS.ECSCredentials({ * httpOptions: { timeout: 5000 }, // 5 second timeout * maxRetries: 10, // retry 10 times * retryDelayOptions: { base: 200 } // see AWS.Config for information * }); * ``` * * @see AWS.Config.retryDelayOptions * * @!macro nobrowser */ AWS.ECSCredentials = AWS.RemoteCredentials; /***/ }), /***/ 57714: /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => { var AWS = __webpack_require__(28437); /** * Represents credentials from the environment. * * By default, this class will look for the matching environment variables * prefixed by a given {envPrefix}. The un-prefixed environment variable names * for each credential value is listed below: * * ```javascript * accessKeyId: ACCESS_KEY_ID * secretAccessKey: SECRET_ACCESS_KEY * sessionToken: SESSION_TOKEN * ``` * * With the default prefix of 'AWS', the environment variables would be: * * AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY, AWS_SESSION_TOKEN * * @!attribute envPrefix * @readonly * @return [String] the prefix for the environment variable names excluding * the separating underscore ('_'). */ AWS.EnvironmentCredentials = AWS.util.inherit(AWS.Credentials, { /** * Creates a new EnvironmentCredentials class with a given variable * prefix {envPrefix}. For example, to load credentials using the 'AWS' * prefix: * * ```javascript * var creds = new AWS.EnvironmentCredentials('AWS'); * creds.accessKeyId == 'AKID' // from AWS_ACCESS_KEY_ID env var * ``` * * @param envPrefix [String] the prefix to use (e.g., 'AWS') for environment * variables. Do not include the separating underscore. */ constructor: function EnvironmentCredentials(envPrefix) { AWS.Credentials.call(this); this.envPrefix = envPrefix; this.get(function() {}); }, /** * Loads credentials from the environment using the prefixed * environment variables. * * @callback callback function(err) * Called after the (prefixed) ACCESS_KEY_ID, SECRET_ACCESS_KEY, and * SESSION_TOKEN environment variables are read. When this callback is * called with no error, it means that the credentials information has * been loaded into the object (as the `accessKeyId`, `secretAccessKey`, * and `sessionToken` properties). * @param err [Error] if an error occurred, this value will be filled * @see get */ refresh: function refresh(callback) { if (!callback) callback = AWS.util.fn.callback; if (!process || !process.env) { callback(AWS.util.error( new Error('No process info or environment variables available'), { code: 'EnvironmentCredentialsProviderFailure' } )); return; } var keys = ['ACCESS_KEY_ID', 'SECRET_ACCESS_KEY', 'SESSION_TOKEN']; var values = []; for (var i = 0; i < keys.length; i++) { var prefix = ''; if (this.envPrefix) prefix = this.envPrefix + '_'; values[i] = process.env[prefix + keys[i]]; if (!values[i] && keys[i] !== 'SESSION_TOKEN') { callback(AWS.util.error( new Error('Variable ' + prefix + keys[i] + ' not set.'), { code: 'EnvironmentCredentialsProviderFailure' } )); return; } } this.expired = false; AWS.Credentials.apply(this, values); callback(); } }); /***/ }), /***/ 27454: /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => { var AWS = __webpack_require__(28437); /** * Represents credentials from a JSON file on disk. * If the credentials expire, the SDK can {refresh} the credentials * from the file. * * The format of the file should be similar to the options passed to * {AWS.Config}: * * ```javascript * {accessKeyId: 'akid', secretAccessKey: 'secret', sessionToken: 'optional'} * ``` * * @example Loading credentials from disk * var creds = new AWS.FileSystemCredentials('./configuration.json'); * creds.accessKeyId == 'AKID' * * @!attribute filename * @readonly * @return [String] the path to the JSON file on disk containing the * credentials. * @!macro nobrowser */ AWS.FileSystemCredentials = AWS.util.inherit(AWS.Credentials, { /** * @overload AWS.FileSystemCredentials(filename) * Creates a new FileSystemCredentials object from a filename * * @param filename [String] the path on disk to the JSON file to load. */ constructor: function FileSystemCredentials(filename) { AWS.Credentials.call(this); this.filename = filename; this.get(function() {}); }, /** * Loads the credentials from the {filename} on disk. * * @callback callback function(err) * Called after the JSON file on disk is read and parsed. When this callback * is called with no error, it means that the credentials information * has been loaded into the object (as the `accessKeyId`, `secretAccessKey`, * and `sessionToken` properties). * @param err [Error] if an error occurred, this value will be filled * @see get */ refresh: function refresh(callback) { if (!callback) callback = AWS.util.fn.callback; try { var creds = JSON.parse(AWS.util.readFileSync(this.filename)); AWS.Credentials.call(this, creds); if (!this.accessKeyId || !this.secretAccessKey) { throw AWS.util.error( new Error('Credentials not set in ' + this.filename), { code: 'FileSystemCredentialsProviderFailure' } ); } this.expired = false; callback(); } catch (err) { callback(err); } } }); /***/ }), /***/ 80371: /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => { var AWS = __webpack_require__(28437); var proc = __webpack_require__(63129); var iniLoader = AWS.util.iniLoader; /** * Represents credentials loaded from shared credentials file * (defaulting to ~/.aws/credentials or defined by the * `AWS_SHARED_CREDENTIALS_FILE` environment variable). * * ## Using process credentials * * The credentials file can specify a credential provider that executes * a given process and attempts to read its stdout to recieve a JSON payload * containing the credentials: * * [default] * credential_process = /usr/bin/credential_proc * * Automatically handles refreshing credentials if an Expiration time is * provided in the credentials payload. Credentials supplied in the same profile * will take precedence over the credential_process. * * Sourcing credentials from an external process can potentially be dangerous, * so proceed with caution. Other credential providers should be preferred if * at all possible. If using this option, you should make sure that the shared * credentials file is as locked down as possible using security best practices * for your operating system. * * ## Using custom profiles * * The SDK supports loading credentials for separate profiles. This can be done * in two ways: * * 1. Set the `AWS_PROFILE` environment variable in your process prior to * loading the SDK. * 2. Directly load the AWS.ProcessCredentials provider: * * ```javascript * var creds = new AWS.ProcessCredentials({profile: 'myprofile'}); * AWS.config.credentials = creds; * ``` * * @!macro nobrowser */ AWS.ProcessCredentials = AWS.util.inherit(AWS.Credentials, { /** * Creates a new ProcessCredentials object. * * @param options [map] a set of options * @option options profile [String] (AWS_PROFILE env var or 'default') * the name of the profile to load. * @option options filename [String] ('~/.aws/credentials' or defined by * AWS_SHARED_CREDENTIALS_FILE process env var) * the filename to use when loading credentials. * @option options callback [Function] (err) Credentials are eagerly loaded * by the constructor. When the callback is called with no error, the * credentials have been loaded successfully. */ constructor: function ProcessCredentials(options) { AWS.Credentials.call(this); options = options || {}; this.filename = options.filename; this.profile = options.profile || process.env.AWS_PROFILE || AWS.util.defaultProfile; this.get(options.callback || AWS.util.fn.noop); }, /** * @api private */ load: function load(callback) { var self = this; try { var profiles = AWS.util.getProfilesFromSharedConfig(iniLoader, this.filename); var profile = profiles[this.profile] || {}; if (Object.keys(profile).length === 0) { throw AWS.util.error( new Error('Profile ' + this.profile + ' not found'), { code: 'ProcessCredentialsProviderFailure' } ); } if (profile['credential_process']) { this.loadViaCredentialProcess(profile, function(err, data) { if (err) { callback(err, null); } else { self.expired = false; self.accessKeyId = data.AccessKeyId; self.secretAccessKey = data.SecretAccessKey; self.sessionToken = data.SessionToken; if (data.Expiration) { self.expireTime = new Date(data.Expiration); } callback(null); } }); } else { throw AWS.util.error( new Error('Profile ' + this.profile + ' did not include credential process'), { code: 'ProcessCredentialsProviderFailure' } ); } } catch (err) { callback(err); } }, /** * Executes the credential_process and retrieves * credentials from the output * @api private * @param profile [map] credentials profile * @throws ProcessCredentialsProviderFailure */ loadViaCredentialProcess: function loadViaCredentialProcess(profile, callback) { proc.exec(profile['credential_process'], function(err, stdOut, stdErr) { if (err) { callback(AWS.util.error( new Error('credential_process returned error'), { code: 'ProcessCredentialsProviderFailure'} ), null); } else { try { var credData = JSON.parse(stdOut); if (credData.Expiration) { var currentTime = AWS.util.date.getDate(); var expireTime = new Date(credData.Expiration); if (expireTime < currentTime) { throw Error('credential_process returned expired credentials'); } } if (credData.Version !== 1) { throw Error('credential_process does not return Version == 1'); } callback(null, credData); } catch (err) { callback(AWS.util.error( new Error(err.message), { code: 'ProcessCredentialsProviderFailure'} ), null); } } }); }, /** * Loads the credentials from the credential process * * @callback callback function(err) * Called after the credential process has been executed. When this * callback is called with no error, it means that the credentials * information has been loaded into the object (as the `accessKeyId`, * `secretAccessKey`, and `sessionToken` properties). * @param err [Error] if an error occurred, this value will be filled * @see get */ refresh: function refresh(callback) { iniLoader.clearCachedFiles(); this.coalesceRefresh(callback || AWS.util.fn.callback); } }); /***/ }), /***/ 88764: /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => { var AWS = __webpack_require__(28437), ENV_RELATIVE_URI = 'AWS_CONTAINER_CREDENTIALS_RELATIVE_URI', ENV_FULL_URI = 'AWS_CONTAINER_CREDENTIALS_FULL_URI', ENV_AUTH_TOKEN = 'AWS_CONTAINER_AUTHORIZATION_TOKEN', FULL_URI_UNRESTRICTED_PROTOCOLS = ['https:'], FULL_URI_ALLOWED_PROTOCOLS = ['http:', 'https:'], FULL_URI_ALLOWED_HOSTNAMES = ['localhost', '127.0.0.1'], RELATIVE_URI_HOST = '169.254.170.2'; /** * Represents credentials received from specified URI. * * This class will request refreshable credentials from the relative URI * specified by the AWS_CONTAINER_CREDENTIALS_RELATIVE_URI or the * AWS_CONTAINER_CREDENTIALS_FULL_URI environment variable. If valid credentials * are returned in the response, these will be used with zero configuration. * * This credentials class will by default timeout after 1 second of inactivity * and retry 3 times. * If your requests to the relative URI are timing out, you can increase * the value by configuring them directly: * * ```javascript * AWS.config.credentials = new AWS.RemoteCredentials({ * httpOptions: { timeout: 5000 }, // 5 second timeout * maxRetries: 10, // retry 10 times * retryDelayOptions: { base: 200 } // see AWS.Config for information * }); * ``` * * @see AWS.Config.retryDelayOptions * * @!macro nobrowser */ AWS.RemoteCredentials = AWS.util.inherit(AWS.Credentials, { constructor: function RemoteCredentials(options) { AWS.Credentials.call(this); options = options ? AWS.util.copy(options) : {}; if (!options.httpOptions) options.httpOptions = {}; options.httpOptions = AWS.util.merge( this.httpOptions, options.httpOptions); AWS.util.update(this, options); }, /** * @api private */ httpOptions: { timeout: 1000 }, /** * @api private */ maxRetries: 3, /** * @api private */ isConfiguredForEcsCredentials: function isConfiguredForEcsCredentials() { return Boolean( process && process.env && (process.env[ENV_RELATIVE_URI] || process.env[ENV_FULL_URI]) ); }, /** * @api private */ getECSFullUri: function getECSFullUri() { if (process && process.env) { var relative = process.env[ENV_RELATIVE_URI], full = process.env[ENV_FULL_URI]; if (relative) { return 'http://' + RELATIVE_URI_HOST + relative; } else if (full) { var parsed = AWS.util.urlParse(full); if (FULL_URI_ALLOWED_PROTOCOLS.indexOf(parsed.protocol) < 0) { throw AWS.util.error( new Error('Unsupported protocol: AWS.RemoteCredentials supports ' + FULL_URI_ALLOWED_PROTOCOLS.join(',') + ' only; ' + parsed.protocol + ' requested.'), { code: 'ECSCredentialsProviderFailure' } ); } if (FULL_URI_UNRESTRICTED_PROTOCOLS.indexOf(parsed.protocol) < 0 && FULL_URI_ALLOWED_HOSTNAMES.indexOf(parsed.hostname) < 0) { throw AWS.util.error( new Error('Unsupported hostname: AWS.RemoteCredentials only supports ' + FULL_URI_ALLOWED_HOSTNAMES.join(',') + ' for ' + parsed.protocol + '; ' + parsed.protocol + '//' + parsed.hostname + ' requested.'), { code: 'ECSCredentialsProviderFailure' } ); } return full; } else { throw AWS.util.error( new Error('Variable ' + ENV_RELATIVE_URI + ' or ' + ENV_FULL_URI + ' must be set to use AWS.RemoteCredentials.'), { code: 'ECSCredentialsProviderFailure' } ); } } else { throw AWS.util.error( new Error('No process info available'), { code: 'ECSCredentialsProviderFailure' } ); } }, /** * @api private */ getECSAuthToken: function getECSAuthToken() { if (process && process.env && process.env[ENV_FULL_URI]) { return process.env[ENV_AUTH_TOKEN]; } }, /** * @api private */ credsFormatIsValid: function credsFormatIsValid(credData) { return (!!credData.accessKeyId && !!credData.secretAccessKey && !!credData.sessionToken && !!credData.expireTime); }, /** * @api private */ formatCreds: function formatCreds(credData) { if (!!credData.credentials) { credData = credData.credentials; } return { expired: false, accessKeyId: credData.accessKeyId || credData.AccessKeyId, secretAccessKey: credData.secretAccessKey || credData.SecretAccessKey, sessionToken: credData.sessionToken || credData.Token, expireTime: new Date(credData.expiration || credData.Expiration) }; }, /** * @api private */ request: function request(url, callback) { var httpRequest = new AWS.HttpRequest(url); httpRequest.method = 'GET'; httpRequest.headers.Accept = 'application/json'; var token = this.getECSAuthToken(); if (token) { httpRequest.headers.Authorization = token; } AWS.util.handleRequestWithRetries(httpRequest, this, callback); }, /** * Loads the credentials from the relative URI specified by container * * @callback callback function(err) * Called when the request to the relative URI responds (or fails). When * this callback is called with no error, it means that the credentials * information has been loaded into the object (as the `accessKeyId`, * `secretAccessKey`, `sessionToken`, and `expireTime` properties). * @param err [Error] if an error occurred, this value will be filled * @see get */ refresh: function refresh(callback) { this.coalesceRefresh(callback || AWS.util.fn.callback); }, /** * @api private */ load: function load(callback) { var self = this; var fullUri; try { fullUri = this.getECSFullUri(); } catch (err) { callback(err); return; } this.request(fullUri, function(err, data) { if (!err) { try { data = JSON.parse(data); var creds = self.formatCreds(data); if (!self.credsFormatIsValid(creds)) { throw AWS.util.error( new Error('Response data is not in valid format'), { code: 'ECSCredentialsProviderFailure' } ); } AWS.util.update(self, creds); } catch (dataError) { err = dataError; } } callback(err, creds); }); } }); /***/ }), /***/ 15037: /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => { var AWS = __webpack_require__(28437); var STS = __webpack_require__(57513); /** * Represents credentials retrieved from STS SAML support. * * By default this provider gets credentials using the * {AWS.STS.assumeRoleWithSAML} service operation. This operation * requires a `RoleArn` containing the ARN of the IAM trust policy for the * application for which credentials will be given, as well as a `PrincipalArn` * representing the ARN for the SAML identity provider. In addition, the * `SAMLAssertion` must be set to the token provided by the identity * provider. See {constructor} for an example on creating a credentials * object with proper `RoleArn`, `PrincipalArn`, and `SAMLAssertion` values. * * ## Refreshing Credentials from Identity Service * * In addition to AWS credentials expiring after a given amount of time, the * login token from the identity provider will also expire. Once this token * expires, it will not be usable to refresh AWS credentials, and another * token will be needed. The SDK does not manage refreshing of the token value, * but this can be done through a "refresh token" supported by most identity * providers. Consult the documentation for the identity provider for refreshing * tokens. Once the refreshed token is acquired, you should make sure to update * this new token in the credentials object's {params} property. The following * code will update the SAMLAssertion, assuming you have retrieved an updated * token from the identity provider: * * ```javascript * AWS.config.credentials.params.SAMLAssertion = updatedToken; * ``` * * Future calls to `credentials.refresh()` will now use the new token. * * @!attribute params * @return [map] the map of params passed to * {AWS.STS.assumeRoleWithSAML}. To update the token, set the * `params.SAMLAssertion` property. */ AWS.SAMLCredentials = AWS.util.inherit(AWS.Credentials, { /** * Creates a new credentials object. * @param (see AWS.STS.assumeRoleWithSAML) * @example Creating a new credentials object * AWS.config.credentials = new AWS.SAMLCredentials({ * RoleArn: 'arn:aws:iam::1234567890:role/SAMLRole', * PrincipalArn: 'arn:aws:iam::1234567890:role/SAMLPrincipal', * SAMLAssertion: 'base64-token', // base64-encoded token from IdP * }); * @see AWS.STS.assumeRoleWithSAML */ constructor: function SAMLCredentials(params) { AWS.Credentials.call(this); this.expired = true; this.params = params; }, /** * Refreshes credentials using {AWS.STS.assumeRoleWithSAML} * * @callback callback function(err) * Called when the STS service responds (or fails). When * this callback is called with no error, it means that the credentials * information has been loaded into the object (as the `accessKeyId`, * `secretAccessKey`, and `sessionToken` properties). * @param err [Error] if an error occurred, this value will be filled * @see get */ refresh: function refresh(callback) { this.coalesceRefresh(callback || AWS.util.fn.callback); }, /** * @api private */ load: function load(callback) { var self = this; self.createClients(); self.service.assumeRoleWithSAML(function (err, data) { if (!err) { self.service.credentialsFrom(data, self); } callback(err); }); }, /** * @api private */ createClients: function() { this.service = this.service || new STS({params: this.params}); } }); /***/ }), /***/ 13754: /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => { var AWS = __webpack_require__(28437); var STS = __webpack_require__(57513); var iniLoader = AWS.util.iniLoader; var ASSUME_ROLE_DEFAULT_REGION = 'us-east-1'; /** * Represents credentials loaded from shared credentials file * (defaulting to ~/.aws/credentials or defined by the * `AWS_SHARED_CREDENTIALS_FILE` environment variable). * * ## Using the shared credentials file * * This provider is checked by default in the Node.js environment. To use the * credentials file provider, simply add your access and secret keys to the * ~/.aws/credentials file in the following format: * * [default] * aws_access_key_id = AKID... * aws_secret_access_key = YOUR_SECRET_KEY * * ## Using custom profiles * * The SDK supports loading credentials for separate profiles. This can be done * in two ways: * * 1. Set the `AWS_PROFILE` environment variable in your process prior to * loading the SDK. * 2. Directly load the AWS.SharedIniFileCredentials provider: * * ```javascript * var creds = new AWS.SharedIniFileCredentials({profile: 'myprofile'}); * AWS.config.credentials = creds; * ``` * * @!macro nobrowser */ AWS.SharedIniFileCredentials = AWS.util.inherit(AWS.Credentials, { /** * Creates a new SharedIniFileCredentials object. * * @param options [map] a set of options * @option options profile [String] (AWS_PROFILE env var or 'default') * the name of the profile to load. * @option options filename [String] ('~/.aws/credentials' or defined by * AWS_SHARED_CREDENTIALS_FILE process env var) * the filename to use when loading credentials. * @option options disableAssumeRole [Boolean] (false) True to disable * support for profiles that assume an IAM role. If true, and an assume * role profile is selected, an error is raised. * @option options preferStaticCredentials [Boolean] (false) True to * prefer static credentials to role_arn if both are present. * @option options tokenCodeFn [Function] (null) Function to provide * STS Assume Role TokenCode, if mfa_serial is provided for profile in ini * file. Function is called with value of mfa_serial and callback, and * should provide the TokenCode or an error to the callback in the format * callback(err, token) * @option options callback [Function] (err) Credentials are eagerly loaded * by the constructor. When the callback is called with no error, the * credentials have been loaded successfully. * @option options httpOptions [map] A set of options to pass to the low-level * HTTP request. Currently supported options are: * * **proxy** [String] — the URL to proxy requests through * * **agent** [http.Agent, https.Agent] — the Agent object to perform * HTTP requests with. Used for connection pooling. Defaults to the global * agent (`http.globalAgent`) for non-SSL connections. Note that for * SSL connections, a special Agent object is used in order to enable * peer certificate verification. This feature is only available in the * Node.js environment. * * **connectTimeout** [Integer] — Sets the socket to timeout after * failing to establish a connection with the server after * `connectTimeout` milliseconds. This timeout has no effect once a socket * connection has been established. * * **timeout** [Integer] — The number of milliseconds a request can * take before automatically being terminated. * Defaults to two minutes (120000). */ constructor: function SharedIniFileCredentials(options) { AWS.Credentials.call(this); options = options || {}; this.filename = options.filename; this.profile = options.profile || process.env.AWS_PROFILE || AWS.util.defaultProfile; this.disableAssumeRole = Boolean(options.disableAssumeRole); this.preferStaticCredentials = Boolean(options.preferStaticCredentials); this.tokenCodeFn = options.tokenCodeFn || null; this.httpOptions = options.httpOptions || null; this.get(options.callback || AWS.util.fn.noop); }, /** * @api private */ load: function load(callback) { var self = this; try { var profiles = AWS.util.getProfilesFromSharedConfig(iniLoader, this.filename); var profile = profiles[this.profile] || {}; if (Object.keys(profile).length === 0) { throw AWS.util.error( new Error('Profile ' + this.profile + ' not found'), { code: 'SharedIniFileCredentialsProviderFailure' } ); } /* In the CLI, the presence of both a role_arn and static credentials have different meanings depending on how many profiles have been visited. For the first profile processed, role_arn takes precedence over any static credentials, but for all subsequent profiles, static credentials are used if present, and only in their absence will the profile's source_profile and role_arn keys be used to load another set of credentials. This var is intended to yield compatible behaviour in this sdk. */ var preferStaticCredentialsToRoleArn = Boolean( this.preferStaticCredentials && profile['aws_access_key_id'] && profile['aws_secret_access_key'] ); if (profile['role_arn'] && !preferStaticCredentialsToRoleArn) { this.loadRoleProfile(profiles, profile, function(err, data) { if (err) { callback(err); } else { self.expired = false; self.accessKeyId = data.Credentials.AccessKeyId; self.secretAccessKey = data.Credentials.SecretAccessKey; self.sessionToken = data.Credentials.SessionToken; self.expireTime = data.Credentials.Expiration; callback(null); } }); return; } this.accessKeyId = profile['aws_access_key_id']; this.secretAccessKey = profile['aws_secret_access_key']; this.sessionToken = profile['aws_session_token']; if (!this.accessKeyId || !this.secretAccessKey) { throw AWS.util.error( new Error('Credentials not set for profile ' + this.profile), { code: 'SharedIniFileCredentialsProviderFailure' } ); } this.expired = false; callback(null); } catch (err) { callback(err); } }, /** * Loads the credentials from the shared credentials file * * @callback callback function(err) * Called after the shared INI file on disk is read and parsed. When this * callback is called with no error, it means that the credentials * information has been loaded into the object (as the `accessKeyId`, * `secretAccessKey`, and `sessionToken` properties). * @param err [Error] if an error occurred, this value will be filled * @see get */ refresh: function refresh(callback) { iniLoader.clearCachedFiles(); this.coalesceRefresh( callback || AWS.util.fn.callback, this.disableAssumeRole ); }, /** * @api private */ loadRoleProfile: function loadRoleProfile(creds, roleProfile, callback) { if (this.disableAssumeRole) { throw AWS.util.error( new Error('Role assumption profiles are disabled. ' + 'Failed to load profile ' + this.profile + ' from ' + creds.filename), { code: 'SharedIniFileCredentialsProviderFailure' } ); } var self = this; var roleArn = roleProfile['role_arn']; var roleSessionName = roleProfile['role_session_name']; var externalId = roleProfile['external_id']; var mfaSerial = roleProfile['mfa_serial']; var sourceProfileName = roleProfile['source_profile']; // From experimentation, the following behavior mimics the AWS CLI: // // 1. Use region from the profile if present. // 2. Otherwise fall back to N. Virginia (global endpoint). // // It is necessary to do the fallback explicitly, because if // 'AWS_STS_REGIONAL_ENDPOINTS=regional', the underlying STS client will // otherwise throw an error if region is left 'undefined'. // // Experimentation shows that the AWS CLI (tested at version 1.18.136) // ignores the following potential sources of a region for the purposes of // this AssumeRole call: // // - The [default] profile // - The AWS_REGION environment variable // // Ignoring the [default] profile for the purposes of AssumeRole is arguably // a bug in the CLI since it does use the [default] region for service // calls... but right now we're matching behavior of the other tool. var profileRegion = roleProfile['region'] || ASSUME_ROLE_DEFAULT_REGION; if (!sourceProfileName) { throw AWS.util.error( new Error('source_profile is not set using profile ' + this.profile), { code: 'SharedIniFileCredentialsProviderFailure' } ); } var sourceProfileExistanceTest = creds[sourceProfileName]; if (typeof sourceProfileExistanceTest !== 'object') { throw AWS.util.error( new Error('source_profile ' + sourceProfileName + ' using profile ' + this.profile + ' does not exist'), { code: 'SharedIniFileCredentialsProviderFailure' } ); } var sourceCredentials = new AWS.SharedIniFileCredentials( AWS.util.merge(this.options || {}, { profile: sourceProfileName, preferStaticCredentials: true }) ); this.roleArn = roleArn; var sts = new STS({ credentials: sourceCredentials, region: profileRegion, httpOptions: this.httpOptions }); var roleParams = { RoleArn: roleArn, RoleSessionName: roleSessionName || 'aws-sdk-js-' + Date.now() }; if (externalId) { roleParams.ExternalId = externalId; } if (mfaSerial && self.tokenCodeFn) { roleParams.SerialNumber = mfaSerial; self.tokenCodeFn(mfaSerial, function(err, token) { if (err) { var message; if (err instanceof Error) { message = err.message; } else { message = err; } callback( AWS.util.error( new Error('Error fetching MFA token: ' + message), { code: 'SharedIniFileCredentialsProviderFailure' } )); return; } roleParams.TokenCode = token; sts.assumeRole(roleParams, callback); }); return; } sts.assumeRole(roleParams, callback); } }); /***/ }), /***/ 77360: /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => { var AWS = __webpack_require__(28437); var STS = __webpack_require__(57513); /** * Represents temporary credentials retrieved from {AWS.STS}. Without any * extra parameters, credentials will be fetched from the * {AWS.STS.getSessionToken} operation. If an IAM role is provided, the * {AWS.STS.assumeRole} operation will be used to fetch credentials for the * role instead. * * @note AWS.TemporaryCredentials is deprecated, but remains available for * backwards compatibility. {AWS.ChainableTemporaryCredentials} is the * preferred class for temporary credentials. * * To setup temporary credentials, configure a set of master credentials * using the standard credentials providers (environment, EC2 instance metadata, * or from the filesystem), then set the global credentials to a new * temporary credentials object: * * ```javascript * // Note that environment credentials are loaded by default, * // the following line is shown for clarity: * AWS.config.credentials = new AWS.EnvironmentCredentials('AWS'); * * // Now set temporary credentials seeded from the master credentials * AWS.config.credentials = new AWS.TemporaryCredentials(); * * // subsequent requests will now use temporary credentials from AWS STS. * new AWS.S3().listBucket(function(err, data) { ... }); * ``` * * @!attribute masterCredentials * @return [AWS.Credentials] the master (non-temporary) credentials used to * get and refresh temporary credentials from AWS STS. * @note (see constructor) */ AWS.TemporaryCredentials = AWS.util.inherit(AWS.Credentials, { /** * Creates a new temporary credentials object. * * @note In order to create temporary credentials, you first need to have * "master" credentials configured in {AWS.Config.credentials}. These * master credentials are necessary to retrieve the temporary credentials, * as well as refresh the credentials when they expire. * @param params [map] a map of options that are passed to the * {AWS.STS.assumeRole} or {AWS.STS.getSessionToken} operations. * If a `RoleArn` parameter is passed in, credentials will be based on the * IAM role. * @param masterCredentials [AWS.Credentials] the master (non-temporary) credentials * used to get and refresh temporary credentials from AWS STS. * @example Creating a new credentials object for generic temporary credentials * AWS.config.credentials = new AWS.TemporaryCredentials(); * @example Creating a new credentials object for an IAM role * AWS.config.credentials = new AWS.TemporaryCredentials({ * RoleArn: 'arn:aws:iam::1234567890:role/TemporaryCredentials', * }); * @see AWS.STS.assumeRole * @see AWS.STS.getSessionToken */ constructor: function TemporaryCredentials(params, masterCredentials) { AWS.Credentials.call(this); this.loadMasterCredentials(masterCredentials); this.expired = true; this.params = params || {}; if (this.params.RoleArn) { this.params.RoleSessionName = this.params.RoleSessionName || 'temporary-credentials'; } }, /** * Refreshes credentials using {AWS.STS.assumeRole} or * {AWS.STS.getSessionToken}, depending on whether an IAM role ARN was passed * to the credentials {constructor}. * * @callback callback function(err) * Called when the STS service responds (or fails). When * this callback is called with no error, it means that the credentials * information has been loaded into the object (as the `accessKeyId`, * `secretAccessKey`, and `sessionToken` properties). * @param err [Error] if an error occurred, this value will be filled * @see get */ refresh: function refresh (callback) { this.coalesceRefresh(callback || AWS.util.fn.callback); }, /** * @api private */ load: function load (callback) { var self = this; self.createClients(); self.masterCredentials.get(function () { self.service.config.credentials = self.masterCredentials; var operation = self.params.RoleArn ? self.service.assumeRole : self.service.getSessionToken; operation.call(self.service, function (err, data) { if (!err) { self.service.credentialsFrom(data, self); } callback(err); }); }); }, /** * @api private */ loadMasterCredentials: function loadMasterCredentials (masterCredentials) { this.masterCredentials = masterCredentials || AWS.config.credentials; while (this.masterCredentials.masterCredentials) { this.masterCredentials = this.masterCredentials.masterCredentials; } if (typeof this.masterCredentials.get !== 'function') { this.masterCredentials = new AWS.Credentials(this.masterCredentials); } }, /** * @api private */ createClients: function () { this.service = this.service || new STS({params: this.params}); } }); /***/ }), /***/ 11017: /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => { var AWS = __webpack_require__(28437); var fs = __webpack_require__(35747); var STS = __webpack_require__(57513); var iniLoader = AWS.util.iniLoader; /** * Represents OIDC credentials from a file on disk * If the credentials expire, the SDK can {refresh} the credentials * from the file. * * ## Using the web identity token file * * This provider is checked by default in the Node.js environment. To use * the provider simply add your OIDC token to a file (ASCII encoding) and * share the filename in either AWS_WEB_IDENTITY_TOKEN_FILE environment * variable or web_identity_token_file shared config variable * * The file contains encoded OIDC token and the characters are * ASCII encoded. OIDC tokens are JSON Web Tokens (JWT). * JWT's are 3 base64 encoded strings joined by the '.' character. * * This class will read filename from AWS_WEB_IDENTITY_TOKEN_FILE * environment variable or web_identity_token_file shared config variable, * and get the OIDC token from filename. * It will also read IAM role to be assumed from AWS_ROLE_ARN * environment variable or role_arn shared config variable. * This provider gets credetials using the {AWS.STS.assumeRoleWithWebIdentity} * service operation * * @!macro nobrowser */ AWS.TokenFileWebIdentityCredentials = AWS.util.inherit(AWS.Credentials, { /** * @example Creating a new credentials object * AWS.config.credentials = new AWS.TokenFileWebIdentityCredentials( * // optionally provide configuration to apply to the underlying AWS.STS service client * // if configuration is not provided, then configuration will be pulled from AWS.config * { * // specify timeout options * httpOptions: { * timeout: 100 * } * }); * @see AWS.Config */ constructor: function TokenFileWebIdentityCredentials(clientConfig) { AWS.Credentials.call(this); this.data = null; this.clientConfig = AWS.util.copy(clientConfig || {}); }, /** * Returns params from environment variables * * @api private */ getParamsFromEnv: function getParamsFromEnv() { var ENV_TOKEN_FILE = 'AWS_WEB_IDENTITY_TOKEN_FILE', ENV_ROLE_ARN = 'AWS_ROLE_ARN'; if (process.env[ENV_TOKEN_FILE] && process.env[ENV_ROLE_ARN]) { return [{ envTokenFile: process.env[ENV_TOKEN_FILE], roleArn: process.env[ENV_ROLE_ARN], roleSessionName: process.env['AWS_ROLE_SESSION_NAME'] }]; } }, /** * Returns params from shared config variables * * @api private */ getParamsFromSharedConfig: function getParamsFromSharedConfig() { var profiles = AWS.util.getProfilesFromSharedConfig(iniLoader); var profileName = process.env.AWS_PROFILE || AWS.util.defaultProfile; var profile = profiles[profileName] || {}; if (Object.keys(profile).length === 0) { throw AWS.util.error( new Error('Profile ' + profileName + ' not found'), { code: 'TokenFileWebIdentityCredentialsProviderFailure' } ); } var paramsArray = []; while (!profile['web_identity_token_file'] && profile['source_profile']) { paramsArray.unshift({ roleArn: profile['role_arn'], roleSessionName: profile['role_session_name'] }); var sourceProfile = profile['source_profile']; profile = profiles[sourceProfile]; } paramsArray.unshift({ envTokenFile: profile['web_identity_token_file'], roleArn: profile['role_arn'], roleSessionName: profile['role_session_name'] }); return paramsArray; }, /** * Refreshes credentials using {AWS.STS.assumeRoleWithWebIdentity} * * @callback callback function(err) * Called when the STS service responds (or fails). When * this callback is called with no error, it means that the credentials * information has been loaded into the object (as the `accessKeyId`, * `secretAccessKey`, and `sessionToken` properties). * @param err [Error] if an error occurred, this value will be filled * @see AWS.Credentials.get */ refresh: function refresh(callback) { this.coalesceRefresh(callback || AWS.util.fn.callback); }, /** * @api private */ assumeRoleChaining: function assumeRoleChaining(paramsArray, callback) { var self = this; if (paramsArray.length === 0) { self.service.credentialsFrom(self.data, self); callback(); } else { var params = paramsArray.shift(); self.service.config.credentials = self.service.credentialsFrom(self.data, self); self.service.assumeRole( { RoleArn: params.roleArn, RoleSessionName: params.roleSessionName || 'token-file-web-identity' }, function (err, data) { self.data = null; if (err) { callback(err); } else { self.data = data; self.assumeRoleChaining(paramsArray, callback); } } ); } }, /** * @api private */ load: function load(callback) { var self = this; try { var paramsArray = self.getParamsFromEnv(); if (!paramsArray) { paramsArray = self.getParamsFromSharedConfig(); } if (paramsArray) { var params = paramsArray.shift(); var oidcToken = fs.readFileSync(params.envTokenFile, {encoding: 'ascii'}); if (!self.service) { self.createClients(); } self.service.assumeRoleWithWebIdentity( { WebIdentityToken: oidcToken, RoleArn: params.roleArn, RoleSessionName: params.roleSessionName || 'token-file-web-identity' }, function (err, data) { self.data = null; if (err) { callback(err); } else { self.data = data; self.assumeRoleChaining(paramsArray, callback); } } ); } } catch (err) { callback(err); } }, /** * @api private */ createClients: function() { if (!this.service) { var stsConfig = AWS.util.merge({}, this.clientConfig); this.service = new STS(stsConfig); // Retry in case of IDPCommunicationErrorException or InvalidIdentityToken this.service.retryableError = function(error) { if (error.code === 'IDPCommunicationErrorException' || error.code === 'InvalidIdentityToken') { return true; } else { return AWS.Service.prototype.retryableError.call(this, error); } }; } } }); /***/ }), /***/ 74998: /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => { var AWS = __webpack_require__(28437); var STS = __webpack_require__(57513); /** * Represents credentials retrieved from STS Web Identity Federation support. * * By default this provider gets credentials using the * {AWS.STS.assumeRoleWithWebIdentity} service operation. This operation * requires a `RoleArn` containing the ARN of the IAM trust policy for the * application for which credentials will be given. In addition, the * `WebIdentityToken` must be set to the token provided by the identity * provider. See {constructor} for an example on creating a credentials * object with proper `RoleArn` and `WebIdentityToken` values. * * ## Refreshing Credentials from Identity Service * * In addition to AWS credentials expiring after a given amount of time, the * login token from the identity provider will also expire. Once this token * expires, it will not be usable to refresh AWS credentials, and another * token will be needed. The SDK does not manage refreshing of the token value, * but this can be done through a "refresh token" supported by most identity * providers. Consult the documentation for the identity provider for refreshing * tokens. Once the refreshed token is acquired, you should make sure to update * this new token in the credentials object's {params} property. The following * code will update the WebIdentityToken, assuming you have retrieved an updated * token from the identity provider: * * ```javascript * AWS.config.credentials.params.WebIdentityToken = updatedToken; * ``` * * Future calls to `credentials.refresh()` will now use the new token. * * @!attribute params * @return [map] the map of params passed to * {AWS.STS.assumeRoleWithWebIdentity}. To update the token, set the * `params.WebIdentityToken` property. * @!attribute data * @return [map] the raw data response from the call to * {AWS.STS.assumeRoleWithWebIdentity}. Use this if you want to get * access to other properties from the response. */ AWS.WebIdentityCredentials = AWS.util.inherit(AWS.Credentials, { /** * Creates a new credentials object. * @param (see AWS.STS.assumeRoleWithWebIdentity) * @example Creating a new credentials object * AWS.config.credentials = new AWS.WebIdentityCredentials({ * RoleArn: 'arn:aws:iam::1234567890:role/WebIdentity', * WebIdentityToken: 'ABCDEFGHIJKLMNOP', // token from identity service * RoleSessionName: 'web' // optional name, defaults to web-identity * }, { * // optionally provide configuration to apply to the underlying AWS.STS service client * // if configuration is not provided, then configuration will be pulled from AWS.config * * // specify timeout options * httpOptions: { * timeout: 100 * } * }); * @see AWS.STS.assumeRoleWithWebIdentity * @see AWS.Config */ constructor: function WebIdentityCredentials(params, clientConfig) { AWS.Credentials.call(this); this.expired = true; this.params = params; this.params.RoleSessionName = this.params.RoleSessionName || 'web-identity'; this.data = null; this._clientConfig = AWS.util.copy(clientConfig || {}); }, /** * Refreshes credentials using {AWS.STS.assumeRoleWithWebIdentity} * * @callback callback function(err) * Called when the STS service responds (or fails). When * this callback is called with no error, it means that the credentials * information has been loaded into the object (as the `accessKeyId`, * `secretAccessKey`, and `sessionToken` properties). * @param err [Error] if an error occurred, this value will be filled * @see get */ refresh: function refresh(callback) { this.coalesceRefresh(callback || AWS.util.fn.callback); }, /** * @api private */ load: function load(callback) { var self = this; self.createClients(); self.service.assumeRoleWithWebIdentity(function (err, data) { self.data = null; if (!err) { self.data = data; self.service.credentialsFrom(data, self); } callback(err); }); }, /** * @api private */ createClients: function() { if (!this.service) { var stsConfig = AWS.util.merge({}, this._clientConfig); stsConfig.params = this.params; this.service = new STS(stsConfig); } } }); /***/ }), /***/ 45313: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { var AWS = __webpack_require__(28437); var util = __webpack_require__(77985); var endpointDiscoveryEnabledEnvs = ['AWS_ENABLE_ENDPOINT_DISCOVERY', 'AWS_ENDPOINT_DISCOVERY_ENABLED']; /** * Generate key (except resources and operation part) to index the endpoints in the cache * If input shape has endpointdiscoveryid trait then use * accessKey + operation + resources + region + service as cache key * If input shape doesn't have endpointdiscoveryid trait then use * accessKey + region + service as cache key * @return [map] object with keys to index endpoints. * @api private */ function getCacheKey(request) { var service = request.service; var api = service.api || {}; var operations = api.operations; var identifiers = {}; if (service.config.region) { identifiers.region = service.config.region; } if (api.serviceId) { identifiers.serviceId = api.serviceId; } if (service.config.credentials.accessKeyId) { identifiers.accessKeyId = service.config.credentials.accessKeyId; } return identifiers; } /** * Recursive helper for marshallCustomIdentifiers(). * Looks for required string input members that have 'endpointdiscoveryid' trait. * @api private */ function marshallCustomIdentifiersHelper(result, params, shape) { if (!shape || params === undefined || params === null) return; if (shape.type === 'structure' && shape.required && shape.required.length > 0) { util.arrayEach(shape.required, function(name) { var memberShape = shape.members[name]; if (memberShape.endpointDiscoveryId === true) { var locationName = memberShape.isLocationName ? memberShape.name : name; result[locationName] = String(params[name]); } else { marshallCustomIdentifiersHelper(result, params[name], memberShape); } }); } } /** * Get custom identifiers for cache key. * Identifies custom identifiers by checking each shape's `endpointDiscoveryId` trait. * @param [object] request object * @param [object] input shape of the given operation's api * @api private */ function marshallCustomIdentifiers(request, shape) { var identifiers = {}; marshallCustomIdentifiersHelper(identifiers, request.params, shape); return identifiers; } /** * Call endpoint discovery operation when it's optional. * When endpoint is available in cache then use the cached endpoints. If endpoints * are unavailable then use regional endpoints and call endpoint discovery operation * asynchronously. This is turned off by default. * @param [object] request object * @api private */ function optionalDiscoverEndpoint(request) { var service = request.service; var api = service.api; var operationModel = api.operations ? api.operations[request.operation] : undefined; var inputShape = operationModel ? operationModel.input : undefined; var identifiers = marshallCustomIdentifiers(request, inputShape); var cacheKey = getCacheKey(request); if (Object.keys(identifiers).length > 0) { cacheKey = util.update(cacheKey, identifiers); if (operationModel) cacheKey.operation = operationModel.name; } var endpoints = AWS.endpointCache.get(cacheKey); if (endpoints && endpoints.length === 1 && endpoints[0].Address === '') { //endpoint operation is being made but response not yet received //or endpoint operation just failed in 1 minute return; } else if (endpoints && endpoints.length > 0) { //found endpoint record from cache request.httpRequest.updateEndpoint(endpoints[0].Address); } else { //endpoint record not in cache or outdated. make discovery operation var endpointRequest = service.makeRequest(api.endpointOperation, { Operation: operationModel.name, Identifiers: identifiers, }); addApiVersionHeader(endpointRequest); endpointRequest.removeListener('validate', AWS.EventListeners.Core.VALIDATE_PARAMETERS); endpointRequest.removeListener('retry', AWS.EventListeners.Core.RETRY_CHECK); //put in a placeholder for endpoints already requested, prevent //too much in-flight calls AWS.endpointCache.put(cacheKey, [{ Address: '', CachePeriodInMinutes: 1 }]); endpointRequest.send(function(err, data) { if (data && data.Endpoints) { AWS.endpointCache.put(cacheKey, data.Endpoints); } else if (err) { AWS.endpointCache.put(cacheKey, [{ Address: '', CachePeriodInMinutes: 1 //not to make more endpoint operation in next 1 minute }]); } }); } } var requestQueue = {}; /** * Call endpoint discovery operation when it's required. * When endpoint is available in cache then use cached ones. If endpoints are * unavailable then SDK should call endpoint operation then use returned new * endpoint for the api call. SDK will automatically attempt to do endpoint * discovery. This is turned off by default * @param [object] request object * @api private */ function requiredDiscoverEndpoint(request, done) { var service = request.service; var api = service.api; var operationModel = api.operations ? api.operations[request.operation] : undefined; var inputShape = operationModel ? operationModel.input : undefined; var identifiers = marshallCustomIdentifiers(request, inputShape); var cacheKey = getCacheKey(request); if (Object.keys(identifiers).length > 0) { cacheKey = util.update(cacheKey, identifiers); if (operationModel) cacheKey.operation = operationModel.name; } var cacheKeyStr = AWS.EndpointCache.getKeyString(cacheKey); var endpoints = AWS.endpointCache.get(cacheKeyStr); //endpoint cache also accepts string keys if (endpoints && endpoints.length === 1 && endpoints[0].Address === '') { //endpoint operation is being made but response not yet received //push request object to a pending queue if (!requestQueue[cacheKeyStr]) requestQueue[cacheKeyStr] = []; requestQueue[cacheKeyStr].push({request: request, callback: done}); return; } else if (endpoints && endpoints.length > 0) { request.httpRequest.updateEndpoint(endpoints[0].Address); done(); } else { var endpointRequest = service.makeRequest(api.endpointOperation, { Operation: operationModel.name, Identifiers: identifiers, }); endpointRequest.removeListener('validate', AWS.EventListeners.Core.VALIDATE_PARAMETERS); addApiVersionHeader(endpointRequest); //put in a placeholder for endpoints already requested, prevent //too much in-flight calls AWS.endpointCache.put(cacheKeyStr, [{ Address: '', CachePeriodInMinutes: 60 //long-live cache }]); endpointRequest.send(function(err, data) { if (err) { request.response.error = util.error(err, { retryable: false }); AWS.endpointCache.remove(cacheKey); //fail all the pending requests in batch if (requestQueue[cacheKeyStr]) { var pendingRequests = requestQueue[cacheKeyStr]; util.arrayEach(pendingRequests, function(requestContext) { requestContext.request.response.error = util.error(err, { retryable: false }); requestContext.callback(); }); delete requestQueue[cacheKeyStr]; } } else if (data) { AWS.endpointCache.put(cacheKeyStr, data.Endpoints); request.httpRequest.updateEndpoint(data.Endpoints[0].Address); //update the endpoint for all the pending requests in batch if (requestQueue[cacheKeyStr]) { var pendingRequests = requestQueue[cacheKeyStr]; util.arrayEach(pendingRequests, function(requestContext) { requestContext.request.httpRequest.updateEndpoint(data.Endpoints[0].Address); requestContext.callback(); }); delete requestQueue[cacheKeyStr]; } } done(); }); } } /** * add api version header to endpoint operation * @api private */ function addApiVersionHeader(endpointRequest) { var api = endpointRequest.service.api; var apiVersion = api.apiVersion; if (apiVersion && !endpointRequest.httpRequest.headers['x-amz-api-version']) { endpointRequest.httpRequest.headers['x-amz-api-version'] = apiVersion; } } /** * If api call gets invalid endpoint exception, SDK should attempt to remove the invalid * endpoint from cache. * @api private */ function invalidateCachedEndpoints(response) { var error = response.error; var httpResponse = response.httpResponse; if (error && (error.code === 'InvalidEndpointException' || httpResponse.statusCode === 421) ) { var request = response.request; var operations = request.service.api.operations || {}; var inputShape = operations[request.operation] ? operations[request.operation].input : undefined; var identifiers = marshallCustomIdentifiers(request, inputShape); var cacheKey = getCacheKey(request); if (Object.keys(identifiers).length > 0) { cacheKey = util.update(cacheKey, identifiers); if (operations[request.operation]) cacheKey.operation = operations[request.operation].name; } AWS.endpointCache.remove(cacheKey); } } /** * If endpoint is explicitly configured, SDK should not do endpoint discovery in anytime. * @param [object] client Service client object. * @api private */ function hasCustomEndpoint(client) { //if set endpoint is set for specific client, enable endpoint discovery will raise an error. if (client._originalConfig && client._originalConfig.endpoint && client._originalConfig.endpointDiscoveryEnabled === true) { throw util.error(new Error(), { code: 'ConfigurationException', message: 'Custom endpoint is supplied; endpointDiscoveryEnabled must not be true.' }); }; var svcConfig = AWS.config[client.serviceIdentifier] || {}; return Boolean(AWS.config.endpoint || svcConfig.endpoint || (client._originalConfig && client._originalConfig.endpoint)); } /** * @api private */ function isFalsy(value) { return ['false', '0'].indexOf(value) >= 0; } /** * If endpoint discovery should perform for this request when no operation requires endpoint * discovery for the given service. * SDK performs config resolution in order like below: * 1. If set in client configuration. * 2. If set in env AWS_ENABLE_ENDPOINT_DISCOVERY. * 3. If set in shared ini config file with key 'endpoint_discovery_enabled'. * @param [object] request request object. * @returns [boolean|undefined] if endpoint discovery config is not set in any source, this * function returns undefined * @api private */ function resolveEndpointDiscoveryConfig(request) { var service = request.service || {}; if (service.config.endpointDiscoveryEnabled !== undefined) { return service.config.endpointDiscoveryEnabled; } //shared ini file is only available in Node //not to check env in browser if (util.isBrowser()) return undefined; // If any of recognized endpoint discovery config env is set for (var i = 0; i < endpointDiscoveryEnabledEnvs.length; i++) { var env = endpointDiscoveryEnabledEnvs[i]; if (Object.prototype.hasOwnProperty.call(process.env, env)) { if (process.env[env] === '' || process.env[env] === undefined) { throw util.error(new Error(), { code: 'ConfigurationException', message: 'environmental variable ' + env + ' cannot be set to nothing' }); } return !isFalsy(process.env[env]); } } var configFile = {}; try { configFile = AWS.util.iniLoader ? AWS.util.iniLoader.loadFrom({ isConfig: true, filename: process.env[AWS.util.sharedConfigFileEnv] }) : {}; } catch (e) {} var sharedFileConfig = configFile[ process.env.AWS_PROFILE || AWS.util.defaultProfile ] || {}; if (Object.prototype.hasOwnProperty.call(sharedFileConfig, 'endpoint_discovery_enabled')) { if (sharedFileConfig.endpoint_discovery_enabled === undefined) { throw util.error(new Error(), { code: 'ConfigurationException', message: 'config file entry \'endpoint_discovery_enabled\' cannot be set to nothing' }); } return !isFalsy(sharedFileConfig.endpoint_discovery_enabled); } return undefined; } /** * attach endpoint discovery logic to request object * @param [object] request * @api private */ function discoverEndpoint(request, done) { var service = request.service || {}; if (hasCustomEndpoint(service) || request.isPresigned()) return done(); var operations = service.api.operations || {}; var operationModel = operations[request.operation]; var isEndpointDiscoveryRequired = operationModel ? operationModel.endpointDiscoveryRequired : 'NULL'; var isEnabled = resolveEndpointDiscoveryConfig(request); var hasRequiredEndpointDiscovery = service.api.hasRequiredEndpointDiscovery; if (isEnabled || hasRequiredEndpointDiscovery) { // Once a customer enables endpoint discovery, the SDK should start appending // the string endpoint-discovery to the user-agent on all requests. request.httpRequest.appendToUserAgent('endpoint-discovery'); } switch (isEndpointDiscoveryRequired) { case 'OPTIONAL': if (isEnabled || hasRequiredEndpointDiscovery) { // For a given service; if at least one operation requires endpoint discovery then the SDK must enable endpoint discovery // by default for all operations of that service, including operations where endpoint discovery is optional. optionalDiscoverEndpoint(request); request.addNamedListener('INVALIDATE_CACHED_ENDPOINTS', 'extractError', invalidateCachedEndpoints); } done(); break; case 'REQUIRED': if (isEnabled === false) { // For a given operation; if endpoint discovery is required and it has been disabled on the SDK client, // then the SDK must return a clear and actionable exception. request.response.error = util.error(new Error(), { code: 'ConfigurationException', message: 'Endpoint Discovery is disabled but ' + service.api.className + '.' + request.operation + '() requires it. Please check your configurations.' }); done(); break; } request.addNamedListener('INVALIDATE_CACHED_ENDPOINTS', 'extractError', invalidateCachedEndpoints); requiredDiscoverEndpoint(request, done); break; case 'NULL': default: done(); break; } } module.exports = { discoverEndpoint: discoverEndpoint, requiredDiscoverEndpoint: requiredDiscoverEndpoint, optionalDiscoverEndpoint: optionalDiscoverEndpoint, marshallCustomIdentifiers: marshallCustomIdentifiers, getCacheKey: getCacheKey, invalidateCachedEndpoint: invalidateCachedEndpoints, }; /***/ }), /***/ 76663: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { var AWS = __webpack_require__(28437); var util = AWS.util; var typeOf = __webpack_require__(48084).typeOf; var DynamoDBSet = __webpack_require__(20304); var NumberValue = __webpack_require__(91593); AWS.DynamoDB.Converter = { /** * Convert a JavaScript value to its equivalent DynamoDB AttributeValue type * * @param data [any] The data to convert to a DynamoDB AttributeValue * @param options [map] * @option options convertEmptyValues [Boolean] Whether to automatically * convert empty strings, blobs, * and sets to `null` * @option options wrapNumbers [Boolean] Whether to return numbers as a * NumberValue object instead of * converting them to native JavaScript * numbers. This allows for the safe * round-trip transport of numbers of * arbitrary size. * @return [map] An object in the Amazon DynamoDB AttributeValue format * * @see AWS.DynamoDB.Converter.marshall AWS.DynamoDB.Converter.marshall to * convert entire records (rather than individual attributes) */ input: function convertInput(data, options) { options = options || {}; var type = typeOf(data); if (type === 'Object') { return formatMap(data, options); } else if (type === 'Array') { return formatList(data, options); } else if (type === 'Set') { return formatSet(data, options); } else if (type === 'String') { if (data.length === 0 && options.convertEmptyValues) { return convertInput(null); } return { S: data }; } else if (type === 'Number' || type === 'NumberValue') { return { N: data.toString() }; } else if (type === 'Binary') { if (data.length === 0 && options.convertEmptyValues) { return convertInput(null); } return { B: data }; } else if (type === 'Boolean') { return { BOOL: data }; } else if (type === 'null') { return { NULL: true }; } else if (type !== 'undefined' && type !== 'Function') { // this value has a custom constructor return formatMap(data, options); } }, /** * Convert a JavaScript object into a DynamoDB record. * * @param data [any] The data to convert to a DynamoDB record * @param options [map] * @option options convertEmptyValues [Boolean] Whether to automatically * convert empty strings, blobs, * and sets to `null` * @option options wrapNumbers [Boolean] Whether to return numbers as a * NumberValue object instead of * converting them to native JavaScript * numbers. This allows for the safe * round-trip transport of numbers of * arbitrary size. * * @return [map] An object in the DynamoDB record format. * * @example Convert a JavaScript object into a DynamoDB record * var marshalled = AWS.DynamoDB.Converter.marshall({ * string: 'foo', * list: ['fizz', 'buzz', 'pop'], * map: { * nestedMap: { * key: 'value', * } * }, * number: 123, * nullValue: null, * boolValue: true, * stringSet: new DynamoDBSet(['foo', 'bar', 'baz']) * }); */ marshall: function marshallItem(data, options) { return AWS.DynamoDB.Converter.input(data, options).M; }, /** * Convert a DynamoDB AttributeValue object to its equivalent JavaScript type. * * @param data [map] An object in the Amazon DynamoDB AttributeValue format * @param options [map] * @option options convertEmptyValues [Boolean] Whether to automatically * convert empty strings, blobs, * and sets to `null` * @option options wrapNumbers [Boolean] Whether to return numbers as a * NumberValue object instead of * converting them to native JavaScript * numbers. This allows for the safe * round-trip transport of numbers of * arbitrary size. * * @return [Object|Array|String|Number|Boolean|null] * * @see AWS.DynamoDB.Converter.unmarshall AWS.DynamoDB.Converter.unmarshall to * convert entire records (rather than individual attributes) */ output: function convertOutput(data, options) { options = options || {}; var list, map, i; for (var type in data) { var values = data[type]; if (type === 'M') { map = {}; for (var key in values) { map[key] = convertOutput(values[key], options); } return map; } else if (type === 'L') { list = []; for (i = 0; i < values.length; i++) { list.push(convertOutput(values[i], options)); } return list; } else if (type === 'SS') { list = []; for (i = 0; i < values.length; i++) { list.push(values[i] + ''); } return new DynamoDBSet(list); } else if (type === 'NS') { list = []; for (i = 0; i < values.length; i++) { list.push(convertNumber(values[i], options.wrapNumbers)); } return new DynamoDBSet(list); } else if (type === 'BS') { list = []; for (i = 0; i < values.length; i++) { list.push(AWS.util.buffer.toBuffer(values[i])); } return new DynamoDBSet(list); } else if (type === 'S') { return values + ''; } else if (type === 'N') { return convertNumber(values, options.wrapNumbers); } else if (type === 'B') { return util.buffer.toBuffer(values); } else if (type === 'BOOL') { return (values === 'true' || values === 'TRUE' || values === true); } else if (type === 'NULL') { return null; } } }, /** * Convert a DynamoDB record into a JavaScript object. * * @param data [any] The DynamoDB record * @param options [map] * @option options convertEmptyValues [Boolean] Whether to automatically * convert empty strings, blobs, * and sets to `null` * @option options wrapNumbers [Boolean] Whether to return numbers as a * NumberValue object instead of * converting them to native JavaScript * numbers. This allows for the safe * round-trip transport of numbers of * arbitrary size. * * @return [map] An object whose properties have been converted from * DynamoDB's AttributeValue format into their corresponding native * JavaScript types. * * @example Convert a record received from a DynamoDB stream * var unmarshalled = AWS.DynamoDB.Converter.unmarshall({ * string: {S: 'foo'}, * list: {L: [{S: 'fizz'}, {S: 'buzz'}, {S: 'pop'}]}, * map: { * M: { * nestedMap: { * M: { * key: {S: 'value'} * } * } * } * }, * number: {N: '123'}, * nullValue: {NULL: true}, * boolValue: {BOOL: true} * }); */ unmarshall: function unmarshall(data, options) { return AWS.DynamoDB.Converter.output({M: data}, options); } }; /** * @api private * @param data [Array] * @param options [map] */ function formatList(data, options) { var list = {L: []}; for (var i = 0; i < data.length; i++) { list['L'].push(AWS.DynamoDB.Converter.input(data[i], options)); } return list; } /** * @api private * @param value [String] * @param wrapNumbers [Boolean] */ function convertNumber(value, wrapNumbers) { return wrapNumbers ? new NumberValue(value) : Number(value); } /** * @api private * @param data [map] * @param options [map] */ function formatMap(data, options) { var map = {M: {}}; for (var key in data) { var formatted = AWS.DynamoDB.Converter.input(data[key], options); if (formatted !== void 0) { map['M'][key] = formatted; } } return map; } /** * @api private */ function formatSet(data, options) { options = options || {}; var values = data.values; if (options.convertEmptyValues) { values = filterEmptySetValues(data); if (values.length === 0) { return AWS.DynamoDB.Converter.input(null); } } var map = {}; switch (data.type) { case 'String': map['SS'] = values; break; case 'Binary': map['BS'] = values; break; case 'Number': map['NS'] = values.map(function (value) { return value.toString(); }); } return map; } /** * @api private */ function filterEmptySetValues(set) { var nonEmptyValues = []; var potentiallyEmptyTypes = { String: true, Binary: true, Number: false }; if (potentiallyEmptyTypes[set.type]) { for (var i = 0; i < set.values.length; i++) { if (set.values[i].length === 0) { continue; } nonEmptyValues.push(set.values[i]); } return nonEmptyValues; } return set.values; } /** * @api private */ module.exports = AWS.DynamoDB.Converter; /***/ }), /***/ 90030: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { var AWS = __webpack_require__(28437); var Translator = __webpack_require__(34222); var DynamoDBSet = __webpack_require__(20304); /** * The document client simplifies working with items in Amazon DynamoDB * by abstracting away the notion of attribute values. This abstraction * annotates native JavaScript types supplied as input parameters, as well * as converts annotated response data to native JavaScript types. * * ## Marshalling Input and Unmarshalling Response Data * * The document client affords developers the use of native JavaScript types * instead of `AttributeValue`s to simplify the JavaScript development * experience with Amazon DynamoDB. JavaScript objects passed in as parameters * are marshalled into `AttributeValue` shapes required by Amazon DynamoDB. * Responses from DynamoDB are unmarshalled into plain JavaScript objects * by the `DocumentClient`. The `DocumentClient`, does not accept * `AttributeValue`s in favor of native JavaScript types. * * | JavaScript Type | DynamoDB AttributeValue | * |:----------------------------------------------------------------------:|-------------------------| * | String | S | * | Number | N | * | Boolean | BOOL | * | null | NULL | * | Array | L | * | Object | M | * | Buffer, File, Blob, ArrayBuffer, DataView, and JavaScript typed arrays | B | * * ## Support for Sets * * The `DocumentClient` offers a convenient way to create sets from * JavaScript Arrays. The type of set is inferred from the first element * in the array. DynamoDB supports string, number, and binary sets. To * learn more about supported types see the * [Amazon DynamoDB Data Model Documentation](http://docs.aws.amazon.com/amazondynamodb/latest/developerguide/DataModel.html) * For more information see {AWS.DynamoDB.DocumentClient.createSet} * */ AWS.DynamoDB.DocumentClient = AWS.util.inherit({ /** * Creates a DynamoDB document client with a set of configuration options. * * @option options params [map] An optional map of parameters to bind to every * request sent by this service object. * @option options service [AWS.DynamoDB] An optional pre-configured instance * of the AWS.DynamoDB service object to use for requests. The object may * bound parameters used by the document client. * @option options convertEmptyValues [Boolean] set to true if you would like * the document client to convert empty values (0-length strings, binary * buffers, and sets) to be converted to NULL types when persisting to * DynamoDB. * @option options wrapNumbers [Boolean] Set to true to return numbers as a * NumberValue object instead of converting them to native JavaScript numbers. * This allows for the safe round-trip transport of numbers of arbitrary size. * @see AWS.DynamoDB.constructor * */ constructor: function DocumentClient(options) { var self = this; self.options = options || {}; self.configure(self.options); }, /** * @api private */ configure: function configure(options) { var self = this; self.service = options.service; self.bindServiceObject(options); self.attrValue = options.attrValue = self.service.api.operations.putItem.input.members.Item.value.shape; }, /** * @api private */ bindServiceObject: function bindServiceObject(options) { var self = this; options = options || {}; if (!self.service) { self.service = new AWS.DynamoDB(options); } else { var config = AWS.util.copy(self.service.config); self.service = new self.service.constructor.__super__(config); self.service.config.params = AWS.util.merge(self.service.config.params || {}, options.params); } }, /** * @api private */ makeServiceRequest: function(operation, params, callback) { var self = this; var request = self.service[operation](params); self.setupRequest(request); self.setupResponse(request); if (typeof callback === 'function') { request.send(callback); } return request; }, /** * @api private */ serviceClientOperationsMap: { batchGet: 'batchGetItem', batchWrite: 'batchWriteItem', delete: 'deleteItem', get: 'getItem', put: 'putItem', query: 'query', scan: 'scan', update: 'updateItem', transactGet: 'transactGetItems', transactWrite: 'transactWriteItems' }, /** * Returns the attributes of one or more items from one or more tables * by delegating to `AWS.DynamoDB.batchGetItem()`. * * Supply the same parameters as {AWS.DynamoDB.batchGetItem} with * `AttributeValue`s substituted by native JavaScript types. * * @see AWS.DynamoDB.batchGetItem * @example Get items from multiple tables * var params = { * RequestItems: { * 'Table-1': { * Keys: [ * { * HashKey: 'haskey', * NumberRangeKey: 1 * } * ] * }, * 'Table-2': { * Keys: [ * { foo: 'bar' }, * ] * } * } * }; * * var documentClient = new AWS.DynamoDB.DocumentClient(); * * documentClient.batchGet(params, function(err, data) { * if (err) console.log(err); * else console.log(data); * }); * */ batchGet: function(params, callback) { var operation = this.serviceClientOperationsMap['batchGet']; return this.makeServiceRequest(operation, params, callback); }, /** * Puts or deletes multiple items in one or more tables by delegating * to `AWS.DynamoDB.batchWriteItem()`. * * Supply the same parameters as {AWS.DynamoDB.batchWriteItem} with * `AttributeValue`s substituted by native JavaScript types. * * @see AWS.DynamoDB.batchWriteItem * @example Write to and delete from a table * var params = { * RequestItems: { * 'Table-1': [ * { * DeleteRequest: { * Key: { HashKey: 'someKey' } * } * }, * { * PutRequest: { * Item: { * HashKey: 'anotherKey', * NumAttribute: 1, * BoolAttribute: true, * ListAttribute: [1, 'two', false], * MapAttribute: { foo: 'bar' } * } * } * } * ] * } * }; * * var documentClient = new AWS.DynamoDB.DocumentClient(); * * documentClient.batchWrite(params, function(err, data) { * if (err) console.log(err); * else console.log(data); * }); * */ batchWrite: function(params, callback) { var operation = this.serviceClientOperationsMap['batchWrite']; return this.makeServiceRequest(operation, params, callback); }, /** * Deletes a single item in a table by primary key by delegating to * `AWS.DynamoDB.deleteItem()` * * Supply the same parameters as {AWS.DynamoDB.deleteItem} with * `AttributeValue`s substituted by native JavaScript types. * * @see AWS.DynamoDB.deleteItem * @example Delete an item from a table * var params = { * TableName : 'Table', * Key: { * HashKey: 'hashkey', * NumberRangeKey: 1 * } * }; * * var documentClient = new AWS.DynamoDB.DocumentClient(); * * documentClient.delete(params, function(err, data) { * if (err) console.log(err); * else console.log(data); * }); * */ delete: function(params, callback) { var operation = this.serviceClientOperationsMap['delete']; return this.makeServiceRequest(operation, params, callback); }, /** * Returns a set of attributes for the item with the given primary key * by delegating to `AWS.DynamoDB.getItem()`. * * Supply the same parameters as {AWS.DynamoDB.getItem} with * `AttributeValue`s substituted by native JavaScript types. * * @see AWS.DynamoDB.getItem * @example Get an item from a table * var params = { * TableName : 'Table', * Key: { * HashKey: 'hashkey' * } * }; * * var documentClient = new AWS.DynamoDB.DocumentClient(); * * documentClient.get(params, function(err, data) { * if (err) console.log(err); * else console.log(data); * }); * */ get: function(params, callback) { var operation = this.serviceClientOperationsMap['get']; return this.makeServiceRequest(operation, params, callback); }, /** * Creates a new item, or replaces an old item with a new item by * delegating to `AWS.DynamoDB.putItem()`. * * Supply the same parameters as {AWS.DynamoDB.putItem} with * `AttributeValue`s substituted by native JavaScript types. * * @see AWS.DynamoDB.putItem * @example Create a new item in a table * var params = { * TableName : 'Table', * Item: { * HashKey: 'haskey', * NumAttribute: 1, * BoolAttribute: true, * ListAttribute: [1, 'two', false], * MapAttribute: { foo: 'bar'}, * NullAttribute: null * } * }; * * var documentClient = new AWS.DynamoDB.DocumentClient(); * * documentClient.put(params, function(err, data) { * if (err) console.log(err); * else console.log(data); * }); * */ put: function(params, callback) { var operation = this.serviceClientOperationsMap['put']; return this.makeServiceRequest(operation, params, callback); }, /** * Edits an existing item's attributes, or adds a new item to the table if * it does not already exist by delegating to `AWS.DynamoDB.updateItem()`. * * Supply the same parameters as {AWS.DynamoDB.updateItem} with * `AttributeValue`s substituted by native JavaScript types. * * @see AWS.DynamoDB.updateItem * @example Update an item with expressions * var params = { * TableName: 'Table', * Key: { HashKey : 'hashkey' }, * UpdateExpression: 'set #a = :x + :y', * ConditionExpression: '#a < :MAX', * ExpressionAttributeNames: {'#a' : 'Sum'}, * ExpressionAttributeValues: { * ':x' : 20, * ':y' : 45, * ':MAX' : 100, * } * }; * * var documentClient = new AWS.DynamoDB.DocumentClient(); * * documentClient.update(params, function(err, data) { * if (err) console.log(err); * else console.log(data); * }); * */ update: function(params, callback) { var operation = this.serviceClientOperationsMap['update']; return this.makeServiceRequest(operation, params, callback); }, /** * Returns one or more items and item attributes by accessing every item * in a table or a secondary index. * * Supply the same parameters as {AWS.DynamoDB.scan} with * `AttributeValue`s substituted by native JavaScript types. * * @see AWS.DynamoDB.scan * @example Scan the table with a filter expression * var params = { * TableName : 'Table', * FilterExpression : 'Year = :this_year', * ExpressionAttributeValues : {':this_year' : 2015} * }; * * var documentClient = new AWS.DynamoDB.DocumentClient(); * * documentClient.scan(params, function(err, data) { * if (err) console.log(err); * else console.log(data); * }); * */ scan: function(params, callback) { var operation = this.serviceClientOperationsMap['scan']; return this.makeServiceRequest(operation, params, callback); }, /** * Directly access items from a table by primary key or a secondary index. * * Supply the same parameters as {AWS.DynamoDB.query} with * `AttributeValue`s substituted by native JavaScript types. * * @see AWS.DynamoDB.query * @example Query an index * var params = { * TableName: 'Table', * IndexName: 'Index', * KeyConditionExpression: 'HashKey = :hkey and RangeKey > :rkey', * ExpressionAttributeValues: { * ':hkey': 'key', * ':rkey': 2015 * } * }; * * var documentClient = new AWS.DynamoDB.DocumentClient(); * * documentClient.query(params, function(err, data) { * if (err) console.log(err); * else console.log(data); * }); * */ query: function(params, callback) { var operation = this.serviceClientOperationsMap['query']; return this.makeServiceRequest(operation, params, callback); }, /** * Synchronous write operation that groups up to 10 action requests * * Supply the same parameters as {AWS.DynamoDB.transactWriteItems} with * `AttributeValue`s substituted by native JavaScript types. * * @see AWS.DynamoDB.transactWriteItems * @example Get items from multiple tables * var params = { * TransactItems: [{ * Put: { * TableName : 'Table0', * Item: { * HashKey: 'haskey', * NumAttribute: 1, * BoolAttribute: true, * ListAttribute: [1, 'two', false], * MapAttribute: { foo: 'bar'}, * NullAttribute: null * } * } * }, { * Update: { * TableName: 'Table1', * Key: { HashKey : 'hashkey' }, * UpdateExpression: 'set #a = :x + :y', * ConditionExpression: '#a < :MAX', * ExpressionAttributeNames: {'#a' : 'Sum'}, * ExpressionAttributeValues: { * ':x' : 20, * ':y' : 45, * ':MAX' : 100, * } * } * }] * }; * * documentClient.transactWrite(params, function(err, data) { * if (err) console.log(err); * else console.log(data); * }); */ transactWrite: function(params, callback) { var operation = this.serviceClientOperationsMap['transactWrite']; return this.makeServiceRequest(operation, params, callback); }, /** * Atomically retrieves multiple items from one or more tables (but not from indexes) * in a single account and region. * * Supply the same parameters as {AWS.DynamoDB.transactGetItems} with * `AttributeValue`s substituted by native JavaScript types. * * @see AWS.DynamoDB.transactGetItems * @example Get items from multiple tables * var params = { * TransactItems: [{ * Get: { * TableName : 'Table0', * Key: { * HashKey: 'hashkey0' * } * } * }, { * Get: { * TableName : 'Table1', * Key: { * HashKey: 'hashkey1' * } * } * }] * }; * * documentClient.transactGet(params, function(err, data) { * if (err) console.log(err); * else console.log(data); * }); */ transactGet: function(params, callback) { var operation = this.serviceClientOperationsMap['transactGet']; return this.makeServiceRequest(operation, params, callback); }, /** * Creates a set of elements inferring the type of set from * the type of the first element. Amazon DynamoDB currently supports * the number sets, string sets, and binary sets. For more information * about DynamoDB data types see the documentation on the * [Amazon DynamoDB Data Model](http://docs.aws.amazon.com/amazondynamodb/latest/developerguide/DataModel.html#DataModel.DataTypes). * * @param list [Array] Collection to represent your DynamoDB Set * @param options [map] * * **validate** [Boolean] set to true if you want to validate the type * of each element in the set. Defaults to `false`. * @example Creating a number set * var documentClient = new AWS.DynamoDB.DocumentClient(); * * var params = { * Item: { * hashkey: 'hashkey' * numbers: documentClient.createSet([1, 2, 3]); * } * }; * * documentClient.put(params, function(err, data) { * if (err) console.log(err); * else console.log(data); * }); * */ createSet: function(list, options) { options = options || {}; return new DynamoDBSet(list, options); }, /** * @api private */ getTranslator: function() { return new Translator(this.options); }, /** * @api private */ setupRequest: function setupRequest(request) { var self = this; var translator = self.getTranslator(); var operation = request.operation; var inputShape = request.service.api.operations[operation].input; request._events.validate.unshift(function(req) { req.rawParams = AWS.util.copy(req.params); req.params = translator.translateInput(req.rawParams, inputShape); }); }, /** * @api private */ setupResponse: function setupResponse(request) { var self = this; var translator = self.getTranslator(); var outputShape = self.service.api.operations[request.operation].output; request.on('extractData', function(response) { response.data = translator.translateOutput(response.data, outputShape); }); var response = request.response; response.nextPage = function(cb) { var resp = this; var req = resp.request; var config; var service = req.service; var operation = req.operation; try { config = service.paginationConfig(operation, true); } catch (e) { resp.error = e; } if (!resp.hasNextPage()) { if (cb) cb(resp.error, null); else if (resp.error) throw resp.error; return null; } var params = AWS.util.copy(req.rawParams); if (!resp.nextPageTokens) { return cb ? cb(null, null) : null; } else { var inputTokens = config.inputToken; if (typeof inputTokens === 'string') inputTokens = [inputTokens]; for (var i = 0; i < inputTokens.length; i++) { params[inputTokens[i]] = resp.nextPageTokens[i]; } return self[operation](params, cb); } }; } }); /** * @api private */ module.exports = AWS.DynamoDB.DocumentClient; /***/ }), /***/ 91593: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { var util = __webpack_require__(28437).util; /** * An object recognizable as a numeric value that stores the underlying number * as a string. * * Intended to be a deserialization target for the DynamoDB Document Client when * the `wrapNumbers` flag is set. This allows for numeric values that lose * precision when converted to JavaScript's `number` type. */ var DynamoDBNumberValue = util.inherit({ constructor: function NumberValue(value) { this.wrapperName = 'NumberValue'; this.value = value.toString(); }, /** * Render the underlying value as a number when converting to JSON. */ toJSON: function () { return this.toNumber(); }, /** * Convert the underlying value to a JavaScript number. */ toNumber: function () { return Number(this.value); }, /** * Return a string representing the unaltered value provided to the * constructor. */ toString: function () { return this.value; } }); /** * @api private */ module.exports = DynamoDBNumberValue; /***/ }), /***/ 20304: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { var util = __webpack_require__(28437).util; var typeOf = __webpack_require__(48084).typeOf; /** * @api private */ var memberTypeToSetType = { 'String': 'String', 'Number': 'Number', 'NumberValue': 'Number', 'Binary': 'Binary' }; /** * @api private */ var DynamoDBSet = util.inherit({ constructor: function Set(list, options) { options = options || {}; this.wrapperName = 'Set'; this.initialize(list, options.validate); }, initialize: function(list, validate) { var self = this; self.values = [].concat(list); self.detectType(); if (validate) { self.validate(); } }, detectType: function() { this.type = memberTypeToSetType[typeOf(this.values[0])]; if (!this.type) { throw util.error(new Error(), { code: 'InvalidSetType', message: 'Sets can contain string, number, or binary values' }); } }, validate: function() { var self = this; var length = self.values.length; var values = self.values; for (var i = 0; i < length; i++) { if (memberTypeToSetType[typeOf(values[i])] !== self.type) { throw util.error(new Error(), { code: 'InvalidType', message: self.type + ' Set contains ' + typeOf(values[i]) + ' value' }); } } }, /** * Render the underlying values only when converting to JSON. */ toJSON: function() { var self = this; return self.values; } }); /** * @api private */ module.exports = DynamoDBSet; /***/ }), /***/ 34222: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { var util = __webpack_require__(28437).util; var convert = __webpack_require__(76663); var Translator = function(options) { options = options || {}; this.attrValue = options.attrValue; this.convertEmptyValues = Boolean(options.convertEmptyValues); this.wrapNumbers = Boolean(options.wrapNumbers); }; Translator.prototype.translateInput = function(value, shape) { this.mode = 'input'; return this.translate(value, shape); }; Translator.prototype.translateOutput = function(value, shape) { this.mode = 'output'; return this.translate(value, shape); }; Translator.prototype.translate = function(value, shape) { var self = this; if (!shape || value === undefined) return undefined; if (shape.shape === self.attrValue) { return convert[self.mode](value, { convertEmptyValues: self.convertEmptyValues, wrapNumbers: self.wrapNumbers, }); } switch (shape.type) { case 'structure': return self.translateStructure(value, shape); case 'map': return self.translateMap(value, shape); case 'list': return self.translateList(value, shape); default: return self.translateScalar(value, shape); } }; Translator.prototype.translateStructure = function(structure, shape) { var self = this; if (structure == null) return undefined; var struct = {}; util.each(structure, function(name, value) { var memberShape = shape.members[name]; if (memberShape) { var result = self.translate(value, memberShape); if (result !== undefined) struct[name] = result; } }); return struct; }; Translator.prototype.translateList = function(list, shape) { var self = this; if (list == null) return undefined; var out = []; util.arrayEach(list, function(value) { var result = self.translate(value, shape.member); if (result === undefined) out.push(null); else out.push(result); }); return out; }; Translator.prototype.translateMap = function(map, shape) { var self = this; if (map == null) return undefined; var out = {}; util.each(map, function(key, value) { var result = self.translate(value, shape.value); if (result === undefined) out[key] = null; else out[key] = result; }); return out; }; Translator.prototype.translateScalar = function(value, shape) { return shape.toType(value); }; /** * @api private */ module.exports = Translator; /***/ }), /***/ 48084: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { var util = __webpack_require__(28437).util; function typeOf(data) { if (data === null && typeof data === 'object') { return 'null'; } else if (data !== undefined && isBinary(data)) { return 'Binary'; } else if (data !== undefined && data.constructor) { return data.wrapperName || util.typeName(data.constructor); } else if (data !== undefined && typeof data === 'object') { // this object is the result of Object.create(null), hence the absence of a // defined constructor return 'Object'; } else { return 'undefined'; } } function isBinary(data) { var types = [ 'Buffer', 'File', 'Blob', 'ArrayBuffer', 'DataView', 'Int8Array', 'Uint8Array', 'Uint8ClampedArray', 'Int16Array', 'Uint16Array', 'Int32Array', 'Uint32Array', 'Float32Array', 'Float64Array' ]; if (util.isNode()) { var Stream = util.stream.Stream; if (util.Buffer.isBuffer(data) || data instanceof Stream) { return true; } } for (var i = 0; i < types.length; i++) { if (data !== undefined && data.constructor) { if (util.isType(data, types[i])) return true; if (util.typeName(data.constructor) === types[i]) return true; } } return false; } /** * @api private */ module.exports = { typeOf: typeOf, isBinary: isBinary }; /***/ }), /***/ 63727: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { var eventMessageChunker = __webpack_require__(73630).eventMessageChunker; var parseEvent = __webpack_require__(52123).parseEvent; function createEventStream(body, parser, model) { var eventMessages = eventMessageChunker(body); var events = []; for (var i = 0; i < eventMessages.length; i++) { events.push(parseEvent(parser, eventMessages[i], model)); } return events; } /** * @api private */ module.exports = { createEventStream: createEventStream }; /***/ }), /***/ 18518: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { var util = __webpack_require__(28437).util; var Transform = __webpack_require__(92413).Transform; var allocBuffer = util.buffer.alloc; /** @type {Transform} */ function EventMessageChunkerStream(options) { Transform.call(this, options); this.currentMessageTotalLength = 0; this.currentMessagePendingLength = 0; /** @type {Buffer} */ this.currentMessage = null; /** @type {Buffer} */ this.messageLengthBuffer = null; } EventMessageChunkerStream.prototype = Object.create(Transform.prototype); /** * * @param {Buffer} chunk * @param {string} encoding * @param {*} callback */ EventMessageChunkerStream.prototype._transform = function(chunk, encoding, callback) { var chunkLength = chunk.length; var currentOffset = 0; while (currentOffset < chunkLength) { // create new message if necessary if (!this.currentMessage) { // working on a new message, determine total length var bytesRemaining = chunkLength - currentOffset; // prevent edge case where total length spans 2 chunks if (!this.messageLengthBuffer) { this.messageLengthBuffer = allocBuffer(4); } var numBytesForTotal = Math.min( 4 - this.currentMessagePendingLength, // remaining bytes to fill the messageLengthBuffer bytesRemaining // bytes left in chunk ); chunk.copy( this.messageLengthBuffer, this.currentMessagePendingLength, currentOffset, currentOffset + numBytesForTotal ); this.currentMessagePendingLength += numBytesForTotal; currentOffset += numBytesForTotal; if (this.currentMessagePendingLength < 4) { // not enough information to create the current message break; } this.allocateMessage(this.messageLengthBuffer.readUInt32BE(0)); this.messageLengthBuffer = null; } // write data into current message var numBytesToWrite = Math.min( this.currentMessageTotalLength - this.currentMessagePendingLength, // number of bytes left to complete message chunkLength - currentOffset // number of bytes left in the original chunk ); chunk.copy( this.currentMessage, // target buffer this.currentMessagePendingLength, // target offset currentOffset, // chunk offset currentOffset + numBytesToWrite // chunk end to write ); this.currentMessagePendingLength += numBytesToWrite; currentOffset += numBytesToWrite; // check if a message is ready to be pushed if (this.currentMessageTotalLength && this.currentMessageTotalLength === this.currentMessagePendingLength) { // push out the message this.push(this.currentMessage); // cleanup this.currentMessage = null; this.currentMessageTotalLength = 0; this.currentMessagePendingLength = 0; } } callback(); }; EventMessageChunkerStream.prototype._flush = function(callback) { if (this.currentMessageTotalLength) { if (this.currentMessageTotalLength === this.currentMessagePendingLength) { callback(null, this.currentMessage); } else { callback(new Error('Truncated event message received.')); } } else { callback(); } }; /** * @param {number} size Size of the message to be allocated. * @api private */ EventMessageChunkerStream.prototype.allocateMessage = function(size) { if (typeof size !== 'number') { throw new Error('Attempted to allocate an event message where size was not a number: ' + size); } this.currentMessageTotalLength = size; this.currentMessagePendingLength = 4; this.currentMessage = allocBuffer(size); this.currentMessage.writeUInt32BE(size, 0); }; /** * @api private */ module.exports = { EventMessageChunkerStream: EventMessageChunkerStream }; /***/ }), /***/ 73630: /***/ ((module) => { /** * Takes in a buffer of event messages and splits them into individual messages. * @param {Buffer} buffer * @api private */ function eventMessageChunker(buffer) { /** @type Buffer[] */ var messages = []; var offset = 0; while (offset < buffer.length) { var totalLength = buffer.readInt32BE(offset); // create new buffer for individual message (shares memory with original) var message = buffer.slice(offset, totalLength + offset); // increment offset to it starts at the next message offset += totalLength; messages.push(message); } return messages; } /** * @api private */ module.exports = { eventMessageChunker: eventMessageChunker }; /***/ }), /***/ 93773: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { var Transform = __webpack_require__(92413).Transform; var parseEvent = __webpack_require__(52123).parseEvent; /** @type {Transform} */ function EventUnmarshallerStream(options) { options = options || {}; // set output to object mode options.readableObjectMode = true; Transform.call(this, options); this._readableState.objectMode = true; this.parser = options.parser; this.eventStreamModel = options.eventStreamModel; } EventUnmarshallerStream.prototype = Object.create(Transform.prototype); /** * * @param {Buffer} chunk * @param {string} encoding * @param {*} callback */ EventUnmarshallerStream.prototype._transform = function(chunk, encoding, callback) { try { var event = parseEvent(this.parser, chunk, this.eventStreamModel); this.push(event); return callback(); } catch (err) { callback(err); } }; /** * @api private */ module.exports = { EventUnmarshallerStream: EventUnmarshallerStream }; /***/ }), /***/ 48583: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { var util = __webpack_require__(28437).util; var toBuffer = util.buffer.toBuffer; /** * A lossless representation of a signed, 64-bit integer. Instances of this * class may be used in arithmetic expressions as if they were numeric * primitives, but the binary representation will be preserved unchanged as the * `bytes` property of the object. The bytes should be encoded as big-endian, * two's complement integers. * @param {Buffer} bytes * * @api private */ function Int64(bytes) { if (bytes.length !== 8) { throw new Error('Int64 buffers must be exactly 8 bytes'); } if (!util.Buffer.isBuffer(bytes)) bytes = toBuffer(bytes); this.bytes = bytes; } /** * @param {number} number * @returns {Int64} * * @api private */ Int64.fromNumber = function(number) { if (number > 9223372036854775807 || number < -9223372036854775808) { throw new Error( number + ' is too large (or, if negative, too small) to represent as an Int64' ); } var bytes = new Uint8Array(8); for ( var i = 7, remaining = Math.abs(Math.round(number)); i > -1 && remaining > 0; i--, remaining /= 256 ) { bytes[i] = remaining; } if (number < 0) { negate(bytes); } return new Int64(bytes); }; /** * @returns {number} * * @api private */ Int64.prototype.valueOf = function() { var bytes = this.bytes.slice(0); var negative = bytes[0] & 128; if (negative) { negate(bytes); } return parseInt(bytes.toString('hex'), 16) * (negative ? -1 : 1); }; Int64.prototype.toString = function() { return String(this.valueOf()); }; /** * @param {Buffer} bytes * * @api private */ function negate(bytes) { for (var i = 0; i < 8; i++) { bytes[i] ^= 0xFF; } for (var i = 7; i > -1; i--) { bytes[i]++; if (bytes[i] !== 0) { break; } } } /** * @api private */ module.exports = { Int64: Int64 }; /***/ }), /***/ 52123: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { var parseMessage = __webpack_require__(30866).parseMessage; /** * * @param {*} parser * @param {Buffer} message * @param {*} shape * @api private */ function parseEvent(parser, message, shape) { var parsedMessage = parseMessage(message); // check if message is an event or error var messageType = parsedMessage.headers[':message-type']; if (messageType) { if (messageType.value === 'error') { throw parseError(parsedMessage); } else if (messageType.value !== 'event') { // not sure how to parse non-events/non-errors, ignore for now return; } } // determine event type var eventType = parsedMessage.headers[':event-type']; // check that the event type is modeled var eventModel = shape.members[eventType.value]; if (!eventModel) { return; } var result = {}; // check if an event payload exists var eventPayloadMemberName = eventModel.eventPayloadMemberName; if (eventPayloadMemberName) { var payloadShape = eventModel.members[eventPayloadMemberName]; // if the shape is binary, return the byte array if (payloadShape.type === 'binary') { result[eventPayloadMemberName] = parsedMessage.body; } else { result[eventPayloadMemberName] = parser.parse(parsedMessage.body.toString(), payloadShape); } } // read event headers var eventHeaderNames = eventModel.eventHeaderMemberNames; for (var i = 0; i < eventHeaderNames.length; i++) { var name = eventHeaderNames[i]; if (parsedMessage.headers[name]) { // parse the header! result[name] = eventModel.members[name].toType(parsedMessage.headers[name].value); } } var output = {}; output[eventType.value] = result; return output; } function parseError(message) { var errorCode = message.headers[':error-code']; var errorMessage = message.headers[':error-message']; var error = new Error(errorMessage.value || errorMessage); error.code = error.name = errorCode.value || errorCode; return error; } /** * @api private */ module.exports = { parseEvent: parseEvent }; /***/ }), /***/ 30866: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { var Int64 = __webpack_require__(48583).Int64; var splitMessage = __webpack_require__(71765).splitMessage; var BOOLEAN_TAG = 'boolean'; var BYTE_TAG = 'byte'; var SHORT_TAG = 'short'; var INT_TAG = 'integer'; var LONG_TAG = 'long'; var BINARY_TAG = 'binary'; var STRING_TAG = 'string'; var TIMESTAMP_TAG = 'timestamp'; var UUID_TAG = 'uuid'; /** * @api private * * @param {Buffer} headers */ function parseHeaders(headers) { var out = {}; var position = 0; while (position < headers.length) { var nameLength = headers.readUInt8(position++); var name = headers.slice(position, position + nameLength).toString(); position += nameLength; switch (headers.readUInt8(position++)) { case 0 /* boolTrue */: out[name] = { type: BOOLEAN_TAG, value: true }; break; case 1 /* boolFalse */: out[name] = { type: BOOLEAN_TAG, value: false }; break; case 2 /* byte */: out[name] = { type: BYTE_TAG, value: headers.readInt8(position++) }; break; case 3 /* short */: out[name] = { type: SHORT_TAG, value: headers.readInt16BE(position) }; position += 2; break; case 4 /* integer */: out[name] = { type: INT_TAG, value: headers.readInt32BE(position) }; position += 4; break; case 5 /* long */: out[name] = { type: LONG_TAG, value: new Int64(headers.slice(position, position + 8)) }; position += 8; break; case 6 /* byteArray */: var binaryLength = headers.readUInt16BE(position); position += 2; out[name] = { type: BINARY_TAG, value: headers.slice(position, position + binaryLength) }; position += binaryLength; break; case 7 /* string */: var stringLength = headers.readUInt16BE(position); position += 2; out[name] = { type: STRING_TAG, value: headers.slice( position, position + stringLength ).toString() }; position += stringLength; break; case 8 /* timestamp */: out[name] = { type: TIMESTAMP_TAG, value: new Date( new Int64(headers.slice(position, position + 8)) .valueOf() ) }; position += 8; break; case 9 /* uuid */: var uuidChars = headers.slice(position, position + 16) .toString('hex'); position += 16; out[name] = { type: UUID_TAG, value: uuidChars.substr(0, 8) + '-' + uuidChars.substr(8, 4) + '-' + uuidChars.substr(12, 4) + '-' + uuidChars.substr(16, 4) + '-' + uuidChars.substr(20) }; break; default: throw new Error('Unrecognized header type tag'); } } return out; } function parseMessage(message) { var parsed = splitMessage(message); return { headers: parseHeaders(parsed.headers), body: parsed.body }; } /** * @api private */ module.exports = { parseMessage: parseMessage }; /***/ }), /***/ 71765: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { var util = __webpack_require__(28437).util; var toBuffer = util.buffer.toBuffer; // All prelude components are unsigned, 32-bit integers var PRELUDE_MEMBER_LENGTH = 4; // The prelude consists of two components var PRELUDE_LENGTH = PRELUDE_MEMBER_LENGTH * 2; // Checksums are always CRC32 hashes. var CHECKSUM_LENGTH = 4; // Messages must include a full prelude, a prelude checksum, and a message checksum var MINIMUM_MESSAGE_LENGTH = PRELUDE_LENGTH + CHECKSUM_LENGTH * 2; /** * @api private * * @param {Buffer} message */ function splitMessage(message) { if (!util.Buffer.isBuffer(message)) message = toBuffer(message); if (message.length < MINIMUM_MESSAGE_LENGTH) { throw new Error('Provided message too short to accommodate event stream message overhead'); } if (message.length !== message.readUInt32BE(0)) { throw new Error('Reported message length does not match received message length'); } var expectedPreludeChecksum = message.readUInt32BE(PRELUDE_LENGTH); if ( expectedPreludeChecksum !== util.crypto.crc32( message.slice(0, PRELUDE_LENGTH) ) ) { throw new Error( 'The prelude checksum specified in the message (' + expectedPreludeChecksum + ') does not match the calculated CRC32 checksum.' ); } var expectedMessageChecksum = message.readUInt32BE(message.length - CHECKSUM_LENGTH); if ( expectedMessageChecksum !== util.crypto.crc32( message.slice(0, message.length - CHECKSUM_LENGTH) ) ) { throw new Error( 'The message checksum did not match the expected value of ' + expectedMessageChecksum ); } var headersStart = PRELUDE_LENGTH + CHECKSUM_LENGTH; var headersEnd = headersStart + message.readUInt32BE(PRELUDE_MEMBER_LENGTH); return { headers: message.slice(headersStart, headersEnd), body: message.slice(headersEnd, message.length - CHECKSUM_LENGTH), }; } /** * @api private */ module.exports = { splitMessage: splitMessage }; /***/ }), /***/ 69643: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { /** * What is necessary to create an event stream in node? * - http response stream * - parser * - event stream model */ var EventMessageChunkerStream = __webpack_require__(18518).EventMessageChunkerStream; var EventUnmarshallerStream = __webpack_require__(93773).EventUnmarshallerStream; function createEventStream(stream, parser, model) { var eventStream = new EventUnmarshallerStream({ parser: parser, eventStreamModel: model }); var eventMessageChunker = new EventMessageChunkerStream(); stream.pipe( eventMessageChunker ).pipe(eventStream); stream.on('error', function(err) { eventMessageChunker.emit('error', err); }); eventMessageChunker.on('error', function(err) { eventStream.emit('error', err); }); return eventStream; } /** * @api private */ module.exports = { createEventStream: createEventStream }; /***/ }), /***/ 54995: /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => { var AWS = __webpack_require__(28437); var SequentialExecutor = __webpack_require__(55948); var DISCOVER_ENDPOINT = __webpack_require__(45313).discoverEndpoint; /** * The namespace used to register global event listeners for request building * and sending. */ AWS.EventListeners = { /** * @!attribute VALIDATE_CREDENTIALS * A request listener that validates whether the request is being * sent with credentials. * Handles the {AWS.Request~validate 'validate' Request event} * @example Sending a request without validating credentials * var listener = AWS.EventListeners.Core.VALIDATE_CREDENTIALS; * request.removeListener('validate', listener); * @readonly * @return [Function] * @!attribute VALIDATE_REGION * A request listener that validates whether the region is set * for a request. * Handles the {AWS.Request~validate 'validate' Request event} * @example Sending a request without validating region configuration * var listener = AWS.EventListeners.Core.VALIDATE_REGION; * request.removeListener('validate', listener); * @readonly * @return [Function] * @!attribute VALIDATE_PARAMETERS * A request listener that validates input parameters in a request. * Handles the {AWS.Request~validate 'validate' Request event} * @example Sending a request without validating parameters * var listener = AWS.EventListeners.Core.VALIDATE_PARAMETERS; * request.removeListener('validate', listener); * @example Disable parameter validation globally * AWS.EventListeners.Core.removeListener('validate', * AWS.EventListeners.Core.VALIDATE_REGION); * @readonly * @return [Function] * @!attribute SEND * A request listener that initiates the HTTP connection for a * request being sent. Handles the {AWS.Request~send 'send' Request event} * @example Replacing the HTTP handler * var listener = AWS.EventListeners.Core.SEND; * request.removeListener('send', listener); * request.on('send', function(response) { * customHandler.send(response); * }); * @return [Function] * @readonly * @!attribute HTTP_DATA * A request listener that reads data from the HTTP connection in order * to build the response data. * Handles the {AWS.Request~httpData 'httpData' Request event}. * Remove this handler if you are overriding the 'httpData' event and * do not want extra data processing and buffering overhead. * @example Disabling default data processing * var listener = AWS.EventListeners.Core.HTTP_DATA; * request.removeListener('httpData', listener); * @return [Function] * @readonly */ Core: {} /* doc hack */ }; /** * @api private */ function getOperationAuthtype(req) { if (!req.service.api.operations) { return ''; } var operation = req.service.api.operations[req.operation]; return operation ? operation.authtype : ''; } AWS.EventListeners = { Core: new SequentialExecutor().addNamedListeners(function(add, addAsync) { addAsync('VALIDATE_CREDENTIALS', 'validate', function VALIDATE_CREDENTIALS(req, done) { if (!req.service.api.signatureVersion && !req.service.config.signatureVersion) return done(); // none req.service.config.getCredentials(function(err) { if (err) { req.response.error = AWS.util.error(err, {code: 'CredentialsError', message: 'Missing credentials in config, if using AWS_CONFIG_FILE, set AWS_SDK_LOAD_CONFIG=1'}); } done(); }); }); add('VALIDATE_REGION', 'validate', function VALIDATE_REGION(req) { if (!req.service.isGlobalEndpoint) { var dnsHostRegex = new RegExp(/^([a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9-]{0,61}[a-zA-Z0-9])$/); if (!req.service.config.region) { req.response.error = AWS.util.error(new Error(), {code: 'ConfigError', message: 'Missing region in config'}); } else if (!dnsHostRegex.test(req.service.config.region)) { req.response.error = AWS.util.error(new Error(), {code: 'ConfigError', message: 'Invalid region in config'}); } } }); add('BUILD_IDEMPOTENCY_TOKENS', 'validate', function BUILD_IDEMPOTENCY_TOKENS(req) { if (!req.service.api.operations) { return; } var operation = req.service.api.operations[req.operation]; if (!operation) { return; } var idempotentMembers = operation.idempotentMembers; if (!idempotentMembers.length) { return; } // creates a copy of params so user's param object isn't mutated var params = AWS.util.copy(req.params); for (var i = 0, iLen = idempotentMembers.length; i < iLen; i++) { if (!params[idempotentMembers[i]]) { // add the member params[idempotentMembers[i]] = AWS.util.uuid.v4(); } } req.params = params; }); add('VALIDATE_PARAMETERS', 'validate', function VALIDATE_PARAMETERS(req) { if (!req.service.api.operations) { return; } var rules = req.service.api.operations[req.operation].input; var validation = req.service.config.paramValidation; new AWS.ParamValidator(validation).validate(rules, req.params); }); addAsync('COMPUTE_SHA256', 'afterBuild', function COMPUTE_SHA256(req, done) { req.haltHandlersOnError(); if (!req.service.api.operations) { return; } var operation = req.service.api.operations[req.operation]; var authtype = operation ? operation.authtype : ''; if (!req.service.api.signatureVersion && !authtype && !req.service.config.signatureVersion) return done(); // none if (req.service.getSignerClass(req) === AWS.Signers.V4) { var body = req.httpRequest.body || ''; if (authtype.indexOf('unsigned-body') >= 0) { req.httpRequest.headers['X-Amz-Content-Sha256'] = 'UNSIGNED-PAYLOAD'; return done(); } AWS.util.computeSha256(body, function(err, sha) { if (err) { done(err); } else { req.httpRequest.headers['X-Amz-Content-Sha256'] = sha; done(); } }); } else { done(); } }); add('SET_CONTENT_LENGTH', 'afterBuild', function SET_CONTENT_LENGTH(req) { var authtype = getOperationAuthtype(req); var payloadMember = AWS.util.getRequestPayloadShape(req); if (req.httpRequest.headers['Content-Length'] === undefined) { try { var length = AWS.util.string.byteLength(req.httpRequest.body); req.httpRequest.headers['Content-Length'] = length; } catch (err) { if (payloadMember && payloadMember.isStreaming) { if (payloadMember.requiresLength) { //streaming payload requires length(s3, glacier) throw err; } else if (authtype.indexOf('unsigned-body') >= 0) { //unbounded streaming payload(lex, mediastore) req.httpRequest.headers['Transfer-Encoding'] = 'chunked'; return; } else { throw err; } } throw err; } } }); add('SET_HTTP_HOST', 'afterBuild', function SET_HTTP_HOST(req) { req.httpRequest.headers['Host'] = req.httpRequest.endpoint.host; }); add('RESTART', 'restart', function RESTART() { var err = this.response.error; if (!err || !err.retryable) return; this.httpRequest = new AWS.HttpRequest( this.service.endpoint, this.service.region ); if (this.response.retryCount < this.service.config.maxRetries) { this.response.retryCount++; } else { this.response.error = null; } }); var addToHead = true; addAsync('DISCOVER_ENDPOINT', 'sign', DISCOVER_ENDPOINT, addToHead); addAsync('SIGN', 'sign', function SIGN(req, done) { var service = req.service; var operations = req.service.api.operations || {}; var operation = operations[req.operation]; var authtype = operation ? operation.authtype : ''; if (!service.api.signatureVersion && !authtype && !service.config.signatureVersion) return done(); // none service.config.getCredentials(function (err, credentials) { if (err) { req.response.error = err; return done(); } try { var date = service.getSkewCorrectedDate(); var SignerClass = service.getSignerClass(req); var signer = new SignerClass(req.httpRequest, service.getSigningName(req), { signatureCache: service.config.signatureCache, operation: operation, signatureVersion: service.api.signatureVersion }); signer.setServiceClientId(service._clientId); // clear old authorization headers delete req.httpRequest.headers['Authorization']; delete req.httpRequest.headers['Date']; delete req.httpRequest.headers['X-Amz-Date']; // add new authorization signer.addAuthorization(credentials, date); req.signedAt = date; } catch (e) { req.response.error = e; } done(); }); }); add('VALIDATE_RESPONSE', 'validateResponse', function VALIDATE_RESPONSE(resp) { if (this.service.successfulResponse(resp, this)) { resp.data = {}; resp.error = null; } else { resp.data = null; resp.error = AWS.util.error(new Error(), {code: 'UnknownError', message: 'An unknown error occurred.'}); } }); addAsync('SEND', 'send', function SEND(resp, done) { resp.httpResponse._abortCallback = done; resp.error = null; resp.data = null; function callback(httpResp) { resp.httpResponse.stream = httpResp; var stream = resp.request.httpRequest.stream; var service = resp.request.service; var api = service.api; var operationName = resp.request.operation; var operation = api.operations[operationName] || {}; httpResp.on('headers', function onHeaders(statusCode, headers, statusMessage) { resp.request.emit( 'httpHeaders', [statusCode, headers, resp, statusMessage] ); if (!resp.httpResponse.streaming) { if (AWS.HttpClient.streamsApiVersion === 2) { // streams2 API check // if we detect event streams, we're going to have to // return the stream immediately if (operation.hasEventOutput && service.successfulResponse(resp)) { // skip reading the IncomingStream resp.request.emit('httpDone'); done(); return; } httpResp.on('readable', function onReadable() { var data = httpResp.read(); if (data !== null) { resp.request.emit('httpData', [data, resp]); } }); } else { // legacy streams API httpResp.on('data', function onData(data) { resp.request.emit('httpData', [data, resp]); }); } } }); httpResp.on('end', function onEnd() { if (!stream || !stream.didCallback) { if (AWS.HttpClient.streamsApiVersion === 2 && (operation.hasEventOutput && service.successfulResponse(resp))) { // don't concatenate response chunks when streaming event stream data when response is successful return; } resp.request.emit('httpDone'); done(); } }); } function progress(httpResp) { httpResp.on('sendProgress', function onSendProgress(value) { resp.request.emit('httpUploadProgress', [value, resp]); }); httpResp.on('receiveProgress', function onReceiveProgress(value) { resp.request.emit('httpDownloadProgress', [value, resp]); }); } function error(err) { if (err.code !== 'RequestAbortedError') { var errCode = err.code === 'TimeoutError' ? err.code : 'NetworkingError'; err = AWS.util.error(err, { code: errCode, region: resp.request.httpRequest.region, hostname: resp.request.httpRequest.endpoint.hostname, retryable: true }); } resp.error = err; resp.request.emit('httpError', [resp.error, resp], function() { done(); }); } function executeSend() { var http = AWS.HttpClient.getInstance(); var httpOptions = resp.request.service.config.httpOptions || {}; try { var stream = http.handleRequest(resp.request.httpRequest, httpOptions, callback, error); progress(stream); } catch (err) { error(err); } } var timeDiff = (resp.request.service.getSkewCorrectedDate() - this.signedAt) / 1000; if (timeDiff >= 60 * 10) { // if we signed 10min ago, re-sign this.emit('sign', [this], function(err) { if (err) done(err); else executeSend(); }); } else { executeSend(); } }); add('HTTP_HEADERS', 'httpHeaders', function HTTP_HEADERS(statusCode, headers, resp, statusMessage) { resp.httpResponse.statusCode = statusCode; resp.httpResponse.statusMessage = statusMessage; resp.httpResponse.headers = headers; resp.httpResponse.body = AWS.util.buffer.toBuffer(''); resp.httpResponse.buffers = []; resp.httpResponse.numBytes = 0; var dateHeader = headers.date || headers.Date; var service = resp.request.service; if (dateHeader) { var serverTime = Date.parse(dateHeader); if (service.config.correctClockSkew && service.isClockSkewed(serverTime)) { service.applyClockOffset(serverTime); } } }); add('HTTP_DATA', 'httpData', function HTTP_DATA(chunk, resp) { if (chunk) { if (AWS.util.isNode()) { resp.httpResponse.numBytes += chunk.length; var total = resp.httpResponse.headers['content-length']; var progress = { loaded: resp.httpResponse.numBytes, total: total }; resp.request.emit('httpDownloadProgress', [progress, resp]); } resp.httpResponse.buffers.push(AWS.util.buffer.toBuffer(chunk)); } }); add('HTTP_DONE', 'httpDone', function HTTP_DONE(resp) { // convert buffers array into single buffer if (resp.httpResponse.buffers && resp.httpResponse.buffers.length > 0) { var body = AWS.util.buffer.concat(resp.httpResponse.buffers); resp.httpResponse.body = body; } delete resp.httpResponse.numBytes; delete resp.httpResponse.buffers; }); add('FINALIZE_ERROR', 'retry', function FINALIZE_ERROR(resp) { if (resp.httpResponse.statusCode) { resp.error.statusCode = resp.httpResponse.statusCode; if (resp.error.retryable === undefined) { resp.error.retryable = this.service.retryableError(resp.error, this); } } }); add('INVALIDATE_CREDENTIALS', 'retry', function INVALIDATE_CREDENTIALS(resp) { if (!resp.error) return; switch (resp.error.code) { case 'RequestExpired': // EC2 only case 'ExpiredTokenException': case 'ExpiredToken': resp.error.retryable = true; resp.request.service.config.credentials.expired = true; } }); add('EXPIRED_SIGNATURE', 'retry', function EXPIRED_SIGNATURE(resp) { var err = resp.error; if (!err) return; if (typeof err.code === 'string' && typeof err.message === 'string') { if (err.code.match(/Signature/) && err.message.match(/expired/)) { resp.error.retryable = true; } } }); add('CLOCK_SKEWED', 'retry', function CLOCK_SKEWED(resp) { if (!resp.error) return; if (this.service.clockSkewError(resp.error) && this.service.config.correctClockSkew) { resp.error.retryable = true; } }); add('REDIRECT', 'retry', function REDIRECT(resp) { if (resp.error && resp.error.statusCode >= 300 && resp.error.statusCode < 400 && resp.httpResponse.headers['location']) { this.httpRequest.endpoint = new AWS.Endpoint(resp.httpResponse.headers['location']); this.httpRequest.headers['Host'] = this.httpRequest.endpoint.host; resp.error.redirect = true; resp.error.retryable = true; } }); add('RETRY_CHECK', 'retry', function RETRY_CHECK(resp) { if (resp.error) { if (resp.error.redirect && resp.redirectCount < resp.maxRedirects) { resp.error.retryDelay = 0; } else if (resp.retryCount < resp.maxRetries) { resp.error.retryDelay = this.service.retryDelays(resp.retryCount, resp.error) || 0; } } }); addAsync('RESET_RETRY_STATE', 'afterRetry', function RESET_RETRY_STATE(resp, done) { var delay, willRetry = false; if (resp.error) { delay = resp.error.retryDelay || 0; if (resp.error.retryable && resp.retryCount < resp.maxRetries) { resp.retryCount++; willRetry = true; } else if (resp.error.redirect && resp.redirectCount < resp.maxRedirects) { resp.redirectCount++; willRetry = true; } } // delay < 0 is a signal from customBackoff to skip retries if (willRetry && delay >= 0) { resp.error = null; setTimeout(done, delay); } else { done(); } }); }), CorePost: new SequentialExecutor().addNamedListeners(function(add) { add('EXTRACT_REQUEST_ID', 'extractData', AWS.util.extractRequestId); add('EXTRACT_REQUEST_ID', 'extractError', AWS.util.extractRequestId); add('ENOTFOUND_ERROR', 'httpError', function ENOTFOUND_ERROR(err) { function isDNSError(err) { return err.errno === 'ENOTFOUND' || typeof err.errno === 'number' && typeof AWS.util.getSystemErrorName === 'function' && ['EAI_NONAME', 'EAI_NODATA'].indexOf(AWS.util.getSystemErrorName(err.errno) >= 0); } if (err.code === 'NetworkingError' && isDNSError(err)) { var message = 'Inaccessible host: `' + err.hostname + '\'. This service may not be available in the `' + err.region + '\' region.'; this.response.error = AWS.util.error(new Error(message), { code: 'UnknownEndpoint', region: err.region, hostname: err.hostname, retryable: true, originalError: err }); } }); }), Logger: new SequentialExecutor().addNamedListeners(function(add) { add('LOG_REQUEST', 'complete', function LOG_REQUEST(resp) { var req = resp.request; var logger = req.service.config.logger; if (!logger) return; function filterSensitiveLog(inputShape, shape) { if (!shape) { return shape; } if (inputShape.isSensitive) { return '***SensitiveInformation***'; } switch (inputShape.type) { case 'structure': var struct = {}; AWS.util.each(shape, function(subShapeName, subShape) { if (Object.prototype.hasOwnProperty.call(inputShape.members, subShapeName)) { struct[subShapeName] = filterSensitiveLog(inputShape.members[subShapeName], subShape); } else { struct[subShapeName] = subShape; } }); return struct; case 'list': var list = []; AWS.util.arrayEach(shape, function(subShape, index) { list.push(filterSensitiveLog(inputShape.member, subShape)); }); return list; case 'map': var map = {}; AWS.util.each(shape, function(key, value) { map[key] = filterSensitiveLog(inputShape.value, value); }); return map; default: return shape; } } function buildMessage() { var time = resp.request.service.getSkewCorrectedDate().getTime(); var delta = (time - req.startTime.getTime()) / 1000; var ansi = logger.isTTY ? true : false; var status = resp.httpResponse.statusCode; var censoredParams = req.params; if ( req.service.api.operations && req.service.api.operations[req.operation] && req.service.api.operations[req.operation].input ) { var inputShape = req.service.api.operations[req.operation].input; censoredParams = filterSensitiveLog(inputShape, req.params); } var params = __webpack_require__(31669).inspect(censoredParams, true, null); var message = ''; if (ansi) message += '\x1B[33m'; message += '[AWS ' + req.service.serviceIdentifier + ' ' + status; message += ' ' + delta.toString() + 's ' + resp.retryCount + ' retries]'; if (ansi) message += '\x1B[0;1m'; message += ' ' + AWS.util.string.lowerFirst(req.operation); message += '(' + params + ')'; if (ansi) message += '\x1B[0m'; return message; } var line = buildMessage(); if (typeof logger.log === 'function') { logger.log(line); } else if (typeof logger.write === 'function') { logger.write(line + '\n'); } }); }), Json: new SequentialExecutor().addNamedListeners(function(add) { var svc = __webpack_require__(30083); add('BUILD', 'build', svc.buildRequest); add('EXTRACT_DATA', 'extractData', svc.extractData); add('EXTRACT_ERROR', 'extractError', svc.extractError); }), Rest: new SequentialExecutor().addNamedListeners(function(add) { var svc = __webpack_require__(98200); add('BUILD', 'build', svc.buildRequest); add('EXTRACT_DATA', 'extractData', svc.extractData); add('EXTRACT_ERROR', 'extractError', svc.extractError); }), RestJson: new SequentialExecutor().addNamedListeners(function(add) { var svc = __webpack_require__(5883); add('BUILD', 'build', svc.buildRequest); add('EXTRACT_DATA', 'extractData', svc.extractData); add('EXTRACT_ERROR', 'extractError', svc.extractError); }), RestXml: new SequentialExecutor().addNamedListeners(function(add) { var svc = __webpack_require__(15143); add('BUILD', 'build', svc.buildRequest); add('EXTRACT_DATA', 'extractData', svc.extractData); add('EXTRACT_ERROR', 'extractError', svc.extractError); }), Query: new SequentialExecutor().addNamedListeners(function(add) { var svc = __webpack_require__(90761); add('BUILD', 'build', svc.buildRequest); add('EXTRACT_DATA', 'extractData', svc.extractData); add('EXTRACT_ERROR', 'extractError', svc.extractError); }) }; /***/ }), /***/ 1556: /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => { var AWS = __webpack_require__(28437); var inherit = AWS.util.inherit; /** * The endpoint that a service will talk to, for example, * `'https://ec2.ap-southeast-1.amazonaws.com'`. If * you need to override an endpoint for a service, you can * set the endpoint on a service by passing the endpoint * object with the `endpoint` option key: * * ```javascript * var ep = new AWS.Endpoint('awsproxy.example.com'); * var s3 = new AWS.S3({endpoint: ep}); * s3.service.endpoint.hostname == 'awsproxy.example.com' * ``` * * Note that if you do not specify a protocol, the protocol will * be selected based on your current {AWS.config} configuration. * * @!attribute protocol * @return [String] the protocol (http or https) of the endpoint * URL * @!attribute hostname * @return [String] the host portion of the endpoint, e.g., * example.com * @!attribute host * @return [String] the host portion of the endpoint including * the port, e.g., example.com:80 * @!attribute port * @return [Integer] the port of the endpoint * @!attribute href * @return [String] the full URL of the endpoint */ AWS.Endpoint = inherit({ /** * @overload Endpoint(endpoint) * Constructs a new endpoint given an endpoint URL. If the * URL omits a protocol (http or https), the default protocol * set in the global {AWS.config} will be used. * @param endpoint [String] the URL to construct an endpoint from */ constructor: function Endpoint(endpoint, config) { AWS.util.hideProperties(this, ['slashes', 'auth', 'hash', 'search', 'query']); if (typeof endpoint === 'undefined' || endpoint === null) { throw new Error('Invalid endpoint: ' + endpoint); } else if (typeof endpoint !== 'string') { return AWS.util.copy(endpoint); } if (!endpoint.match(/^http/)) { var useSSL = config && config.sslEnabled !== undefined ? config.sslEnabled : AWS.config.sslEnabled; endpoint = (useSSL ? 'https' : 'http') + '://' + endpoint; } AWS.util.update(this, AWS.util.urlParse(endpoint)); // Ensure the port property is set as an integer if (this.port) { this.port = parseInt(this.port, 10); } else { this.port = this.protocol === 'https:' ? 443 : 80; } } }); /** * The low level HTTP request object, encapsulating all HTTP header * and body data sent by a service request. * * @!attribute method * @return [String] the HTTP method of the request * @!attribute path * @return [String] the path portion of the URI, e.g., * "/list/?start=5&num=10" * @!attribute headers * @return [map] * a map of header keys and their respective values * @!attribute body * @return [String] the request body payload * @!attribute endpoint * @return [AWS.Endpoint] the endpoint for the request * @!attribute region * @api private * @return [String] the region, for signing purposes only. */ AWS.HttpRequest = inherit({ /** * @api private */ constructor: function HttpRequest(endpoint, region) { endpoint = new AWS.Endpoint(endpoint); this.method = 'POST'; this.path = endpoint.path || '/'; this.headers = {}; this.body = ''; this.endpoint = endpoint; this.region = region; this._userAgent = ''; this.setUserAgent(); }, /** * @api private */ setUserAgent: function setUserAgent() { this._userAgent = this.headers[this.getUserAgentHeaderName()] = AWS.util.userAgent(); }, getUserAgentHeaderName: function getUserAgentHeaderName() { var prefix = AWS.util.isBrowser() ? 'X-Amz-' : ''; return prefix + 'User-Agent'; }, /** * @api private */ appendToUserAgent: function appendToUserAgent(agentPartial) { if (typeof agentPartial === 'string' && agentPartial) { this._userAgent += ' ' + agentPartial; } this.headers[this.getUserAgentHeaderName()] = this._userAgent; }, /** * @api private */ getUserAgent: function getUserAgent() { return this._userAgent; }, /** * @return [String] the part of the {path} excluding the * query string */ pathname: function pathname() { return this.path.split('?', 1)[0]; }, /** * @return [String] the query string portion of the {path} */ search: function search() { var query = this.path.split('?', 2)[1]; if (query) { query = AWS.util.queryStringParse(query); return AWS.util.queryParamsToString(query); } return ''; }, /** * @api private * update httpRequest endpoint with endpoint string */ updateEndpoint: function updateEndpoint(endpointStr) { var newEndpoint = new AWS.Endpoint(endpointStr); this.endpoint = newEndpoint; this.path = newEndpoint.path || '/'; if (this.headers['Host']) { this.headers['Host'] = newEndpoint.host; } } }); /** * The low level HTTP response object, encapsulating all HTTP header * and body data returned from the request. * * @!attribute statusCode * @return [Integer] the HTTP status code of the response (e.g., 200, 404) * @!attribute headers * @return [map] * a map of response header keys and their respective values * @!attribute body * @return [String] the response body payload * @!attribute [r] streaming * @return [Boolean] whether this response is being streamed at a low-level. * Defaults to `false` (buffered reads). Do not modify this manually, use * {createUnbufferedStream} to convert the stream to unbuffered mode * instead. */ AWS.HttpResponse = inherit({ /** * @api private */ constructor: function HttpResponse() { this.statusCode = undefined; this.headers = {}; this.body = undefined; this.streaming = false; this.stream = null; }, /** * Disables buffering on the HTTP response and returns the stream for reading. * @return [Stream, XMLHttpRequest, null] the underlying stream object. * Use this object to directly read data off of the stream. * @note This object is only available after the {AWS.Request~httpHeaders} * event has fired. This method must be called prior to * {AWS.Request~httpData}. * @example Taking control of a stream * request.on('httpHeaders', function(statusCode, headers) { * if (statusCode < 300) { * if (headers.etag === 'xyz') { * // pipe the stream, disabling buffering * var stream = this.response.httpResponse.createUnbufferedStream(); * stream.pipe(process.stdout); * } else { // abort this request and set a better error message * this.abort(); * this.response.error = new Error('Invalid ETag'); * } * } * }).send(console.log); */ createUnbufferedStream: function createUnbufferedStream() { this.streaming = true; return this.stream; } }); AWS.HttpClient = inherit({}); /** * @api private */ AWS.HttpClient.getInstance = function getInstance() { if (this.singleton === undefined) { this.singleton = new this(); } return this.singleton; }; /***/ }), /***/ 2310: /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => { var AWS = __webpack_require__(28437); var Stream = AWS.util.stream.Stream; var TransformStream = AWS.util.stream.Transform; var ReadableStream = AWS.util.stream.Readable; __webpack_require__(1556); var CONNECTION_REUSE_ENV_NAME = 'AWS_NODEJS_CONNECTION_REUSE_ENABLED'; /** * @api private */ AWS.NodeHttpClient = AWS.util.inherit({ handleRequest: function handleRequest(httpRequest, httpOptions, callback, errCallback) { var self = this; var endpoint = httpRequest.endpoint; var pathPrefix = ''; if (!httpOptions) httpOptions = {}; if (httpOptions.proxy) { pathPrefix = endpoint.protocol + '//' + endpoint.hostname; if (endpoint.port !== 80 && endpoint.port !== 443) { pathPrefix += ':' + endpoint.port; } endpoint = new AWS.Endpoint(httpOptions.proxy); } var useSSL = endpoint.protocol === 'https:'; var http = useSSL ? __webpack_require__(57211) : __webpack_require__(98605); var options = { host: endpoint.hostname, port: endpoint.port, method: httpRequest.method, headers: httpRequest.headers, path: pathPrefix + httpRequest.path }; if (!httpOptions.agent) { options.agent = this.getAgent(useSSL, { keepAlive: process.env[CONNECTION_REUSE_ENV_NAME] === '1' ? true : false }); } AWS.util.update(options, httpOptions); delete options.proxy; // proxy isn't an HTTP option delete options.timeout; // timeout isn't an HTTP option var stream = http.request(options, function (httpResp) { if (stream.didCallback) return; callback(httpResp); httpResp.emit( 'headers', httpResp.statusCode, httpResp.headers, httpResp.statusMessage ); }); httpRequest.stream = stream; // attach stream to httpRequest stream.didCallback = false; // connection timeout support if (httpOptions.connectTimeout) { var connectTimeoutId; stream.on('socket', function(socket) { if (socket.connecting) { connectTimeoutId = setTimeout(function connectTimeout() { if (stream.didCallback) return; stream.didCallback = true; stream.abort(); errCallback(AWS.util.error( new Error('Socket timed out without establishing a connection'), {code: 'TimeoutError'} )); }, httpOptions.connectTimeout); socket.on('connect', function() { clearTimeout(connectTimeoutId); connectTimeoutId = null; }); } }); } // timeout support stream.setTimeout(httpOptions.timeout || 0, function() { if (stream.didCallback) return; stream.didCallback = true; var msg = 'Connection timed out after ' + httpOptions.timeout + 'ms'; errCallback(AWS.util.error(new Error(msg), {code: 'TimeoutError'})); stream.abort(); }); stream.on('error', function() { if (connectTimeoutId) { clearTimeout(connectTimeoutId); connectTimeoutId = null; } if (stream.didCallback) return; stream.didCallback = true; errCallback.apply(stream, arguments); }); var expect = httpRequest.headers.Expect || httpRequest.headers.expect; if (expect === '100-continue') { stream.once('continue', function() { self.writeBody(stream, httpRequest); }); } else { this.writeBody(stream, httpRequest); } return stream; }, writeBody: function writeBody(stream, httpRequest) { var body = httpRequest.body; var totalBytes = parseInt(httpRequest.headers['Content-Length'], 10); if (body instanceof Stream) { // For progress support of streaming content - // pipe the data through a transform stream to emit 'sendProgress' events var progressStream = this.progressStream(stream, totalBytes); if (progressStream) { body.pipe(progressStream).pipe(stream); } else { body.pipe(stream); } } else if (body) { // The provided body is a buffer/string and is already fully available in memory - // For performance it's best to send it as a whole by calling stream.end(body), // Callers expect a 'sendProgress' event which is best emitted once // the http request stream has been fully written and all data flushed. // The use of totalBytes is important over body.length for strings where // length is char length and not byte length. stream.once('finish', function() { stream.emit('sendProgress', { loaded: totalBytes, total: totalBytes }); }); stream.end(body); } else { // no request body stream.end(); } }, /** * Create the https.Agent or http.Agent according to the request schema. */ getAgent: function getAgent(useSSL, agentOptions) { var http = useSSL ? __webpack_require__(57211) : __webpack_require__(98605); if (useSSL) { if (!AWS.NodeHttpClient.sslAgent) { AWS.NodeHttpClient.sslAgent = new http.Agent(AWS.util.merge({ rejectUnauthorized: process.env.NODE_TLS_REJECT_UNAUTHORIZED === '0' ? false : true }, agentOptions || {})); AWS.NodeHttpClient.sslAgent.setMaxListeners(0); // delegate maxSockets to globalAgent, set a default limit of 50 if current value is Infinity. // Users can bypass this default by supplying their own Agent as part of SDK configuration. Object.defineProperty(AWS.NodeHttpClient.sslAgent, 'maxSockets', { enumerable: true, get: function() { var defaultMaxSockets = 50; var globalAgent = http.globalAgent; if (globalAgent && globalAgent.maxSockets !== Infinity && typeof globalAgent.maxSockets === 'number') { return globalAgent.maxSockets; } return defaultMaxSockets; } }); } return AWS.NodeHttpClient.sslAgent; } else { if (!AWS.NodeHttpClient.agent) { AWS.NodeHttpClient.agent = new http.Agent(agentOptions); } return AWS.NodeHttpClient.agent; } }, progressStream: function progressStream(stream, totalBytes) { if (typeof TransformStream === 'undefined') { // for node 0.8 there is no streaming progress return; } var loadedBytes = 0; var reporter = new TransformStream(); reporter._transform = function(chunk, encoding, callback) { if (chunk) { loadedBytes += chunk.length; stream.emit('sendProgress', { loaded: loadedBytes, total: totalBytes }); } callback(null, chunk); }; return reporter; }, emitter: null }); /** * @!ignore */ /** * @api private */ AWS.HttpClient.prototype = AWS.NodeHttpClient.prototype; /** * @api private */ AWS.HttpClient.streamsApiVersion = ReadableStream ? 2 : 1; /***/ }), /***/ 47495: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { var util = __webpack_require__(77985); function JsonBuilder() { } JsonBuilder.prototype.build = function(value, shape) { return JSON.stringify(translate(value, shape)); }; function translate(value, shape) { if (!shape || value === undefined || value === null) return undefined; switch (shape.type) { case 'structure': return translateStructure(value, shape); case 'map': return translateMap(value, shape); case 'list': return translateList(value, shape); default: return translateScalar(value, shape); } } function translateStructure(structure, shape) { var struct = {}; util.each(structure, function(name, value) { var memberShape = shape.members[name]; if (memberShape) { if (memberShape.location !== 'body') return; var locationName = memberShape.isLocationName ? memberShape.name : name; var result = translate(value, memberShape); if (result !== undefined) struct[locationName] = result; } }); return struct; } function translateList(list, shape) { var out = []; util.arrayEach(list, function(value) { var result = translate(value, shape.member); if (result !== undefined) out.push(result); }); return out; } function translateMap(map, shape) { var out = {}; util.each(map, function(key, value) { var result = translate(value, shape.value); if (result !== undefined) out[key] = result; }); return out; } function translateScalar(value, shape) { return shape.toWireFormat(value); } /** * @api private */ module.exports = JsonBuilder; /***/ }), /***/ 5474: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { var util = __webpack_require__(77985); function JsonParser() { } JsonParser.prototype.parse = function(value, shape) { return translate(JSON.parse(value), shape); }; function translate(value, shape) { if (!shape || value === undefined) return undefined; switch (shape.type) { case 'structure': return translateStructure(value, shape); case 'map': return translateMap(value, shape); case 'list': return translateList(value, shape); default: return translateScalar(value, shape); } } function translateStructure(structure, shape) { if (structure == null) return undefined; var struct = {}; var shapeMembers = shape.members; util.each(shapeMembers, function(name, memberShape) { var locationName = memberShape.isLocationName ? memberShape.name : name; if (Object.prototype.hasOwnProperty.call(structure, locationName)) { var value = structure[locationName]; var result = translate(value, memberShape); if (result !== undefined) struct[name] = result; } }); return struct; } function translateList(list, shape) { if (list == null) return undefined; var out = []; util.arrayEach(list, function(value) { var result = translate(value, shape.member); if (result === undefined) out.push(null); else out.push(result); }); return out; } function translateMap(map, shape) { if (map == null) return undefined; var out = {}; util.each(map, function(key, value) { var result = translate(value, shape.value); if (result === undefined) out[key] = null; else out[key] = result; }); return out; } function translateScalar(value, shape) { return shape.toType(value); } /** * @api private */ module.exports = JsonParser; /***/ }), /***/ 25768: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { var AWS = __webpack_require__(28437); __webpack_require__(1556); var inherit = AWS.util.inherit; /** * Represents a metadata service available on EC2 instances. Using the * {request} method, you can receieve metadata about any available resource * on the metadata service. * * You can disable the use of the IMDS by setting the AWS_EC2_METADATA_DISABLED * environment variable to a truthy value. * * @!attribute [r] httpOptions * @return [map] a map of options to pass to the underlying HTTP request: * * * **timeout** (Number) — a timeout value in milliseconds to wait * before aborting the connection. Set to 0 for no timeout. * * @!macro nobrowser */ AWS.MetadataService = inherit({ /** * @return [String] the hostname of the instance metadata service */ host: '169.254.169.254', /** * @!ignore */ /** * Default HTTP options. By default, the metadata service is set to not * timeout on long requests. This means that on non-EC2 machines, this * request will never return. If you are calling this operation from an * environment that may not always run on EC2, set a `timeout` value so * the SDK will abort the request after a given number of milliseconds. */ httpOptions: { timeout: 0 }, /** * when enabled, metadata service will not fetch token */ disableFetchToken: false, /** * Creates a new MetadataService object with a given set of options. * * @option options host [String] the hostname of the instance metadata * service * @option options httpOptions [map] a map of options to pass to the * underlying HTTP request: * * * **timeout** (Number) — a timeout value in milliseconds to wait * before aborting the connection. Set to 0 for no timeout. * @option options maxRetries [Integer] the maximum number of retries to * perform for timeout errors * @option options retryDelayOptions [map] A set of options to configure the * retry delay on retryable errors. See AWS.Config for details. */ constructor: function MetadataService(options) { AWS.util.update(this, options); }, /** * Sends a request to the instance metadata service for a given resource. * * @param path [String] the path of the resource to get * * @param options [map] an optional map used to make request * * * **method** (String) — HTTP request method * * * **headers** (map) — a map of response header keys and their respective values * * @callback callback function(err, data) * Called when a response is available from the service. * @param err [Error, null] if an error occurred, this value will be set * @param data [String, null] if the request was successful, the body of * the response */ request: function request(path, options, callback) { if (arguments.length === 2) { callback = options; options = {}; } if (process.env[AWS.util.imdsDisabledEnv]) { callback(new Error('EC2 Instance Metadata Service access disabled')); return; } path = path || '/'; var httpRequest = new AWS.HttpRequest('http://' + this.host + path); httpRequest.method = options.method || 'GET'; if (options.headers) { httpRequest.headers = options.headers; } AWS.util.handleRequestWithRetries(httpRequest, this, callback); }, /** * @api private */ loadCredentialsCallbacks: [], /** * Fetches metadata token used for getting credentials * * @api private * @callback callback function(err, token) * Called when token is loaded from the resource */ fetchMetadataToken: function fetchMetadataToken(callback) { var self = this; var tokenFetchPath = '/latest/api/token'; self.request( tokenFetchPath, { 'method': 'PUT', 'headers': { 'x-aws-ec2-metadata-token-ttl-seconds': '21600' } }, callback ); }, /** * Fetches credentials * * @api private * @callback cb function(err, creds) * Called when credentials are loaded from the resource */ fetchCredentials: function fetchCredentials(options, cb) { var self = this; var basePath = '/latest/meta-data/iam/security-credentials/'; self.request(basePath, options, function (err, roleName) { if (err) { self.disableFetchToken = !(err.statusCode === 401); cb(AWS.util.error( err, { message: 'EC2 Metadata roleName request returned error' } )); return; } roleName = roleName.split('\n')[0]; // grab first (and only) role self.request(basePath + roleName, options, function (credErr, credData) { if (credErr) { self.disableFetchToken = !(credErr.statusCode === 401); cb(AWS.util.error( credErr, { message: 'EC2 Metadata creds request returned error' } )); return; } try { var credentials = JSON.parse(credData); cb(null, credentials); } catch (parseError) { cb(parseError); } }); }); }, /** * Loads a set of credentials stored in the instance metadata service * * @api private * @callback callback function(err, credentials) * Called when credentials are loaded from the resource * @param err [Error] if an error occurred, this value will be set * @param credentials [Object] the raw JSON object containing all * metadata from the credentials resource */ loadCredentials: function loadCredentials(callback) { var self = this; self.loadCredentialsCallbacks.push(callback); if (self.loadCredentialsCallbacks.length > 1) { return; } function callbacks(err, creds) { var cb; while ((cb = self.loadCredentialsCallbacks.shift()) !== undefined) { cb(err, creds); } } if (self.disableFetchToken) { self.fetchCredentials({}, callbacks); } else { self.fetchMetadataToken(function(tokenError, token) { if (tokenError) { if (tokenError.code === 'TimeoutError') { self.disableFetchToken = true; } else if (tokenError.retryable === true) { callbacks(AWS.util.error( tokenError, { message: 'EC2 Metadata token request returned error' } )); return; } else if (tokenError.statusCode === 400) { callbacks(AWS.util.error( tokenError, { message: 'EC2 Metadata token request returned 400' } )); return; } } var options = {}; if (token) { options.headers = { 'x-aws-ec2-metadata-token': token }; } self.fetchCredentials(options, callbacks); }); } } }); /** * @api private */ module.exports = AWS.MetadataService; /***/ }), /***/ 17657: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { var Collection = __webpack_require__(71965); var Operation = __webpack_require__(28083); var Shape = __webpack_require__(71349); var Paginator = __webpack_require__(45938); var ResourceWaiter = __webpack_require__(41368); var metadata = __webpack_require__(49497); var util = __webpack_require__(77985); var property = util.property; var memoizedProperty = util.memoizedProperty; function Api(api, options) { var self = this; api = api || {}; options = options || {}; options.api = this; api.metadata = api.metadata || {}; var serviceIdentifier = options.serviceIdentifier; delete options.serviceIdentifier; property(this, 'isApi', true, false); property(this, 'apiVersion', api.metadata.apiVersion); property(this, 'endpointPrefix', api.metadata.endpointPrefix); property(this, 'signingName', api.metadata.signingName); property(this, 'globalEndpoint', api.metadata.globalEndpoint); property(this, 'signatureVersion', api.metadata.signatureVersion); property(this, 'jsonVersion', api.metadata.jsonVersion); property(this, 'targetPrefix', api.metadata.targetPrefix); property(this, 'protocol', api.metadata.protocol); property(this, 'timestampFormat', api.metadata.timestampFormat); property(this, 'xmlNamespaceUri', api.metadata.xmlNamespace); property(this, 'abbreviation', api.metadata.serviceAbbreviation); property(this, 'fullName', api.metadata.serviceFullName); property(this, 'serviceId', api.metadata.serviceId); if (serviceIdentifier && metadata[serviceIdentifier]) { property(this, 'xmlNoDefaultLists', metadata[serviceIdentifier].xmlNoDefaultLists, false); } memoizedProperty(this, 'className', function() { var name = api.metadata.serviceAbbreviation || api.metadata.serviceFullName; if (!name) return null; name = name.replace(/^Amazon|AWS\s*|\(.*|\s+|\W+/g, ''); if (name === 'ElasticLoadBalancing') name = 'ELB'; return name; }); function addEndpointOperation(name, operation) { if (operation.endpointoperation === true) { property(self, 'endpointOperation', util.string.lowerFirst(name)); } if (operation.endpointdiscovery && !self.hasRequiredEndpointDiscovery) { property( self, 'hasRequiredEndpointDiscovery', operation.endpointdiscovery.required === true ); } } property(this, 'operations', new Collection(api.operations, options, function(name, operation) { return new Operation(name, operation, options); }, util.string.lowerFirst, addEndpointOperation)); property(this, 'shapes', new Collection(api.shapes, options, function(name, shape) { return Shape.create(shape, options); })); property(this, 'paginators', new Collection(api.paginators, options, function(name, paginator) { return new Paginator(name, paginator, options); })); property(this, 'waiters', new Collection(api.waiters, options, function(name, waiter) { return new ResourceWaiter(name, waiter, options); }, util.string.lowerFirst)); if (options.documentation) { property(this, 'documentation', api.documentation); property(this, 'documentationUrl', api.documentationUrl); } } /** * @api private */ module.exports = Api; /***/ }), /***/ 71965: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { var memoizedProperty = __webpack_require__(77985).memoizedProperty; function memoize(name, value, factory, nameTr) { memoizedProperty(this, nameTr(name), function() { return factory(name, value); }); } function Collection(iterable, options, factory, nameTr, callback) { nameTr = nameTr || String; var self = this; for (var id in iterable) { if (Object.prototype.hasOwnProperty.call(iterable, id)) { memoize.call(self, id, iterable[id], factory, nameTr); if (callback) callback(id, iterable[id]); } } } /** * @api private */ module.exports = Collection; /***/ }), /***/ 28083: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { var Shape = __webpack_require__(71349); var util = __webpack_require__(77985); var property = util.property; var memoizedProperty = util.memoizedProperty; function Operation(name, operation, options) { var self = this; options = options || {}; property(this, 'name', operation.name || name); property(this, 'api', options.api, false); operation.http = operation.http || {}; property(this, 'endpoint', operation.endpoint); property(this, 'httpMethod', operation.http.method || 'POST'); property(this, 'httpPath', operation.http.requestUri || '/'); property(this, 'authtype', operation.authtype || ''); property( this, 'endpointDiscoveryRequired', operation.endpointdiscovery ? (operation.endpointdiscovery.required ? 'REQUIRED' : 'OPTIONAL') : 'NULL' ); memoizedProperty(this, 'input', function() { if (!operation.input) { return new Shape.create({type: 'structure'}, options); } return Shape.create(operation.input, options); }); memoizedProperty(this, 'output', function() { if (!operation.output) { return new Shape.create({type: 'structure'}, options); } return Shape.create(operation.output, options); }); memoizedProperty(this, 'errors', function() { var list = []; if (!operation.errors) return null; for (var i = 0; i < operation.errors.length; i++) { list.push(Shape.create(operation.errors[i], options)); } return list; }); memoizedProperty(this, 'paginator', function() { return options.api.paginators[name]; }); if (options.documentation) { property(this, 'documentation', operation.documentation); property(this, 'documentationUrl', operation.documentationUrl); } // idempotentMembers only tracks top-level input shapes memoizedProperty(this, 'idempotentMembers', function() { var idempotentMembers = []; var input = self.input; var members = input.members; if (!input.members) { return idempotentMembers; } for (var name in members) { if (!members.hasOwnProperty(name)) { continue; } if (members[name].isIdempotent === true) { idempotentMembers.push(name); } } return idempotentMembers; }); memoizedProperty(this, 'hasEventOutput', function() { var output = self.output; return hasEventStream(output); }); } function hasEventStream(topLevelShape) { var members = topLevelShape.members; var payload = topLevelShape.payload; if (!topLevelShape.members) { return false; } if (payload) { var payloadMember = members[payload]; return payloadMember.isEventStream; } // check if any member is an event stream for (var name in members) { if (!members.hasOwnProperty(name)) { if (members[name].isEventStream === true) { return true; } } } return false; } /** * @api private */ module.exports = Operation; /***/ }), /***/ 45938: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { var property = __webpack_require__(77985).property; function Paginator(name, paginator) { property(this, 'inputToken', paginator.input_token); property(this, 'limitKey', paginator.limit_key); property(this, 'moreResults', paginator.more_results); property(this, 'outputToken', paginator.output_token); property(this, 'resultKey', paginator.result_key); } /** * @api private */ module.exports = Paginator; /***/ }), /***/ 41368: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { var util = __webpack_require__(77985); var property = util.property; function ResourceWaiter(name, waiter, options) { options = options || {}; property(this, 'name', name); property(this, 'api', options.api, false); if (waiter.operation) { property(this, 'operation', util.string.lowerFirst(waiter.operation)); } var self = this; var keys = [ 'type', 'description', 'delay', 'maxAttempts', 'acceptors' ]; keys.forEach(function(key) { var value = waiter[key]; if (value) { property(self, key, value); } }); } /** * @api private */ module.exports = ResourceWaiter; /***/ }), /***/ 71349: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { var Collection = __webpack_require__(71965); var util = __webpack_require__(77985); function property(obj, name, value) { if (value !== null && value !== undefined) { util.property.apply(this, arguments); } } function memoizedProperty(obj, name) { if (!obj.constructor.prototype[name]) { util.memoizedProperty.apply(this, arguments); } } function Shape(shape, options, memberName) { options = options || {}; property(this, 'shape', shape.shape); property(this, 'api', options.api, false); property(this, 'type', shape.type); property(this, 'enum', shape.enum); property(this, 'min', shape.min); property(this, 'max', shape.max); property(this, 'pattern', shape.pattern); property(this, 'location', shape.location || this.location || 'body'); property(this, 'name', this.name || shape.xmlName || shape.queryName || shape.locationName || memberName); property(this, 'isStreaming', shape.streaming || this.isStreaming || false); property(this, 'requiresLength', shape.requiresLength, false); property(this, 'isComposite', shape.isComposite || false); property(this, 'isShape', true, false); property(this, 'isQueryName', Boolean(shape.queryName), false); property(this, 'isLocationName', Boolean(shape.locationName), false); property(this, 'isIdempotent', shape.idempotencyToken === true); property(this, 'isJsonValue', shape.jsonvalue === true); property(this, 'isSensitive', shape.sensitive === true || shape.prototype && shape.prototype.sensitive === true); property(this, 'isEventStream', Boolean(shape.eventstream), false); property(this, 'isEvent', Boolean(shape.event), false); property(this, 'isEventPayload', Boolean(shape.eventpayload), false); property(this, 'isEventHeader', Boolean(shape.eventheader), false); property(this, 'isTimestampFormatSet', Boolean(shape.timestampFormat) || shape.prototype && shape.prototype.isTimestampFormatSet === true, false); property(this, 'endpointDiscoveryId', Boolean(shape.endpointdiscoveryid), false); property(this, 'hostLabel', Boolean(shape.hostLabel), false); if (options.documentation) { property(this, 'documentation', shape.documentation); property(this, 'documentationUrl', shape.documentationUrl); } if (shape.xmlAttribute) { property(this, 'isXmlAttribute', shape.xmlAttribute || false); } // type conversion and parsing property(this, 'defaultValue', null); this.toWireFormat = function(value) { if (value === null || value === undefined) return ''; return value; }; this.toType = function(value) { return value; }; } /** * @api private */ Shape.normalizedTypes = { character: 'string', double: 'float', long: 'integer', short: 'integer', biginteger: 'integer', bigdecimal: 'float', blob: 'binary' }; /** * @api private */ Shape.types = { 'structure': StructureShape, 'list': ListShape, 'map': MapShape, 'boolean': BooleanShape, 'timestamp': TimestampShape, 'float': FloatShape, 'integer': IntegerShape, 'string': StringShape, 'base64': Base64Shape, 'binary': BinaryShape }; Shape.resolve = function resolve(shape, options) { if (shape.shape) { var refShape = options.api.shapes[shape.shape]; if (!refShape) { throw new Error('Cannot find shape reference: ' + shape.shape); } return refShape; } else { return null; } }; Shape.create = function create(shape, options, memberName) { if (shape.isShape) return shape; var refShape = Shape.resolve(shape, options); if (refShape) { var filteredKeys = Object.keys(shape); if (!options.documentation) { filteredKeys = filteredKeys.filter(function(name) { return !name.match(/documentation/); }); } // create an inline shape with extra members var InlineShape = function() { refShape.constructor.call(this, shape, options, memberName); }; InlineShape.prototype = refShape; return new InlineShape(); } else { // set type if not set if (!shape.type) { if (shape.members) shape.type = 'structure'; else if (shape.member) shape.type = 'list'; else if (shape.key) shape.type = 'map'; else shape.type = 'string'; } // normalize types var origType = shape.type; if (Shape.normalizedTypes[shape.type]) { shape.type = Shape.normalizedTypes[shape.type]; } if (Shape.types[shape.type]) { return new Shape.types[shape.type](shape, options, memberName); } else { throw new Error('Unrecognized shape type: ' + origType); } } }; function CompositeShape(shape) { Shape.apply(this, arguments); property(this, 'isComposite', true); if (shape.flattened) { property(this, 'flattened', shape.flattened || false); } } function StructureShape(shape, options) { var self = this; var requiredMap = null, firstInit = !this.isShape; CompositeShape.apply(this, arguments); if (firstInit) { property(this, 'defaultValue', function() { return {}; }); property(this, 'members', {}); property(this, 'memberNames', []); property(this, 'required', []); property(this, 'isRequired', function() { return false; }); } if (shape.members) { property(this, 'members', new Collection(shape.members, options, function(name, member) { return Shape.create(member, options, name); })); memoizedProperty(this, 'memberNames', function() { return shape.xmlOrder || Object.keys(shape.members); }); if (shape.event) { memoizedProperty(this, 'eventPayloadMemberName', function() { var members = self.members; var memberNames = self.memberNames; // iterate over members to find ones that are event payloads for (var i = 0, iLen = memberNames.length; i < iLen; i++) { if (members[memberNames[i]].isEventPayload) { return memberNames[i]; } } }); memoizedProperty(this, 'eventHeaderMemberNames', function() { var members = self.members; var memberNames = self.memberNames; var eventHeaderMemberNames = []; // iterate over members to find ones that are event headers for (var i = 0, iLen = memberNames.length; i < iLen; i++) { if (members[memberNames[i]].isEventHeader) { eventHeaderMemberNames.push(memberNames[i]); } } return eventHeaderMemberNames; }); } } if (shape.required) { property(this, 'required', shape.required); property(this, 'isRequired', function(name) { if (!requiredMap) { requiredMap = {}; for (var i = 0; i < shape.required.length; i++) { requiredMap[shape.required[i]] = true; } } return requiredMap[name]; }, false, true); } property(this, 'resultWrapper', shape.resultWrapper || null); if (shape.payload) { property(this, 'payload', shape.payload); } if (typeof shape.xmlNamespace === 'string') { property(this, 'xmlNamespaceUri', shape.xmlNamespace); } else if (typeof shape.xmlNamespace === 'object') { property(this, 'xmlNamespacePrefix', shape.xmlNamespace.prefix); property(this, 'xmlNamespaceUri', shape.xmlNamespace.uri); } } function ListShape(shape, options) { var self = this, firstInit = !this.isShape; CompositeShape.apply(this, arguments); if (firstInit) { property(this, 'defaultValue', function() { return []; }); } if (shape.member) { memoizedProperty(this, 'member', function() { return Shape.create(shape.member, options); }); } if (this.flattened) { var oldName = this.name; memoizedProperty(this, 'name', function() { return self.member.name || oldName; }); } } function MapShape(shape, options) { var firstInit = !this.isShape; CompositeShape.apply(this, arguments); if (firstInit) { property(this, 'defaultValue', function() { return {}; }); property(this, 'key', Shape.create({type: 'string'}, options)); property(this, 'value', Shape.create({type: 'string'}, options)); } if (shape.key) { memoizedProperty(this, 'key', function() { return Shape.create(shape.key, options); }); } if (shape.value) { memoizedProperty(this, 'value', function() { return Shape.create(shape.value, options); }); } } function TimestampShape(shape) { var self = this; Shape.apply(this, arguments); if (shape.timestampFormat) { property(this, 'timestampFormat', shape.timestampFormat); } else if (self.isTimestampFormatSet && this.timestampFormat) { property(this, 'timestampFormat', this.timestampFormat); } else if (this.location === 'header') { property(this, 'timestampFormat', 'rfc822'); } else if (this.location === 'querystring') { property(this, 'timestampFormat', 'iso8601'); } else if (this.api) { switch (this.api.protocol) { case 'json': case 'rest-json': property(this, 'timestampFormat', 'unixTimestamp'); break; case 'rest-xml': case 'query': case 'ec2': property(this, 'timestampFormat', 'iso8601'); break; } } this.toType = function(value) { if (value === null || value === undefined) return null; if (typeof value.toUTCString === 'function') return value; return typeof value === 'string' || typeof value === 'number' ? util.date.parseTimestamp(value) : null; }; this.toWireFormat = function(value) { return util.date.format(value, self.timestampFormat); }; } function StringShape() { Shape.apply(this, arguments); var nullLessProtocols = ['rest-xml', 'query', 'ec2']; this.toType = function(value) { value = this.api && nullLessProtocols.indexOf(this.api.protocol) > -1 ? value || '' : value; if (this.isJsonValue) { return JSON.parse(value); } return value && typeof value.toString === 'function' ? value.toString() : value; }; this.toWireFormat = function(value) { return this.isJsonValue ? JSON.stringify(value) : value; }; } function FloatShape() { Shape.apply(this, arguments); this.toType = function(value) { if (value === null || value === undefined) return null; return parseFloat(value); }; this.toWireFormat = this.toType; } function IntegerShape() { Shape.apply(this, arguments); this.toType = function(value) { if (value === null || value === undefined) return null; return parseInt(value, 10); }; this.toWireFormat = this.toType; } function BinaryShape() { Shape.apply(this, arguments); this.toType = function(value) { var buf = util.base64.decode(value); if (this.isSensitive && util.isNode() && typeof util.Buffer.alloc === 'function') { /* Node.js can create a Buffer that is not isolated. * i.e. buf.byteLength !== buf.buffer.byteLength * This means that the sensitive data is accessible to anyone with access to buf.buffer. * If this is the node shared Buffer, then other code within this process _could_ find this secret. * Copy sensitive data to an isolated Buffer and zero the sensitive data. * While this is safe to do here, copying this code somewhere else may produce unexpected results. */ var secureBuf = util.Buffer.alloc(buf.length, buf); buf.fill(0); buf = secureBuf; } return buf; }; this.toWireFormat = util.base64.encode; } function Base64Shape() { BinaryShape.apply(this, arguments); } function BooleanShape() { Shape.apply(this, arguments); this.toType = function(value) { if (typeof value === 'boolean') return value; if (value === null || value === undefined) return null; return value === 'true'; }; } /** * @api private */ Shape.shapes = { StructureShape: StructureShape, ListShape: ListShape, MapShape: MapShape, StringShape: StringShape, BooleanShape: BooleanShape, Base64Shape: Base64Shape }; /** * @api private */ module.exports = Shape; /***/ }), /***/ 73639: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { var util = __webpack_require__(77985); util.isBrowser = function() { return false; }; util.isNode = function() { return true; }; // node.js specific modules util.crypto.lib = __webpack_require__(33373); util.Buffer = __webpack_require__(64293).Buffer; util.domain = __webpack_require__(85229); util.stream = __webpack_require__(92413); util.url = __webpack_require__(78835); util.querystring = __webpack_require__(71191); util.environment = 'nodejs'; util.createEventStream = util.stream.Readable ? __webpack_require__(69643).createEventStream : __webpack_require__(63727).createEventStream; util.realClock = __webpack_require__(81370); util.clientSideMonitoring = { Publisher: __webpack_require__(66807).Publisher, configProvider: __webpack_require__(91822), }; util.iniLoader = __webpack_require__(29697)/* .iniLoader */ .b; util.getSystemErrorName = __webpack_require__(31669).getSystemErrorName; var AWS; /** * @api private */ module.exports = AWS = __webpack_require__(28437); __webpack_require__(53819); __webpack_require__(36965); __webpack_require__(77360); __webpack_require__(44694); __webpack_require__(74998); __webpack_require__(3498); __webpack_require__(15037); __webpack_require__(80371); // Load the xml2js XML parser AWS.XML.Parser = __webpack_require__(96752); // Load Node HTTP client __webpack_require__(2310); __webpack_require__(95417); // Load custom credential providers __webpack_require__(11017); __webpack_require__(73379); __webpack_require__(88764); __webpack_require__(10645); __webpack_require__(57714); __webpack_require__(27454); __webpack_require__(13754); __webpack_require__(80371); // Setup default chain providers // If this changes, please update documentation for // AWS.CredentialProviderChain.defaultProviders in // credentials/credential_provider_chain.js AWS.CredentialProviderChain.defaultProviders = [ function () { return new AWS.EnvironmentCredentials('AWS'); }, function () { return new AWS.EnvironmentCredentials('AMAZON'); }, function () { return new AWS.SharedIniFileCredentials(); }, function () { return new AWS.ECSCredentials(); }, function () { return new AWS.ProcessCredentials(); }, function () { return new AWS.TokenFileWebIdentityCredentials(); }, function () { return new AWS.EC2MetadataCredentials(); } ]; // Update configuration keys AWS.util.update(AWS.Config.prototype.keys, { credentials: function () { var credentials = null; new AWS.CredentialProviderChain([ function () { return new AWS.EnvironmentCredentials('AWS'); }, function () { return new AWS.EnvironmentCredentials('AMAZON'); }, function () { return new AWS.SharedIniFileCredentials({ disableAssumeRole: true }); } ]).resolve(function(err, creds) { if (!err) credentials = creds; }); return credentials; }, credentialProvider: function() { return new AWS.CredentialProviderChain(); }, logger: function () { return process.env.AWSJS_DEBUG ? console : null; }, region: function() { var env = process.env; var region = env.AWS_REGION || env.AMAZON_REGION; if (env[AWS.util.configOptInEnv]) { var toCheck = [ {filename: env[AWS.util.sharedCredentialsFileEnv]}, {isConfig: true, filename: env[AWS.util.sharedConfigFileEnv]} ]; var iniLoader = AWS.util.iniLoader; while (!region && toCheck.length) { var configFile = {}; var fileInfo = toCheck.shift(); try { configFile = iniLoader.loadFrom(fileInfo); } catch (err) { if (fileInfo.isConfig) throw err; } var profile = configFile[env.AWS_PROFILE || AWS.util.defaultProfile]; region = profile && profile.region; } } return region; } }); // Reset configuration AWS.config = new AWS.Config(); /***/ }), /***/ 99127: /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => { var AWS = __webpack_require__(28437); /** * @api private */ AWS.ParamValidator = AWS.util.inherit({ /** * Create a new validator object. * * @param validation [Boolean|map] whether input parameters should be * validated against the operation description before sending the * request. Pass a map to enable any of the following specific * validation features: * * * **min** [Boolean] — Validates that a value meets the min * constraint. This is enabled by default when paramValidation is set * to `true`. * * **max** [Boolean] — Validates that a value meets the max * constraint. * * **pattern** [Boolean] — Validates that a string value matches a * regular expression. * * **enum** [Boolean] — Validates that a string value matches one * of the allowable enum values. */ constructor: function ParamValidator(validation) { if (validation === true || validation === undefined) { validation = {'min': true}; } this.validation = validation; }, validate: function validate(shape, params, context) { this.errors = []; this.validateMember(shape, params || {}, context || 'params'); if (this.errors.length > 1) { var msg = this.errors.join('\n* '); msg = 'There were ' + this.errors.length + ' validation errors:\n* ' + msg; throw AWS.util.error(new Error(msg), {code: 'MultipleValidationErrors', errors: this.errors}); } else if (this.errors.length === 1) { throw this.errors[0]; } else { return true; } }, fail: function fail(code, message) { this.errors.push(AWS.util.error(new Error(message), {code: code})); }, validateStructure: function validateStructure(shape, params, context) { this.validateType(params, context, ['object'], 'structure'); var paramName; for (var i = 0; shape.required && i < shape.required.length; i++) { paramName = shape.required[i]; var value = params[paramName]; if (value === undefined || value === null) { this.fail('MissingRequiredParameter', 'Missing required key \'' + paramName + '\' in ' + context); } } // validate hash members for (paramName in params) { if (!Object.prototype.hasOwnProperty.call(params, paramName)) continue; var paramValue = params[paramName], memberShape = shape.members[paramName]; if (memberShape !== undefined) { var memberContext = [context, paramName].join('.'); this.validateMember(memberShape, paramValue, memberContext); } else if (paramValue !== undefined && paramValue !== null) { this.fail('UnexpectedParameter', 'Unexpected key \'' + paramName + '\' found in ' + context); } } return true; }, validateMember: function validateMember(shape, param, context) { switch (shape.type) { case 'structure': return this.validateStructure(shape, param, context); case 'list': return this.validateList(shape, param, context); case 'map': return this.validateMap(shape, param, context); default: return this.validateScalar(shape, param, context); } }, validateList: function validateList(shape, params, context) { if (this.validateType(params, context, [Array])) { this.validateRange(shape, params.length, context, 'list member count'); // validate array members for (var i = 0; i < params.length; i++) { this.validateMember(shape.member, params[i], context + '[' + i + ']'); } } }, validateMap: function validateMap(shape, params, context) { if (this.validateType(params, context, ['object'], 'map')) { // Build up a count of map members to validate range traits. var mapCount = 0; for (var param in params) { if (!Object.prototype.hasOwnProperty.call(params, param)) continue; // Validate any map key trait constraints this.validateMember(shape.key, param, context + '[key=\'' + param + '\']'); this.validateMember(shape.value, params[param], context + '[\'' + param + '\']'); mapCount++; } this.validateRange(shape, mapCount, context, 'map member count'); } }, validateScalar: function validateScalar(shape, value, context) { switch (shape.type) { case null: case undefined: case 'string': return this.validateString(shape, value, context); case 'base64': case 'binary': return this.validatePayload(value, context); case 'integer': case 'float': return this.validateNumber(shape, value, context); case 'boolean': return this.validateType(value, context, ['boolean']); case 'timestamp': return this.validateType(value, context, [Date, /^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}(\.\d+)?Z$/, 'number'], 'Date object, ISO-8601 string, or a UNIX timestamp'); default: return this.fail('UnkownType', 'Unhandled type ' + shape.type + ' for ' + context); } }, validateString: function validateString(shape, value, context) { var validTypes = ['string']; if (shape.isJsonValue) { validTypes = validTypes.concat(['number', 'object', 'boolean']); } if (value !== null && this.validateType(value, context, validTypes)) { this.validateEnum(shape, value, context); this.validateRange(shape, value.length, context, 'string length'); this.validatePattern(shape, value, context); this.validateUri(shape, value, context); } }, validateUri: function validateUri(shape, value, context) { if (shape['location'] === 'uri') { if (value.length === 0) { this.fail('UriParameterError', 'Expected uri parameter to have length >= 1,' + ' but found "' + value +'" for ' + context); } } }, validatePattern: function validatePattern(shape, value, context) { if (this.validation['pattern'] && shape['pattern'] !== undefined) { if (!(new RegExp(shape['pattern'])).test(value)) { this.fail('PatternMatchError', 'Provided value "' + value + '" ' + 'does not match regex pattern /' + shape['pattern'] + '/ for ' + context); } } }, validateRange: function validateRange(shape, value, context, descriptor) { if (this.validation['min']) { if (shape['min'] !== undefined && value < shape['min']) { this.fail('MinRangeError', 'Expected ' + descriptor + ' >= ' + shape['min'] + ', but found ' + value + ' for ' + context); } } if (this.validation['max']) { if (shape['max'] !== undefined && value > shape['max']) { this.fail('MaxRangeError', 'Expected ' + descriptor + ' <= ' + shape['max'] + ', but found ' + value + ' for ' + context); } } }, validateEnum: function validateRange(shape, value, context) { if (this.validation['enum'] && shape['enum'] !== undefined) { // Fail if the string value is not present in the enum list if (shape['enum'].indexOf(value) === -1) { this.fail('EnumError', 'Found string value of ' + value + ', but ' + 'expected ' + shape['enum'].join('|') + ' for ' + context); } } }, validateType: function validateType(value, context, acceptedTypes, type) { // We will not log an error for null or undefined, but we will return // false so that callers know that the expected type was not strictly met. if (value === null || value === undefined) return false; var foundInvalidType = false; for (var i = 0; i < acceptedTypes.length; i++) { if (typeof acceptedTypes[i] === 'string') { if (typeof value === acceptedTypes[i]) return true; } else if (acceptedTypes[i] instanceof RegExp) { if ((value || '').toString().match(acceptedTypes[i])) return true; } else { if (value instanceof acceptedTypes[i]) return true; if (AWS.util.isType(value, acceptedTypes[i])) return true; if (!type && !foundInvalidType) acceptedTypes = acceptedTypes.slice(); acceptedTypes[i] = AWS.util.typeName(acceptedTypes[i]); } foundInvalidType = true; } var acceptedType = type; if (!acceptedType) { acceptedType = acceptedTypes.join(', ').replace(/,([^,]+)$/, ', or$1'); } var vowel = acceptedType.match(/^[aeiou]/i) ? 'n' : ''; this.fail('InvalidParameterType', 'Expected ' + context + ' to be a' + vowel + ' ' + acceptedType); return false; }, validateNumber: function validateNumber(shape, value, context) { if (value === null || value === undefined) return; if (typeof value === 'string') { var castedValue = parseFloat(value); if (castedValue.toString() === value) value = castedValue; } if (this.validateType(value, context, ['number'])) { this.validateRange(shape, value, context, 'numeric value'); } }, validatePayload: function validatePayload(value, context) { if (value === null || value === undefined) return; if (typeof value === 'string') return; if (value && typeof value.byteLength === 'number') return; // typed arrays if (AWS.util.isNode()) { // special check for buffer/stream in Node.js var Stream = AWS.util.stream.Stream; if (AWS.util.Buffer.isBuffer(value) || value instanceof Stream) return; } else { if (typeof Blob !== void 0 && value instanceof Blob) return; } var types = ['Buffer', 'Stream', 'File', 'Blob', 'ArrayBuffer', 'DataView']; if (value) { for (var i = 0; i < types.length; i++) { if (AWS.util.isType(value, types[i])) return; if (AWS.util.typeName(value.constructor) === types[i]) return; } } this.fail('InvalidParameterType', 'Expected ' + context + ' to be a ' + 'string, Buffer, Stream, Blob, or typed array object'); } }); /***/ }), /***/ 44086: /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => { var AWS = __webpack_require__(28437); var rest = AWS.Protocol.Rest; /** * A presigner object can be used to generate presigned urls for the Polly service. */ AWS.Polly.Presigner = AWS.util.inherit({ /** * Creates a presigner object with a set of configuration options. * * @option options params [map] An optional map of parameters to bind to every * request sent by this service object. * @option options service [AWS.Polly] An optional pre-configured instance * of the AWS.Polly service object to use for requests. The object may * bound parameters used by the presigner. * @see AWS.Polly.constructor */ constructor: function Signer(options) { options = options || {}; this.options = options; this.service = options.service; this.bindServiceObject(options); this._operations = {}; }, /** * @api private */ bindServiceObject: function bindServiceObject(options) { options = options || {}; if (!this.service) { this.service = new AWS.Polly(options); } else { var config = AWS.util.copy(this.service.config); this.service = new this.service.constructor.__super__(config); this.service.config.params = AWS.util.merge(this.service.config.params || {}, options.params); } }, /** * @api private */ modifyInputMembers: function modifyInputMembers(input) { // make copies of the input so we don't overwrite the api // need to be careful to copy anything we access/modify var modifiedInput = AWS.util.copy(input); modifiedInput.members = AWS.util.copy(input.members); AWS.util.each(input.members, function(name, member) { modifiedInput.members[name] = AWS.util.copy(member); // update location and locationName if (!member.location || member.location === 'body') { modifiedInput.members[name].location = 'querystring'; modifiedInput.members[name].locationName = name; } }); return modifiedInput; }, /** * @api private */ convertPostToGet: function convertPostToGet(req) { // convert method req.httpRequest.method = 'GET'; var operation = req.service.api.operations[req.operation]; // get cached operation input first var input = this._operations[req.operation]; if (!input) { // modify the original input this._operations[req.operation] = input = this.modifyInputMembers(operation.input); } var uri = rest.generateURI(req.httpRequest.endpoint.path, operation.httpPath, input, req.params); req.httpRequest.path = uri; req.httpRequest.body = ''; // don't need these headers on a GET request delete req.httpRequest.headers['Content-Length']; delete req.httpRequest.headers['Content-Type']; }, /** * @overload getSynthesizeSpeechUrl(params = {}, [expires = 3600], [callback]) * Generate a presigned url for {AWS.Polly.synthesizeSpeech}. * @note You must ensure that you have static or previously resolved * credentials if you call this method synchronously (with no callback), * otherwise it may not properly sign the request. If you cannot guarantee * this (you are using an asynchronous credential provider, i.e., EC2 * IAM roles), you should always call this method with an asynchronous * callback. * @param params [map] parameters to pass to the operation. See the {AWS.Polly.synthesizeSpeech} * operation for the expected operation parameters. * @param expires [Integer] (3600) the number of seconds to expire the pre-signed URL operation in. * Defaults to 1 hour. * @return [string] if called synchronously (with no callback), returns the signed URL. * @return [null] nothing is returned if a callback is provided. * @callback callback function (err, url) * If a callback is supplied, it is called when a signed URL has been generated. * @param err [Error] the error object returned from the presigner. * @param url [String] the signed URL. * @see AWS.Polly.synthesizeSpeech */ getSynthesizeSpeechUrl: function getSynthesizeSpeechUrl(params, expires, callback) { var self = this; var request = this.service.makeRequest('synthesizeSpeech', params); // remove existing build listeners request.removeAllListeners('build'); request.on('build', function(req) { self.convertPostToGet(req); }); return request.presign(expires, callback); } }); /***/ }), /***/ 97969: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { var util = __webpack_require__(77985); var AWS = __webpack_require__(28437); /** * Prepend prefix defined by API model to endpoint that's already * constructed. This feature does not apply to operations using * endpoint discovery and can be disabled. * @api private */ function populateHostPrefix(request) { var enabled = request.service.config.hostPrefixEnabled; if (!enabled) return request; var operationModel = request.service.api.operations[request.operation]; //don't marshal host prefix when operation has endpoint discovery traits if (hasEndpointDiscover(request)) return request; if (operationModel.endpoint && operationModel.endpoint.hostPrefix) { var hostPrefixNotation = operationModel.endpoint.hostPrefix; var hostPrefix = expandHostPrefix(hostPrefixNotation, request.params, operationModel.input); prependEndpointPrefix(request.httpRequest.endpoint, hostPrefix); validateHostname(request.httpRequest.endpoint.hostname); } return request; } /** * @api private */ function hasEndpointDiscover(request) { var api = request.service.api; var operationModel = api.operations[request.operation]; var isEndpointOperation = api.endpointOperation && (api.endpointOperation === util.string.lowerFirst(operationModel.name)); return (operationModel.endpointDiscoveryRequired !== 'NULL' || isEndpointOperation === true); } /** * @api private */ function expandHostPrefix(hostPrefixNotation, params, shape) { util.each(shape.members, function(name, member) { if (member.hostLabel === true) { if (typeof params[name] !== 'string' || params[name] === '') { throw util.error(new Error(), { message: 'Parameter ' + name + ' should be a non-empty string.', code: 'InvalidParameter' }); } var regex = new RegExp('\\{' + name + '\\}', 'g'); hostPrefixNotation = hostPrefixNotation.replace(regex, params[name]); } }); return hostPrefixNotation; } /** * @api private */ function prependEndpointPrefix(endpoint, prefix) { if (endpoint.host) { endpoint.host = prefix + endpoint.host; } if (endpoint.hostname) { endpoint.hostname = prefix + endpoint.hostname; } } /** * @api private */ function validateHostname(hostname) { var labels = hostname.split('.'); //Reference: https://tools.ietf.org/html/rfc1123#section-2 var hostPattern = /^[a-zA-Z0-9]{1}$|^[a-zA-Z0-9][a-zA-Z0-9\-]*[a-zA-Z0-9]$/; util.arrayEach(labels, function(label) { if (!label.length || label.length < 1 || label.length > 63) { throw util.error(new Error(), { code: 'ValidationError', message: 'Hostname label length should be between 1 to 63 characters, inclusive.' }); } if (!hostPattern.test(label)) { throw AWS.util.error(new Error(), {code: 'ValidationError', message: label + ' is not hostname compatible.'}); } }); } module.exports = { populateHostPrefix: populateHostPrefix }; /***/ }), /***/ 30083: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { var util = __webpack_require__(77985); var JsonBuilder = __webpack_require__(47495); var JsonParser = __webpack_require__(5474); var populateHostPrefix = __webpack_require__(97969).populateHostPrefix; function buildRequest(req) { var httpRequest = req.httpRequest; var api = req.service.api; var target = api.targetPrefix + '.' + api.operations[req.operation].name; var version = api.jsonVersion || '1.0'; var input = api.operations[req.operation].input; var builder = new JsonBuilder(); if (version === 1) version = '1.0'; httpRequest.body = builder.build(req.params || {}, input); httpRequest.headers['Content-Type'] = 'application/x-amz-json-' + version; httpRequest.headers['X-Amz-Target'] = target; populateHostPrefix(req); } function extractError(resp) { var error = {}; var httpResponse = resp.httpResponse; error.code = httpResponse.headers['x-amzn-errortype'] || 'UnknownError'; if (typeof error.code === 'string') { error.code = error.code.split(':')[0]; } if (httpResponse.body.length > 0) { try { var e = JSON.parse(httpResponse.body.toString()); var code = e.__type || e.code || e.Code; if (code) { error.code = code.split('#').pop(); } if (error.code === 'RequestEntityTooLarge') { error.message = 'Request body must be less than 1 MB'; } else { error.message = (e.message || e.Message || null); } } catch (e) { error.statusCode = httpResponse.statusCode; error.message = httpResponse.statusMessage; } } else { error.statusCode = httpResponse.statusCode; error.message = httpResponse.statusCode.toString(); } resp.error = util.error(new Error(), error); } function extractData(resp) { var body = resp.httpResponse.body.toString() || '{}'; if (resp.request.service.config.convertResponseTypes === false) { resp.data = JSON.parse(body); } else { var operation = resp.request.service.api.operations[resp.request.operation]; var shape = operation.output || {}; var parser = new JsonParser(); resp.data = parser.parse(body, shape); } } /** * @api private */ module.exports = { buildRequest: buildRequest, extractError: extractError, extractData: extractData }; /***/ }), /***/ 90761: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { var AWS = __webpack_require__(28437); var util = __webpack_require__(77985); var QueryParamSerializer = __webpack_require__(45175); var Shape = __webpack_require__(71349); var populateHostPrefix = __webpack_require__(97969).populateHostPrefix; function buildRequest(req) { var operation = req.service.api.operations[req.operation]; var httpRequest = req.httpRequest; httpRequest.headers['Content-Type'] = 'application/x-www-form-urlencoded; charset=utf-8'; httpRequest.params = { Version: req.service.api.apiVersion, Action: operation.name }; // convert the request parameters into a list of query params, // e.g. Deeply.NestedParam.0.Name=value var builder = new QueryParamSerializer(); builder.serialize(req.params, operation.input, function(name, value) { httpRequest.params[name] = value; }); httpRequest.body = util.queryParamsToString(httpRequest.params); populateHostPrefix(req); } function extractError(resp) { var data, body = resp.httpResponse.body.toString(); if (body.match(' { var util = __webpack_require__(77985); var populateHostPrefix = __webpack_require__(97969).populateHostPrefix; function populateMethod(req) { req.httpRequest.method = req.service.api.operations[req.operation].httpMethod; } function generateURI(endpointPath, operationPath, input, params) { var uri = [endpointPath, operationPath].join('/'); uri = uri.replace(/\/+/g, '/'); var queryString = {}, queryStringSet = false; util.each(input.members, function (name, member) { var paramValue = params[name]; if (paramValue === null || paramValue === undefined) return; if (member.location === 'uri') { var regex = new RegExp('\\{' + member.name + '(\\+)?\\}'); uri = uri.replace(regex, function(_, plus) { var fn = plus ? util.uriEscapePath : util.uriEscape; return fn(String(paramValue)); }); } else if (member.location === 'querystring') { queryStringSet = true; if (member.type === 'list') { queryString[member.name] = paramValue.map(function(val) { return util.uriEscape(member.member.toWireFormat(val).toString()); }); } else if (member.type === 'map') { util.each(paramValue, function(key, value) { if (Array.isArray(value)) { queryString[key] = value.map(function(val) { return util.uriEscape(String(val)); }); } else { queryString[key] = util.uriEscape(String(value)); } }); } else { queryString[member.name] = util.uriEscape(member.toWireFormat(paramValue).toString()); } } }); if (queryStringSet) { uri += (uri.indexOf('?') >= 0 ? '&' : '?'); var parts = []; util.arrayEach(Object.keys(queryString).sort(), function(key) { if (!Array.isArray(queryString[key])) { queryString[key] = [queryString[key]]; } for (var i = 0; i < queryString[key].length; i++) { parts.push(util.uriEscape(String(key)) + '=' + queryString[key][i]); } }); uri += parts.join('&'); } return uri; } function populateURI(req) { var operation = req.service.api.operations[req.operation]; var input = operation.input; var uri = generateURI(req.httpRequest.endpoint.path, operation.httpPath, input, req.params); req.httpRequest.path = uri; } function populateHeaders(req) { var operation = req.service.api.operations[req.operation]; util.each(operation.input.members, function (name, member) { var value = req.params[name]; if (value === null || value === undefined) return; if (member.location === 'headers' && member.type === 'map') { util.each(value, function(key, memberValue) { req.httpRequest.headers[member.name + key] = memberValue; }); } else if (member.location === 'header') { value = member.toWireFormat(value).toString(); if (member.isJsonValue) { value = util.base64.encode(value); } req.httpRequest.headers[member.name] = value; } }); } function buildRequest(req) { populateMethod(req); populateURI(req); populateHeaders(req); populateHostPrefix(req); } function extractError() { } function extractData(resp) { var req = resp.request; var data = {}; var r = resp.httpResponse; var operation = req.service.api.operations[req.operation]; var output = operation.output; // normalize headers names to lower-cased keys for matching var headers = {}; util.each(r.headers, function (k, v) { headers[k.toLowerCase()] = v; }); util.each(output.members, function(name, member) { var header = (member.name || name).toLowerCase(); if (member.location === 'headers' && member.type === 'map') { data[name] = {}; var location = member.isLocationName ? member.name : ''; var pattern = new RegExp('^' + location + '(.+)', 'i'); util.each(r.headers, function (k, v) { var result = k.match(pattern); if (result !== null) { data[name][result[1]] = v; } }); } else if (member.location === 'header') { if (headers[header] !== undefined) { var value = member.isJsonValue ? util.base64.decode(headers[header]) : headers[header]; data[name] = member.toType(value); } } else if (member.location === 'statusCode') { data[name] = parseInt(r.statusCode, 10); } }); resp.data = data; } /** * @api private */ module.exports = { buildRequest: buildRequest, extractError: extractError, extractData: extractData, generateURI: generateURI }; /***/ }), /***/ 5883: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { var util = __webpack_require__(77985); var Rest = __webpack_require__(98200); var Json = __webpack_require__(30083); var JsonBuilder = __webpack_require__(47495); var JsonParser = __webpack_require__(5474); function populateBody(req) { var builder = new JsonBuilder(); var input = req.service.api.operations[req.operation].input; if (input.payload) { var params = {}; var payloadShape = input.members[input.payload]; params = req.params[input.payload]; if (params === undefined) return; if (payloadShape.type === 'structure') { req.httpRequest.body = builder.build(params, payloadShape); applyContentTypeHeader(req); } else { // non-JSON payload req.httpRequest.body = params; if (payloadShape.type === 'binary' || payloadShape.isStreaming) { applyContentTypeHeader(req, true); } } } else { var body = builder.build(req.params, input); if (body !== '{}' || req.httpRequest.method !== 'GET') { //don't send empty body for GET method req.httpRequest.body = body; } applyContentTypeHeader(req); } } function applyContentTypeHeader(req, isBinary) { var operation = req.service.api.operations[req.operation]; var input = operation.input; if (!req.httpRequest.headers['Content-Type']) { var type = isBinary ? 'binary/octet-stream' : 'application/json'; req.httpRequest.headers['Content-Type'] = type; } } function buildRequest(req) { Rest.buildRequest(req); // never send body payload on HEAD/DELETE if (['HEAD', 'DELETE'].indexOf(req.httpRequest.method) < 0) { populateBody(req); } } function extractError(resp) { Json.extractError(resp); } function extractData(resp) { Rest.extractData(resp); var req = resp.request; var operation = req.service.api.operations[req.operation]; var rules = req.service.api.operations[req.operation].output || {}; var parser; var hasEventOutput = operation.hasEventOutput; if (rules.payload) { var payloadMember = rules.members[rules.payload]; var body = resp.httpResponse.body; if (payloadMember.isEventStream) { parser = new JsonParser(); resp.data[payload] = util.createEventStream( AWS.HttpClient.streamsApiVersion === 2 ? resp.httpResponse.stream : body, parser, payloadMember ); } else if (payloadMember.type === 'structure' || payloadMember.type === 'list') { var parser = new JsonParser(); resp.data[rules.payload] = parser.parse(body, payloadMember); } else if (payloadMember.type === 'binary' || payloadMember.isStreaming) { resp.data[rules.payload] = body; } else { resp.data[rules.payload] = payloadMember.toType(body); } } else { var data = resp.data; Json.extractData(resp); resp.data = util.merge(data, resp.data); } } /** * @api private */ module.exports = { buildRequest: buildRequest, extractError: extractError, extractData: extractData }; /***/ }), /***/ 15143: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { var AWS = __webpack_require__(28437); var util = __webpack_require__(77985); var Rest = __webpack_require__(98200); function populateBody(req) { var input = req.service.api.operations[req.operation].input; var builder = new AWS.XML.Builder(); var params = req.params; var payload = input.payload; if (payload) { var payloadMember = input.members[payload]; params = params[payload]; if (params === undefined) return; if (payloadMember.type === 'structure') { var rootElement = payloadMember.name; req.httpRequest.body = builder.toXML(params, payloadMember, rootElement, true); } else { // non-xml payload req.httpRequest.body = params; } } else { req.httpRequest.body = builder.toXML(params, input, input.name || input.shape || util.string.upperFirst(req.operation) + 'Request'); } } function buildRequest(req) { Rest.buildRequest(req); // never send body payload on GET/HEAD if (['GET', 'HEAD'].indexOf(req.httpRequest.method) < 0) { populateBody(req); } } function extractError(resp) { Rest.extractError(resp); var data; try { data = new AWS.XML.Parser().parse(resp.httpResponse.body.toString()); } catch (e) { data = { Code: resp.httpResponse.statusCode, Message: resp.httpResponse.statusMessage }; } if (data.Errors) data = data.Errors; if (data.Error) data = data.Error; if (data.Code) { resp.error = util.error(new Error(), { code: data.Code, message: data.Message }); } else { resp.error = util.error(new Error(), { code: resp.httpResponse.statusCode, message: null }); } } function extractData(resp) { Rest.extractData(resp); var parser; var req = resp.request; var body = resp.httpResponse.body; var operation = req.service.api.operations[req.operation]; var output = operation.output; var hasEventOutput = operation.hasEventOutput; var payload = output.payload; if (payload) { var payloadMember = output.members[payload]; if (payloadMember.isEventStream) { parser = new AWS.XML.Parser(); resp.data[payload] = util.createEventStream( AWS.HttpClient.streamsApiVersion === 2 ? resp.httpResponse.stream : resp.httpResponse.body, parser, payloadMember ); } else if (payloadMember.type === 'structure') { parser = new AWS.XML.Parser(); resp.data[payload] = parser.parse(body.toString(), payloadMember); } else if (payloadMember.type === 'binary' || payloadMember.isStreaming) { resp.data[payload] = body; } else { resp.data[payload] = payloadMember.toType(body); } } else if (body.length > 0) { parser = new AWS.XML.Parser(); var data = parser.parse(body.toString(), output); util.update(resp.data, data); } } /** * @api private */ module.exports = { buildRequest: buildRequest, extractError: extractError, extractData: extractData }; /***/ }), /***/ 91822: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { var AWS = __webpack_require__(28437); /** * Resolve client-side monitoring configuration from either environmental variables * or shared config file. Configurations from environmental variables have higher priority * than those from shared config file. The resolver will try to read the shared config file * no matter whether the AWS_SDK_LOAD_CONFIG variable is set. * @api private */ function resolveMonitoringConfig() { var config = { port: undefined, clientId: undefined, enabled: undefined, host: undefined }; if (fromEnvironment(config) || fromConfigFile(config)) return toJSType(config); return toJSType(config); } /** * Resolve configurations from environmental variables. * @param {object} client side monitoring config object needs to be resolved * @returns {boolean} whether resolving configurations is done * @api private */ function fromEnvironment(config) { config.port = config.port || process.env.AWS_CSM_PORT; config.enabled = config.enabled || process.env.AWS_CSM_ENABLED; config.clientId = config.clientId || process.env.AWS_CSM_CLIENT_ID; config.host = config.host || process.env.AWS_CSM_HOST; return config.port && config.enabled && config.clientId && config.host || ['false', '0'].indexOf(config.enabled) >= 0; //no need to read shared config file if explicitely disabled } /** * Resolve cofigurations from shared config file with specified role name * @param {object} client side monitoring config object needs to be resolved * @returns {boolean} whether resolving configurations is done * @api private */ function fromConfigFile(config) { var sharedFileConfig; try { var configFile = AWS.util.iniLoader.loadFrom({ isConfig: true, filename: process.env[AWS.util.sharedConfigFileEnv] }); var sharedFileConfig = configFile[ process.env.AWS_PROFILE || AWS.util.defaultProfile ]; } catch (err) { return false; } if (!sharedFileConfig) return config; config.port = config.port || sharedFileConfig.csm_port; config.enabled = config.enabled || sharedFileConfig.csm_enabled; config.clientId = config.clientId || sharedFileConfig.csm_client_id; config.host = config.host || sharedFileConfig.csm_host; return config.port && config.enabled && config.clientId && config.host; } /** * Transfer the resolved configuration value to proper types: port as number, enabled * as boolean and clientId as string. The 'enabled' flag is valued to false when set * to 'false' or '0'. * @param {object} resolved client side monitoring config * @api private */ function toJSType(config) { //config.XXX is either undefined or string var falsyNotations = ['false', '0', undefined]; if (!config.enabled || falsyNotations.indexOf(config.enabled.toLowerCase()) >= 0) { config.enabled = false; } else { config.enabled = true; } config.port = config.port ? parseInt(config.port, 10) : undefined; return config; } module.exports = resolveMonitoringConfig; /***/ }), /***/ 66807: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { var util = __webpack_require__(28437).util; var dgram = __webpack_require__(76200); var stringToBuffer = util.buffer.toBuffer; var MAX_MESSAGE_SIZE = 1024 * 8; // 8 KB /** * Publishes metrics via udp. * @param {object} options Paramters for Publisher constructor * @param {number} [options.port = 31000] Port number * @param {string} [options.clientId = ''] Client Identifier * @param {boolean} [options.enabled = false] enable sending metrics datagram * @api private */ function Publisher(options) { // handle configuration options = options || {}; this.enabled = options.enabled || false; this.port = options.port || 31000; this.clientId = options.clientId || ''; this.address = options.host || '127.0.0.1'; if (this.clientId.length > 255) { // ClientId has a max length of 255 this.clientId = this.clientId.substr(0, 255); } this.messagesInFlight = 0; } Publisher.prototype.fieldsToTrim = { UserAgent: 256, SdkException: 128, SdkExceptionMessage: 512, AwsException: 128, AwsExceptionMessage: 512, FinalSdkException: 128, FinalSdkExceptionMessage: 512, FinalAwsException: 128, FinalAwsExceptionMessage: 512 }; /** * Trims fields that have a specified max length. * @param {object} event ApiCall or ApiCallAttempt event. * @returns {object} * @api private */ Publisher.prototype.trimFields = function(event) { var trimmableFields = Object.keys(this.fieldsToTrim); for (var i = 0, iLen = trimmableFields.length; i < iLen; i++) { var field = trimmableFields[i]; if (event.hasOwnProperty(field)) { var maxLength = this.fieldsToTrim[field]; var value = event[field]; if (value && value.length > maxLength) { event[field] = value.substr(0, maxLength); } } } return event; }; /** * Handles ApiCall and ApiCallAttempt events. * @param {Object} event apiCall or apiCallAttempt event. * @api private */ Publisher.prototype.eventHandler = function(event) { // set the clientId event.ClientId = this.clientId; this.trimFields(event); var message = stringToBuffer(JSON.stringify(event)); if (!this.enabled || message.length > MAX_MESSAGE_SIZE) { // drop the message if publisher not enabled or it is too large return; } this.publishDatagram(message); }; /** * Publishes message to an agent. * @param {Buffer} message JSON message to send to agent. * @api private */ Publisher.prototype.publishDatagram = function(message) { var self = this; var client = this.getClient(); this.messagesInFlight++; this.client.send(message, 0, message.length, this.port, this.address, function(err, bytes) { if (--self.messagesInFlight <= 0) { // destroy existing client so the event loop isn't kept open self.destroyClient(); } }); }; /** * Returns an existing udp socket, or creates one if it doesn't already exist. * @api private */ Publisher.prototype.getClient = function() { if (!this.client) { this.client = dgram.createSocket('udp4'); } return this.client; }; /** * Destroys the udp socket. * @api private */ Publisher.prototype.destroyClient = function() { if (this.client) { this.client.close(); this.client = void 0; } }; module.exports = { Publisher: Publisher }; /***/ }), /***/ 45175: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { var util = __webpack_require__(77985); function QueryParamSerializer() { } QueryParamSerializer.prototype.serialize = function(params, shape, fn) { serializeStructure('', params, shape, fn); }; function ucfirst(shape) { if (shape.isQueryName || shape.api.protocol !== 'ec2') { return shape.name; } else { return shape.name[0].toUpperCase() + shape.name.substr(1); } } function serializeStructure(prefix, struct, rules, fn) { util.each(rules.members, function(name, member) { var value = struct[name]; if (value === null || value === undefined) return; var memberName = ucfirst(member); memberName = prefix ? prefix + '.' + memberName : memberName; serializeMember(memberName, value, member, fn); }); } function serializeMap(name, map, rules, fn) { var i = 1; util.each(map, function (key, value) { var prefix = rules.flattened ? '.' : '.entry.'; var position = prefix + (i++) + '.'; var keyName = position + (rules.key.name || 'key'); var valueName = position + (rules.value.name || 'value'); serializeMember(name + keyName, key, rules.key, fn); serializeMember(name + valueName, value, rules.value, fn); }); } function serializeList(name, list, rules, fn) { var memberRules = rules.member || {}; if (list.length === 0) { fn.call(this, name, null); return; } util.arrayEach(list, function (v, n) { var suffix = '.' + (n + 1); if (rules.api.protocol === 'ec2') { // Do nothing for EC2 suffix = suffix + ''; // make linter happy } else if (rules.flattened) { if (memberRules.name) { var parts = name.split('.'); parts.pop(); parts.push(ucfirst(memberRules)); name = parts.join('.'); } } else { suffix = '.' + (memberRules.name ? memberRules.name : 'member') + suffix; } serializeMember(name + suffix, v, memberRules, fn); }); } function serializeMember(name, value, rules, fn) { if (value === null || value === undefined) return; if (rules.type === 'structure') { serializeStructure(name, value, rules, fn); } else if (rules.type === 'list') { serializeList(name, value, rules, fn); } else if (rules.type === 'map') { serializeMap(name, value, rules, fn); } else { fn(name, rules.toWireFormat(value).toString()); } } /** * @api private */ module.exports = QueryParamSerializer; /***/ }), /***/ 16612: /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => { var AWS = __webpack_require__(28437); /** * @api private */ var service = null; /** * @api private */ var api = { signatureVersion: 'v4', signingName: 'rds-db', operations: {} }; /** * @api private */ var requiredAuthTokenOptions = { region: 'string', hostname: 'string', port: 'number', username: 'string' }; /** * A signer object can be used to generate an auth token to a database. */ AWS.RDS.Signer = AWS.util.inherit({ /** * Creates a signer object can be used to generate an auth token. * * @option options credentials [AWS.Credentials] the AWS credentials * to sign requests with. Uses the default credential provider chain * if not specified. * @option options hostname [String] the hostname of the database to connect to. * @option options port [Number] the port number the database is listening on. * @option options region [String] the region the database is located in. * @option options username [String] the username to login as. * @example Passing in options to constructor * var signer = new AWS.RDS.Signer({ * credentials: new AWS.SharedIniFileCredentials({profile: 'default'}), * region: 'us-east-1', * hostname: 'db.us-east-1.rds.amazonaws.com', * port: 8000, * username: 'name' * }); */ constructor: function Signer(options) { this.options = options || {}; }, /** * @api private * Strips the protocol from a url. */ convertUrlToAuthToken: function convertUrlToAuthToken(url) { // we are always using https as the protocol var protocol = 'https://'; if (url.indexOf(protocol) === 0) { return url.substring(protocol.length); } }, /** * @overload getAuthToken(options = {}, [callback]) * Generate an auth token to a database. * @note You must ensure that you have static or previously resolved * credentials if you call this method synchronously (with no callback), * otherwise it may not properly sign the request. If you cannot guarantee * this (you are using an asynchronous credential provider, i.e., EC2 * IAM roles), you should always call this method with an asynchronous * callback. * * @param options [map] The fields to use when generating an auth token. * Any options specified here will be merged on top of any options passed * to AWS.RDS.Signer: * * * **credentials** (AWS.Credentials) — the AWS credentials * to sign requests with. Uses the default credential provider chain * if not specified. * * **hostname** (String) — the hostname of the database to connect to. * * **port** (Number) — the port number the database is listening on. * * **region** (String) — the region the database is located in. * * **username** (String) — the username to login as. * @return [String] if called synchronously (with no callback), returns the * auth token. * @return [null] nothing is returned if a callback is provided. * @callback callback function (err, token) * If a callback is supplied, it is called when an auth token has been generated. * @param err [Error] the error object returned from the signer. * @param token [String] the auth token. * * @example Generating an auth token synchronously * var signer = new AWS.RDS.Signer({ * // configure options * region: 'us-east-1', * username: 'default', * hostname: 'db.us-east-1.amazonaws.com', * port: 8000 * }); * var token = signer.getAuthToken({ * // these options are merged with those defined when creating the signer, overriding in the case of a duplicate option * // credentials are not specified here or when creating the signer, so default credential provider will be used * username: 'test' // overriding username * }); * @example Generating an auth token asynchronously * var signer = new AWS.RDS.Signer({ * // configure options * region: 'us-east-1', * username: 'default', * hostname: 'db.us-east-1.amazonaws.com', * port: 8000 * }); * signer.getAuthToken({ * // these options are merged with those defined when creating the signer, overriding in the case of a duplicate option * // credentials are not specified here or when creating the signer, so default credential provider will be used * username: 'test' // overriding username * }, function(err, token) { * if (err) { * // handle error * } else { * // use token * } * }); * */ getAuthToken: function getAuthToken(options, callback) { if (typeof options === 'function' && callback === undefined) { callback = options; options = {}; } var self = this; var hasCallback = typeof callback === 'function'; // merge options with existing options options = AWS.util.merge(this.options, options); // validate options var optionsValidation = this.validateAuthTokenOptions(options); if (optionsValidation !== true) { if (hasCallback) { return callback(optionsValidation, null); } throw optionsValidation; } // 15 minutes var expires = 900; // create service to generate a request from var serviceOptions = { region: options.region, endpoint: new AWS.Endpoint(options.hostname + ':' + options.port), paramValidation: false, signatureVersion: 'v4' }; if (options.credentials) { serviceOptions.credentials = options.credentials; } service = new AWS.Service(serviceOptions); // ensure the SDK is using sigv4 signing (config is not enough) service.api = api; var request = service.makeRequest(); // add listeners to request to properly build auth token this.modifyRequestForAuthToken(request, options); if (hasCallback) { request.presign(expires, function(err, url) { if (url) { url = self.convertUrlToAuthToken(url); } callback(err, url); }); } else { var url = request.presign(expires); return this.convertUrlToAuthToken(url); } }, /** * @api private * Modifies a request to allow the presigner to generate an auth token. */ modifyRequestForAuthToken: function modifyRequestForAuthToken(request, options) { request.on('build', request.buildAsGet); var httpRequest = request.httpRequest; httpRequest.body = AWS.util.queryParamsToString({ Action: 'connect', DBUser: options.username }); }, /** * @api private * Validates that the options passed in contain all the keys with values of the correct type that * are needed to generate an auth token. */ validateAuthTokenOptions: function validateAuthTokenOptions(options) { // iterate over all keys in options var message = ''; options = options || {}; for (var key in requiredAuthTokenOptions) { if (!Object.prototype.hasOwnProperty.call(requiredAuthTokenOptions, key)) { continue; } if (typeof options[key] !== requiredAuthTokenOptions[key]) { message += 'option \'' + key + '\' should have been type \'' + requiredAuthTokenOptions[key] + '\', was \'' + typeof options[key] + '\'.\n'; } } if (message.length) { return AWS.util.error(new Error(), { code: 'InvalidParameter', message: message }); } return true; } }); /***/ }), /***/ 81370: /***/ ((module) => { module.exports = { //provide realtime clock for performance measurement now: function now() { var second = process.hrtime(); return second[0] * 1000 + (second[1] / 1000000); } }; /***/ }), /***/ 18262: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { var util = __webpack_require__(77985); var regionConfig = __webpack_require__(51765); function generateRegionPrefix(region) { if (!region) return null; var parts = region.split('-'); if (parts.length < 3) return null; return parts.slice(0, parts.length - 2).join('-') + '-*'; } function derivedKeys(service) { var region = service.config.region; var regionPrefix = generateRegionPrefix(region); var endpointPrefix = service.api.endpointPrefix; return [ [region, endpointPrefix], [regionPrefix, endpointPrefix], [region, '*'], [regionPrefix, '*'], ['*', endpointPrefix], ['*', '*'] ].map(function(item) { return item[0] && item[1] ? item.join('/') : null; }); } function applyConfig(service, config) { util.each(config, function(key, value) { if (key === 'globalEndpoint') return; if (service.config[key] === undefined || service.config[key] === null) { service.config[key] = value; } }); } function configureEndpoint(service) { var keys = derivedKeys(service); for (var i = 0; i < keys.length; i++) { var key = keys[i]; if (!key) continue; if (Object.prototype.hasOwnProperty.call(regionConfig.rules, key)) { var config = regionConfig.rules[key]; if (typeof config === 'string') { config = regionConfig.patterns[config]; } // set dualstack endpoint if (service.config.useDualstack && util.isDualstackAvailable(service)) { config = util.copy(config); config.endpoint = config.endpoint.replace( /{service}\.({region}\.)?/, '{service}.dualstack.{region}.' ); } // set global endpoint service.isGlobalEndpoint = !!config.globalEndpoint; if (config.signingRegion) { service.signingRegion = config.signingRegion; } // signature version if (!config.signatureVersion) config.signatureVersion = 'v4'; // merge config applyConfig(service, config); return; } } } function getEndpointSuffix(region) { var regionRegexes = { '^(us|eu|ap|sa|ca|me)\\-\\w+\\-\\d+$': 'amazonaws.com', '^cn\\-\\w+\\-\\d+$': 'amazonaws.com.cn', '^us\\-gov\\-\\w+\\-\\d+$': 'amazonaws.com', '^us\\-iso\\-\\w+\\-\\d+$': 'c2s.ic.gov', '^us\\-isob\\-\\w+\\-\\d+$': 'sc2s.sgov.gov' }; var defaultSuffix = 'amazonaws.com'; var regexes = Object.keys(regionRegexes); for (var i = 0; i < regexes.length; i++) { var regionPattern = RegExp(regexes[i]); var dnsSuffix = regionRegexes[regexes[i]]; if (regionPattern.test(region)) return dnsSuffix; } return defaultSuffix; } /** * @api private */ module.exports = { configureEndpoint: configureEndpoint, getEndpointSuffix: getEndpointSuffix }; /***/ }), /***/ 78652: /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => { var AWS = __webpack_require__(28437); var AcceptorStateMachine = __webpack_require__(68118); var inherit = AWS.util.inherit; var domain = AWS.util.domain; var jmespath = __webpack_require__(87783); /** * @api private */ var hardErrorStates = {success: 1, error: 1, complete: 1}; function isTerminalState(machine) { return Object.prototype.hasOwnProperty.call(hardErrorStates, machine._asm.currentState); } var fsm = new AcceptorStateMachine(); fsm.setupStates = function() { var transition = function(_, done) { var self = this; self._haltHandlersOnError = false; self.emit(self._asm.currentState, function(err) { if (err) { if (isTerminalState(self)) { if (domain && self.domain instanceof domain.Domain) { err.domainEmitter = self; err.domain = self.domain; err.domainThrown = false; self.domain.emit('error', err); } else { throw err; } } else { self.response.error = err; done(err); } } else { done(self.response.error); } }); }; this.addState('validate', 'build', 'error', transition); this.addState('build', 'afterBuild', 'restart', transition); this.addState('afterBuild', 'sign', 'restart', transition); this.addState('sign', 'send', 'retry', transition); this.addState('retry', 'afterRetry', 'afterRetry', transition); this.addState('afterRetry', 'sign', 'error', transition); this.addState('send', 'validateResponse', 'retry', transition); this.addState('validateResponse', 'extractData', 'extractError', transition); this.addState('extractError', 'extractData', 'retry', transition); this.addState('extractData', 'success', 'retry', transition); this.addState('restart', 'build', 'error', transition); this.addState('success', 'complete', 'complete', transition); this.addState('error', 'complete', 'complete', transition); this.addState('complete', null, null, transition); }; fsm.setupStates(); /** * ## Asynchronous Requests * * All requests made through the SDK are asynchronous and use a * callback interface. Each service method that kicks off a request * returns an `AWS.Request` object that you can use to register * callbacks. * * For example, the following service method returns the request * object as "request", which can be used to register callbacks: * * ```javascript * // request is an AWS.Request object * var request = ec2.describeInstances(); * * // register callbacks on request to retrieve response data * request.on('success', function(response) { * console.log(response.data); * }); * ``` * * When a request is ready to be sent, the {send} method should * be called: * * ```javascript * request.send(); * ``` * * Since registered callbacks may or may not be idempotent, requests should only * be sent once. To perform the same operation multiple times, you will need to * create multiple request objects, each with its own registered callbacks. * * ## Removing Default Listeners for Events * * Request objects are built with default listeners for the various events, * depending on the service type. In some cases, you may want to remove * some built-in listeners to customize behaviour. Doing this requires * access to the built-in listener functions, which are exposed through * the {AWS.EventListeners.Core} namespace. For instance, you may * want to customize the HTTP handler used when sending a request. In this * case, you can remove the built-in listener associated with the 'send' * event, the {AWS.EventListeners.Core.SEND} listener and add your own. * * ## Multiple Callbacks and Chaining * * You can register multiple callbacks on any request object. The * callbacks can be registered for different events, or all for the * same event. In addition, you can chain callback registration, for * example: * * ```javascript * request. * on('success', function(response) { * console.log("Success!"); * }). * on('error', function(error, response) { * console.log("Error!"); * }). * on('complete', function(response) { * console.log("Always!"); * }). * send(); * ``` * * The above example will print either "Success! Always!", or "Error! Always!", * depending on whether the request succeeded or not. * * @!attribute httpRequest * @readonly * @!group HTTP Properties * @return [AWS.HttpRequest] the raw HTTP request object * containing request headers and body information * sent by the service. * * @!attribute startTime * @readonly * @!group Operation Properties * @return [Date] the time that the request started * * @!group Request Building Events * * @!event validate(request) * Triggered when a request is being validated. Listeners * should throw an error if the request should not be sent. * @param request [Request] the request object being sent * @see AWS.EventListeners.Core.VALIDATE_CREDENTIALS * @see AWS.EventListeners.Core.VALIDATE_REGION * @example Ensuring that a certain parameter is set before sending a request * var req = s3.putObject(params); * req.on('validate', function() { * if (!req.params.Body.match(/^Hello\s/)) { * throw new Error('Body must start with "Hello "'); * } * }); * req.send(function(err, data) { ... }); * * @!event build(request) * Triggered when the request payload is being built. Listeners * should fill the necessary information to send the request * over HTTP. * @param (see AWS.Request~validate) * @example Add a custom HTTP header to a request * var req = s3.putObject(params); * req.on('build', function() { * req.httpRequest.headers['Custom-Header'] = 'value'; * }); * req.send(function(err, data) { ... }); * * @!event sign(request) * Triggered when the request is being signed. Listeners should * add the correct authentication headers and/or adjust the body, * depending on the authentication mechanism being used. * @param (see AWS.Request~validate) * * @!group Request Sending Events * * @!event send(response) * Triggered when the request is ready to be sent. Listeners * should call the underlying transport layer to initiate * the sending of the request. * @param response [Response] the response object * @context [Request] the request object that was sent * @see AWS.EventListeners.Core.SEND * * @!event retry(response) * Triggered when a request failed and might need to be retried or redirected. * If the response is retryable, the listener should set the * `response.error.retryable` property to `true`, and optionally set * `response.error.retryDelay` to the millisecond delay for the next attempt. * In the case of a redirect, `response.error.redirect` should be set to * `true` with `retryDelay` set to an optional delay on the next request. * * If a listener decides that a request should not be retried, * it should set both `retryable` and `redirect` to false. * * Note that a retryable error will be retried at most * {AWS.Config.maxRetries} times (based on the service object's config). * Similarly, a request that is redirected will only redirect at most * {AWS.Config.maxRedirects} times. * * @param (see AWS.Request~send) * @context (see AWS.Request~send) * @example Adding a custom retry for a 404 response * request.on('retry', function(response) { * // this resource is not yet available, wait 10 seconds to get it again * if (response.httpResponse.statusCode === 404 && response.error) { * response.error.retryable = true; // retry this error * response.error.retryDelay = 10000; // wait 10 seconds * } * }); * * @!group Data Parsing Events * * @!event extractError(response) * Triggered on all non-2xx requests so that listeners can extract * error details from the response body. Listeners to this event * should set the `response.error` property. * @param (see AWS.Request~send) * @context (see AWS.Request~send) * * @!event extractData(response) * Triggered in successful requests to allow listeners to * de-serialize the response body into `response.data`. * @param (see AWS.Request~send) * @context (see AWS.Request~send) * * @!group Completion Events * * @!event success(response) * Triggered when the request completed successfully. * `response.data` will contain the response data and * `response.error` will be null. * @param (see AWS.Request~send) * @context (see AWS.Request~send) * * @!event error(error, response) * Triggered when an error occurs at any point during the * request. `response.error` will contain details about the error * that occurred. `response.data` will be null. * @param error [Error] the error object containing details about * the error that occurred. * @param (see AWS.Request~send) * @context (see AWS.Request~send) * * @!event complete(response) * Triggered whenever a request cycle completes. `response.error` * should be checked, since the request may have failed. * @param (see AWS.Request~send) * @context (see AWS.Request~send) * * @!group HTTP Events * * @!event httpHeaders(statusCode, headers, response, statusMessage) * Triggered when headers are sent by the remote server * @param statusCode [Integer] the HTTP response code * @param headers [map] the response headers * @param (see AWS.Request~send) * @param statusMessage [String] A status message corresponding to the HTTP * response code * @context (see AWS.Request~send) * * @!event httpData(chunk, response) * Triggered when data is sent by the remote server * @param chunk [Buffer] the buffer data containing the next data chunk * from the server * @param (see AWS.Request~send) * @context (see AWS.Request~send) * @see AWS.EventListeners.Core.HTTP_DATA * * @!event httpUploadProgress(progress, response) * Triggered when the HTTP request has uploaded more data * @param progress [map] An object containing the `loaded` and `total` bytes * of the request. * @param (see AWS.Request~send) * @context (see AWS.Request~send) * @note This event will not be emitted in Node.js 0.8.x. * * @!event httpDownloadProgress(progress, response) * Triggered when the HTTP request has downloaded more data * @param progress [map] An object containing the `loaded` and `total` bytes * of the request. * @param (see AWS.Request~send) * @context (see AWS.Request~send) * @note This event will not be emitted in Node.js 0.8.x. * * @!event httpError(error, response) * Triggered when the HTTP request failed * @param error [Error] the error object that was thrown * @param (see AWS.Request~send) * @context (see AWS.Request~send) * * @!event httpDone(response) * Triggered when the server is finished sending data * @param (see AWS.Request~send) * @context (see AWS.Request~send) * * @see AWS.Response */ AWS.Request = inherit({ /** * Creates a request for an operation on a given service with * a set of input parameters. * * @param service [AWS.Service] the service to perform the operation on * @param operation [String] the operation to perform on the service * @param params [Object] parameters to send to the operation. * See the operation's documentation for the format of the * parameters. */ constructor: function Request(service, operation, params) { var endpoint = service.endpoint; var region = service.config.region; var customUserAgent = service.config.customUserAgent; if (service.isGlobalEndpoint) { if (service.signingRegion) { region = service.signingRegion; } else { region = 'us-east-1'; } } this.domain = domain && domain.active; this.service = service; this.operation = operation; this.params = params || {}; this.httpRequest = new AWS.HttpRequest(endpoint, region); this.httpRequest.appendToUserAgent(customUserAgent); this.startTime = service.getSkewCorrectedDate(); this.response = new AWS.Response(this); this._asm = new AcceptorStateMachine(fsm.states, 'validate'); this._haltHandlersOnError = false; AWS.SequentialExecutor.call(this); this.emit = this.emitEvent; }, /** * @!group Sending a Request */ /** * @overload send(callback = null) * Sends the request object. * * @callback callback function(err, data) * If a callback is supplied, it is called when a response is returned * from the service. * @context [AWS.Request] the request object being sent. * @param err [Error] the error object returned from the request. * Set to `null` if the request is successful. * @param data [Object] the de-serialized data returned from * the request. Set to `null` if a request error occurs. * @example Sending a request with a callback * request = s3.putObject({Bucket: 'bucket', Key: 'key'}); * request.send(function(err, data) { console.log(err, data); }); * @example Sending a request with no callback (using event handlers) * request = s3.putObject({Bucket: 'bucket', Key: 'key'}); * request.on('complete', function(response) { ... }); // register a callback * request.send(); */ send: function send(callback) { if (callback) { // append to user agent this.httpRequest.appendToUserAgent('callback'); this.on('complete', function (resp) { callback.call(resp, resp.error, resp.data); }); } this.runTo(); return this.response; }, /** * @!method promise() * Sends the request and returns a 'thenable' promise. * * Two callbacks can be provided to the `then` method on the returned promise. * The first callback will be called if the promise is fulfilled, and the second * callback will be called if the promise is rejected. * @callback fulfilledCallback function(data) * Called if the promise is fulfilled. * @param data [Object] the de-serialized data returned from the request. * @callback rejectedCallback function(error) * Called if the promise is rejected. * @param error [Error] the error object returned from the request. * @return [Promise] A promise that represents the state of the request. * @example Sending a request using promises. * var request = s3.putObject({Bucket: 'bucket', Key: 'key'}); * var result = request.promise(); * result.then(function(data) { ... }, function(error) { ... }); */ /** * @api private */ build: function build(callback) { return this.runTo('send', callback); }, /** * @api private */ runTo: function runTo(state, done) { this._asm.runTo(state, done, this); return this; }, /** * Aborts a request, emitting the error and complete events. * * @!macro nobrowser * @example Aborting a request after sending * var params = { * Bucket: 'bucket', Key: 'key', * Body: Buffer.alloc(1024 * 1024 * 5) // 5MB payload * }; * var request = s3.putObject(params); * request.send(function (err, data) { * if (err) console.log("Error:", err.code, err.message); * else console.log(data); * }); * * // abort request in 1 second * setTimeout(request.abort.bind(request), 1000); * * // prints "Error: RequestAbortedError Request aborted by user" * @return [AWS.Request] the same request object, for chaining. * @since v1.4.0 */ abort: function abort() { this.removeAllListeners('validateResponse'); this.removeAllListeners('extractError'); this.on('validateResponse', function addAbortedError(resp) { resp.error = AWS.util.error(new Error('Request aborted by user'), { code: 'RequestAbortedError', retryable: false }); }); if (this.httpRequest.stream && !this.httpRequest.stream.didCallback) { // abort HTTP stream this.httpRequest.stream.abort(); if (this.httpRequest._abortCallback) { this.httpRequest._abortCallback(); } else { this.removeAllListeners('send'); // haven't sent yet, so let's not } } return this; }, /** * Iterates over each page of results given a pageable request, calling * the provided callback with each page of data. After all pages have been * retrieved, the callback is called with `null` data. * * @note This operation can generate multiple requests to a service. * @example Iterating over multiple pages of objects in an S3 bucket * var pages = 1; * s3.listObjects().eachPage(function(err, data) { * if (err) return; * console.log("Page", pages++); * console.log(data); * }); * @example Iterating over multiple pages with an asynchronous callback * s3.listObjects(params).eachPage(function(err, data, done) { * doSomethingAsyncAndOrExpensive(function() { * // The next page of results isn't fetched until done is called * done(); * }); * }); * @callback callback function(err, data, [doneCallback]) * Called with each page of resulting data from the request. If the * optional `doneCallback` is provided in the function, it must be called * when the callback is complete. * * @param err [Error] an error object, if an error occurred. * @param data [Object] a single page of response data. If there is no * more data, this object will be `null`. * @param doneCallback [Function] an optional done callback. If this * argument is defined in the function declaration, it should be called * when the next page is ready to be retrieved. This is useful for * controlling serial pagination across asynchronous operations. * @return [Boolean] if the callback returns `false`, pagination will * stop. * * @see AWS.Request.eachItem * @see AWS.Response.nextPage * @since v1.4.0 */ eachPage: function eachPage(callback) { // Make all callbacks async-ish callback = AWS.util.fn.makeAsync(callback, 3); function wrappedCallback(response) { callback.call(response, response.error, response.data, function (result) { if (result === false) return; if (response.hasNextPage()) { response.nextPage().on('complete', wrappedCallback).send(); } else { callback.call(response, null, null, AWS.util.fn.noop); } }); } this.on('complete', wrappedCallback).send(); }, /** * Enumerates over individual items of a request, paging the responses if * necessary. * * @api experimental * @since v1.4.0 */ eachItem: function eachItem(callback) { var self = this; function wrappedCallback(err, data) { if (err) return callback(err, null); if (data === null) return callback(null, null); var config = self.service.paginationConfig(self.operation); var resultKey = config.resultKey; if (Array.isArray(resultKey)) resultKey = resultKey[0]; var items = jmespath.search(data, resultKey); var continueIteration = true; AWS.util.arrayEach(items, function(item) { continueIteration = callback(null, item); if (continueIteration === false) { return AWS.util.abort; } }); return continueIteration; } this.eachPage(wrappedCallback); }, /** * @return [Boolean] whether the operation can return multiple pages of * response data. * @see AWS.Response.eachPage * @since v1.4.0 */ isPageable: function isPageable() { return this.service.paginationConfig(this.operation) ? true : false; }, /** * Sends the request and converts the request object into a readable stream * that can be read from or piped into a writable stream. * * @note The data read from a readable stream contains only * the raw HTTP body contents. * @example Manually reading from a stream * request.createReadStream().on('data', function(data) { * console.log("Got data:", data.toString()); * }); * @example Piping a request body into a file * var out = fs.createWriteStream('/path/to/outfile.jpg'); * s3.service.getObject(params).createReadStream().pipe(out); * @return [Stream] the readable stream object that can be piped * or read from (by registering 'data' event listeners). * @!macro nobrowser */ createReadStream: function createReadStream() { var streams = AWS.util.stream; var req = this; var stream = null; if (AWS.HttpClient.streamsApiVersion === 2) { stream = new streams.PassThrough(); process.nextTick(function() { req.send(); }); } else { stream = new streams.Stream(); stream.readable = true; stream.sent = false; stream.on('newListener', function(event) { if (!stream.sent && event === 'data') { stream.sent = true; process.nextTick(function() { req.send(); }); } }); } this.on('error', function(err) { stream.emit('error', err); }); this.on('httpHeaders', function streamHeaders(statusCode, headers, resp) { if (statusCode < 300) { req.removeListener('httpData', AWS.EventListeners.Core.HTTP_DATA); req.removeListener('httpError', AWS.EventListeners.Core.HTTP_ERROR); req.on('httpError', function streamHttpError(error) { resp.error = error; resp.error.retryable = false; }); var shouldCheckContentLength = false; var expectedLen; if (req.httpRequest.method !== 'HEAD') { expectedLen = parseInt(headers['content-length'], 10); } if (expectedLen !== undefined && !isNaN(expectedLen) && expectedLen >= 0) { shouldCheckContentLength = true; var receivedLen = 0; } var checkContentLengthAndEmit = function checkContentLengthAndEmit() { if (shouldCheckContentLength && receivedLen !== expectedLen) { stream.emit('error', AWS.util.error( new Error('Stream content length mismatch. Received ' + receivedLen + ' of ' + expectedLen + ' bytes.'), { code: 'StreamContentLengthMismatch' } )); } else if (AWS.HttpClient.streamsApiVersion === 2) { stream.end(); } else { stream.emit('end'); } }; var httpStream = resp.httpResponse.createUnbufferedStream(); if (AWS.HttpClient.streamsApiVersion === 2) { if (shouldCheckContentLength) { var lengthAccumulator = new streams.PassThrough(); lengthAccumulator._write = function(chunk) { if (chunk && chunk.length) { receivedLen += chunk.length; } return streams.PassThrough.prototype._write.apply(this, arguments); }; lengthAccumulator.on('end', checkContentLengthAndEmit); stream.on('error', function(err) { shouldCheckContentLength = false; httpStream.unpipe(lengthAccumulator); lengthAccumulator.emit('end'); lengthAccumulator.end(); }); httpStream.pipe(lengthAccumulator).pipe(stream, { end: false }); } else { httpStream.pipe(stream); } } else { if (shouldCheckContentLength) { httpStream.on('data', function(arg) { if (arg && arg.length) { receivedLen += arg.length; } }); } httpStream.on('data', function(arg) { stream.emit('data', arg); }); httpStream.on('end', checkContentLengthAndEmit); } httpStream.on('error', function(err) { shouldCheckContentLength = false; stream.emit('error', err); }); } }); return stream; }, /** * @param [Array,Response] args This should be the response object, * or an array of args to send to the event. * @api private */ emitEvent: function emit(eventName, args, done) { if (typeof args === 'function') { done = args; args = null; } if (!done) done = function() { }; if (!args) args = this.eventParameters(eventName, this.response); var origEmit = AWS.SequentialExecutor.prototype.emit; origEmit.call(this, eventName, args, function (err) { if (err) this.response.error = err; done.call(this, err); }); }, /** * @api private */ eventParameters: function eventParameters(eventName) { switch (eventName) { case 'restart': case 'validate': case 'sign': case 'build': case 'afterValidate': case 'afterBuild': return [this]; case 'error': return [this.response.error, this.response]; default: return [this.response]; } }, /** * @api private */ presign: function presign(expires, callback) { if (!callback && typeof expires === 'function') { callback = expires; expires = null; } return new AWS.Signers.Presign().sign(this.toGet(), expires, callback); }, /** * @api private */ isPresigned: function isPresigned() { return Object.prototype.hasOwnProperty.call(this.httpRequest.headers, 'presigned-expires'); }, /** * @api private */ toUnauthenticated: function toUnauthenticated() { this._unAuthenticated = true; this.removeListener('validate', AWS.EventListeners.Core.VALIDATE_CREDENTIALS); this.removeListener('sign', AWS.EventListeners.Core.SIGN); return this; }, /** * @api private */ toGet: function toGet() { if (this.service.api.protocol === 'query' || this.service.api.protocol === 'ec2') { this.removeListener('build', this.buildAsGet); this.addListener('build', this.buildAsGet); } return this; }, /** * @api private */ buildAsGet: function buildAsGet(request) { request.httpRequest.method = 'GET'; request.httpRequest.path = request.service.endpoint.path + '?' + request.httpRequest.body; request.httpRequest.body = ''; // don't need these headers on a GET request delete request.httpRequest.headers['Content-Length']; delete request.httpRequest.headers['Content-Type']; }, /** * @api private */ haltHandlersOnError: function haltHandlersOnError() { this._haltHandlersOnError = true; } }); /** * @api private */ AWS.Request.addPromisesToClass = function addPromisesToClass(PromiseDependency) { this.prototype.promise = function promise() { var self = this; // append to user agent this.httpRequest.appendToUserAgent('promise'); return new PromiseDependency(function(resolve, reject) { self.on('complete', function(resp) { if (resp.error) { reject(resp.error); } else { // define $response property so that it is not enumerable // this prevents circular reference errors when stringifying the JSON object resolve(Object.defineProperty( resp.data || {}, '$response', {value: resp} )); } }); self.runTo(); }); }; }; /** * @api private */ AWS.Request.deletePromisesFromClass = function deletePromisesFromClass() { delete this.prototype.promise; }; AWS.util.addPromises(AWS.Request); AWS.util.mixin(AWS.Request, AWS.SequentialExecutor); /***/ }), /***/ 39925: /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => { /** * Copyright 2012-2013 Amazon.com, Inc. or its affiliates. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"). You * may not use this file except in compliance with the License. A copy of * the License is located at * * http://aws.amazon.com/apache2.0/ * * or in the "license" file accompanying this file. This file is * distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF * ANY KIND, either express or implied. See the License for the specific * language governing permissions and limitations under the License. */ var AWS = __webpack_require__(28437); var inherit = AWS.util.inherit; var jmespath = __webpack_require__(87783); /** * @api private */ function CHECK_ACCEPTORS(resp) { var waiter = resp.request._waiter; var acceptors = waiter.config.acceptors; var acceptorMatched = false; var state = 'retry'; acceptors.forEach(function(acceptor) { if (!acceptorMatched) { var matcher = waiter.matchers[acceptor.matcher]; if (matcher && matcher(resp, acceptor.expected, acceptor.argument)) { acceptorMatched = true; state = acceptor.state; } } }); if (!acceptorMatched && resp.error) state = 'failure'; if (state === 'success') { waiter.setSuccess(resp); } else { waiter.setError(resp, state === 'retry'); } } /** * @api private */ AWS.ResourceWaiter = inherit({ /** * Waits for a given state on a service object * @param service [Service] the service object to wait on * @param state [String] the state (defined in waiter configuration) to wait * for. * @example Create a waiter for running EC2 instances * var ec2 = new AWS.EC2; * var waiter = new AWS.ResourceWaiter(ec2, 'instanceRunning'); */ constructor: function constructor(service, state) { this.service = service; this.state = state; this.loadWaiterConfig(this.state); }, service: null, state: null, config: null, matchers: { path: function(resp, expected, argument) { try { var result = jmespath.search(resp.data, argument); } catch (err) { return false; } return jmespath.strictDeepEqual(result,expected); }, pathAll: function(resp, expected, argument) { try { var results = jmespath.search(resp.data, argument); } catch (err) { return false; } if (!Array.isArray(results)) results = [results]; var numResults = results.length; if (!numResults) return false; for (var ind = 0 ; ind < numResults; ind++) { if (!jmespath.strictDeepEqual(results[ind], expected)) { return false; } } return true; }, pathAny: function(resp, expected, argument) { try { var results = jmespath.search(resp.data, argument); } catch (err) { return false; } if (!Array.isArray(results)) results = [results]; var numResults = results.length; for (var ind = 0 ; ind < numResults; ind++) { if (jmespath.strictDeepEqual(results[ind], expected)) { return true; } } return false; }, status: function(resp, expected) { var statusCode = resp.httpResponse.statusCode; return (typeof statusCode === 'number') && (statusCode === expected); }, error: function(resp, expected) { if (typeof expected === 'string' && resp.error) { return expected === resp.error.code; } // if expected is not string, can be boolean indicating presence of error return expected === !!resp.error; } }, listeners: new AWS.SequentialExecutor().addNamedListeners(function(add) { add('RETRY_CHECK', 'retry', function(resp) { var waiter = resp.request._waiter; if (resp.error && resp.error.code === 'ResourceNotReady') { resp.error.retryDelay = (waiter.config.delay || 0) * 1000; } }); add('CHECK_OUTPUT', 'extractData', CHECK_ACCEPTORS); add('CHECK_ERROR', 'extractError', CHECK_ACCEPTORS); }), /** * @return [AWS.Request] */ wait: function wait(params, callback) { if (typeof params === 'function') { callback = params; params = undefined; } if (params && params.$waiter) { params = AWS.util.copy(params); if (typeof params.$waiter.delay === 'number') { this.config.delay = params.$waiter.delay; } if (typeof params.$waiter.maxAttempts === 'number') { this.config.maxAttempts = params.$waiter.maxAttempts; } delete params.$waiter; } var request = this.service.makeRequest(this.config.operation, params); request._waiter = this; request.response.maxRetries = this.config.maxAttempts; request.addListeners(this.listeners); if (callback) request.send(callback); return request; }, setSuccess: function setSuccess(resp) { resp.error = null; resp.data = resp.data || {}; resp.request.removeAllListeners('extractData'); }, setError: function setError(resp, retryable) { resp.data = null; resp.error = AWS.util.error(resp.error || new Error(), { code: 'ResourceNotReady', message: 'Resource is not in the state ' + this.state, retryable: retryable }); }, /** * Loads waiter configuration from API configuration * * @api private */ loadWaiterConfig: function loadWaiterConfig(state) { if (!this.service.api.waiters[state]) { throw new AWS.util.error(new Error(), { code: 'StateNotFoundError', message: 'State ' + state + ' not found.' }); } this.config = AWS.util.copy(this.service.api.waiters[state]); } }); /***/ }), /***/ 58743: /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => { var AWS = __webpack_require__(28437); var inherit = AWS.util.inherit; var jmespath = __webpack_require__(87783); /** * This class encapsulates the response information * from a service request operation sent through {AWS.Request}. * The response object has two main properties for getting information * back from a request: * * ## The `data` property * * The `response.data` property contains the serialized object data * retrieved from the service request. For instance, for an * Amazon DynamoDB `listTables` method call, the response data might * look like: * * ``` * > resp.data * { TableNames: * [ 'table1', 'table2', ... ] } * ``` * * The `data` property can be null if an error occurs (see below). * * ## The `error` property * * In the event of a service error (or transfer error), the * `response.error` property will be filled with the given * error data in the form: * * ``` * { code: 'SHORT_UNIQUE_ERROR_CODE', * message: 'Some human readable error message' } * ``` * * In the case of an error, the `data` property will be `null`. * Note that if you handle events that can be in a failure state, * you should always check whether `response.error` is set * before attempting to access the `response.data` property. * * @!attribute data * @readonly * @!group Data Properties * @note Inside of a {AWS.Request~httpData} event, this * property contains a single raw packet instead of the * full de-serialized service response. * @return [Object] the de-serialized response data * from the service. * * @!attribute error * An structure containing information about a service * or networking error. * @readonly * @!group Data Properties * @note This attribute is only filled if a service or * networking error occurs. * @return [Error] * * code [String] a unique short code representing the * error that was emitted. * * message [String] a longer human readable error message * * retryable [Boolean] whether the error message is * retryable. * * statusCode [Numeric] in the case of a request that reached the service, * this value contains the response status code. * * time [Date] the date time object when the error occurred. * * hostname [String] set when a networking error occurs to easily * identify the endpoint of the request. * * region [String] set when a networking error occurs to easily * identify the region of the request. * * @!attribute requestId * @readonly * @!group Data Properties * @return [String] the unique request ID associated with the response. * Log this value when debugging requests for AWS support. * * @!attribute retryCount * @readonly * @!group Operation Properties * @return [Integer] the number of retries that were * attempted before the request was completed. * * @!attribute redirectCount * @readonly * @!group Operation Properties * @return [Integer] the number of redirects that were * followed before the request was completed. * * @!attribute httpResponse * @readonly * @!group HTTP Properties * @return [AWS.HttpResponse] the raw HTTP response object * containing the response headers and body information * from the server. * * @see AWS.Request */ AWS.Response = inherit({ /** * @api private */ constructor: function Response(request) { this.request = request; this.data = null; this.error = null; this.retryCount = 0; this.redirectCount = 0; this.httpResponse = new AWS.HttpResponse(); if (request) { this.maxRetries = request.service.numRetries(); this.maxRedirects = request.service.config.maxRedirects; } }, /** * Creates a new request for the next page of response data, calling the * callback with the page data if a callback is provided. * * @callback callback function(err, data) * Called when a page of data is returned from the next request. * * @param err [Error] an error object, if an error occurred in the request * @param data [Object] the next page of data, or null, if there are no * more pages left. * @return [AWS.Request] the request object for the next page of data * @return [null] if no callback is provided and there are no pages left * to retrieve. * @since v1.4.0 */ nextPage: function nextPage(callback) { var config; var service = this.request.service; var operation = this.request.operation; try { config = service.paginationConfig(operation, true); } catch (e) { this.error = e; } if (!this.hasNextPage()) { if (callback) callback(this.error, null); else if (this.error) throw this.error; return null; } var params = AWS.util.copy(this.request.params); if (!this.nextPageTokens) { return callback ? callback(null, null) : null; } else { var inputTokens = config.inputToken; if (typeof inputTokens === 'string') inputTokens = [inputTokens]; for (var i = 0; i < inputTokens.length; i++) { params[inputTokens[i]] = this.nextPageTokens[i]; } return service.makeRequest(this.request.operation, params, callback); } }, /** * @return [Boolean] whether more pages of data can be returned by further * requests * @since v1.4.0 */ hasNextPage: function hasNextPage() { this.cacheNextPageTokens(); if (this.nextPageTokens) return true; if (this.nextPageTokens === undefined) return undefined; else return false; }, /** * @api private */ cacheNextPageTokens: function cacheNextPageTokens() { if (Object.prototype.hasOwnProperty.call(this, 'nextPageTokens')) return this.nextPageTokens; this.nextPageTokens = undefined; var config = this.request.service.paginationConfig(this.request.operation); if (!config) return this.nextPageTokens; this.nextPageTokens = null; if (config.moreResults) { if (!jmespath.search(this.data, config.moreResults)) { return this.nextPageTokens; } } var exprs = config.outputToken; if (typeof exprs === 'string') exprs = [exprs]; AWS.util.arrayEach.call(this, exprs, function (expr) { var output = jmespath.search(this.data, expr); if (output) { this.nextPageTokens = this.nextPageTokens || []; this.nextPageTokens.push(output); } }); return this.nextPageTokens; } }); /***/ }), /***/ 81600: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { var AWS = __webpack_require__(28437); var byteLength = AWS.util.string.byteLength; var Buffer = AWS.util.Buffer; /** * The managed uploader allows for easy and efficient uploading of buffers, * blobs, or streams, using a configurable amount of concurrency to perform * multipart uploads where possible. This abstraction also enables uploading * streams of unknown size due to the use of multipart uploads. * * To construct a managed upload object, see the {constructor} function. * * ## Tracking upload progress * * The managed upload object can also track progress by attaching an * 'httpUploadProgress' listener to the upload manager. This event is similar * to {AWS.Request~httpUploadProgress} but groups all concurrent upload progress * into a single event. See {AWS.S3.ManagedUpload~httpUploadProgress} for more * information. * * ## Handling Multipart Cleanup * * By default, this class will automatically clean up any multipart uploads * when an individual part upload fails. This behavior can be disabled in order * to manually handle failures by setting the `leavePartsOnError` configuration * option to `true` when initializing the upload object. * * @!event httpUploadProgress(progress) * Triggered when the uploader has uploaded more data. * @note The `total` property may not be set if the stream being uploaded has * not yet finished chunking. In this case the `total` will be undefined * until the total stream size is known. * @note This event will not be emitted in Node.js 0.8.x. * @param progress [map] An object containing the `loaded` and `total` bytes * of the request and the `key` of the S3 object. Note that `total` may be undefined until the payload * size is known. * @context (see AWS.Request~send) */ AWS.S3.ManagedUpload = AWS.util.inherit({ /** * Creates a managed upload object with a set of configuration options. * * @note A "Body" parameter is required to be set prior to calling {send}. * @note In Node.js, sending "Body" as {https://nodejs.org/dist/latest/docs/api/stream.html#stream_object_mode object-mode stream} * may result in upload hangs. Using buffer stream is preferable. * @option options params [map] a map of parameters to pass to the upload * requests. The "Body" parameter is required to be specified either on * the service or in the params option. * @note ContentMD5 should not be provided when using the managed upload object. * Instead, setting "computeChecksums" to true will enable automatic ContentMD5 generation * by the managed upload object. * @option options queueSize [Number] (4) the size of the concurrent queue * manager to upload parts in parallel. Set to 1 for synchronous uploading * of parts. Note that the uploader will buffer at most queueSize * partSize * bytes into memory at any given time. * @option options partSize [Number] (5mb) the size in bytes for each * individual part to be uploaded. Adjust the part size to ensure the number * of parts does not exceed {maxTotalParts}. See {minPartSize} for the * minimum allowed part size. * @option options leavePartsOnError [Boolean] (false) whether to abort the * multipart upload if an error occurs. Set to true if you want to handle * failures manually. * @option options service [AWS.S3] an optional S3 service object to use for * requests. This object might have bound parameters used by the uploader. * @option options tags [Array] The tags to apply to the uploaded object. * Each tag should have a `Key` and `Value` keys. * @example Creating a default uploader for a stream object * var upload = new AWS.S3.ManagedUpload({ * params: {Bucket: 'bucket', Key: 'key', Body: stream} * }); * @example Creating an uploader with concurrency of 1 and partSize of 10mb * var upload = new AWS.S3.ManagedUpload({ * partSize: 10 * 1024 * 1024, queueSize: 1, * params: {Bucket: 'bucket', Key: 'key', Body: stream} * }); * @example Creating an uploader with tags * var upload = new AWS.S3.ManagedUpload({ * params: {Bucket: 'bucket', Key: 'key', Body: stream}, * tags: [{Key: 'tag1', Value: 'value1'}, {Key: 'tag2', Value: 'value2'}] * }); * @see send */ constructor: function ManagedUpload(options) { var self = this; AWS.SequentialExecutor.call(self); self.body = null; self.sliceFn = null; self.callback = null; self.parts = {}; self.completeInfo = []; self.fillQueue = function() { self.callback(new Error('Unsupported body payload ' + typeof self.body)); }; self.configure(options); }, /** * @api private */ configure: function configure(options) { options = options || {}; this.partSize = this.minPartSize; if (options.queueSize) this.queueSize = options.queueSize; if (options.partSize) this.partSize = options.partSize; if (options.leavePartsOnError) this.leavePartsOnError = true; if (options.tags) { if (!Array.isArray(options.tags)) { throw new Error('Tags must be specified as an array; ' + typeof options.tags + ' provided.'); } this.tags = options.tags; } if (this.partSize < this.minPartSize) { throw new Error('partSize must be greater than ' + this.minPartSize); } this.service = options.service; this.bindServiceObject(options.params); this.validateBody(); this.adjustTotalBytes(); }, /** * @api private */ leavePartsOnError: false, /** * @api private */ queueSize: 4, /** * @api private */ partSize: null, /** * @readonly * @return [Number] the minimum number of bytes for an individual part * upload. */ minPartSize: 1024 * 1024 * 5, /** * @readonly * @return [Number] the maximum allowed number of parts in a multipart upload. */ maxTotalParts: 10000, /** * Initiates the managed upload for the payload. * * @callback callback function(err, data) * @param err [Error] an error or null if no error occurred. * @param data [map] The response data from the successful upload: * * `Location` (String) the URL of the uploaded object * * `ETag` (String) the ETag of the uploaded object * * `Bucket` (String) the bucket to which the object was uploaded * * `Key` (String) the key to which the object was uploaded * @example Sending a managed upload object * var params = {Bucket: 'bucket', Key: 'key', Body: stream}; * var upload = new AWS.S3.ManagedUpload({params: params}); * upload.send(function(err, data) { * console.log(err, data); * }); */ send: function(callback) { var self = this; self.failed = false; self.callback = callback || function(err) { if (err) throw err; }; var runFill = true; if (self.sliceFn) { self.fillQueue = self.fillBuffer; } else if (AWS.util.isNode()) { var Stream = AWS.util.stream.Stream; if (self.body instanceof Stream) { runFill = false; self.fillQueue = self.fillStream; self.partBuffers = []; self.body. on('error', function(err) { self.cleanup(err); }). on('readable', function() { self.fillQueue(); }). on('end', function() { self.isDoneChunking = true; self.numParts = self.totalPartNumbers; self.fillQueue.call(self); if (self.isDoneChunking && self.totalPartNumbers >= 1 && self.doneParts === self.numParts) { self.finishMultiPart(); } }); } } if (runFill) self.fillQueue.call(self); }, /** * @!method promise() * Returns a 'thenable' promise. * * Two callbacks can be provided to the `then` method on the returned promise. * The first callback will be called if the promise is fulfilled, and the second * callback will be called if the promise is rejected. * @callback fulfilledCallback function(data) * Called if the promise is fulfilled. * @param data [map] The response data from the successful upload: * `Location` (String) the URL of the uploaded object * `ETag` (String) the ETag of the uploaded object * `Bucket` (String) the bucket to which the object was uploaded * `Key` (String) the key to which the object was uploaded * @callback rejectedCallback function(err) * Called if the promise is rejected. * @param err [Error] an error or null if no error occurred. * @return [Promise] A promise that represents the state of the upload request. * @example Sending an upload request using promises. * var upload = s3.upload({Bucket: 'bucket', Key: 'key', Body: stream}); * var promise = upload.promise(); * promise.then(function(data) { ... }, function(err) { ... }); */ /** * Aborts a managed upload, including all concurrent upload requests. * @note By default, calling this function will cleanup a multipart upload * if one was created. To leave the multipart upload around after aborting * a request, configure `leavePartsOnError` to `true` in the {constructor}. * @note Calling {abort} in the browser environment will not abort any requests * that are already in flight. If a multipart upload was created, any parts * not yet uploaded will not be sent, and the multipart upload will be cleaned up. * @example Aborting an upload * var params = { * Bucket: 'bucket', Key: 'key', * Body: Buffer.alloc(1024 * 1024 * 25) // 25MB payload * }; * var upload = s3.upload(params); * upload.send(function (err, data) { * if (err) console.log("Error:", err.code, err.message); * else console.log(data); * }); * * // abort request in 1 second * setTimeout(upload.abort.bind(upload), 1000); */ abort: function() { var self = this; //abort putObject request if (self.isDoneChunking === true && self.totalPartNumbers === 1 && self.singlePart) { self.singlePart.abort(); } else { self.cleanup(AWS.util.error(new Error('Request aborted by user'), { code: 'RequestAbortedError', retryable: false })); } }, /** * @api private */ validateBody: function validateBody() { var self = this; self.body = self.service.config.params.Body; if (typeof self.body === 'string') { self.body = AWS.util.buffer.toBuffer(self.body); } else if (!self.body) { throw new Error('params.Body is required'); } self.sliceFn = AWS.util.arraySliceFn(self.body); }, /** * @api private */ bindServiceObject: function bindServiceObject(params) { params = params || {}; var self = this; // bind parameters to new service object if (!self.service) { self.service = new AWS.S3({params: params}); } else { // Create a new S3 client from the supplied client's constructor. var service = self.service; var config = AWS.util.copy(service.config); config.signatureVersion = service.getSignatureVersion(); self.service = new service.constructor.__super__(config); self.service.config.params = AWS.util.merge(self.service.config.params || {}, params); Object.defineProperty(self.service, '_originalConfig', { get: function() { return service._originalConfig; }, enumerable: false, configurable: true }); } }, /** * @api private */ adjustTotalBytes: function adjustTotalBytes() { var self = this; try { // try to get totalBytes self.totalBytes = byteLength(self.body); } catch (e) { } // try to adjust partSize if we know payload length if (self.totalBytes) { var newPartSize = Math.ceil(self.totalBytes / self.maxTotalParts); if (newPartSize > self.partSize) self.partSize = newPartSize; } else { self.totalBytes = undefined; } }, /** * @api private */ isDoneChunking: false, /** * @api private */ partPos: 0, /** * @api private */ totalChunkedBytes: 0, /** * @api private */ totalUploadedBytes: 0, /** * @api private */ totalBytes: undefined, /** * @api private */ numParts: 0, /** * @api private */ totalPartNumbers: 0, /** * @api private */ activeParts: 0, /** * @api private */ doneParts: 0, /** * @api private */ parts: null, /** * @api private */ completeInfo: null, /** * @api private */ failed: false, /** * @api private */ multipartReq: null, /** * @api private */ partBuffers: null, /** * @api private */ partBufferLength: 0, /** * @api private */ fillBuffer: function fillBuffer() { var self = this; var bodyLen = byteLength(self.body); if (bodyLen === 0) { self.isDoneChunking = true; self.numParts = 1; self.nextChunk(self.body); return; } while (self.activeParts < self.queueSize && self.partPos < bodyLen) { var endPos = Math.min(self.partPos + self.partSize, bodyLen); var buf = self.sliceFn.call(self.body, self.partPos, endPos); self.partPos += self.partSize; if (byteLength(buf) < self.partSize || self.partPos === bodyLen) { self.isDoneChunking = true; self.numParts = self.totalPartNumbers + 1; } self.nextChunk(buf); } }, /** * @api private */ fillStream: function fillStream() { var self = this; if (self.activeParts >= self.queueSize) return; var buf = self.body.read(self.partSize - self.partBufferLength) || self.body.read(); if (buf) { self.partBuffers.push(buf); self.partBufferLength += buf.length; self.totalChunkedBytes += buf.length; } if (self.partBufferLength >= self.partSize) { // if we have single buffer we avoid copyfull concat var pbuf = self.partBuffers.length === 1 ? self.partBuffers[0] : Buffer.concat(self.partBuffers); self.partBuffers = []; self.partBufferLength = 0; // if we have more than partSize, push the rest back on the queue if (pbuf.length > self.partSize) { var rest = pbuf.slice(self.partSize); self.partBuffers.push(rest); self.partBufferLength += rest.length; pbuf = pbuf.slice(0, self.partSize); } self.nextChunk(pbuf); } if (self.isDoneChunking && !self.isDoneSending) { // if we have single buffer we avoid copyfull concat pbuf = self.partBuffers.length === 1 ? self.partBuffers[0] : Buffer.concat(self.partBuffers); self.partBuffers = []; self.partBufferLength = 0; self.totalBytes = self.totalChunkedBytes; self.isDoneSending = true; if (self.numParts === 0 || pbuf.length > 0) { self.numParts++; self.nextChunk(pbuf); } } self.body.read(0); }, /** * @api private */ nextChunk: function nextChunk(chunk) { var self = this; if (self.failed) return null; var partNumber = ++self.totalPartNumbers; if (self.isDoneChunking && partNumber === 1) { var params = {Body: chunk}; if (this.tags) { params.Tagging = this.getTaggingHeader(); } var req = self.service.putObject(params); req._managedUpload = self; req.on('httpUploadProgress', self.progress).send(self.finishSinglePart); self.singlePart = req; //save the single part request return null; } else if (self.service.config.params.ContentMD5) { var err = AWS.util.error(new Error('The Content-MD5 you specified is invalid for multi-part uploads.'), { code: 'InvalidDigest', retryable: false }); self.cleanup(err); return null; } if (self.completeInfo[partNumber] && self.completeInfo[partNumber].ETag !== null) { return null; // Already uploaded this part. } self.activeParts++; if (!self.service.config.params.UploadId) { if (!self.multipartReq) { // create multipart self.multipartReq = self.service.createMultipartUpload(); self.multipartReq.on('success', function(resp) { self.service.config.params.UploadId = resp.data.UploadId; self.multipartReq = null; }); self.queueChunks(chunk, partNumber); self.multipartReq.on('error', function(err) { self.cleanup(err); }); self.multipartReq.send(); } else { self.queueChunks(chunk, partNumber); } } else { // multipart is created, just send self.uploadPart(chunk, partNumber); } }, /** * @api private */ getTaggingHeader: function getTaggingHeader() { var kvPairStrings = []; for (var i = 0; i < this.tags.length; i++) { kvPairStrings.push(AWS.util.uriEscape(this.tags[i].Key) + '=' + AWS.util.uriEscape(this.tags[i].Value)); } return kvPairStrings.join('&'); }, /** * @api private */ uploadPart: function uploadPart(chunk, partNumber) { var self = this; var partParams = { Body: chunk, ContentLength: AWS.util.string.byteLength(chunk), PartNumber: partNumber }; var partInfo = {ETag: null, PartNumber: partNumber}; self.completeInfo[partNumber] = partInfo; var req = self.service.uploadPart(partParams); self.parts[partNumber] = req; req._lastUploadedBytes = 0; req._managedUpload = self; req.on('httpUploadProgress', self.progress); req.send(function(err, data) { delete self.parts[partParams.PartNumber]; self.activeParts--; if (!err && (!data || !data.ETag)) { var message = 'No access to ETag property on response.'; if (AWS.util.isBrowser()) { message += ' Check CORS configuration to expose ETag header.'; } err = AWS.util.error(new Error(message), { code: 'ETagMissing', retryable: false }); } if (err) return self.cleanup(err); //prevent sending part being returned twice (https://github.com/aws/aws-sdk-js/issues/2304) if (self.completeInfo[partNumber] && self.completeInfo[partNumber].ETag !== null) return null; partInfo.ETag = data.ETag; self.doneParts++; if (self.isDoneChunking && self.doneParts === self.numParts) { self.finishMultiPart(); } else { self.fillQueue.call(self); } }); }, /** * @api private */ queueChunks: function queueChunks(chunk, partNumber) { var self = this; self.multipartReq.on('success', function() { self.uploadPart(chunk, partNumber); }); }, /** * @api private */ cleanup: function cleanup(err) { var self = this; if (self.failed) return; // clean up stream if (typeof self.body.removeAllListeners === 'function' && typeof self.body.resume === 'function') { self.body.removeAllListeners('readable'); self.body.removeAllListeners('end'); self.body.resume(); } // cleanup multipartReq listeners if (self.multipartReq) { self.multipartReq.removeAllListeners('success'); self.multipartReq.removeAllListeners('error'); self.multipartReq.removeAllListeners('complete'); delete self.multipartReq; } if (self.service.config.params.UploadId && !self.leavePartsOnError) { self.service.abortMultipartUpload().send(); } else if (self.leavePartsOnError) { self.isDoneChunking = false; } AWS.util.each(self.parts, function(partNumber, part) { part.removeAllListeners('complete'); part.abort(); }); self.activeParts = 0; self.partPos = 0; self.numParts = 0; self.totalPartNumbers = 0; self.parts = {}; self.failed = true; self.callback(err); }, /** * @api private */ finishMultiPart: function finishMultiPart() { var self = this; var completeParams = { MultipartUpload: { Parts: self.completeInfo.slice(1) } }; self.service.completeMultipartUpload(completeParams, function(err, data) { if (err) { return self.cleanup(err); } if (data && typeof data.Location === 'string') { data.Location = data.Location.replace(/%2F/g, '/'); } if (Array.isArray(self.tags)) { for (var i = 0; i < self.tags.length; i++) { self.tags[i].Value = String(self.tags[i].Value); } self.service.putObjectTagging( {Tagging: {TagSet: self.tags}}, function(e, d) { if (e) { self.callback(e); } else { self.callback(e, data); } } ); } else { self.callback(err, data); } }); }, /** * @api private */ finishSinglePart: function finishSinglePart(err, data) { var upload = this.request._managedUpload; var httpReq = this.request.httpRequest; var endpoint = httpReq.endpoint; if (err) return upload.callback(err); data.Location = [endpoint.protocol, '//', endpoint.host, httpReq.path].join(''); data.key = this.request.params.Key; // will stay undocumented data.Key = this.request.params.Key; data.Bucket = this.request.params.Bucket; upload.callback(err, data); }, /** * @api private */ progress: function progress(info) { var upload = this._managedUpload; if (this.operation === 'putObject') { info.part = 1; info.key = this.params.Key; } else { upload.totalUploadedBytes += info.loaded - this._lastUploadedBytes; this._lastUploadedBytes = info.loaded; info = { loaded: upload.totalUploadedBytes, total: upload.totalBytes, part: this.params.PartNumber, key: this.params.Key }; } upload.emit('httpUploadProgress', [info]); } }); AWS.util.mixin(AWS.S3.ManagedUpload, AWS.SequentialExecutor); /** * @api private */ AWS.S3.ManagedUpload.addPromisesToClass = function addPromisesToClass(PromiseDependency) { this.prototype.promise = AWS.util.promisifyMethod('send', PromiseDependency); }; /** * @api private */ AWS.S3.ManagedUpload.deletePromisesFromClass = function deletePromisesFromClass() { delete this.prototype.promise; }; AWS.util.addPromises(AWS.S3.ManagedUpload); /** * @api private */ module.exports = AWS.S3.ManagedUpload; /***/ }), /***/ 55948: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { var AWS = __webpack_require__(28437); /** * @api private * @!method on(eventName, callback) * Registers an event listener callback for the event given by `eventName`. * Parameters passed to the callback function depend on the individual event * being triggered. See the event documentation for those parameters. * * @param eventName [String] the event name to register the listener for * @param callback [Function] the listener callback function * @param toHead [Boolean] attach the listener callback to the head of callback array if set to true. * Default to be false. * @return [AWS.SequentialExecutor] the same object for chaining */ AWS.SequentialExecutor = AWS.util.inherit({ constructor: function SequentialExecutor() { this._events = {}; }, /** * @api private */ listeners: function listeners(eventName) { return this._events[eventName] ? this._events[eventName].slice(0) : []; }, on: function on(eventName, listener, toHead) { if (this._events[eventName]) { toHead ? this._events[eventName].unshift(listener) : this._events[eventName].push(listener); } else { this._events[eventName] = [listener]; } return this; }, onAsync: function onAsync(eventName, listener, toHead) { listener._isAsync = true; return this.on(eventName, listener, toHead); }, removeListener: function removeListener(eventName, listener) { var listeners = this._events[eventName]; if (listeners) { var length = listeners.length; var position = -1; for (var i = 0; i < length; ++i) { if (listeners[i] === listener) { position = i; } } if (position > -1) { listeners.splice(position, 1); } } return this; }, removeAllListeners: function removeAllListeners(eventName) { if (eventName) { delete this._events[eventName]; } else { this._events = {}; } return this; }, /** * @api private */ emit: function emit(eventName, eventArgs, doneCallback) { if (!doneCallback) doneCallback = function() { }; var listeners = this.listeners(eventName); var count = listeners.length; this.callListeners(listeners, eventArgs, doneCallback); return count > 0; }, /** * @api private */ callListeners: function callListeners(listeners, args, doneCallback, prevError) { var self = this; var error = prevError || null; function callNextListener(err) { if (err) { error = AWS.util.error(error || new Error(), err); if (self._haltHandlersOnError) { return doneCallback.call(self, error); } } self.callListeners(listeners, args, doneCallback, error); } while (listeners.length > 0) { var listener = listeners.shift(); if (listener._isAsync) { // asynchronous listener listener.apply(self, args.concat([callNextListener])); return; // stop here, callNextListener will continue } else { // synchronous listener try { listener.apply(self, args); } catch (err) { error = AWS.util.error(error || new Error(), err); } if (error && self._haltHandlersOnError) { doneCallback.call(self, error); return; } } } doneCallback.call(self, error); }, /** * Adds or copies a set of listeners from another list of * listeners or SequentialExecutor object. * * @param listeners [map>, AWS.SequentialExecutor] * a list of events and callbacks, or an event emitter object * containing listeners to add to this emitter object. * @return [AWS.SequentialExecutor] the emitter object, for chaining. * @example Adding listeners from a map of listeners * emitter.addListeners({ * event1: [function() { ... }, function() { ... }], * event2: [function() { ... }] * }); * emitter.emit('event1'); // emitter has event1 * emitter.emit('event2'); // emitter has event2 * @example Adding listeners from another emitter object * var emitter1 = new AWS.SequentialExecutor(); * emitter1.on('event1', function() { ... }); * emitter1.on('event2', function() { ... }); * var emitter2 = new AWS.SequentialExecutor(); * emitter2.addListeners(emitter1); * emitter2.emit('event1'); // emitter2 has event1 * emitter2.emit('event2'); // emitter2 has event2 */ addListeners: function addListeners(listeners) { var self = this; // extract listeners if parameter is an SequentialExecutor object if (listeners._events) listeners = listeners._events; AWS.util.each(listeners, function(event, callbacks) { if (typeof callbacks === 'function') callbacks = [callbacks]; AWS.util.arrayEach(callbacks, function(callback) { self.on(event, callback); }); }); return self; }, /** * Registers an event with {on} and saves the callback handle function * as a property on the emitter object using a given `name`. * * @param name [String] the property name to set on this object containing * the callback function handle so that the listener can be removed in * the future. * @param (see on) * @return (see on) * @example Adding a named listener DATA_CALLBACK * var listener = function() { doSomething(); }; * emitter.addNamedListener('DATA_CALLBACK', 'data', listener); * * // the following prints: true * console.log(emitter.DATA_CALLBACK == listener); */ addNamedListener: function addNamedListener(name, eventName, callback, toHead) { this[name] = callback; this.addListener(eventName, callback, toHead); return this; }, /** * @api private */ addNamedAsyncListener: function addNamedAsyncListener(name, eventName, callback, toHead) { callback._isAsync = true; return this.addNamedListener(name, eventName, callback, toHead); }, /** * Helper method to add a set of named listeners using * {addNamedListener}. The callback contains a parameter * with a handle to the `addNamedListener` method. * * @callback callback function(add) * The callback function is called immediately in order to provide * the `add` function to the block. This simplifies the addition of * a large group of named listeners. * @param add [Function] the {addNamedListener} function to call * when registering listeners. * @example Adding a set of named listeners * emitter.addNamedListeners(function(add) { * add('DATA_CALLBACK', 'data', function() { ... }); * add('OTHER', 'otherEvent', function() { ... }); * add('LAST', 'lastEvent', function() { ... }); * }); * * // these properties are now set: * emitter.DATA_CALLBACK; * emitter.OTHER; * emitter.LAST; */ addNamedListeners: function addNamedListeners(callback) { var self = this; callback( function() { self.addNamedListener.apply(self, arguments); }, function() { self.addNamedAsyncListener.apply(self, arguments); } ); return this; } }); /** * {on} is the prefered method. * @api private */ AWS.SequentialExecutor.prototype.addListener = AWS.SequentialExecutor.prototype.on; /** * @api private */ module.exports = AWS.SequentialExecutor; /***/ }), /***/ 68903: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { var AWS = __webpack_require__(28437); var Api = __webpack_require__(17657); var regionConfig = __webpack_require__(18262); var inherit = AWS.util.inherit; var clientCount = 0; /** * The service class representing an AWS service. * * @class_abstract This class is an abstract class. * * @!attribute apiVersions * @return [Array] the list of API versions supported by this service. * @readonly */ AWS.Service = inherit({ /** * Create a new service object with a configuration object * * @param config [map] a map of configuration options */ constructor: function Service(config) { if (!this.loadServiceClass) { throw AWS.util.error(new Error(), 'Service must be constructed with `new\' operator'); } var ServiceClass = this.loadServiceClass(config || {}); if (ServiceClass) { var originalConfig = AWS.util.copy(config); var svc = new ServiceClass(config); Object.defineProperty(svc, '_originalConfig', { get: function() { return originalConfig; }, enumerable: false, configurable: true }); svc._clientId = ++clientCount; return svc; } this.initialize(config); }, /** * @api private */ initialize: function initialize(config) { var svcConfig = AWS.config[this.serviceIdentifier]; this.config = new AWS.Config(AWS.config); if (svcConfig) this.config.update(svcConfig, true); if (config) this.config.update(config, true); this.validateService(); if (!this.config.endpoint) regionConfig.configureEndpoint(this); this.config.endpoint = this.endpointFromTemplate(this.config.endpoint); this.setEndpoint(this.config.endpoint); //enable attaching listeners to service client AWS.SequentialExecutor.call(this); AWS.Service.addDefaultMonitoringListeners(this); if ((this.config.clientSideMonitoring || AWS.Service._clientSideMonitoring) && this.publisher) { var publisher = this.publisher; this.addNamedListener('PUBLISH_API_CALL', 'apiCall', function PUBLISH_API_CALL(event) { process.nextTick(function() {publisher.eventHandler(event);}); }); this.addNamedListener('PUBLISH_API_ATTEMPT', 'apiCallAttempt', function PUBLISH_API_ATTEMPT(event) { process.nextTick(function() {publisher.eventHandler(event);}); }); } }, /** * @api private */ validateService: function validateService() { }, /** * @api private */ loadServiceClass: function loadServiceClass(serviceConfig) { var config = serviceConfig; if (!AWS.util.isEmpty(this.api)) { return null; } else if (config.apiConfig) { return AWS.Service.defineServiceApi(this.constructor, config.apiConfig); } else if (!this.constructor.services) { return null; } else { config = new AWS.Config(AWS.config); config.update(serviceConfig, true); var version = config.apiVersions[this.constructor.serviceIdentifier]; version = version || config.apiVersion; return this.getLatestServiceClass(version); } }, /** * @api private */ getLatestServiceClass: function getLatestServiceClass(version) { version = this.getLatestServiceVersion(version); if (this.constructor.services[version] === null) { AWS.Service.defineServiceApi(this.constructor, version); } return this.constructor.services[version]; }, /** * @api private */ getLatestServiceVersion: function getLatestServiceVersion(version) { if (!this.constructor.services || this.constructor.services.length === 0) { throw new Error('No services defined on ' + this.constructor.serviceIdentifier); } if (!version) { version = 'latest'; } else if (AWS.util.isType(version, Date)) { version = AWS.util.date.iso8601(version).split('T')[0]; } if (Object.hasOwnProperty(this.constructor.services, version)) { return version; } var keys = Object.keys(this.constructor.services).sort(); var selectedVersion = null; for (var i = keys.length - 1; i >= 0; i--) { // versions that end in "*" are not available on disk and can be // skipped, so do not choose these as selectedVersions if (keys[i][keys[i].length - 1] !== '*') { selectedVersion = keys[i]; } if (keys[i].substr(0, 10) <= version) { return selectedVersion; } } throw new Error('Could not find ' + this.constructor.serviceIdentifier + ' API to satisfy version constraint `' + version + '\''); }, /** * @api private */ api: {}, /** * @api private */ defaultRetryCount: 3, /** * @api private */ customizeRequests: function customizeRequests(callback) { if (!callback) { this.customRequestHandler = null; } else if (typeof callback === 'function') { this.customRequestHandler = callback; } else { throw new Error('Invalid callback type \'' + typeof callback + '\' provided in customizeRequests'); } }, /** * Calls an operation on a service with the given input parameters. * * @param operation [String] the name of the operation to call on the service. * @param params [map] a map of input options for the operation * @callback callback function(err, data) * If a callback is supplied, it is called when a response is returned * from the service. * @param err [Error] the error object returned from the request. * Set to `null` if the request is successful. * @param data [Object] the de-serialized data returned from * the request. Set to `null` if a request error occurs. */ makeRequest: function makeRequest(operation, params, callback) { if (typeof params === 'function') { callback = params; params = null; } params = params || {}; if (this.config.params) { // copy only toplevel bound params var rules = this.api.operations[operation]; if (rules) { params = AWS.util.copy(params); AWS.util.each(this.config.params, function(key, value) { if (rules.input.members[key]) { if (params[key] === undefined || params[key] === null) { params[key] = value; } } }); } } var request = new AWS.Request(this, operation, params); this.addAllRequestListeners(request); this.attachMonitoringEmitter(request); if (callback) request.send(callback); return request; }, /** * Calls an operation on a service with the given input parameters, without * any authentication data. This method is useful for "public" API operations. * * @param operation [String] the name of the operation to call on the service. * @param params [map] a map of input options for the operation * @callback callback function(err, data) * If a callback is supplied, it is called when a response is returned * from the service. * @param err [Error] the error object returned from the request. * Set to `null` if the request is successful. * @param data [Object] the de-serialized data returned from * the request. Set to `null` if a request error occurs. */ makeUnauthenticatedRequest: function makeUnauthenticatedRequest(operation, params, callback) { if (typeof params === 'function') { callback = params; params = {}; } var request = this.makeRequest(operation, params).toUnauthenticated(); return callback ? request.send(callback) : request; }, /** * Waits for a given state * * @param state [String] the state on the service to wait for * @param params [map] a map of parameters to pass with each request * @option params $waiter [map] a map of configuration options for the waiter * @option params $waiter.delay [Number] The number of seconds to wait between * requests * @option params $waiter.maxAttempts [Number] The maximum number of requests * to send while waiting * @callback callback function(err, data) * If a callback is supplied, it is called when a response is returned * from the service. * @param err [Error] the error object returned from the request. * Set to `null` if the request is successful. * @param data [Object] the de-serialized data returned from * the request. Set to `null` if a request error occurs. */ waitFor: function waitFor(state, params, callback) { var waiter = new AWS.ResourceWaiter(this, state); return waiter.wait(params, callback); }, /** * @api private */ addAllRequestListeners: function addAllRequestListeners(request) { var list = [AWS.events, AWS.EventListeners.Core, this.serviceInterface(), AWS.EventListeners.CorePost]; for (var i = 0; i < list.length; i++) { if (list[i]) request.addListeners(list[i]); } // disable parameter validation if (!this.config.paramValidation) { request.removeListener('validate', AWS.EventListeners.Core.VALIDATE_PARAMETERS); } if (this.config.logger) { // add logging events request.addListeners(AWS.EventListeners.Logger); } this.setupRequestListeners(request); // call prototype's customRequestHandler if (typeof this.constructor.prototype.customRequestHandler === 'function') { this.constructor.prototype.customRequestHandler(request); } // call instance's customRequestHandler if (Object.prototype.hasOwnProperty.call(this, 'customRequestHandler') && typeof this.customRequestHandler === 'function') { this.customRequestHandler(request); } }, /** * Event recording metrics for a whole API call. * @returns {object} a subset of api call metrics * @api private */ apiCallEvent: function apiCallEvent(request) { var api = request.service.api.operations[request.operation]; var monitoringEvent = { Type: 'ApiCall', Api: api ? api.name : request.operation, Version: 1, Service: request.service.api.serviceId || request.service.api.endpointPrefix, Region: request.httpRequest.region, MaxRetriesExceeded: 0, UserAgent: request.httpRequest.getUserAgent(), }; var response = request.response; if (response.httpResponse.statusCode) { monitoringEvent.FinalHttpStatusCode = response.httpResponse.statusCode; } if (response.error) { var error = response.error; var statusCode = response.httpResponse.statusCode; if (statusCode > 299) { if (error.code) monitoringEvent.FinalAwsException = error.code; if (error.message) monitoringEvent.FinalAwsExceptionMessage = error.message; } else { if (error.code || error.name) monitoringEvent.FinalSdkException = error.code || error.name; if (error.message) monitoringEvent.FinalSdkExceptionMessage = error.message; } } return monitoringEvent; }, /** * Event recording metrics for an API call attempt. * @returns {object} a subset of api call attempt metrics * @api private */ apiAttemptEvent: function apiAttemptEvent(request) { var api = request.service.api.operations[request.operation]; var monitoringEvent = { Type: 'ApiCallAttempt', Api: api ? api.name : request.operation, Version: 1, Service: request.service.api.serviceId || request.service.api.endpointPrefix, Fqdn: request.httpRequest.endpoint.hostname, UserAgent: request.httpRequest.getUserAgent(), }; var response = request.response; if (response.httpResponse.statusCode) { monitoringEvent.HttpStatusCode = response.httpResponse.statusCode; } if ( !request._unAuthenticated && request.service.config.credentials && request.service.config.credentials.accessKeyId ) { monitoringEvent.AccessKey = request.service.config.credentials.accessKeyId; } if (!response.httpResponse.headers) return monitoringEvent; if (request.httpRequest.headers['x-amz-security-token']) { monitoringEvent.SessionToken = request.httpRequest.headers['x-amz-security-token']; } if (response.httpResponse.headers['x-amzn-requestid']) { monitoringEvent.XAmznRequestId = response.httpResponse.headers['x-amzn-requestid']; } if (response.httpResponse.headers['x-amz-request-id']) { monitoringEvent.XAmzRequestId = response.httpResponse.headers['x-amz-request-id']; } if (response.httpResponse.headers['x-amz-id-2']) { monitoringEvent.XAmzId2 = response.httpResponse.headers['x-amz-id-2']; } return monitoringEvent; }, /** * Add metrics of failed request. * @api private */ attemptFailEvent: function attemptFailEvent(request) { var monitoringEvent = this.apiAttemptEvent(request); var response = request.response; var error = response.error; if (response.httpResponse.statusCode > 299 ) { if (error.code) monitoringEvent.AwsException = error.code; if (error.message) monitoringEvent.AwsExceptionMessage = error.message; } else { if (error.code || error.name) monitoringEvent.SdkException = error.code || error.name; if (error.message) monitoringEvent.SdkExceptionMessage = error.message; } return monitoringEvent; }, /** * Attach listeners to request object to fetch metrics of each request * and emit data object through \'ApiCall\' and \'ApiCallAttempt\' events. * @api private */ attachMonitoringEmitter: function attachMonitoringEmitter(request) { var attemptTimestamp; //timestamp marking the beginning of a request attempt var attemptStartRealTime; //Start time of request attempt. Used to calculating attemptLatency var attemptLatency; //latency from request sent out to http response reaching SDK var callStartRealTime; //Start time of API call. Used to calculating API call latency var attemptCount = 0; //request.retryCount is not reliable here var region; //region cache region for each attempt since it can be updated in plase (e.g. s3) var callTimestamp; //timestamp when the request is created var self = this; var addToHead = true; request.on('validate', function () { callStartRealTime = AWS.util.realClock.now(); callTimestamp = Date.now(); }, addToHead); request.on('sign', function () { attemptStartRealTime = AWS.util.realClock.now(); attemptTimestamp = Date.now(); region = request.httpRequest.region; attemptCount++; }, addToHead); request.on('validateResponse', function() { attemptLatency = Math.round(AWS.util.realClock.now() - attemptStartRealTime); }); request.addNamedListener('API_CALL_ATTEMPT', 'success', function API_CALL_ATTEMPT() { var apiAttemptEvent = self.apiAttemptEvent(request); apiAttemptEvent.Timestamp = attemptTimestamp; apiAttemptEvent.AttemptLatency = attemptLatency >= 0 ? attemptLatency : 0; apiAttemptEvent.Region = region; self.emit('apiCallAttempt', [apiAttemptEvent]); }); request.addNamedListener('API_CALL_ATTEMPT_RETRY', 'retry', function API_CALL_ATTEMPT_RETRY() { var apiAttemptEvent = self.attemptFailEvent(request); apiAttemptEvent.Timestamp = attemptTimestamp; //attemptLatency may not be available if fail before response attemptLatency = attemptLatency || Math.round(AWS.util.realClock.now() - attemptStartRealTime); apiAttemptEvent.AttemptLatency = attemptLatency >= 0 ? attemptLatency : 0; apiAttemptEvent.Region = region; self.emit('apiCallAttempt', [apiAttemptEvent]); }); request.addNamedListener('API_CALL', 'complete', function API_CALL() { var apiCallEvent = self.apiCallEvent(request); apiCallEvent.AttemptCount = attemptCount; if (apiCallEvent.AttemptCount <= 0) return; apiCallEvent.Timestamp = callTimestamp; var latency = Math.round(AWS.util.realClock.now() - callStartRealTime); apiCallEvent.Latency = latency >= 0 ? latency : 0; var response = request.response; if ( response.error && response.error.retryable && typeof response.retryCount === 'number' && typeof response.maxRetries === 'number' && (response.retryCount >= response.maxRetries) ) { apiCallEvent.MaxRetriesExceeded = 1; } self.emit('apiCall', [apiCallEvent]); }); }, /** * Override this method to setup any custom request listeners for each * new request to the service. * * @method_abstract This is an abstract method. */ setupRequestListeners: function setupRequestListeners(request) { }, /** * Gets the signing name for a given request * @api private */ getSigningName: function getSigningName() { return this.api.signingName || this.api.endpointPrefix; }, /** * Gets the signer class for a given request * @api private */ getSignerClass: function getSignerClass(request) { var version; // get operation authtype if present var operation = null; var authtype = ''; if (request) { var operations = request.service.api.operations || {}; operation = operations[request.operation] || null; authtype = operation ? operation.authtype : ''; } if (this.config.signatureVersion) { version = this.config.signatureVersion; } else if (authtype === 'v4' || authtype === 'v4-unsigned-body') { version = 'v4'; } else { version = this.api.signatureVersion; } return AWS.Signers.RequestSigner.getVersion(version); }, /** * @api private */ serviceInterface: function serviceInterface() { switch (this.api.protocol) { case 'ec2': return AWS.EventListeners.Query; case 'query': return AWS.EventListeners.Query; case 'json': return AWS.EventListeners.Json; case 'rest-json': return AWS.EventListeners.RestJson; case 'rest-xml': return AWS.EventListeners.RestXml; } if (this.api.protocol) { throw new Error('Invalid service `protocol\' ' + this.api.protocol + ' in API config'); } }, /** * @api private */ successfulResponse: function successfulResponse(resp) { return resp.httpResponse.statusCode < 300; }, /** * How many times a failed request should be retried before giving up. * the defaultRetryCount can be overriden by service classes. * * @api private */ numRetries: function numRetries() { if (this.config.maxRetries !== undefined) { return this.config.maxRetries; } else { return this.defaultRetryCount; } }, /** * @api private */ retryDelays: function retryDelays(retryCount, err) { return AWS.util.calculateRetryDelay(retryCount, this.config.retryDelayOptions, err); }, /** * @api private */ retryableError: function retryableError(error) { if (this.timeoutError(error)) return true; if (this.networkingError(error)) return true; if (this.expiredCredentialsError(error)) return true; if (this.throttledError(error)) return true; if (error.statusCode >= 500) return true; return false; }, /** * @api private */ networkingError: function networkingError(error) { return error.code === 'NetworkingError'; }, /** * @api private */ timeoutError: function timeoutError(error) { return error.code === 'TimeoutError'; }, /** * @api private */ expiredCredentialsError: function expiredCredentialsError(error) { // TODO : this only handles *one* of the expired credential codes return (error.code === 'ExpiredTokenException'); }, /** * @api private */ clockSkewError: function clockSkewError(error) { switch (error.code) { case 'RequestTimeTooSkewed': case 'RequestExpired': case 'InvalidSignatureException': case 'SignatureDoesNotMatch': case 'AuthFailure': case 'RequestInTheFuture': return true; default: return false; } }, /** * @api private */ getSkewCorrectedDate: function getSkewCorrectedDate() { return new Date(Date.now() + this.config.systemClockOffset); }, /** * @api private */ applyClockOffset: function applyClockOffset(newServerTime) { if (newServerTime) { this.config.systemClockOffset = newServerTime - Date.now(); } }, /** * @api private */ isClockSkewed: function isClockSkewed(newServerTime) { if (newServerTime) { return Math.abs(this.getSkewCorrectedDate().getTime() - newServerTime) >= 300000; } }, /** * @api private */ throttledError: function throttledError(error) { // this logic varies between services if (error.statusCode === 429) return true; switch (error.code) { case 'ProvisionedThroughputExceededException': case 'Throttling': case 'ThrottlingException': case 'RequestLimitExceeded': case 'RequestThrottled': case 'RequestThrottledException': case 'TooManyRequestsException': case 'TransactionInProgressException': //dynamodb case 'EC2ThrottledException': return true; default: return false; } }, /** * @api private */ endpointFromTemplate: function endpointFromTemplate(endpoint) { if (typeof endpoint !== 'string') return endpoint; var e = endpoint; e = e.replace(/\{service\}/g, this.api.endpointPrefix); e = e.replace(/\{region\}/g, this.config.region); e = e.replace(/\{scheme\}/g, this.config.sslEnabled ? 'https' : 'http'); return e; }, /** * @api private */ setEndpoint: function setEndpoint(endpoint) { this.endpoint = new AWS.Endpoint(endpoint, this.config); }, /** * @api private */ paginationConfig: function paginationConfig(operation, throwException) { var paginator = this.api.operations[operation].paginator; if (!paginator) { if (throwException) { var e = new Error(); throw AWS.util.error(e, 'No pagination configuration for ' + operation); } return null; } return paginator; } }); AWS.util.update(AWS.Service, { /** * Adds one method for each operation described in the api configuration * * @api private */ defineMethods: function defineMethods(svc) { AWS.util.each(svc.prototype.api.operations, function iterator(method) { if (svc.prototype[method]) return; var operation = svc.prototype.api.operations[method]; if (operation.authtype === 'none') { svc.prototype[method] = function (params, callback) { return this.makeUnauthenticatedRequest(method, params, callback); }; } else { svc.prototype[method] = function (params, callback) { return this.makeRequest(method, params, callback); }; } }); }, /** * Defines a new Service class using a service identifier and list of versions * including an optional set of features (functions) to apply to the class * prototype. * * @param serviceIdentifier [String] the identifier for the service * @param versions [Array] a list of versions that work with this * service * @param features [Object] an object to attach to the prototype * @return [Class] the service class defined by this function. */ defineService: function defineService(serviceIdentifier, versions, features) { AWS.Service._serviceMap[serviceIdentifier] = true; if (!Array.isArray(versions)) { features = versions; versions = []; } var svc = inherit(AWS.Service, features || {}); if (typeof serviceIdentifier === 'string') { AWS.Service.addVersions(svc, versions); var identifier = svc.serviceIdentifier || serviceIdentifier; svc.serviceIdentifier = identifier; } else { // defineService called with an API svc.prototype.api = serviceIdentifier; AWS.Service.defineMethods(svc); } AWS.SequentialExecutor.call(this.prototype); //util.clientSideMonitoring is only available in node if (!this.prototype.publisher && AWS.util.clientSideMonitoring) { var Publisher = AWS.util.clientSideMonitoring.Publisher; var configProvider = AWS.util.clientSideMonitoring.configProvider; var publisherConfig = configProvider(); this.prototype.publisher = new Publisher(publisherConfig); if (publisherConfig.enabled) { //if csm is enabled in environment, SDK should send all metrics AWS.Service._clientSideMonitoring = true; } } AWS.SequentialExecutor.call(svc.prototype); AWS.Service.addDefaultMonitoringListeners(svc.prototype); return svc; }, /** * @api private */ addVersions: function addVersions(svc, versions) { if (!Array.isArray(versions)) versions = [versions]; svc.services = svc.services || {}; for (var i = 0; i < versions.length; i++) { if (svc.services[versions[i]] === undefined) { svc.services[versions[i]] = null; } } svc.apiVersions = Object.keys(svc.services).sort(); }, /** * @api private */ defineServiceApi: function defineServiceApi(superclass, version, apiConfig) { var svc = inherit(superclass, { serviceIdentifier: superclass.serviceIdentifier }); function setApi(api) { if (api.isApi) { svc.prototype.api = api; } else { svc.prototype.api = new Api(api, { serviceIdentifier: superclass.serviceIdentifier }); } } if (typeof version === 'string') { if (apiConfig) { setApi(apiConfig); } else { try { setApi(AWS.apiLoader(superclass.serviceIdentifier, version)); } catch (err) { throw AWS.util.error(err, { message: 'Could not find API configuration ' + superclass.serviceIdentifier + '-' + version }); } } if (!Object.prototype.hasOwnProperty.call(superclass.services, version)) { superclass.apiVersions = superclass.apiVersions.concat(version).sort(); } superclass.services[version] = svc; } else { setApi(version); } AWS.Service.defineMethods(svc); return svc; }, /** * @api private */ hasService: function(identifier) { return Object.prototype.hasOwnProperty.call(AWS.Service._serviceMap, identifier); }, /** * @param attachOn attach default monitoring listeners to object * * Each monitoring event should be emitted from service client to service constructor prototype and then * to global service prototype like bubbling up. These default monitoring events listener will transfer * the monitoring events to the upper layer. * @api private */ addDefaultMonitoringListeners: function addDefaultMonitoringListeners(attachOn) { attachOn.addNamedListener('MONITOR_EVENTS_BUBBLE', 'apiCallAttempt', function EVENTS_BUBBLE(event) { var baseClass = Object.getPrototypeOf(attachOn); if (baseClass._events) baseClass.emit('apiCallAttempt', [event]); }); attachOn.addNamedListener('CALL_EVENTS_BUBBLE', 'apiCall', function CALL_EVENTS_BUBBLE(event) { var baseClass = Object.getPrototypeOf(attachOn); if (baseClass._events) baseClass.emit('apiCall', [event]); }); }, /** * @api private */ _serviceMap: {} }); AWS.util.mixin(AWS.Service, AWS.SequentialExecutor); /** * @api private */ module.exports = AWS.Service; /***/ }), /***/ 4338: /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => { var AWS = __webpack_require__(28437); AWS.util.update(AWS.APIGateway.prototype, { /** * Sets the Accept header to application/json. * * @api private */ setAcceptHeader: function setAcceptHeader(req) { var httpRequest = req.httpRequest; if (!httpRequest.headers.Accept) { httpRequest.headers['Accept'] = 'application/json'; } }, /** * @api private */ setupRequestListeners: function setupRequestListeners(request) { request.addListener('build', this.setAcceptHeader); if (request.operation === 'getExport') { var params = request.params || {}; if (params.exportType === 'swagger') { request.addListener('extractData', AWS.util.convertPayloadToString); } } } }); /***/ }), /***/ 95483: /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => { var AWS = __webpack_require__(28437); // pull in CloudFront signer __webpack_require__(93260); AWS.util.update(AWS.CloudFront.prototype, { setupRequestListeners: function setupRequestListeners(request) { request.addListener('extractData', AWS.util.hoistPayloadMember); } }); /***/ }), /***/ 48571: /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => { var AWS = __webpack_require__(28437); /** * Constructs a service interface object. Each API operation is exposed as a * function on service. * * ### Sending a Request Using CloudSearchDomain * * ```javascript * var csd = new AWS.CloudSearchDomain({endpoint: 'my.host.tld'}); * csd.search(params, function (err, data) { * if (err) console.log(err, err.stack); // an error occurred * else console.log(data); // successful response * }); * ``` * * ### Locking the API Version * * In order to ensure that the CloudSearchDomain object uses this specific API, * you can construct the object by passing the `apiVersion` option to the * constructor: * * ```javascript * var csd = new AWS.CloudSearchDomain({ * endpoint: 'my.host.tld', * apiVersion: '2013-01-01' * }); * ``` * * You can also set the API version globally in `AWS.config.apiVersions` using * the **cloudsearchdomain** service identifier: * * ```javascript * AWS.config.apiVersions = { * cloudsearchdomain: '2013-01-01', * // other service API versions * }; * * var csd = new AWS.CloudSearchDomain({endpoint: 'my.host.tld'}); * ``` * * @note You *must* provide an `endpoint` configuration parameter when * constructing this service. See {constructor} for more information. * * @!method constructor(options = {}) * Constructs a service object. This object has one method for each * API operation. * * @example Constructing a CloudSearchDomain object * var csd = new AWS.CloudSearchDomain({endpoint: 'my.host.tld'}); * @note You *must* provide an `endpoint` when constructing this service. * @option (see AWS.Config.constructor) * * @service cloudsearchdomain * @version 2013-01-01 */ AWS.util.update(AWS.CloudSearchDomain.prototype, { /** * @api private */ validateService: function validateService() { if (!this.config.endpoint || this.config.endpoint.indexOf('{') >= 0) { var msg = 'AWS.CloudSearchDomain requires an explicit ' + '`endpoint\' configuration option.'; throw AWS.util.error(new Error(), {name: 'InvalidEndpoint', message: msg}); } }, /** * @api private */ setupRequestListeners: function setupRequestListeners(request) { request.removeListener('validate', AWS.EventListeners.Core.VALIDATE_CREDENTIALS ); request.onAsync('validate', this.validateCredentials); request.addListener('validate', this.updateRegion); if (request.operation === 'search') { request.addListener('build', this.convertGetToPost); } }, /** * @api private */ validateCredentials: function(req, done) { if (!req.service.api.signatureVersion) return done(); // none req.service.config.getCredentials(function(err) { if (err) { req.removeListener('sign', AWS.EventListeners.Core.SIGN); } done(); }); }, /** * @api private */ convertGetToPost: function(request) { var httpRequest = request.httpRequest; // convert queries to POST to avoid length restrictions var path = httpRequest.path.split('?'); httpRequest.method = 'POST'; httpRequest.path = path[0]; httpRequest.body = path[1]; httpRequest.headers['Content-Length'] = httpRequest.body.length; httpRequest.headers['Content-Type'] = 'application/x-www-form-urlencoded'; }, /** * @api private */ updateRegion: function updateRegion(request) { var endpoint = request.httpRequest.endpoint.hostname; var zones = endpoint.split('.'); request.httpRequest.region = zones[1] || request.httpRequest.region; } }); /***/ }), /***/ 59050: /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => { var AWS = __webpack_require__(28437); var rdsutil = __webpack_require__(30650); /** * @api private */ var crossRegionOperations = ['createDBCluster', 'copyDBClusterSnapshot']; AWS.util.update(AWS.DocDB.prototype, { /** * @api private */ setupRequestListeners: function setupRequestListeners(request) { if ( crossRegionOperations.indexOf(request.operation) !== -1 && this.config.params && this.config.params.SourceRegion && request.params && !request.params.SourceRegion ) { request.params.SourceRegion = this.config.params.SourceRegion; } rdsutil.setupRequestListeners(this, request, crossRegionOperations); }, }); /***/ }), /***/ 17101: /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => { var AWS = __webpack_require__(28437); __webpack_require__(90030); AWS.util.update(AWS.DynamoDB.prototype, { /** * @api private */ setupRequestListeners: function setupRequestListeners(request) { if (request.service.config.dynamoDbCrc32) { request.removeListener('extractData', AWS.EventListeners.Json.EXTRACT_DATA); request.addListener('extractData', this.checkCrc32); request.addListener('extractData', AWS.EventListeners.Json.EXTRACT_DATA); } }, /** * @api private */ checkCrc32: function checkCrc32(resp) { if (!resp.httpResponse.streaming && !resp.request.service.crc32IsValid(resp)) { resp.data = null; resp.error = AWS.util.error(new Error(), { code: 'CRC32CheckFailed', message: 'CRC32 integrity check failed', retryable: true }); resp.request.haltHandlersOnError(); throw (resp.error); } }, /** * @api private */ crc32IsValid: function crc32IsValid(resp) { var crc = resp.httpResponse.headers['x-amz-crc32']; if (!crc) return true; // no (valid) CRC32 header return parseInt(crc, 10) === AWS.util.crypto.crc32(resp.httpResponse.body); }, /** * @api private */ defaultRetryCount: 10, /** * @api private */ retryDelays: function retryDelays(retryCount, err) { var retryDelayOptions = AWS.util.copy(this.config.retryDelayOptions); if (typeof retryDelayOptions.base !== 'number') { retryDelayOptions.base = 50; // default for dynamodb } var delay = AWS.util.calculateRetryDelay(retryCount, retryDelayOptions, err); return delay; } }); /***/ }), /***/ 92501: /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => { var AWS = __webpack_require__(28437); AWS.util.update(AWS.EC2.prototype, { /** * @api private */ setupRequestListeners: function setupRequestListeners(request) { request.removeListener('extractError', AWS.EventListeners.Query.EXTRACT_ERROR); request.addListener('extractError', this.extractError); if (request.operation === 'copySnapshot') { request.onAsync('validate', this.buildCopySnapshotPresignedUrl); } }, /** * @api private */ buildCopySnapshotPresignedUrl: function buildCopySnapshotPresignedUrl(req, done) { if (req.params.PresignedUrl || req._subRequest) { return done(); } req.params = AWS.util.copy(req.params); req.params.DestinationRegion = req.service.config.region; var config = AWS.util.copy(req.service.config); delete config.endpoint; config.region = req.params.SourceRegion; var svc = new req.service.constructor(config); var newReq = svc[req.operation](req.params); newReq._subRequest = true; newReq.presign(function(err, url) { if (err) done(err); else { req.params.PresignedUrl = url; done(); } }); }, /** * @api private */ extractError: function extractError(resp) { // EC2 nests the error code and message deeper than other AWS Query services. var httpResponse = resp.httpResponse; var data = new AWS.XML.Parser().parse(httpResponse.body.toString() || ''); if (data.Errors) { resp.error = AWS.util.error(new Error(), { code: data.Errors.Error.Code, message: data.Errors.Error.Message }); } else { resp.error = AWS.util.error(new Error(), { code: httpResponse.statusCode, message: null }); } resp.error.requestId = data.RequestID || null; } }); /***/ }), /***/ 14472: /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => { var AWS = __webpack_require__(28437); AWS.util.update(AWS.Glacier.prototype, { /** * @api private */ setupRequestListeners: function setupRequestListeners(request) { if (Array.isArray(request._events.validate)) { request._events.validate.unshift(this.validateAccountId); } else { request.on('validate', this.validateAccountId); } request.removeListener('afterBuild', AWS.EventListeners.Core.COMPUTE_SHA256); request.on('build', this.addGlacierApiVersion); request.on('build', this.addTreeHashHeaders); }, /** * @api private */ validateAccountId: function validateAccountId(request) { if (request.params.accountId !== undefined) return; request.params = AWS.util.copy(request.params); request.params.accountId = '-'; }, /** * @api private */ addGlacierApiVersion: function addGlacierApiVersion(request) { var version = request.service.api.apiVersion; request.httpRequest.headers['x-amz-glacier-version'] = version; }, /** * @api private */ addTreeHashHeaders: function addTreeHashHeaders(request) { if (request.params.body === undefined) return; var hashes = request.service.computeChecksums(request.params.body); request.httpRequest.headers['X-Amz-Content-Sha256'] = hashes.linearHash; if (!request.httpRequest.headers['x-amz-sha256-tree-hash']) { request.httpRequest.headers['x-amz-sha256-tree-hash'] = hashes.treeHash; } }, /** * @!group Computing Checksums */ /** * Computes the SHA-256 linear and tree hash checksums for a given * block of Buffer data. Pass the tree hash of the computed checksums * as the checksum input to the {completeMultipartUpload} when performing * a multi-part upload. * * @example Calculate checksum of 5.5MB data chunk * var glacier = new AWS.Glacier(); * var data = Buffer.alloc(5.5 * 1024 * 1024); * data.fill('0'); // fill with zeros * var results = glacier.computeChecksums(data); * // Result: { linearHash: '68aff0c5a9...', treeHash: '154e26c78f...' } * @param data [Buffer, String] data to calculate the checksum for * @return [map] a map containing * the linearHash and treeHash properties representing hex based digests * of the respective checksums. * @see completeMultipartUpload */ computeChecksums: function computeChecksums(data) { if (!AWS.util.Buffer.isBuffer(data)) data = AWS.util.buffer.toBuffer(data); var mb = 1024 * 1024; var hashes = []; var hash = AWS.util.crypto.createHash('sha256'); // build leaf nodes in 1mb chunks for (var i = 0; i < data.length; i += mb) { var chunk = data.slice(i, Math.min(i + mb, data.length)); hash.update(chunk); hashes.push(AWS.util.crypto.sha256(chunk)); } return { linearHash: hash.digest('hex'), treeHash: this.buildHashTree(hashes) }; }, /** * @api private */ buildHashTree: function buildHashTree(hashes) { // merge leaf nodes while (hashes.length > 1) { var tmpHashes = []; for (var i = 0; i < hashes.length; i += 2) { if (hashes[i + 1]) { var tmpHash = AWS.util.buffer.alloc(64); tmpHash.write(hashes[i], 0, 32, 'binary'); tmpHash.write(hashes[i + 1], 32, 32, 'binary'); tmpHashes.push(AWS.util.crypto.sha256(tmpHash)); } else { tmpHashes.push(hashes[i]); } } hashes = tmpHashes; } return AWS.util.crypto.toHex(hashes[0]); } }); /***/ }), /***/ 27062: /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => { var AWS = __webpack_require__(28437); /** * @api private */ var blobPayloadOutputOps = [ 'deleteThingShadow', 'getThingShadow', 'updateThingShadow' ]; /** * Constructs a service interface object. Each API operation is exposed as a * function on service. * * ### Sending a Request Using IotData * * ```javascript * var iotdata = new AWS.IotData({endpoint: 'my.host.tld'}); * iotdata.getThingShadow(params, function (err, data) { * if (err) console.log(err, err.stack); // an error occurred * else console.log(data); // successful response * }); * ``` * * ### Locking the API Version * * In order to ensure that the IotData object uses this specific API, * you can construct the object by passing the `apiVersion` option to the * constructor: * * ```javascript * var iotdata = new AWS.IotData({ * endpoint: 'my.host.tld', * apiVersion: '2015-05-28' * }); * ``` * * You can also set the API version globally in `AWS.config.apiVersions` using * the **iotdata** service identifier: * * ```javascript * AWS.config.apiVersions = { * iotdata: '2015-05-28', * // other service API versions * }; * * var iotdata = new AWS.IotData({endpoint: 'my.host.tld'}); * ``` * * @note You *must* provide an `endpoint` configuration parameter when * constructing this service. See {constructor} for more information. * * @!method constructor(options = {}) * Constructs a service object. This object has one method for each * API operation. * * @example Constructing a IotData object * var iotdata = new AWS.IotData({endpoint: 'my.host.tld'}); * @note You *must* provide an `endpoint` when constructing this service. * @option (see AWS.Config.constructor) * * @service iotdata * @version 2015-05-28 */ AWS.util.update(AWS.IotData.prototype, { /** * @api private */ validateService: function validateService() { if (!this.config.endpoint || this.config.endpoint.indexOf('{') >= 0) { var msg = 'AWS.IotData requires an explicit ' + '`endpoint\' configuration option.'; throw AWS.util.error(new Error(), {name: 'InvalidEndpoint', message: msg}); } }, /** * @api private */ setupRequestListeners: function setupRequestListeners(request) { request.addListener('validateResponse', this.validateResponseBody); if (blobPayloadOutputOps.indexOf(request.operation) > -1) { request.addListener('extractData', AWS.util.convertPayloadToString); } }, /** * @api private */ validateResponseBody: function validateResponseBody(resp) { var body = resp.httpResponse.body.toString() || '{}'; var bodyCheck = body.trim(); if (!bodyCheck || bodyCheck.charAt(0) !== '{') { resp.httpResponse.body = ''; } } }); /***/ }), /***/ 8452: /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => { var AWS = __webpack_require__(28437); AWS.util.update(AWS.Lambda.prototype, { /** * @api private */ setupRequestListeners: function setupRequestListeners(request) { if (request.operation === 'invoke') { request.addListener('extractData', AWS.util.convertPayloadToString); } } }); /***/ }), /***/ 22922: /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => { var AWS = __webpack_require__(28437); AWS.util.update(AWS.LexModelsV2.prototype, { /** * @api private */ setupRequestListeners: function setupRequestListeners(request) { request.addListener('build', this.modifyContentType); }, /** * Normally rest-json services require `Content-Type` header to be 'application/json', * However Lex Model V2 services requires the header to be 'application/x-amz-json-1.1'. * * @api private */ modifyContentType: function modifyContentType(request) { if (request.httpRequest.headers['Content-Type'] === 'application/json') { request.httpRequest.headers['Content-Type'] = 'application/x-amz-json-1.1'; } } }); /***/ }), /***/ 64605: /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => { var AWS = __webpack_require__(28437); AWS.util.update(AWS.LookoutMetrics.prototype, { /** * @api private */ setupRequestListeners: function setupRequestListeners(request) { request.addListener('build', this.modifyContentType); }, /** * Normally rest-json services require `Content-Type` header to be 'application/json', * However lookout metrics services requires the header to be 'application/x-amz-json-1.1'. * * @api private */ modifyContentType: function modifyContentType(request) { if (request.httpRequest.headers['Content-Type'] === 'application/json') { request.httpRequest.headers['Content-Type'] = 'application/x-amz-json-1.1'; } } }); /***/ }), /***/ 19174: /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => { var AWS = __webpack_require__(28437); AWS.util.update(AWS.MachineLearning.prototype, { /** * @api private */ setupRequestListeners: function setupRequestListeners(request) { if (request.operation === 'predict') { request.addListener('build', this.buildEndpoint); } }, /** * Updates request endpoint from PredictEndpoint * @api private */ buildEndpoint: function buildEndpoint(request) { var url = request.params.PredictEndpoint; if (url) { request.httpRequest.endpoint = new AWS.Endpoint(url); } } }); /***/ }), /***/ 73090: /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => { var AWS = __webpack_require__(28437); var rdsutil = __webpack_require__(30650); /** * @api private */ var crossRegionOperations = ['createDBCluster', 'copyDBClusterSnapshot']; AWS.util.update(AWS.Neptune.prototype, { /** * @api private */ setupRequestListeners: function setupRequestListeners(request) { if ( crossRegionOperations.indexOf(request.operation) !== -1 && this.config.params && this.config.params.SourceRegion && request.params && !request.params.SourceRegion ) { request.params.SourceRegion = this.config.params.SourceRegion; } rdsutil.setupRequestListeners(this, request, crossRegionOperations); }, }); /***/ }), /***/ 53199: /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => { __webpack_require__(44086); /***/ }), /***/ 71928: /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => { var AWS = __webpack_require__(28437); var rdsutil = __webpack_require__(30650); __webpack_require__(16612); /** * @api private */ var crossRegionOperations = ['copyDBSnapshot', 'createDBInstanceReadReplica', 'createDBCluster', 'copyDBClusterSnapshot', 'startDBInstanceAutomatedBackupsReplication']; AWS.util.update(AWS.RDS.prototype, { /** * @api private */ setupRequestListeners: function setupRequestListeners(request) { rdsutil.setupRequestListeners(this, request, crossRegionOperations); }, }); /***/ }), /***/ 64070: /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => { var AWS = __webpack_require__(28437); AWS.util.update(AWS.RDSDataService.prototype, { /** * @return [Boolean] whether the error can be retried * @api private */ retryableError: function retryableError(error) { if (error.code === 'BadRequestException' && error.message && error.message.match(/^Communications link failure/) && error.statusCode === 400) { return true; } else { var _super = AWS.Service.prototype.retryableError; return _super.call(this, error); } } }); /***/ }), /***/ 30650: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { var AWS = __webpack_require__(28437); var rdsutil = { /** * @api private */ setupRequestListeners: function setupRequestListeners(service, request, crossRegionOperations) { if (crossRegionOperations.indexOf(request.operation) !== -1 && request.params.SourceRegion) { request.params = AWS.util.copy(request.params); if (request.params.PreSignedUrl || request.params.SourceRegion === service.config.region) { delete request.params.SourceRegion; } else { var doesParamValidation = !!service.config.paramValidation; // remove the validate parameters listener so we can re-add it after we build the URL if (doesParamValidation) { request.removeListener('validate', AWS.EventListeners.Core.VALIDATE_PARAMETERS); } request.onAsync('validate', rdsutil.buildCrossRegionPresignedUrl); if (doesParamValidation) { request.addListener('validate', AWS.EventListeners.Core.VALIDATE_PARAMETERS); } } } }, /** * @api private */ buildCrossRegionPresignedUrl: function buildCrossRegionPresignedUrl(req, done) { var config = AWS.util.copy(req.service.config); config.region = req.params.SourceRegion; delete req.params.SourceRegion; delete config.endpoint; // relevant params for the operation will already be in req.params delete config.params; config.signatureVersion = 'v4'; var destinationRegion = req.service.config.region; var svc = new req.service.constructor(config); var newReq = svc[req.operation](AWS.util.copy(req.params)); newReq.on('build', function addDestinationRegionParam(request) { var httpRequest = request.httpRequest; httpRequest.params.DestinationRegion = destinationRegion; httpRequest.body = AWS.util.queryParamsToString(httpRequest.params); }); newReq.presign(function(err, url) { if (err) done(err); else { req.params.PreSignedUrl = url; done(); } }); } }; /** * @api private */ module.exports = rdsutil; /***/ }), /***/ 69627: /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => { var AWS = __webpack_require__(28437); AWS.util.update(AWS.Route53.prototype, { /** * @api private */ setupRequestListeners: function setupRequestListeners(request) { request.on('build', this.sanitizeUrl); }, /** * @api private */ sanitizeUrl: function sanitizeUrl(request) { var path = request.httpRequest.path; request.httpRequest.path = path.replace(/\/%2F\w+%2F/, '/'); }, /** * @return [Boolean] whether the error can be retried * @api private */ retryableError: function retryableError(error) { if (error.code === 'PriorRequestNotComplete' && error.statusCode === 400) { return true; } else { var _super = AWS.Service.prototype.retryableError; return _super.call(this, error); } } }); /***/ }), /***/ 26543: /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => { var AWS = __webpack_require__(28437); var v4Credentials = __webpack_require__(62660); var resolveRegionalEndpointsFlag = __webpack_require__(85566); var s3util = __webpack_require__(35895); var regionUtil = __webpack_require__(18262); // Pull in managed upload extension __webpack_require__(81600); /** * @api private */ var operationsWith200StatusCodeError = { 'completeMultipartUpload': true, 'copyObject': true, 'uploadPartCopy': true }; /** * @api private */ var regionRedirectErrorCodes = [ 'AuthorizationHeaderMalformed', // non-head operations on virtual-hosted global bucket endpoints 'BadRequest', // head operations on virtual-hosted global bucket endpoints 'PermanentRedirect', // non-head operations on path-style or regional endpoints 301 // head operations on path-style or regional endpoints ]; var OBJECT_LAMBDA_SERVICE = 's3-object-lambda'; AWS.util.update(AWS.S3.prototype, { /** * @api private */ getSignatureVersion: function getSignatureVersion(request) { var defaultApiVersion = this.api.signatureVersion; var userDefinedVersion = this._originalConfig ? this._originalConfig.signatureVersion : null; var regionDefinedVersion = this.config.signatureVersion; var isPresigned = request ? request.isPresigned() : false; /* 1) User defined version specified: a) always return user defined version 2) No user defined version specified: a) If not using presigned urls, default to V4 b) If using presigned urls, default to lowest version the region supports */ if (userDefinedVersion) { userDefinedVersion = userDefinedVersion === 'v2' ? 's3' : userDefinedVersion; return userDefinedVersion; } if (isPresigned !== true) { defaultApiVersion = 'v4'; } else if (regionDefinedVersion) { defaultApiVersion = regionDefinedVersion; } return defaultApiVersion; }, /** * @api private */ getSigningName: function getSigningName(req) { if (req && req.operation === 'writeGetObjectResponse') { return OBJECT_LAMBDA_SERVICE; } var _super = AWS.Service.prototype.getSigningName; return (req && req._parsedArn && req._parsedArn.service) ? req._parsedArn.service : _super.call(this); }, /** * @api private */ getSignerClass: function getSignerClass(request) { var signatureVersion = this.getSignatureVersion(request); return AWS.Signers.RequestSigner.getVersion(signatureVersion); }, /** * @api private */ validateService: function validateService() { var msg; var messages = []; // default to us-east-1 when no region is provided if (!this.config.region) this.config.region = 'us-east-1'; if (!this.config.endpoint && this.config.s3BucketEndpoint) { messages.push('An endpoint must be provided when configuring ' + '`s3BucketEndpoint` to true.'); } if (messages.length === 1) { msg = messages[0]; } else if (messages.length > 1) { msg = 'Multiple configuration errors:\n' + messages.join('\n'); } if (msg) { throw AWS.util.error(new Error(), {name: 'InvalidEndpoint', message: msg}); } }, /** * @api private */ shouldDisableBodySigning: function shouldDisableBodySigning(request) { var signerClass = this.getSignerClass(); if (this.config.s3DisableBodySigning === true && signerClass === AWS.Signers.V4 && request.httpRequest.endpoint.protocol === 'https:') { return true; } return false; }, /** * @api private */ setupRequestListeners: function setupRequestListeners(request) { var prependListener = true; request.addListener('validate', this.validateScheme); request.addListener('validate', this.validateBucketName, prependListener); request.addListener('validate', this.optInUsEast1RegionalEndpoint, prependListener); request.removeListener('validate', AWS.EventListeners.Core.VALIDATE_REGION); request.addListener('build', this.addContentType); request.addListener('build', this.computeContentMd5); request.addListener('build', this.computeSseCustomerKeyMd5); request.addListener('build', this.populateURI); request.addListener('afterBuild', this.addExpect100Continue); request.addListener('extractError', this.extractError); request.addListener('extractData', AWS.util.hoistPayloadMember); request.addListener('extractData', this.extractData); request.addListener('extractData', this.extractErrorFrom200Response); request.addListener('beforePresign', this.prepareSignedUrl); if (this.shouldDisableBodySigning(request)) { request.removeListener('afterBuild', AWS.EventListeners.Core.COMPUTE_SHA256); request.addListener('afterBuild', this.disableBodySigning); } //deal with ARNs supplied to Bucket if (request.operation !== 'createBucket' && s3util.isArnInParam(request, 'Bucket')) { // avoid duplicate parsing in the future request._parsedArn = AWS.util.ARN.parse(request.params.Bucket); request.removeListener('validate', this.validateBucketName); request.removeListener('build', this.populateURI); if (request._parsedArn.service === 's3') { request.addListener('validate', s3util.validateS3AccessPointArn); request.addListener('validate', this.validateArnResourceType); } else if (request._parsedArn.service === 's3-outposts') { request.addListener('validate', s3util.validateOutpostsAccessPointArn); request.addListener('validate', s3util.validateOutpostsArn); } request.addListener('validate', s3util.validateArnRegion); request.addListener('validate', s3util.validateArnAccount); request.addListener('validate', s3util.validateArnService); request.addListener('build', this.populateUriFromAccessPointArn); request.addListener('build', s3util.validatePopulateUriFromArn); return; } //listeners regarding region inference request.addListener('validate', this.validateBucketEndpoint); request.addListener('validate', this.correctBucketRegionFromCache); request.onAsync('extractError', this.requestBucketRegion); if (AWS.util.isBrowser()) { request.onAsync('retry', this.reqRegionForNetworkingError); } }, /** * @api private */ validateScheme: function(req) { var params = req.params, scheme = req.httpRequest.endpoint.protocol, sensitive = params.SSECustomerKey || params.CopySourceSSECustomerKey; if (sensitive && scheme !== 'https:') { var msg = 'Cannot send SSE keys over HTTP. Set \'sslEnabled\'' + 'to \'true\' in your configuration'; throw AWS.util.error(new Error(), { code: 'ConfigError', message: msg }); } }, /** * @api private */ validateBucketEndpoint: function(req) { if (!req.params.Bucket && req.service.config.s3BucketEndpoint) { var msg = 'Cannot send requests to root API with `s3BucketEndpoint` set.'; throw AWS.util.error(new Error(), { code: 'ConfigError', message: msg }); } }, /** * Validate resource-type supplied in S3 ARN */ validateArnResourceType: function validateArnResourceType(req) { var resource = req._parsedArn.resource; if ( resource.indexOf('accesspoint:') !== 0 && resource.indexOf('accesspoint/') !== 0 ) { throw AWS.util.error(new Error(), { code: 'InvalidARN', message: 'ARN resource should begin with \'accesspoint/\'' }); } }, /** * @api private */ validateBucketName: function validateBucketName(req) { var service = req.service; var signatureVersion = service.getSignatureVersion(req); var bucket = req.params && req.params.Bucket; var key = req.params && req.params.Key; var slashIndex = bucket && bucket.indexOf('/'); if (bucket && slashIndex >= 0) { if (typeof key === 'string' && slashIndex > 0) { req.params = AWS.util.copy(req.params); // Need to include trailing slash to match sigv2 behavior var prefix = bucket.substr(slashIndex + 1) || ''; req.params.Key = prefix + '/' + key; req.params.Bucket = bucket.substr(0, slashIndex); } else if (signatureVersion === 'v4') { var msg = 'Bucket names cannot contain forward slashes. Bucket: ' + bucket; throw AWS.util.error(new Error(), { code: 'InvalidBucket', message: msg }); } } }, /** * @api private */ isValidAccelerateOperation: function isValidAccelerateOperation(operation) { var invalidOperations = [ 'createBucket', 'deleteBucket', 'listBuckets' ]; return invalidOperations.indexOf(operation) === -1; }, /** * When us-east-1 region endpoint configuration is set, in stead of sending request to * global endpoint(e.g. 's3.amazonaws.com'), we will send request to * 's3.us-east-1.amazonaws.com'. * @api private */ optInUsEast1RegionalEndpoint: function optInUsEast1RegionalEndpoint(req) { var service = req.service; var config = service.config; config.s3UsEast1RegionalEndpoint = resolveRegionalEndpointsFlag(service._originalConfig, { env: 'AWS_S3_US_EAST_1_REGIONAL_ENDPOINT', sharedConfig: 's3_us_east_1_regional_endpoint', clientConfig: 's3UsEast1RegionalEndpoint' }); if ( !(service._originalConfig || {}).endpoint && req.httpRequest.region === 'us-east-1' && config.s3UsEast1RegionalEndpoint === 'regional' && req.httpRequest.endpoint.hostname.indexOf('s3.amazonaws.com') >= 0 ) { var insertPoint = config.endpoint.indexOf('.amazonaws.com'); regionalEndpoint = config.endpoint.substring(0, insertPoint) + '.us-east-1' + config.endpoint.substring(insertPoint); req.httpRequest.updateEndpoint(regionalEndpoint); } }, /** * S3 prefers dns-compatible bucket names to be moved from the uri path * to the hostname as a sub-domain. This is not possible, even for dns-compat * buckets when using SSL and the bucket name contains a dot ('.'). The * ssl wildcard certificate is only 1-level deep. * * @api private */ populateURI: function populateURI(req) { var httpRequest = req.httpRequest; var b = req.params.Bucket; var service = req.service; var endpoint = httpRequest.endpoint; if (b) { if (!service.pathStyleBucketName(b)) { if (service.config.useAccelerateEndpoint && service.isValidAccelerateOperation(req.operation)) { if (service.config.useDualstack) { endpoint.hostname = b + '.s3-accelerate.dualstack.amazonaws.com'; } else { endpoint.hostname = b + '.s3-accelerate.amazonaws.com'; } } else if (!service.config.s3BucketEndpoint) { endpoint.hostname = b + '.' + endpoint.hostname; } var port = endpoint.port; if (port !== 80 && port !== 443) { endpoint.host = endpoint.hostname + ':' + endpoint.port; } else { endpoint.host = endpoint.hostname; } httpRequest.virtualHostedBucket = b; // needed for signing the request service.removeVirtualHostedBucketFromPath(req); } } }, /** * Takes the bucket name out of the path if bucket is virtual-hosted * * @api private */ removeVirtualHostedBucketFromPath: function removeVirtualHostedBucketFromPath(req) { var httpRequest = req.httpRequest; var bucket = httpRequest.virtualHostedBucket; if (bucket && httpRequest.path) { if (req.params && req.params.Key) { var encodedS3Key = '/' + AWS.util.uriEscapePath(req.params.Key); if (httpRequest.path.indexOf(encodedS3Key) === 0 && (httpRequest.path.length === encodedS3Key.length || httpRequest.path[encodedS3Key.length] === '?')) { //path only contains key or path contains only key and querystring return; } } httpRequest.path = httpRequest.path.replace(new RegExp('/' + bucket), ''); if (httpRequest.path[0] !== '/') { httpRequest.path = '/' + httpRequest.path; } } }, /** * When user supply an access point ARN in the Bucket parameter, we need to * populate the URI according to the ARN. */ populateUriFromAccessPointArn: function populateUriFromAccessPointArn(req) { var accessPointArn = req._parsedArn; var isOutpostArn = accessPointArn.service === 's3-outposts'; var isObjectLambdaArn = accessPointArn.service === 's3-object-lambda'; var outpostsSuffix = isOutpostArn ? '.' + accessPointArn.outpostId: ''; var serviceName = isOutpostArn ? 's3-outposts': 's3-accesspoint'; var dualStackSuffix = !isOutpostArn && req.service.config.useDualstack ? '.dualstack' : ''; var endpoint = req.httpRequest.endpoint; var dnsSuffix = regionUtil.getEndpointSuffix(accessPointArn.region); var useArnRegion = req.service.config.s3UseArnRegion; endpoint.hostname = [ accessPointArn.accessPoint + '-' + accessPointArn.accountId + outpostsSuffix, serviceName + dualStackSuffix, useArnRegion ? accessPointArn.region : req.service.config.region, dnsSuffix ].join('.'); if (isObjectLambdaArn) { // should be in the format: "accesspoint/${accesspointName}" var serviceName = 's3-object-lambda'; var accesspointName = accessPointArn.resource.split('/')[1]; endpoint.hostname = [ accesspointName + '-' + accessPointArn.accountId, serviceName, useArnRegion ? accessPointArn.region : req.service.config.region, dnsSuffix ].join('.'); } endpoint.host = endpoint.hostname; var encodedArn = AWS.util.uriEscape(req.params.Bucket); var path = req.httpRequest.path; //remove the Bucket value from path req.httpRequest.path = path.replace(new RegExp('/' + encodedArn), ''); if (req.httpRequest.path[0] !== '/') { req.httpRequest.path = '/' + req.httpRequest.path; } req.httpRequest.region = accessPointArn.region; //region used to sign }, /** * Adds Expect: 100-continue header if payload is greater-or-equal 1MB * @api private */ addExpect100Continue: function addExpect100Continue(req) { var len = req.httpRequest.headers['Content-Length']; if (AWS.util.isNode() && (len >= 1024 * 1024 || req.params.Body instanceof AWS.util.stream.Stream)) { req.httpRequest.headers['Expect'] = '100-continue'; } }, /** * Adds a default content type if none is supplied. * * @api private */ addContentType: function addContentType(req) { var httpRequest = req.httpRequest; if (httpRequest.method === 'GET' || httpRequest.method === 'HEAD') { // Content-Type is not set in GET/HEAD requests delete httpRequest.headers['Content-Type']; return; } if (!httpRequest.headers['Content-Type']) { // always have a Content-Type httpRequest.headers['Content-Type'] = 'application/octet-stream'; } var contentType = httpRequest.headers['Content-Type']; if (AWS.util.isBrowser()) { if (typeof httpRequest.body === 'string' && !contentType.match(/;\s*charset=/)) { var charset = '; charset=UTF-8'; httpRequest.headers['Content-Type'] += charset; } else { var replaceFn = function(_, prefix, charsetName) { return prefix + charsetName.toUpperCase(); }; httpRequest.headers['Content-Type'] = contentType.replace(/(;\s*charset=)(.+)$/, replaceFn); } } }, /** * @api private */ computableChecksumOperations: { putBucketCors: true, putBucketLifecycle: true, putBucketLifecycleConfiguration: true, putBucketTagging: true, deleteObjects: true, putBucketReplication: true, putObjectLegalHold: true, putObjectRetention: true, putObjectLockConfiguration: true }, /** * Checks whether checksums should be computed for the request. * If the request requires checksums to be computed, this will always * return true, otherwise it depends on whether {AWS.Config.computeChecksums} * is set. * * @param req [AWS.Request] the request to check against * @return [Boolean] whether to compute checksums for a request. * @api private */ willComputeChecksums: function willComputeChecksums(req) { if (this.computableChecksumOperations[req.operation]) return true; if (!this.config.computeChecksums) return false; // TODO: compute checksums for Stream objects if (!AWS.util.Buffer.isBuffer(req.httpRequest.body) && typeof req.httpRequest.body !== 'string') { return false; } var rules = req.service.api.operations[req.operation].input.members; // Sha256 signing disabled, and not a presigned url if (req.service.shouldDisableBodySigning(req) && !Object.prototype.hasOwnProperty.call(req.httpRequest.headers, 'presigned-expires')) { if (rules.ContentMD5 && !req.params.ContentMD5) { return true; } } // V4 signer uses SHA256 signatures so only compute MD5 if it is required if (req.service.getSignerClass(req) === AWS.Signers.V4) { if (rules.ContentMD5 && !rules.ContentMD5.required) return false; } if (rules.ContentMD5 && !req.params.ContentMD5) return true; }, /** * A listener that computes the Content-MD5 and sets it in the header. * @see AWS.S3.willComputeChecksums * @api private */ computeContentMd5: function computeContentMd5(req) { if (req.service.willComputeChecksums(req)) { var md5 = AWS.util.crypto.md5(req.httpRequest.body, 'base64'); req.httpRequest.headers['Content-MD5'] = md5; } }, /** * @api private */ computeSseCustomerKeyMd5: function computeSseCustomerKeyMd5(req) { var keys = { SSECustomerKey: 'x-amz-server-side-encryption-customer-key-MD5', CopySourceSSECustomerKey: 'x-amz-copy-source-server-side-encryption-customer-key-MD5' }; AWS.util.each(keys, function(key, header) { if (req.params[key]) { var value = AWS.util.crypto.md5(req.params[key], 'base64'); req.httpRequest.headers[header] = value; } }); }, /** * Returns true if the bucket name should be left in the URI path for * a request to S3. This function takes into account the current * endpoint protocol (e.g. http or https). * * @api private */ pathStyleBucketName: function pathStyleBucketName(bucketName) { // user can force path style requests via the configuration if (this.config.s3ForcePathStyle) return true; if (this.config.s3BucketEndpoint) return false; if (s3util.dnsCompatibleBucketName(bucketName)) { return (this.config.sslEnabled && bucketName.match(/\./)) ? true : false; } else { return true; // not dns compatible names must always use path style } }, /** * For COPY operations, some can be error even with status code 200. * SDK treats the response as exception when response body indicates * an exception or body is empty. * * @api private */ extractErrorFrom200Response: function extractErrorFrom200Response(resp) { if (!operationsWith200StatusCodeError[resp.request.operation]) return; var httpResponse = resp.httpResponse; if (httpResponse.body && httpResponse.body.toString().match('')) { // Response body with '...' indicates an exception. // Get S3 client object. In ManagedUpload, this.service refers to // S3 client object. resp.data = null; var service = this.service ? this.service : this; service.extractError(resp); throw resp.error; } else if (!httpResponse.body || !httpResponse.body.toString().match(/<[\w_]/)) { // When body is empty or incomplete, S3 might stop the request on detecting client // side aborting the request. resp.data = null; throw AWS.util.error(new Error(), { code: 'InternalError', message: 'S3 aborted request' }); } }, /** * @return [Boolean] whether the error can be retried * @api private */ retryableError: function retryableError(error, request) { if (operationsWith200StatusCodeError[request.operation] && error.statusCode === 200) { return true; } else if (request._requestRegionForBucket && request.service.bucketRegionCache[request._requestRegionForBucket]) { return false; } else if (error && error.code === 'RequestTimeout') { return true; } else if (error && regionRedirectErrorCodes.indexOf(error.code) != -1 && error.region && error.region != request.httpRequest.region) { request.httpRequest.region = error.region; if (error.statusCode === 301) { request.service.updateReqBucketRegion(request); } return true; } else { var _super = AWS.Service.prototype.retryableError; return _super.call(this, error, request); } }, /** * Updates httpRequest with region. If region is not provided, then * the httpRequest will be updated based on httpRequest.region * * @api private */ updateReqBucketRegion: function updateReqBucketRegion(request, region) { var httpRequest = request.httpRequest; if (typeof region === 'string' && region.length) { httpRequest.region = region; } if (!httpRequest.endpoint.host.match(/s3(?!-accelerate).*\.amazonaws\.com$/)) { return; } var service = request.service; var s3Config = service.config; var s3BucketEndpoint = s3Config.s3BucketEndpoint; if (s3BucketEndpoint) { delete s3Config.s3BucketEndpoint; } var newConfig = AWS.util.copy(s3Config); delete newConfig.endpoint; newConfig.region = httpRequest.region; httpRequest.endpoint = (new AWS.S3(newConfig)).endpoint; service.populateURI(request); s3Config.s3BucketEndpoint = s3BucketEndpoint; httpRequest.headers.Host = httpRequest.endpoint.host; if (request._asm.currentState === 'validate') { request.removeListener('build', service.populateURI); request.addListener('build', service.removeVirtualHostedBucketFromPath); } }, /** * Provides a specialized parser for getBucketLocation -- all other * operations are parsed by the super class. * * @api private */ extractData: function extractData(resp) { var req = resp.request; if (req.operation === 'getBucketLocation') { var match = resp.httpResponse.body.toString().match(/>(.+)<\/Location/); delete resp.data['_']; if (match) { resp.data.LocationConstraint = match[1]; } else { resp.data.LocationConstraint = ''; } } var bucket = req.params.Bucket || null; if (req.operation === 'deleteBucket' && typeof bucket === 'string' && !resp.error) { req.service.clearBucketRegionCache(bucket); } else { var headers = resp.httpResponse.headers || {}; var region = headers['x-amz-bucket-region'] || null; if (!region && req.operation === 'createBucket' && !resp.error) { var createBucketConfiguration = req.params.CreateBucketConfiguration; if (!createBucketConfiguration) { region = 'us-east-1'; } else if (createBucketConfiguration.LocationConstraint === 'EU') { region = 'eu-west-1'; } else { region = createBucketConfiguration.LocationConstraint; } } if (region) { if (bucket && region !== req.service.bucketRegionCache[bucket]) { req.service.bucketRegionCache[bucket] = region; } } } req.service.extractRequestIds(resp); }, /** * Extracts an error object from the http response. * * @api private */ extractError: function extractError(resp) { var codes = { 304: 'NotModified', 403: 'Forbidden', 400: 'BadRequest', 404: 'NotFound' }; var req = resp.request; var code = resp.httpResponse.statusCode; var body = resp.httpResponse.body || ''; var headers = resp.httpResponse.headers || {}; var region = headers['x-amz-bucket-region'] || null; var bucket = req.params.Bucket || null; var bucketRegionCache = req.service.bucketRegionCache; if (region && bucket && region !== bucketRegionCache[bucket]) { bucketRegionCache[bucket] = region; } var cachedRegion; if (codes[code] && body.length === 0) { if (bucket && !region) { cachedRegion = bucketRegionCache[bucket] || null; if (cachedRegion !== req.httpRequest.region) { region = cachedRegion; } } resp.error = AWS.util.error(new Error(), { code: codes[code], message: null, region: region }); } else { var data = new AWS.XML.Parser().parse(body.toString()); if (data.Region && !region) { region = data.Region; if (bucket && region !== bucketRegionCache[bucket]) { bucketRegionCache[bucket] = region; } } else if (bucket && !region && !data.Region) { cachedRegion = bucketRegionCache[bucket] || null; if (cachedRegion !== req.httpRequest.region) { region = cachedRegion; } } resp.error = AWS.util.error(new Error(), { code: data.Code || code, message: data.Message || null, region: region }); } req.service.extractRequestIds(resp); }, /** * If region was not obtained synchronously, then send async request * to get bucket region for errors resulting from wrong region. * * @api private */ requestBucketRegion: function requestBucketRegion(resp, done) { var error = resp.error; var req = resp.request; var bucket = req.params.Bucket || null; if (!error || !bucket || error.region || req.operation === 'listObjects' || (AWS.util.isNode() && req.operation === 'headBucket') || (error.statusCode === 400 && req.operation !== 'headObject') || regionRedirectErrorCodes.indexOf(error.code) === -1) { return done(); } var reqOperation = AWS.util.isNode() ? 'headBucket' : 'listObjects'; var reqParams = {Bucket: bucket}; if (reqOperation === 'listObjects') reqParams.MaxKeys = 0; var regionReq = req.service[reqOperation](reqParams); regionReq._requestRegionForBucket = bucket; regionReq.send(function() { var region = req.service.bucketRegionCache[bucket] || null; error.region = region; done(); }); }, /** * For browser only. If NetworkingError received, will attempt to obtain * the bucket region. * * @api private */ reqRegionForNetworkingError: function reqRegionForNetworkingError(resp, done) { if (!AWS.util.isBrowser()) { return done(); } var error = resp.error; var request = resp.request; var bucket = request.params.Bucket; if (!error || error.code !== 'NetworkingError' || !bucket || request.httpRequest.region === 'us-east-1') { return done(); } var service = request.service; var bucketRegionCache = service.bucketRegionCache; var cachedRegion = bucketRegionCache[bucket] || null; if (cachedRegion && cachedRegion !== request.httpRequest.region) { service.updateReqBucketRegion(request, cachedRegion); done(); } else if (!s3util.dnsCompatibleBucketName(bucket)) { service.updateReqBucketRegion(request, 'us-east-1'); if (bucketRegionCache[bucket] !== 'us-east-1') { bucketRegionCache[bucket] = 'us-east-1'; } done(); } else if (request.httpRequest.virtualHostedBucket) { var getRegionReq = service.listObjects({Bucket: bucket, MaxKeys: 0}); service.updateReqBucketRegion(getRegionReq, 'us-east-1'); getRegionReq._requestRegionForBucket = bucket; getRegionReq.send(function() { var region = service.bucketRegionCache[bucket] || null; if (region && region !== request.httpRequest.region) { service.updateReqBucketRegion(request, region); } done(); }); } else { // DNS-compatible path-style // (s3ForcePathStyle or bucket name with dot over https) // Cannot obtain region information for this case done(); } }, /** * Cache for bucket region. * * @api private */ bucketRegionCache: {}, /** * Clears bucket region cache. * * @api private */ clearBucketRegionCache: function(buckets) { var bucketRegionCache = this.bucketRegionCache; if (!buckets) { buckets = Object.keys(bucketRegionCache); } else if (typeof buckets === 'string') { buckets = [buckets]; } for (var i = 0; i < buckets.length; i++) { delete bucketRegionCache[buckets[i]]; } return bucketRegionCache; }, /** * Corrects request region if bucket's cached region is different * * @api private */ correctBucketRegionFromCache: function correctBucketRegionFromCache(req) { var bucket = req.params.Bucket || null; if (bucket) { var service = req.service; var requestRegion = req.httpRequest.region; var cachedRegion = service.bucketRegionCache[bucket]; if (cachedRegion && cachedRegion !== requestRegion) { service.updateReqBucketRegion(req, cachedRegion); } } }, /** * Extracts S3 specific request ids from the http response. * * @api private */ extractRequestIds: function extractRequestIds(resp) { var extendedRequestId = resp.httpResponse.headers ? resp.httpResponse.headers['x-amz-id-2'] : null; var cfId = resp.httpResponse.headers ? resp.httpResponse.headers['x-amz-cf-id'] : null; resp.extendedRequestId = extendedRequestId; resp.cfId = cfId; if (resp.error) { resp.error.requestId = resp.requestId || null; resp.error.extendedRequestId = extendedRequestId; resp.error.cfId = cfId; } }, /** * Get a pre-signed URL for a given operation name. * * @note You must ensure that you have static or previously resolved * credentials if you call this method synchronously (with no callback), * otherwise it may not properly sign the request. If you cannot guarantee * this (you are using an asynchronous credential provider, i.e., EC2 * IAM roles), you should always call this method with an asynchronous * callback. * @note Not all operation parameters are supported when using pre-signed * URLs. Certain parameters, such as `SSECustomerKey`, `ACL`, `Expires`, * `ContentLength`, or `Tagging` must be provided as headers when sending a * request. If you are using pre-signed URLs to upload from a browser and * need to use these fields, see {createPresignedPost}. * @note The default signer allows altering the request by adding corresponding * headers to set some parameters (e.g. Range) and these added parameters * won't be signed. You must use signatureVersion v4 to to include these * parameters in the signed portion of the URL and enforce exact matching * between headers and signed params in the URL. * @note This operation cannot be used with a promise. See note above regarding * asynchronous credentials and use with a callback. * @param operation [String] the name of the operation to call * @param params [map] parameters to pass to the operation. See the given * operation for the expected operation parameters. In addition, you can * also pass the "Expires" parameter to inform S3 how long the URL should * work for. * @option params Expires [Integer] (900) the number of seconds to expire * the pre-signed URL operation in. Defaults to 15 minutes. * @param callback [Function] if a callback is provided, this function will * pass the URL as the second parameter (after the error parameter) to * the callback function. * @return [String] if called synchronously (with no callback), returns the * signed URL. * @return [null] nothing is returned if a callback is provided. * @example Pre-signing a getObject operation (synchronously) * var params = {Bucket: 'bucket', Key: 'key'}; * var url = s3.getSignedUrl('getObject', params); * console.log('The URL is', url); * @example Pre-signing a putObject (asynchronously) * var params = {Bucket: 'bucket', Key: 'key'}; * s3.getSignedUrl('putObject', params, function (err, url) { * console.log('The URL is', url); * }); * @example Pre-signing a putObject operation with a specific payload * var params = {Bucket: 'bucket', Key: 'key', Body: 'body'}; * var url = s3.getSignedUrl('putObject', params); * console.log('The URL is', url); * @example Passing in a 1-minute expiry time for a pre-signed URL * var params = {Bucket: 'bucket', Key: 'key', Expires: 60}; * var url = s3.getSignedUrl('getObject', params); * console.log('The URL is', url); // expires in 60 seconds */ getSignedUrl: function getSignedUrl(operation, params, callback) { params = AWS.util.copy(params || {}); var expires = params.Expires || 900; if (typeof expires !== 'number') { throw AWS.util.error(new Error(), { code: 'InvalidParameterException', message: 'The expiration must be a number, received ' + typeof expires }); } delete params.Expires; // we can't validate this var request = this.makeRequest(operation, params); if (callback) { AWS.util.defer(function() { request.presign(expires, callback); }); } else { return request.presign(expires, callback); } }, /** * @!method getSignedUrlPromise() * Returns a 'thenable' promise that will be resolved with a pre-signed URL * for a given operation name. * * Two callbacks can be provided to the `then` method on the returned promise. * The first callback will be called if the promise is fulfilled, and the second * callback will be called if the promise is rejected. * @note Not all operation parameters are supported when using pre-signed * URLs. Certain parameters, such as `SSECustomerKey`, `ACL`, `Expires`, * `ContentLength`, or `Tagging` must be provided as headers when sending a * request. If you are using pre-signed URLs to upload from a browser and * need to use these fields, see {createPresignedPost}. * @param operation [String] the name of the operation to call * @param params [map] parameters to pass to the operation. See the given * operation for the expected operation parameters. In addition, you can * also pass the "Expires" parameter to inform S3 how long the URL should * work for. * @option params Expires [Integer] (900) the number of seconds to expire * the pre-signed URL operation in. Defaults to 15 minutes. * @callback fulfilledCallback function(url) * Called if the promise is fulfilled. * @param url [String] the signed url * @callback rejectedCallback function(err) * Called if the promise is rejected. * @param err [Error] if an error occurred, this value will be filled * @return [Promise] A promise that represents the state of the `refresh` call. * @example Pre-signing a getObject operation * var params = {Bucket: 'bucket', Key: 'key'}; * var promise = s3.getSignedUrlPromise('getObject', params); * promise.then(function(url) { * console.log('The URL is', url); * }, function(err) { ... }); * @example Pre-signing a putObject operation with a specific payload * var params = {Bucket: 'bucket', Key: 'key', Body: 'body'}; * var promise = s3.getSignedUrlPromise('putObject', params); * promise.then(function(url) { * console.log('The URL is', url); * }, function(err) { ... }); * @example Passing in a 1-minute expiry time for a pre-signed URL * var params = {Bucket: 'bucket', Key: 'key', Expires: 60}; * var promise = s3.getSignedUrlPromise('getObject', params); * promise.then(function(url) { * console.log('The URL is', url); * }, function(err) { ... }); */ /** * Get a pre-signed POST policy to support uploading to S3 directly from an * HTML form. * * @param params [map] * @option params Bucket [String] The bucket to which the post should be * uploaded * @option params Expires [Integer] (3600) The number of seconds for which * the presigned policy should be valid. * @option params Conditions [Array] An array of conditions that must be met * for the presigned policy to allow the * upload. This can include required tags, * the accepted range for content lengths, * etc. * @see http://docs.aws.amazon.com/AmazonS3/latest/API/sigv4-HTTPPOSTConstructPolicy.html * @option params Fields [map] Fields to include in the form. All * values passed in as fields will be * signed as exact match conditions. * @param callback [Function] * * @note All fields passed in when creating presigned post data will be signed * as exact match conditions. Any fields that will be interpolated by S3 * must be added to the fields hash after signing, and an appropriate * condition for such fields must be explicitly added to the Conditions * array passed to this function before signing. * * @example Presiging post data with a known key * var params = { * Bucket: 'bucket', * Fields: { * key: 'key' * } * }; * s3.createPresignedPost(params, function(err, data) { * if (err) { * console.error('Presigning post data encountered an error', err); * } else { * console.log('The post data is', data); * } * }); * * @example Presigning post data with an interpolated key * var params = { * Bucket: 'bucket', * Conditions: [ * ['starts-with', '$key', 'path/to/uploads/'] * ] * }; * s3.createPresignedPost(params, function(err, data) { * if (err) { * console.error('Presigning post data encountered an error', err); * } else { * data.Fields.key = 'path/to/uploads/${filename}'; * console.log('The post data is', data); * } * }); * * @note You must ensure that you have static or previously resolved * credentials if you call this method synchronously (with no callback), * otherwise it may not properly sign the request. If you cannot guarantee * this (you are using an asynchronous credential provider, i.e., EC2 * IAM roles), you should always call this method with an asynchronous * callback. * * @return [map] If called synchronously (with no callback), returns a hash * with the url to set as the form action and a hash of fields * to include in the form. * @return [null] Nothing is returned if a callback is provided. * * @callback callback function (err, data) * @param err [Error] the error object returned from the policy signer * @param data [map] The data necessary to construct an HTML form * @param data.url [String] The URL to use as the action of the form * @param data.fields [map] A hash of fields that must be included in the * form for the upload to succeed. This hash will * include the signed POST policy, your access key * ID and security token (if present), etc. These * may be safely included as input elements of type * 'hidden.' */ createPresignedPost: function createPresignedPost(params, callback) { if (typeof params === 'function' && callback === undefined) { callback = params; params = null; } params = AWS.util.copy(params || {}); var boundParams = this.config.params || {}; var bucket = params.Bucket || boundParams.Bucket, self = this, config = this.config, endpoint = AWS.util.copy(this.endpoint); if (!config.s3BucketEndpoint) { endpoint.pathname = '/' + bucket; } function finalizePost() { return { url: AWS.util.urlFormat(endpoint), fields: self.preparePostFields( config.credentials, config.region, bucket, params.Fields, params.Conditions, params.Expires ) }; } if (callback) { config.getCredentials(function (err) { if (err) { callback(err); } else { try { callback(null, finalizePost()); } catch (err) { callback(err); } } }); } else { return finalizePost(); } }, /** * @api private */ preparePostFields: function preparePostFields( credentials, region, bucket, fields, conditions, expiresInSeconds ) { var now = this.getSkewCorrectedDate(); if (!credentials || !region || !bucket) { throw new Error('Unable to create a POST object policy without a bucket,' + ' region, and credentials'); } fields = AWS.util.copy(fields || {}); conditions = (conditions || []).slice(0); expiresInSeconds = expiresInSeconds || 3600; var signingDate = AWS.util.date.iso8601(now).replace(/[:\-]|\.\d{3}/g, ''); var shortDate = signingDate.substr(0, 8); var scope = v4Credentials.createScope(shortDate, region, 's3'); var credential = credentials.accessKeyId + '/' + scope; fields['bucket'] = bucket; fields['X-Amz-Algorithm'] = 'AWS4-HMAC-SHA256'; fields['X-Amz-Credential'] = credential; fields['X-Amz-Date'] = signingDate; if (credentials.sessionToken) { fields['X-Amz-Security-Token'] = credentials.sessionToken; } for (var field in fields) { if (fields.hasOwnProperty(field)) { var condition = {}; condition[field] = fields[field]; conditions.push(condition); } } fields.Policy = this.preparePostPolicy( new Date(now.valueOf() + expiresInSeconds * 1000), conditions ); fields['X-Amz-Signature'] = AWS.util.crypto.hmac( v4Credentials.getSigningKey(credentials, shortDate, region, 's3', true), fields.Policy, 'hex' ); return fields; }, /** * @api private */ preparePostPolicy: function preparePostPolicy(expiration, conditions) { return AWS.util.base64.encode(JSON.stringify({ expiration: AWS.util.date.iso8601(expiration), conditions: conditions })); }, /** * @api private */ prepareSignedUrl: function prepareSignedUrl(request) { request.addListener('validate', request.service.noPresignedContentLength); request.removeListener('build', request.service.addContentType); if (!request.params.Body) { // no Content-MD5/SHA-256 if body is not provided request.removeListener('build', request.service.computeContentMd5); } else { request.addListener('afterBuild', AWS.EventListeners.Core.COMPUTE_SHA256); } }, /** * @api private * @param request */ disableBodySigning: function disableBodySigning(request) { var headers = request.httpRequest.headers; // Add the header to anything that isn't a presigned url, unless that presigned url had a body defined if (!Object.prototype.hasOwnProperty.call(headers, 'presigned-expires')) { headers['X-Amz-Content-Sha256'] = 'UNSIGNED-PAYLOAD'; } }, /** * @api private */ noPresignedContentLength: function noPresignedContentLength(request) { if (request.params.ContentLength !== undefined) { throw AWS.util.error(new Error(), {code: 'UnexpectedParameter', message: 'ContentLength is not supported in pre-signed URLs.'}); } }, createBucket: function createBucket(params, callback) { // When creating a bucket *outside* the classic region, the location // constraint must be set for the bucket and it must match the endpoint. // This chunk of code will set the location constraint param based // on the region (when possible), but it will not override a passed-in // location constraint. if (typeof params === 'function' || !params) { callback = callback || params; params = {}; } var hostname = this.endpoint.hostname; // copy params so that appending keys does not unintentioinallly // mutate params object argument passed in by user var copiedParams = AWS.util.copy(params); if (hostname !== this.api.globalEndpoint && !params.CreateBucketConfiguration) { copiedParams.CreateBucketConfiguration = { LocationConstraint: this.config.region }; } return this.makeRequest('createBucket', copiedParams, callback); }, writeGetObjectResponse: function writeGetObjectResponse(params, callback) { var request = this.makeRequest('writeGetObjectResponse', AWS.util.copy(params), callback); var hostname = this.endpoint.hostname; if (hostname.indexOf(this.config.region) !== -1) { // hostname specifies a region already hostname = hostname.replace('s3.', OBJECT_LAMBDA_SERVICE + '.'); } else { // Hostname doesn't have a region. // Object Lambda requires an explicit region. hostname = hostname.replace('s3.', OBJECT_LAMBDA_SERVICE + '.' + this.config.region + '.'); } request.httpRequest.endpoint = new AWS.Endpoint(hostname, this.config); return request; }, /** * @see AWS.S3.ManagedUpload * @overload upload(params = {}, [options], [callback]) * Uploads an arbitrarily sized buffer, blob, or stream, using intelligent * concurrent handling of parts if the payload is large enough. You can * configure the concurrent queue size by setting `options`. Note that this * is the only operation for which the SDK can retry requests with stream * bodies. * * @param (see AWS.S3.putObject) * @option (see AWS.S3.ManagedUpload.constructor) * @return [AWS.S3.ManagedUpload] the managed upload object that can call * `send()` or track progress. * @example Uploading a stream object * var params = {Bucket: 'bucket', Key: 'key', Body: stream}; * s3.upload(params, function(err, data) { * console.log(err, data); * }); * @example Uploading a stream with concurrency of 1 and partSize of 10mb * var params = {Bucket: 'bucket', Key: 'key', Body: stream}; * var options = {partSize: 10 * 1024 * 1024, queueSize: 1}; * s3.upload(params, options, function(err, data) { * console.log(err, data); * }); * @callback callback function(err, data) * @param err [Error] an error or null if no error occurred. * @param data [map] The response data from the successful upload: * @param data.Location [String] the URL of the uploaded object * @param data.ETag [String] the ETag of the uploaded object * @param data.Bucket [String] the bucket to which the object was uploaded * @param data.Key [String] the key to which the object was uploaded */ upload: function upload(params, options, callback) { if (typeof options === 'function' && callback === undefined) { callback = options; options = null; } options = options || {}; options = AWS.util.merge(options || {}, {service: this, params: params}); var uploader = new AWS.S3.ManagedUpload(options); if (typeof callback === 'function') uploader.send(callback); return uploader; } }); /** * @api private */ AWS.S3.addPromisesToClass = function addPromisesToClass(PromiseDependency) { this.prototype.getSignedUrlPromise = AWS.util.promisifyMethod('getSignedUrl', PromiseDependency); }; /** * @api private */ AWS.S3.deletePromisesFromClass = function deletePromisesFromClass() { delete this.prototype.getSignedUrlPromise; }; AWS.util.addPromises(AWS.S3); /***/ }), /***/ 71207: /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => { var AWS = __webpack_require__(28437); var s3util = __webpack_require__(35895); var regionUtil = __webpack_require__(18262); AWS.util.update(AWS.S3Control.prototype, { /** * @api private */ setupRequestListeners: function setupRequestListeners(request) { request.addListener('extractError', this.extractHostId); request.addListener('extractData', this.extractHostId); request.addListener('validate', this.validateAccountId); var isArnInBucket = s3util.isArnInParam(request, 'Bucket'); var isArnInName = s3util.isArnInParam(request, 'Name'); if (isArnInBucket) { request._parsedArn = AWS.util.ARN.parse(request.params['Bucket']); request.addListener('validate', this.validateOutpostsBucketArn); request.addListener('validate', s3util.validateOutpostsArn); request.addListener('afterBuild', this.addOutpostIdHeader); } else if (isArnInName) { request._parsedArn = AWS.util.ARN.parse(request.params['Name']); request.addListener('validate', s3util.validateOutpostsAccessPointArn); request.addListener('validate', s3util.validateOutpostsArn); request.addListener('afterBuild', this.addOutpostIdHeader); } if (isArnInBucket || isArnInName) { request.addListener('validate', s3util.validateArnRegion); request.addListener('validate', this.validateArnAccountWithParams, true); request.addListener('validate', s3util.validateArnAccount); request.addListener('validate', s3util.validateArnService); request.addListener('build', this.populateParamFromArn, true); request.addListener('build', this.populateUriFromArn); request.addListener('build', s3util.validatePopulateUriFromArn); } if (request.params.OutpostId && (request.operation === 'createBucket' || request.operation === 'listRegionalBuckets')) { request.addListener('build', this.populateEndpointForOutpostId); } }, /** * Adds outpostId header */ addOutpostIdHeader: function addOutpostIdHeader(req) { req.httpRequest.headers['x-amz-outpost-id'] = req._parsedArn.outpostId; }, /** * Validate Outposts ARN supplied in Bucket parameter is a valid bucket name */ validateOutpostsBucketArn: function validateOutpostsBucketArn(req) { var parsedArn = req._parsedArn; //can be ':' or '/' var delimiter = parsedArn.resource['outpost'.length]; if (parsedArn.resource.split(delimiter).length !== 4) { throw AWS.util.error(new Error(), { code: 'InvalidARN', message: 'Bucket ARN should have two resources outpost/{outpostId}/bucket/{accesspointName}' }); } var bucket = parsedArn.resource.split(delimiter)[3]; if (!s3util.dnsCompatibleBucketName(bucket) || bucket.match(/\./)) { throw AWS.util.error(new Error(), { code: 'InvalidARN', message: 'Bucket ARN is not DNS compatible. Got ' + bucket }); } //set parsed valid bucket req._parsedArn.bucket = bucket; }, /** * @api private */ populateParamFromArn: function populateParamFromArn(req) { var parsedArn = req._parsedArn; if (s3util.isArnInParam(req, 'Bucket')) { req.params.Bucket = parsedArn.bucket; } else if (s3util.isArnInParam(req, 'Name')) { req.params.Name = parsedArn.accessPoint; } }, /** * Populate URI according to the ARN */ populateUriFromArn: function populateUriFromArn(req) { var parsedArn = req._parsedArn; var endpoint = req.httpRequest.endpoint; var useArnRegion = req.service.config.s3UseArnRegion; endpoint.hostname = [ 's3-outposts', useArnRegion ? parsedArn.region : req.service.config.region, 'amazonaws.com' ].join('.'); endpoint.host = endpoint.hostname; }, /** * @api private */ populateEndpointForOutpostId: function populateEndpointForOutpostId(req) { var endpoint = req.httpRequest.endpoint; endpoint.hostname = [ 's3-outposts', req.service.config.region, 'amazonaws.com' ].join('.'); endpoint.host = endpoint.hostname; }, /** * @api private */ extractHostId: function(response) { var hostId = response.httpResponse.headers ? response.httpResponse.headers['x-amz-id-2'] : null; response.extendedRequestId = hostId; if (response.error) { response.error.extendedRequestId = hostId; } }, /** * @api private */ validateArnAccountWithParams: function validateArnAccountWithParams(req) { var params = req.params; var inputModel = req.service.api.operations[req.operation].input; if (inputModel.members.AccountId) { var parsedArn = req._parsedArn; if (parsedArn.accountId) { if (params.AccountId) { if (params.AccountId !== parsedArn.accountId) { throw AWS.util.error( new Error(), {code: 'ValidationError', message: 'AccountId in ARN and request params should be same.'} ); } } else { // Store accountId from ARN in params params.AccountId = parsedArn.accountId; } } } }, /** * @api private */ validateAccountId: function(request) { var params = request.params; if (!Object.prototype.hasOwnProperty.call(params, 'AccountId')) return; var accountId = params.AccountId; //validate type if (typeof accountId !== 'string') { throw AWS.util.error( new Error(), {code: 'ValidationError', message: 'AccountId must be a string.'} ); } //validate length if (accountId.length < 1 || accountId.length > 63) { throw AWS.util.error( new Error(), {code: 'ValidationError', message: 'AccountId length should be between 1 to 63 characters, inclusive.'} ); } //validate pattern var hostPattern = /^[a-zA-Z0-9]{1}$|^[a-zA-Z0-9][a-zA-Z0-9\-]*[a-zA-Z0-9]$/; if (!hostPattern.test(accountId)) { throw AWS.util.error(new Error(), {code: 'ValidationError', message: 'AccountId should be hostname compatible. AccountId: ' + accountId}); } }, /** * @api private */ getSigningName: function getSigningName(req) { var _super = AWS.Service.prototype.getSigningName; if (req && req._parsedArn && req._parsedArn.service) { return req._parsedArn.service; } else if (req.params.OutpostId && (req.operation === 'createBucket' || req.operation === 'listRegionalBuckets')) { return 's3-outposts'; } else { return _super.call(this, req); } }, }); /***/ }), /***/ 35895: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { var AWS = __webpack_require__(28437); var regionUtil = __webpack_require__(18262); var s3util = { /** * @api private */ isArnInParam: function isArnInParam(req, paramName) { var inputShape = (req.service.api.operations[req.operation] || {}).input || {}; var inputMembers = inputShape.members || {}; if (!req.params[paramName] || !inputMembers[paramName]) return false; return AWS.util.ARN.validate(req.params[paramName]); }, /** * Validate service component from ARN supplied in Bucket parameter */ validateArnService: function validateArnService(req) { var parsedArn = req._parsedArn; if (parsedArn.service !== 's3' && parsedArn.service !== 's3-outposts' && parsedArn.service !== 's3-object-lambda') { throw AWS.util.error(new Error(), { code: 'InvalidARN', message: 'expect \'s3\' or \'s3-outposts\' or \'s3-object-lambda\' in ARN service component' }); } }, /** * Validate account ID from ARN supplied in Bucket parameter is a valid account */ validateArnAccount: function validateArnAccount(req) { var parsedArn = req._parsedArn; if (!/[0-9]{12}/.exec(parsedArn.accountId)) { throw AWS.util.error(new Error(), { code: 'InvalidARN', message: 'ARN accountID does not match regex "[0-9]{12}"' }); } }, /** * Validate ARN supplied in Bucket parameter is a valid access point ARN */ validateS3AccessPointArn: function validateS3AccessPointArn(req) { var parsedArn = req._parsedArn; //can be ':' or '/' var delimiter = parsedArn.resource['accesspoint'.length]; if (parsedArn.resource.split(delimiter).length !== 2) { throw AWS.util.error(new Error(), { code: 'InvalidARN', message: 'Access Point ARN should have one resource accesspoint/{accesspointName}' }); } var accessPoint = parsedArn.resource.split(delimiter)[1]; var accessPointPrefix = accessPoint + '-' + parsedArn.accountId; if (!s3util.dnsCompatibleBucketName(accessPointPrefix) || accessPointPrefix.match(/\./)) { throw AWS.util.error(new Error(), { code: 'InvalidARN', message: 'Access point resource in ARN is not DNS compatible. Got ' + accessPoint }); } //set parsed valid access point req._parsedArn.accessPoint = accessPoint; }, /** * Validate Outposts ARN supplied in Bucket parameter is a valid outposts ARN */ validateOutpostsArn: function validateOutpostsArn(req) { var parsedArn = req._parsedArn; if ( parsedArn.resource.indexOf('outpost:') !== 0 && parsedArn.resource.indexOf('outpost/') !== 0 ) { throw AWS.util.error(new Error(), { code: 'InvalidARN', message: 'ARN resource should begin with \'outpost/\'' }); } //can be ':' or '/' var delimiter = parsedArn.resource['outpost'.length]; var outpostId = parsedArn.resource.split(delimiter)[1]; var dnsHostRegex = new RegExp(/^([a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9-]{0,61}[a-zA-Z0-9])$/); if (!dnsHostRegex.test(outpostId)) { throw AWS.util.error(new Error(), { code: 'InvalidARN', message: 'Outpost resource in ARN is not DNS compatible. Got ' + outpostId }); } req._parsedArn.outpostId = outpostId; }, /** * Validate Outposts ARN supplied in Bucket parameter is a valid outposts ARN */ validateOutpostsAccessPointArn: function validateOutpostsAccessPointArn(req) { var parsedArn = req._parsedArn; //can be ':' or '/' var delimiter = parsedArn.resource['outpost'.length]; if (parsedArn.resource.split(delimiter).length !== 4) { throw AWS.util.error(new Error(), { code: 'InvalidARN', message: 'Outposts ARN should have two resources outpost/{outpostId}/accesspoint/{accesspointName}' }); } var accessPoint = parsedArn.resource.split(delimiter)[3]; var accessPointPrefix = accessPoint + '-' + parsedArn.accountId; if (!s3util.dnsCompatibleBucketName(accessPointPrefix) || accessPointPrefix.match(/\./)) { throw AWS.util.error(new Error(), { code: 'InvalidARN', message: 'Access point resource in ARN is not DNS compatible. Got ' + accessPoint }); } //set parsed valid access point req._parsedArn.accessPoint = accessPoint; }, /** * Validate region field in ARN supplied in Bucket parameter is a valid region */ validateArnRegion: function validateArnRegion(req) { var useArnRegion = s3util.loadUseArnRegionConfig(req); var regionFromArn = req._parsedArn.region; var clientRegion = req.service.config.region; if (!regionFromArn) { throw AWS.util.error(new Error(), { code: 'InvalidARN', message: 'ARN region is empty' }); } if ( clientRegion.indexOf('fips') >= 0 || regionFromArn.indexOf('fips') >= 0 ) { throw AWS.util.error(new Error(), { code: 'InvalidConfiguration', message: 'ARN endpoint is not compatible with FIPS region' }); } if (!useArnRegion && regionFromArn !== clientRegion) { throw AWS.util.error(new Error(), { code: 'InvalidConfiguration', message: 'Configured region conflicts with access point region' }); } else if ( useArnRegion && regionUtil.getEndpointSuffix(regionFromArn) !== regionUtil.getEndpointSuffix(clientRegion) ) { throw AWS.util.error(new Error(), { code: 'InvalidConfiguration', message: 'Configured region and access point region not in same partition' }); } if (req.service.config.useAccelerateEndpoint) { throw AWS.util.error(new Error(), { code: 'InvalidConfiguration', message: 'useAccelerateEndpoint config is not supported with access point ARN' }); } if (req._parsedArn.service === 's3-outposts' && req.service.config.useDualstack) { throw AWS.util.error(new Error(), { code: 'InvalidConfiguration', message: 'useDualstack config is not supported with outposts access point ARN' }); } }, loadUseArnRegionConfig: function loadUseArnRegionConfig(req) { var envName = 'AWS_S3_USE_ARN_REGION'; var configName = 's3_use_arn_region'; var useArnRegion = true; var originalConfig = req.service._originalConfig || {}; if (req.service.config.s3UseArnRegion !== undefined) { return req.service.config.s3UseArnRegion; } else if (originalConfig.s3UseArnRegion !== undefined) { useArnRegion = originalConfig.s3UseArnRegion === true; } else if (AWS.util.isNode()) { //load from environmental variable AWS_USE_ARN_REGION if (process.env[envName]) { var value = process.env[envName].trim().toLowerCase(); if (['false', 'true'].indexOf(value) < 0) { throw AWS.util.error(new Error(), { code: 'InvalidConfiguration', message: envName + ' only accepts true or false. Got ' + process.env[envName], retryable: false }); } useArnRegion = value === 'true'; } else { //load from shared config property use_arn_region var profiles = {}; var profile = {}; try { profiles = AWS.util.getProfilesFromSharedConfig(AWS.util.iniLoader); profile = profiles[process.env.AWS_PROFILE || AWS.util.defaultProfile]; } catch (e) {} if (profile[configName]) { if (['false', 'true'].indexOf(profile[configName].trim().toLowerCase()) < 0) { throw AWS.util.error(new Error(), { code: 'InvalidConfiguration', message: configName + ' only accepts true or false. Got ' + profile[configName], retryable: false }); } useArnRegion = profile[configName].trim().toLowerCase() === 'true'; } } } req.service.config.s3UseArnRegion = useArnRegion; return useArnRegion; }, /** * Validations before URI can be populated */ validatePopulateUriFromArn: function validatePopulateUriFromArn(req) { if (req.service._originalConfig && req.service._originalConfig.endpoint) { throw AWS.util.error(new Error(), { code: 'InvalidConfiguration', message: 'Custom endpoint is not compatible with access point ARN' }); } if (req.service.config.s3ForcePathStyle) { throw AWS.util.error(new Error(), { code: 'InvalidConfiguration', message: 'Cannot construct path-style endpoint with access point' }); } }, /** * Returns true if the bucket name is DNS compatible. Buckets created * outside of the classic region MUST be DNS compatible. * * @api private */ dnsCompatibleBucketName: function dnsCompatibleBucketName(bucketName) { var b = bucketName; var domain = new RegExp(/^[a-z0-9][a-z0-9\.\-]{1,61}[a-z0-9]$/); var ipAddress = new RegExp(/(\d+\.){3}\d+/); var dots = new RegExp(/\.\./); return (b.match(domain) && !b.match(ipAddress) && !b.match(dots)) ? true : false; }, }; /** * @api private */ module.exports = s3util; /***/ }), /***/ 94571: /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => { var AWS = __webpack_require__(28437); AWS.util.update(AWS.SQS.prototype, { /** * @api private */ setupRequestListeners: function setupRequestListeners(request) { request.addListener('build', this.buildEndpoint); if (request.service.config.computeChecksums) { if (request.operation === 'sendMessage') { request.addListener('extractData', this.verifySendMessageChecksum); } else if (request.operation === 'sendMessageBatch') { request.addListener('extractData', this.verifySendMessageBatchChecksum); } else if (request.operation === 'receiveMessage') { request.addListener('extractData', this.verifyReceiveMessageChecksum); } } }, /** * @api private */ verifySendMessageChecksum: function verifySendMessageChecksum(response) { if (!response.data) return; var md5 = response.data.MD5OfMessageBody; var body = this.params.MessageBody; var calculatedMd5 = this.service.calculateChecksum(body); if (calculatedMd5 !== md5) { var msg = 'Got "' + response.data.MD5OfMessageBody + '", expecting "' + calculatedMd5 + '".'; this.service.throwInvalidChecksumError(response, [response.data.MessageId], msg); } }, /** * @api private */ verifySendMessageBatchChecksum: function verifySendMessageBatchChecksum(response) { if (!response.data) return; var service = this.service; var entries = {}; var errors = []; var messageIds = []; AWS.util.arrayEach(response.data.Successful, function (entry) { entries[entry.Id] = entry; }); AWS.util.arrayEach(this.params.Entries, function (entry) { if (entries[entry.Id]) { var md5 = entries[entry.Id].MD5OfMessageBody; var body = entry.MessageBody; if (!service.isChecksumValid(md5, body)) { errors.push(entry.Id); messageIds.push(entries[entry.Id].MessageId); } } }); if (errors.length > 0) { service.throwInvalidChecksumError(response, messageIds, 'Invalid messages: ' + errors.join(', ')); } }, /** * @api private */ verifyReceiveMessageChecksum: function verifyReceiveMessageChecksum(response) { if (!response.data) return; var service = this.service; var messageIds = []; AWS.util.arrayEach(response.data.Messages, function(message) { var md5 = message.MD5OfBody; var body = message.Body; if (!service.isChecksumValid(md5, body)) { messageIds.push(message.MessageId); } }); if (messageIds.length > 0) { service.throwInvalidChecksumError(response, messageIds, 'Invalid messages: ' + messageIds.join(', ')); } }, /** * @api private */ throwInvalidChecksumError: function throwInvalidChecksumError(response, ids, message) { response.error = AWS.util.error(new Error(), { retryable: true, code: 'InvalidChecksum', messageIds: ids, message: response.request.operation + ' returned an invalid MD5 response. ' + message }); }, /** * @api private */ isChecksumValid: function isChecksumValid(checksum, data) { return this.calculateChecksum(data) === checksum; }, /** * @api private */ calculateChecksum: function calculateChecksum(data) { return AWS.util.crypto.md5(data, 'hex'); }, /** * @api private */ buildEndpoint: function buildEndpoint(request) { var url = request.httpRequest.params.QueueUrl; if (url) { request.httpRequest.endpoint = new AWS.Endpoint(url); // signature version 4 requires the region name to be set, // sqs queue urls contain the region name var matches = request.httpRequest.endpoint.host.match(/^sqs\.(.+?)\./); if (matches) request.httpRequest.region = matches[1]; } } }); /***/ }), /***/ 91055: /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => { var AWS = __webpack_require__(28437); var resolveRegionalEndpointsFlag = __webpack_require__(85566); var ENV_REGIONAL_ENDPOINT_ENABLED = 'AWS_STS_REGIONAL_ENDPOINTS'; var CONFIG_REGIONAL_ENDPOINT_ENABLED = 'sts_regional_endpoints'; AWS.util.update(AWS.STS.prototype, { /** * @overload credentialsFrom(data, credentials = null) * Creates a credentials object from STS response data containing * credentials information. Useful for quickly setting AWS credentials. * * @note This is a low-level utility function. If you want to load temporary * credentials into your process for subsequent requests to AWS resources, * you should use {AWS.TemporaryCredentials} instead. * @param data [map] data retrieved from a call to {getFederatedToken}, * {getSessionToken}, {assumeRole}, or {assumeRoleWithWebIdentity}. * @param credentials [AWS.Credentials] an optional credentials object to * fill instead of creating a new object. Useful when modifying an * existing credentials object from a refresh call. * @return [AWS.TemporaryCredentials] the set of temporary credentials * loaded from a raw STS operation response. * @example Using credentialsFrom to load global AWS credentials * var sts = new AWS.STS(); * sts.getSessionToken(function (err, data) { * if (err) console.log("Error getting credentials"); * else { * AWS.config.credentials = sts.credentialsFrom(data); * } * }); * @see AWS.TemporaryCredentials */ credentialsFrom: function credentialsFrom(data, credentials) { if (!data) return null; if (!credentials) credentials = new AWS.TemporaryCredentials(); credentials.expired = false; credentials.accessKeyId = data.Credentials.AccessKeyId; credentials.secretAccessKey = data.Credentials.SecretAccessKey; credentials.sessionToken = data.Credentials.SessionToken; credentials.expireTime = data.Credentials.Expiration; return credentials; }, assumeRoleWithWebIdentity: function assumeRoleWithWebIdentity(params, callback) { return this.makeUnauthenticatedRequest('assumeRoleWithWebIdentity', params, callback); }, assumeRoleWithSAML: function assumeRoleWithSAML(params, callback) { return this.makeUnauthenticatedRequest('assumeRoleWithSAML', params, callback); }, /** * @api private */ setupRequestListeners: function setupRequestListeners(request) { request.addListener('validate', this.optInRegionalEndpoint, true); }, /** * @api private */ optInRegionalEndpoint: function optInRegionalEndpoint(req) { var service = req.service; var config = service.config; config.stsRegionalEndpoints = resolveRegionalEndpointsFlag(service._originalConfig, { env: ENV_REGIONAL_ENDPOINT_ENABLED, sharedConfig: CONFIG_REGIONAL_ENDPOINT_ENABLED, clientConfig: 'stsRegionalEndpoints' }); if ( config.stsRegionalEndpoints === 'regional' && service.isGlobalEndpoint ) { //client will throw if region is not supplied; request will be signed with specified region if (!config.region) { throw AWS.util.error(new Error(), {code: 'ConfigError', message: 'Missing region in config'}); } var insertPoint = config.endpoint.indexOf('.amazonaws.com'); var regionalEndpoint = config.endpoint.substring(0, insertPoint) + '.' + config.region + config.endpoint.substring(insertPoint); req.httpRequest.updateEndpoint(regionalEndpoint); req.httpRequest.region = config.region; } } }); /***/ }), /***/ 31987: /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => { var AWS = __webpack_require__(28437); AWS.util.hideProperties(AWS, ['SimpleWorkflow']); /** * @constant * @readonly * Backwards compatibility for access to the {AWS.SWF} service class. */ AWS.SimpleWorkflow = AWS.SWF; /***/ }), /***/ 29697: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { var IniLoader = __webpack_require__(95417).IniLoader; /** * Singleton object to load specified config/credentials files. * It will cache all the files ever loaded; */ module.exports.b = new IniLoader(); /***/ }), /***/ 95417: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { var AWS = __webpack_require__(28437); var os = __webpack_require__(12087); var path = __webpack_require__(85622); function parseFile(filename, isConfig) { var content = AWS.util.ini.parse(AWS.util.readFileSync(filename)); var tmpContent = {}; Object.keys(content).forEach(function(profileName) { var profileContent = content[profileName]; profileName = isConfig ? profileName.replace(/^profile\s/, '') : profileName; Object.defineProperty(tmpContent, profileName, { value: profileContent, enumerable: true }); }); return tmpContent; } /** * Ini file loader class the same as that used in the SDK. It loads and * parses config and credentials files in .ini format and cache the content * to assure files are only read once. * Note that calling operations on the instance instantiated from this class * won't affect the behavior of SDK since SDK uses an internal singleton of * this class. * @!macro nobrowser */ AWS.IniLoader = AWS.util.inherit({ constructor: function IniLoader() { this.resolvedProfiles = {}; }, /** Remove all cached files. Used after config files are updated. */ clearCachedFiles: function clearCachedFiles() { this.resolvedProfiles = {}; }, /** * Load configurations from config/credentials files and cache them * for later use. If no file is specified it will try to load default * files. * @param options [map] information describing the file * @option options filename [String] ('~/.aws/credentials' or defined by * AWS_SHARED_CREDENTIALS_FILE process env var or '~/.aws/config' if * isConfig is set to true) * path to the file to be read. * @option options isConfig [Boolean] (false) True to read config file. * @return [map] object containing contents from file in key-value * pairs. */ loadFrom: function loadFrom(options) { options = options || {}; var isConfig = options.isConfig === true; var filename = options.filename || this.getDefaultFilePath(isConfig); if (!this.resolvedProfiles[filename]) { var fileContent = this.parseFile(filename, isConfig); Object.defineProperty(this.resolvedProfiles, filename, { value: fileContent }); } return this.resolvedProfiles[filename]; }, /** * @api private */ parseFile: parseFile, /** * @api private */ getDefaultFilePath: function getDefaultFilePath(isConfig) { return path.join( this.getHomeDir(), '.aws', isConfig ? 'config' : 'credentials' ); }, /** * @api private */ getHomeDir: function getHomeDir() { var env = process.env; var home = env.HOME || env.USERPROFILE || (env.HOMEPATH ? ((env.HOMEDRIVE || 'C:/') + env.HOMEPATH) : null); if (home) { return home; } if (typeof os.homedir === 'function') { return os.homedir(); } throw AWS.util.error( new Error('Cannot load credentials, HOME path not set') ); } }); var IniLoader = AWS.IniLoader; module.exports = { IniLoader: IniLoader, parseFile: parseFile, }; /***/ }), /***/ 60328: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { var AWS = __webpack_require__(28437); var inherit = AWS.util.inherit; /** * @api private */ var expiresHeader = 'presigned-expires'; /** * @api private */ function signedUrlBuilder(request) { var expires = request.httpRequest.headers[expiresHeader]; var signerClass = request.service.getSignerClass(request); delete request.httpRequest.headers['User-Agent']; delete request.httpRequest.headers['X-Amz-User-Agent']; if (signerClass === AWS.Signers.V4) { if (expires > 604800) { // one week expiry is invalid var message = 'Presigning does not support expiry time greater ' + 'than a week with SigV4 signing.'; throw AWS.util.error(new Error(), { code: 'InvalidExpiryTime', message: message, retryable: false }); } request.httpRequest.headers[expiresHeader] = expires; } else if (signerClass === AWS.Signers.S3) { var now = request.service ? request.service.getSkewCorrectedDate() : AWS.util.date.getDate(); request.httpRequest.headers[expiresHeader] = parseInt( AWS.util.date.unixTimestamp(now) + expires, 10).toString(); } else { throw AWS.util.error(new Error(), { message: 'Presigning only supports S3 or SigV4 signing.', code: 'UnsupportedSigner', retryable: false }); } } /** * @api private */ function signedUrlSigner(request) { var endpoint = request.httpRequest.endpoint; var parsedUrl = AWS.util.urlParse(request.httpRequest.path); var queryParams = {}; if (parsedUrl.search) { queryParams = AWS.util.queryStringParse(parsedUrl.search.substr(1)); } var auth = request.httpRequest.headers['Authorization'].split(' '); if (auth[0] === 'AWS') { auth = auth[1].split(':'); queryParams['Signature'] = auth.pop(); queryParams['AWSAccessKeyId'] = auth.join(':'); AWS.util.each(request.httpRequest.headers, function (key, value) { if (key === expiresHeader) key = 'Expires'; if (key.indexOf('x-amz-meta-') === 0) { // Delete existing, potentially not normalized key delete queryParams[key]; key = key.toLowerCase(); } queryParams[key] = value; }); delete request.httpRequest.headers[expiresHeader]; delete queryParams['Authorization']; delete queryParams['Host']; } else if (auth[0] === 'AWS4-HMAC-SHA256') { // SigV4 signing auth.shift(); var rest = auth.join(' '); var signature = rest.match(/Signature=(.*?)(?:,|\s|\r?\n|$)/)[1]; queryParams['X-Amz-Signature'] = signature; delete queryParams['Expires']; } // build URL endpoint.pathname = parsedUrl.pathname; endpoint.search = AWS.util.queryParamsToString(queryParams); } /** * @api private */ AWS.Signers.Presign = inherit({ /** * @api private */ sign: function sign(request, expireTime, callback) { request.httpRequest.headers[expiresHeader] = expireTime || 3600; request.on('build', signedUrlBuilder); request.on('sign', signedUrlSigner); request.removeListener('afterBuild', AWS.EventListeners.Core.SET_CONTENT_LENGTH); request.removeListener('afterBuild', AWS.EventListeners.Core.COMPUTE_SHA256); request.emit('beforePresign', [request]); if (callback) { request.build(function() { if (this.response.error) callback(this.response.error); else { callback(null, AWS.util.urlFormat(request.httpRequest.endpoint)); } }); } else { request.build(); if (request.response.error) throw request.response.error; return AWS.util.urlFormat(request.httpRequest.endpoint); } } }); /** * @api private */ module.exports = AWS.Signers.Presign; /***/ }), /***/ 9897: /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => { var AWS = __webpack_require__(28437); var inherit = AWS.util.inherit; /** * @api private */ AWS.Signers.RequestSigner = inherit({ constructor: function RequestSigner(request) { this.request = request; }, setServiceClientId: function setServiceClientId(id) { this.serviceClientId = id; }, getServiceClientId: function getServiceClientId() { return this.serviceClientId; } }); AWS.Signers.RequestSigner.getVersion = function getVersion(version) { switch (version) { case 'v2': return AWS.Signers.V2; case 'v3': return AWS.Signers.V3; case 's3v4': return AWS.Signers.V4; case 'v4': return AWS.Signers.V4; case 's3': return AWS.Signers.S3; case 'v3https': return AWS.Signers.V3Https; } throw new Error('Unknown signing version ' + version); }; __webpack_require__(28489); __webpack_require__(66458); __webpack_require__(24473); __webpack_require__(26529); __webpack_require__(58616); __webpack_require__(60328); /***/ }), /***/ 58616: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { var AWS = __webpack_require__(28437); var inherit = AWS.util.inherit; /** * @api private */ AWS.Signers.S3 = inherit(AWS.Signers.RequestSigner, { /** * When building the stringToSign, these sub resource params should be * part of the canonical resource string with their NON-decoded values */ subResources: { 'acl': 1, 'accelerate': 1, 'analytics': 1, 'cors': 1, 'lifecycle': 1, 'delete': 1, 'inventory': 1, 'location': 1, 'logging': 1, 'metrics': 1, 'notification': 1, 'partNumber': 1, 'policy': 1, 'requestPayment': 1, 'replication': 1, 'restore': 1, 'tagging': 1, 'torrent': 1, 'uploadId': 1, 'uploads': 1, 'versionId': 1, 'versioning': 1, 'versions': 1, 'website': 1 }, // when building the stringToSign, these querystring params should be // part of the canonical resource string with their NON-encoded values responseHeaders: { 'response-content-type': 1, 'response-content-language': 1, 'response-expires': 1, 'response-cache-control': 1, 'response-content-disposition': 1, 'response-content-encoding': 1 }, addAuthorization: function addAuthorization(credentials, date) { if (!this.request.headers['presigned-expires']) { this.request.headers['X-Amz-Date'] = AWS.util.date.rfc822(date); } if (credentials.sessionToken) { // presigned URLs require this header to be lowercased this.request.headers['x-amz-security-token'] = credentials.sessionToken; } var signature = this.sign(credentials.secretAccessKey, this.stringToSign()); var auth = 'AWS ' + credentials.accessKeyId + ':' + signature; this.request.headers['Authorization'] = auth; }, stringToSign: function stringToSign() { var r = this.request; var parts = []; parts.push(r.method); parts.push(r.headers['Content-MD5'] || ''); parts.push(r.headers['Content-Type'] || ''); // This is the "Date" header, but we use X-Amz-Date. // The S3 signing mechanism requires us to pass an empty // string for this Date header regardless. parts.push(r.headers['presigned-expires'] || ''); var headers = this.canonicalizedAmzHeaders(); if (headers) parts.push(headers); parts.push(this.canonicalizedResource()); return parts.join('\n'); }, canonicalizedAmzHeaders: function canonicalizedAmzHeaders() { var amzHeaders = []; AWS.util.each(this.request.headers, function (name) { if (name.match(/^x-amz-/i)) amzHeaders.push(name); }); amzHeaders.sort(function (a, b) { return a.toLowerCase() < b.toLowerCase() ? -1 : 1; }); var parts = []; AWS.util.arrayEach.call(this, amzHeaders, function (name) { parts.push(name.toLowerCase() + ':' + String(this.request.headers[name])); }); return parts.join('\n'); }, canonicalizedResource: function canonicalizedResource() { var r = this.request; var parts = r.path.split('?'); var path = parts[0]; var querystring = parts[1]; var resource = ''; if (r.virtualHostedBucket) resource += '/' + r.virtualHostedBucket; resource += path; if (querystring) { // collect a list of sub resources and query params that need to be signed var resources = []; AWS.util.arrayEach.call(this, querystring.split('&'), function (param) { var name = param.split('=')[0]; var value = param.split('=')[1]; if (this.subResources[name] || this.responseHeaders[name]) { var subresource = { name: name }; if (value !== undefined) { if (this.subResources[name]) { subresource.value = value; } else { subresource.value = decodeURIComponent(value); } } resources.push(subresource); } }); resources.sort(function (a, b) { return a.name < b.name ? -1 : 1; }); if (resources.length) { querystring = []; AWS.util.arrayEach(resources, function (res) { if (res.value === undefined) { querystring.push(res.name); } else { querystring.push(res.name + '=' + res.value); } }); resource += '?' + querystring.join('&'); } } return resource; }, sign: function sign(secret, string) { return AWS.util.crypto.hmac(secret, string, 'base64', 'sha1'); } }); /** * @api private */ module.exports = AWS.Signers.S3; /***/ }), /***/ 28489: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { var AWS = __webpack_require__(28437); var inherit = AWS.util.inherit; /** * @api private */ AWS.Signers.V2 = inherit(AWS.Signers.RequestSigner, { addAuthorization: function addAuthorization(credentials, date) { if (!date) date = AWS.util.date.getDate(); var r = this.request; r.params.Timestamp = AWS.util.date.iso8601(date); r.params.SignatureVersion = '2'; r.params.SignatureMethod = 'HmacSHA256'; r.params.AWSAccessKeyId = credentials.accessKeyId; if (credentials.sessionToken) { r.params.SecurityToken = credentials.sessionToken; } delete r.params.Signature; // delete old Signature for re-signing r.params.Signature = this.signature(credentials); r.body = AWS.util.queryParamsToString(r.params); r.headers['Content-Length'] = r.body.length; }, signature: function signature(credentials) { return AWS.util.crypto.hmac(credentials.secretAccessKey, this.stringToSign(), 'base64'); }, stringToSign: function stringToSign() { var parts = []; parts.push(this.request.method); parts.push(this.request.endpoint.host.toLowerCase()); parts.push(this.request.pathname()); parts.push(AWS.util.queryParamsToString(this.request.params)); return parts.join('\n'); } }); /** * @api private */ module.exports = AWS.Signers.V2; /***/ }), /***/ 66458: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { var AWS = __webpack_require__(28437); var inherit = AWS.util.inherit; /** * @api private */ AWS.Signers.V3 = inherit(AWS.Signers.RequestSigner, { addAuthorization: function addAuthorization(credentials, date) { var datetime = AWS.util.date.rfc822(date); this.request.headers['X-Amz-Date'] = datetime; if (credentials.sessionToken) { this.request.headers['x-amz-security-token'] = credentials.sessionToken; } this.request.headers['X-Amzn-Authorization'] = this.authorization(credentials, datetime); }, authorization: function authorization(credentials) { return 'AWS3 ' + 'AWSAccessKeyId=' + credentials.accessKeyId + ',' + 'Algorithm=HmacSHA256,' + 'SignedHeaders=' + this.signedHeaders() + ',' + 'Signature=' + this.signature(credentials); }, signedHeaders: function signedHeaders() { var headers = []; AWS.util.arrayEach(this.headersToSign(), function iterator(h) { headers.push(h.toLowerCase()); }); return headers.sort().join(';'); }, canonicalHeaders: function canonicalHeaders() { var headers = this.request.headers; var parts = []; AWS.util.arrayEach(this.headersToSign(), function iterator(h) { parts.push(h.toLowerCase().trim() + ':' + String(headers[h]).trim()); }); return parts.sort().join('\n') + '\n'; }, headersToSign: function headersToSign() { var headers = []; AWS.util.each(this.request.headers, function iterator(k) { if (k === 'Host' || k === 'Content-Encoding' || k.match(/^X-Amz/i)) { headers.push(k); } }); return headers; }, signature: function signature(credentials) { return AWS.util.crypto.hmac(credentials.secretAccessKey, this.stringToSign(), 'base64'); }, stringToSign: function stringToSign() { var parts = []; parts.push(this.request.method); parts.push('/'); parts.push(''); parts.push(this.canonicalHeaders()); parts.push(this.request.body); return AWS.util.crypto.sha256(parts.join('\n')); } }); /** * @api private */ module.exports = AWS.Signers.V3; /***/ }), /***/ 24473: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { var AWS = __webpack_require__(28437); var inherit = AWS.util.inherit; __webpack_require__(66458); /** * @api private */ AWS.Signers.V3Https = inherit(AWS.Signers.V3, { authorization: function authorization(credentials) { return 'AWS3-HTTPS ' + 'AWSAccessKeyId=' + credentials.accessKeyId + ',' + 'Algorithm=HmacSHA256,' + 'Signature=' + this.signature(credentials); }, stringToSign: function stringToSign() { return this.request.headers['X-Amz-Date']; } }); /** * @api private */ module.exports = AWS.Signers.V3Https; /***/ }), /***/ 26529: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { var AWS = __webpack_require__(28437); var v4Credentials = __webpack_require__(62660); var inherit = AWS.util.inherit; /** * @api private */ var expiresHeader = 'presigned-expires'; /** * @api private */ AWS.Signers.V4 = inherit(AWS.Signers.RequestSigner, { constructor: function V4(request, serviceName, options) { AWS.Signers.RequestSigner.call(this, request); this.serviceName = serviceName; options = options || {}; this.signatureCache = typeof options.signatureCache === 'boolean' ? options.signatureCache : true; this.operation = options.operation; this.signatureVersion = options.signatureVersion; }, algorithm: 'AWS4-HMAC-SHA256', addAuthorization: function addAuthorization(credentials, date) { var datetime = AWS.util.date.iso8601(date).replace(/[:\-]|\.\d{3}/g, ''); if (this.isPresigned()) { this.updateForPresigned(credentials, datetime); } else { this.addHeaders(credentials, datetime); } this.request.headers['Authorization'] = this.authorization(credentials, datetime); }, addHeaders: function addHeaders(credentials, datetime) { this.request.headers['X-Amz-Date'] = datetime; if (credentials.sessionToken) { this.request.headers['x-amz-security-token'] = credentials.sessionToken; } }, updateForPresigned: function updateForPresigned(credentials, datetime) { var credString = this.credentialString(datetime); var qs = { 'X-Amz-Date': datetime, 'X-Amz-Algorithm': this.algorithm, 'X-Amz-Credential': credentials.accessKeyId + '/' + credString, 'X-Amz-Expires': this.request.headers[expiresHeader], 'X-Amz-SignedHeaders': this.signedHeaders() }; if (credentials.sessionToken) { qs['X-Amz-Security-Token'] = credentials.sessionToken; } if (this.request.headers['Content-Type']) { qs['Content-Type'] = this.request.headers['Content-Type']; } if (this.request.headers['Content-MD5']) { qs['Content-MD5'] = this.request.headers['Content-MD5']; } if (this.request.headers['Cache-Control']) { qs['Cache-Control'] = this.request.headers['Cache-Control']; } // need to pull in any other X-Amz-* headers AWS.util.each.call(this, this.request.headers, function(key, value) { if (key === expiresHeader) return; if (this.isSignableHeader(key)) { var lowerKey = key.toLowerCase(); // Metadata should be normalized if (lowerKey.indexOf('x-amz-meta-') === 0) { qs[lowerKey] = value; } else if (lowerKey.indexOf('x-amz-') === 0) { qs[key] = value; } } }); var sep = this.request.path.indexOf('?') >= 0 ? '&' : '?'; this.request.path += sep + AWS.util.queryParamsToString(qs); }, authorization: function authorization(credentials, datetime) { var parts = []; var credString = this.credentialString(datetime); parts.push(this.algorithm + ' Credential=' + credentials.accessKeyId + '/' + credString); parts.push('SignedHeaders=' + this.signedHeaders()); parts.push('Signature=' + this.signature(credentials, datetime)); return parts.join(', '); }, signature: function signature(credentials, datetime) { var signingKey = v4Credentials.getSigningKey( credentials, datetime.substr(0, 8), this.request.region, this.serviceName, this.signatureCache ); return AWS.util.crypto.hmac(signingKey, this.stringToSign(datetime), 'hex'); }, stringToSign: function stringToSign(datetime) { var parts = []; parts.push('AWS4-HMAC-SHA256'); parts.push(datetime); parts.push(this.credentialString(datetime)); parts.push(this.hexEncodedHash(this.canonicalString())); return parts.join('\n'); }, canonicalString: function canonicalString() { var parts = [], pathname = this.request.pathname(); if (this.serviceName !== 's3' && this.signatureVersion !== 's3v4') pathname = AWS.util.uriEscapePath(pathname); parts.push(this.request.method); parts.push(pathname); parts.push(this.request.search()); parts.push(this.canonicalHeaders() + '\n'); parts.push(this.signedHeaders()); parts.push(this.hexEncodedBodyHash()); return parts.join('\n'); }, canonicalHeaders: function canonicalHeaders() { var headers = []; AWS.util.each.call(this, this.request.headers, function (key, item) { headers.push([key, item]); }); headers.sort(function (a, b) { return a[0].toLowerCase() < b[0].toLowerCase() ? -1 : 1; }); var parts = []; AWS.util.arrayEach.call(this, headers, function (item) { var key = item[0].toLowerCase(); if (this.isSignableHeader(key)) { var value = item[1]; if (typeof value === 'undefined' || value === null || typeof value.toString !== 'function') { throw AWS.util.error(new Error('Header ' + key + ' contains invalid value'), { code: 'InvalidHeader' }); } parts.push(key + ':' + this.canonicalHeaderValues(value.toString())); } }); return parts.join('\n'); }, canonicalHeaderValues: function canonicalHeaderValues(values) { return values.replace(/\s+/g, ' ').replace(/^\s+|\s+$/g, ''); }, signedHeaders: function signedHeaders() { var keys = []; AWS.util.each.call(this, this.request.headers, function (key) { key = key.toLowerCase(); if (this.isSignableHeader(key)) keys.push(key); }); return keys.sort().join(';'); }, credentialString: function credentialString(datetime) { return v4Credentials.createScope( datetime.substr(0, 8), this.request.region, this.serviceName ); }, hexEncodedHash: function hash(string) { return AWS.util.crypto.sha256(string, 'hex'); }, hexEncodedBodyHash: function hexEncodedBodyHash() { var request = this.request; if (this.isPresigned() && this.serviceName === 's3' && !request.body) { return 'UNSIGNED-PAYLOAD'; } else if (request.headers['X-Amz-Content-Sha256']) { return request.headers['X-Amz-Content-Sha256']; } else { return this.hexEncodedHash(this.request.body || ''); } }, unsignableHeaders: [ 'authorization', 'content-type', 'content-length', 'user-agent', expiresHeader, 'expect', 'x-amzn-trace-id' ], isSignableHeader: function isSignableHeader(key) { if (key.toLowerCase().indexOf('x-amz-') === 0) return true; return this.unsignableHeaders.indexOf(key) < 0; }, isPresigned: function isPresigned() { return this.request.headers[expiresHeader] ? true : false; } }); /** * @api private */ module.exports = AWS.Signers.V4; /***/ }), /***/ 62660: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { var AWS = __webpack_require__(28437); /** * @api private */ var cachedSecret = {}; /** * @api private */ var cacheQueue = []; /** * @api private */ var maxCacheEntries = 50; /** * @api private */ var v4Identifier = 'aws4_request'; /** * @api private */ module.exports = { /** * @api private * * @param date [String] * @param region [String] * @param serviceName [String] * @return [String] */ createScope: function createScope(date, region, serviceName) { return [ date.substr(0, 8), region, serviceName, v4Identifier ].join('/'); }, /** * @api private * * @param credentials [Credentials] * @param date [String] * @param region [String] * @param service [String] * @param shouldCache [Boolean] * @return [String] */ getSigningKey: function getSigningKey( credentials, date, region, service, shouldCache ) { var credsIdentifier = AWS.util.crypto .hmac(credentials.secretAccessKey, credentials.accessKeyId, 'base64'); var cacheKey = [credsIdentifier, date, region, service].join('_'); shouldCache = shouldCache !== false; if (shouldCache && (cacheKey in cachedSecret)) { return cachedSecret[cacheKey]; } var kDate = AWS.util.crypto.hmac( 'AWS4' + credentials.secretAccessKey, date, 'buffer' ); var kRegion = AWS.util.crypto.hmac(kDate, region, 'buffer'); var kService = AWS.util.crypto.hmac(kRegion, service, 'buffer'); var signingKey = AWS.util.crypto.hmac(kService, v4Identifier, 'buffer'); if (shouldCache) { cachedSecret[cacheKey] = signingKey; cacheQueue.push(cacheKey); if (cacheQueue.length > maxCacheEntries) { // remove the oldest entry (not the least recently used) delete cachedSecret[cacheQueue.shift()]; } } return signingKey; }, /** * @api private * * Empties the derived signing key cache. Made available for testing purposes * only. */ emptyCache: function emptyCache() { cachedSecret = {}; cacheQueue = []; } }; /***/ }), /***/ 68118: /***/ ((module) => { function AcceptorStateMachine(states, state) { this.currentState = state || null; this.states = states || {}; } AcceptorStateMachine.prototype.runTo = function runTo(finalState, done, bindObject, inputError) { if (typeof finalState === 'function') { inputError = bindObject; bindObject = done; done = finalState; finalState = null; } var self = this; var state = self.states[self.currentState]; state.fn.call(bindObject || self, inputError, function(err) { if (err) { if (state.fail) self.currentState = state.fail; else return done ? done.call(bindObject, err) : null; } else { if (state.accept) self.currentState = state.accept; else return done ? done.call(bindObject) : null; } if (self.currentState === finalState) { return done ? done.call(bindObject, err) : null; } self.runTo(finalState, done, bindObject, err); }); }; AcceptorStateMachine.prototype.addState = function addState(name, acceptState, failState, fn) { if (typeof acceptState === 'function') { fn = acceptState; acceptState = null; failState = null; } else if (typeof failState === 'function') { fn = failState; failState = null; } if (!this.currentState) this.currentState = name; this.states[name] = { accept: acceptState, fail: failState, fn: fn }; return this; }; /** * @api private */ module.exports = AcceptorStateMachine; /***/ }), /***/ 77985: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { /* eslint guard-for-in:0 */ var AWS; /** * A set of utility methods for use with the AWS SDK. * * @!attribute abort * Return this value from an iterator function {each} or {arrayEach} * to break out of the iteration. * @example Breaking out of an iterator function * AWS.util.each({a: 1, b: 2, c: 3}, function(key, value) { * if (key == 'b') return AWS.util.abort; * }); * @see each * @see arrayEach * @api private */ var util = { environment: 'nodejs', engine: function engine() { if (util.isBrowser() && typeof navigator !== 'undefined') { return navigator.userAgent; } else { var engine = process.platform + '/' + process.version; if (process.env.AWS_EXECUTION_ENV) { engine += ' exec-env/' + process.env.AWS_EXECUTION_ENV; } return engine; } }, userAgent: function userAgent() { var name = util.environment; var agent = 'aws-sdk-' + name + '/' + __webpack_require__(28437).VERSION; if (name === 'nodejs') agent += ' ' + util.engine(); return agent; }, uriEscape: function uriEscape(string) { var output = encodeURIComponent(string); output = output.replace(/[^A-Za-z0-9_.~\-%]+/g, escape); // AWS percent-encodes some extra non-standard characters in a URI output = output.replace(/[*]/g, function(ch) { return '%' + ch.charCodeAt(0).toString(16).toUpperCase(); }); return output; }, uriEscapePath: function uriEscapePath(string) { var parts = []; util.arrayEach(string.split('/'), function (part) { parts.push(util.uriEscape(part)); }); return parts.join('/'); }, urlParse: function urlParse(url) { return util.url.parse(url); }, urlFormat: function urlFormat(url) { return util.url.format(url); }, queryStringParse: function queryStringParse(qs) { return util.querystring.parse(qs); }, queryParamsToString: function queryParamsToString(params) { var items = []; var escape = util.uriEscape; var sortedKeys = Object.keys(params).sort(); util.arrayEach(sortedKeys, function(name) { var value = params[name]; var ename = escape(name); var result = ename + '='; if (Array.isArray(value)) { var vals = []; util.arrayEach(value, function(item) { vals.push(escape(item)); }); result = ename + '=' + vals.sort().join('&' + ename + '='); } else if (value !== undefined && value !== null) { result = ename + '=' + escape(value); } items.push(result); }); return items.join('&'); }, readFileSync: function readFileSync(path) { if (util.isBrowser()) return null; return __webpack_require__(35747).readFileSync(path, 'utf-8'); }, base64: { encode: function encode64(string) { if (typeof string === 'number') { throw util.error(new Error('Cannot base64 encode number ' + string)); } if (string === null || typeof string === 'undefined') { return string; } var buf = util.buffer.toBuffer(string); return buf.toString('base64'); }, decode: function decode64(string) { if (typeof string === 'number') { throw util.error(new Error('Cannot base64 decode number ' + string)); } if (string === null || typeof string === 'undefined') { return string; } return util.buffer.toBuffer(string, 'base64'); } }, buffer: { /** * Buffer constructor for Node buffer and buffer pollyfill */ toBuffer: function(data, encoding) { return (typeof util.Buffer.from === 'function' && util.Buffer.from !== Uint8Array.from) ? util.Buffer.from(data, encoding) : new util.Buffer(data, encoding); }, alloc: function(size, fill, encoding) { if (typeof size !== 'number') { throw new Error('size passed to alloc must be a number.'); } if (typeof util.Buffer.alloc === 'function') { return util.Buffer.alloc(size, fill, encoding); } else { var buf = new util.Buffer(size); if (fill !== undefined && typeof buf.fill === 'function') { buf.fill(fill, undefined, undefined, encoding); } return buf; } }, toStream: function toStream(buffer) { if (!util.Buffer.isBuffer(buffer)) buffer = util.buffer.toBuffer(buffer); var readable = new (util.stream.Readable)(); var pos = 0; readable._read = function(size) { if (pos >= buffer.length) return readable.push(null); var end = pos + size; if (end > buffer.length) end = buffer.length; readable.push(buffer.slice(pos, end)); pos = end; }; return readable; }, /** * Concatenates a list of Buffer objects. */ concat: function(buffers) { var length = 0, offset = 0, buffer = null, i; for (i = 0; i < buffers.length; i++) { length += buffers[i].length; } buffer = util.buffer.alloc(length); for (i = 0; i < buffers.length; i++) { buffers[i].copy(buffer, offset); offset += buffers[i].length; } return buffer; } }, string: { byteLength: function byteLength(string) { if (string === null || string === undefined) return 0; if (typeof string === 'string') string = util.buffer.toBuffer(string); if (typeof string.byteLength === 'number') { return string.byteLength; } else if (typeof string.length === 'number') { return string.length; } else if (typeof string.size === 'number') { return string.size; } else if (typeof string.path === 'string') { return __webpack_require__(35747).lstatSync(string.path).size; } else { throw util.error(new Error('Cannot determine length of ' + string), { object: string }); } }, upperFirst: function upperFirst(string) { return string[0].toUpperCase() + string.substr(1); }, lowerFirst: function lowerFirst(string) { return string[0].toLowerCase() + string.substr(1); } }, ini: { parse: function string(ini) { var currentSection, map = {}; util.arrayEach(ini.split(/\r?\n/), function(line) { line = line.split(/(^|\s)[;#]/)[0]; // remove comments var section = line.match(/^\s*\[([^\[\]]+)\]\s*$/); if (section) { currentSection = section[1]; if (currentSection === '__proto__' || currentSection.split(/\s/)[1] === '__proto__') { throw util.error( new Error('Cannot load profile name \'' + currentSection + '\' from shared ini file.') ); } } else if (currentSection) { var item = line.match(/^\s*(.+?)\s*=\s*(.+?)\s*$/); if (item) { map[currentSection] = map[currentSection] || {}; map[currentSection][item[1]] = item[2]; } } }); return map; } }, fn: { noop: function() {}, callback: function (err) { if (err) throw err; }, /** * Turn a synchronous function into as "async" function by making it call * a callback. The underlying function is called with all but the last argument, * which is treated as the callback. The callback is passed passed a first argument * of null on success to mimick standard node callbacks. */ makeAsync: function makeAsync(fn, expectedArgs) { if (expectedArgs && expectedArgs <= fn.length) { return fn; } return function() { var args = Array.prototype.slice.call(arguments, 0); var callback = args.pop(); var result = fn.apply(null, args); callback(result); }; } }, /** * Date and time utility functions. */ date: { /** * @return [Date] the current JavaScript date object. Since all * AWS services rely on this date object, you can override * this function to provide a special time value to AWS service * requests. */ getDate: function getDate() { if (!AWS) AWS = __webpack_require__(28437); if (AWS.config.systemClockOffset) { // use offset when non-zero return new Date(new Date().getTime() + AWS.config.systemClockOffset); } else { return new Date(); } }, /** * @return [String] the date in ISO-8601 format */ iso8601: function iso8601(date) { if (date === undefined) { date = util.date.getDate(); } return date.toISOString().replace(/\.\d{3}Z$/, 'Z'); }, /** * @return [String] the date in RFC 822 format */ rfc822: function rfc822(date) { if (date === undefined) { date = util.date.getDate(); } return date.toUTCString(); }, /** * @return [Integer] the UNIX timestamp value for the current time */ unixTimestamp: function unixTimestamp(date) { if (date === undefined) { date = util.date.getDate(); } return date.getTime() / 1000; }, /** * @param [String,number,Date] date * @return [Date] */ from: function format(date) { if (typeof date === 'number') { return new Date(date * 1000); // unix timestamp } else { return new Date(date); } }, /** * Given a Date or date-like value, this function formats the * date into a string of the requested value. * @param [String,number,Date] date * @param [String] formatter Valid formats are: # * 'iso8601' # * 'rfc822' # * 'unixTimestamp' * @return [String] */ format: function format(date, formatter) { if (!formatter) formatter = 'iso8601'; return util.date[formatter](util.date.from(date)); }, parseTimestamp: function parseTimestamp(value) { if (typeof value === 'number') { // unix timestamp (number) return new Date(value * 1000); } else if (value.match(/^\d+$/)) { // unix timestamp return new Date(value * 1000); } else if (value.match(/^\d{4}/)) { // iso8601 return new Date(value); } else if (value.match(/^\w{3},/)) { // rfc822 return new Date(value); } else { throw util.error( new Error('unhandled timestamp format: ' + value), {code: 'TimestampParserError'}); } } }, crypto: { crc32Table: [ 0x00000000, 0x77073096, 0xEE0E612C, 0x990951BA, 0x076DC419, 0x706AF48F, 0xE963A535, 0x9E6495A3, 0x0EDB8832, 0x79DCB8A4, 0xE0D5E91E, 0x97D2D988, 0x09B64C2B, 0x7EB17CBD, 0xE7B82D07, 0x90BF1D91, 0x1DB71064, 0x6AB020F2, 0xF3B97148, 0x84BE41DE, 0x1ADAD47D, 0x6DDDE4EB, 0xF4D4B551, 0x83D385C7, 0x136C9856, 0x646BA8C0, 0xFD62F97A, 0x8A65C9EC, 0x14015C4F, 0x63066CD9, 0xFA0F3D63, 0x8D080DF5, 0x3B6E20C8, 0x4C69105E, 0xD56041E4, 0xA2677172, 0x3C03E4D1, 0x4B04D447, 0xD20D85FD, 0xA50AB56B, 0x35B5A8FA, 0x42B2986C, 0xDBBBC9D6, 0xACBCF940, 0x32D86CE3, 0x45DF5C75, 0xDCD60DCF, 0xABD13D59, 0x26D930AC, 0x51DE003A, 0xC8D75180, 0xBFD06116, 0x21B4F4B5, 0x56B3C423, 0xCFBA9599, 0xB8BDA50F, 0x2802B89E, 0x5F058808, 0xC60CD9B2, 0xB10BE924, 0x2F6F7C87, 0x58684C11, 0xC1611DAB, 0xB6662D3D, 0x76DC4190, 0x01DB7106, 0x98D220BC, 0xEFD5102A, 0x71B18589, 0x06B6B51F, 0x9FBFE4A5, 0xE8B8D433, 0x7807C9A2, 0x0F00F934, 0x9609A88E, 0xE10E9818, 0x7F6A0DBB, 0x086D3D2D, 0x91646C97, 0xE6635C01, 0x6B6B51F4, 0x1C6C6162, 0x856530D8, 0xF262004E, 0x6C0695ED, 0x1B01A57B, 0x8208F4C1, 0xF50FC457, 0x65B0D9C6, 0x12B7E950, 0x8BBEB8EA, 0xFCB9887C, 0x62DD1DDF, 0x15DA2D49, 0x8CD37CF3, 0xFBD44C65, 0x4DB26158, 0x3AB551CE, 0xA3BC0074, 0xD4BB30E2, 0x4ADFA541, 0x3DD895D7, 0xA4D1C46D, 0xD3D6F4FB, 0x4369E96A, 0x346ED9FC, 0xAD678846, 0xDA60B8D0, 0x44042D73, 0x33031DE5, 0xAA0A4C5F, 0xDD0D7CC9, 0x5005713C, 0x270241AA, 0xBE0B1010, 0xC90C2086, 0x5768B525, 0x206F85B3, 0xB966D409, 0xCE61E49F, 0x5EDEF90E, 0x29D9C998, 0xB0D09822, 0xC7D7A8B4, 0x59B33D17, 0x2EB40D81, 0xB7BD5C3B, 0xC0BA6CAD, 0xEDB88320, 0x9ABFB3B6, 0x03B6E20C, 0x74B1D29A, 0xEAD54739, 0x9DD277AF, 0x04DB2615, 0x73DC1683, 0xE3630B12, 0x94643B84, 0x0D6D6A3E, 0x7A6A5AA8, 0xE40ECF0B, 0x9309FF9D, 0x0A00AE27, 0x7D079EB1, 0xF00F9344, 0x8708A3D2, 0x1E01F268, 0x6906C2FE, 0xF762575D, 0x806567CB, 0x196C3671, 0x6E6B06E7, 0xFED41B76, 0x89D32BE0, 0x10DA7A5A, 0x67DD4ACC, 0xF9B9DF6F, 0x8EBEEFF9, 0x17B7BE43, 0x60B08ED5, 0xD6D6A3E8, 0xA1D1937E, 0x38D8C2C4, 0x4FDFF252, 0xD1BB67F1, 0xA6BC5767, 0x3FB506DD, 0x48B2364B, 0xD80D2BDA, 0xAF0A1B4C, 0x36034AF6, 0x41047A60, 0xDF60EFC3, 0xA867DF55, 0x316E8EEF, 0x4669BE79, 0xCB61B38C, 0xBC66831A, 0x256FD2A0, 0x5268E236, 0xCC0C7795, 0xBB0B4703, 0x220216B9, 0x5505262F, 0xC5BA3BBE, 0xB2BD0B28, 0x2BB45A92, 0x5CB36A04, 0xC2D7FFA7, 0xB5D0CF31, 0x2CD99E8B, 0x5BDEAE1D, 0x9B64C2B0, 0xEC63F226, 0x756AA39C, 0x026D930A, 0x9C0906A9, 0xEB0E363F, 0x72076785, 0x05005713, 0x95BF4A82, 0xE2B87A14, 0x7BB12BAE, 0x0CB61B38, 0x92D28E9B, 0xE5D5BE0D, 0x7CDCEFB7, 0x0BDBDF21, 0x86D3D2D4, 0xF1D4E242, 0x68DDB3F8, 0x1FDA836E, 0x81BE16CD, 0xF6B9265B, 0x6FB077E1, 0x18B74777, 0x88085AE6, 0xFF0F6A70, 0x66063BCA, 0x11010B5C, 0x8F659EFF, 0xF862AE69, 0x616BFFD3, 0x166CCF45, 0xA00AE278, 0xD70DD2EE, 0x4E048354, 0x3903B3C2, 0xA7672661, 0xD06016F7, 0x4969474D, 0x3E6E77DB, 0xAED16A4A, 0xD9D65ADC, 0x40DF0B66, 0x37D83BF0, 0xA9BCAE53, 0xDEBB9EC5, 0x47B2CF7F, 0x30B5FFE9, 0xBDBDF21C, 0xCABAC28A, 0x53B39330, 0x24B4A3A6, 0xBAD03605, 0xCDD70693, 0x54DE5729, 0x23D967BF, 0xB3667A2E, 0xC4614AB8, 0x5D681B02, 0x2A6F2B94, 0xB40BBE37, 0xC30C8EA1, 0x5A05DF1B, 0x2D02EF8D], crc32: function crc32(data) { var tbl = util.crypto.crc32Table; var crc = 0 ^ -1; if (typeof data === 'string') { data = util.buffer.toBuffer(data); } for (var i = 0; i < data.length; i++) { var code = data.readUInt8(i); crc = (crc >>> 8) ^ tbl[(crc ^ code) & 0xFF]; } return (crc ^ -1) >>> 0; }, hmac: function hmac(key, string, digest, fn) { if (!digest) digest = 'binary'; if (digest === 'buffer') { digest = undefined; } if (!fn) fn = 'sha256'; if (typeof string === 'string') string = util.buffer.toBuffer(string); return util.crypto.lib.createHmac(fn, key).update(string).digest(digest); }, md5: function md5(data, digest, callback) { return util.crypto.hash('md5', data, digest, callback); }, sha256: function sha256(data, digest, callback) { return util.crypto.hash('sha256', data, digest, callback); }, hash: function(algorithm, data, digest, callback) { var hash = util.crypto.createHash(algorithm); if (!digest) { digest = 'binary'; } if (digest === 'buffer') { digest = undefined; } if (typeof data === 'string') data = util.buffer.toBuffer(data); var sliceFn = util.arraySliceFn(data); var isBuffer = util.Buffer.isBuffer(data); //Identifying objects with an ArrayBuffer as buffers if (util.isBrowser() && typeof ArrayBuffer !== 'undefined' && data && data.buffer instanceof ArrayBuffer) isBuffer = true; if (callback && typeof data === 'object' && typeof data.on === 'function' && !isBuffer) { data.on('data', function(chunk) { hash.update(chunk); }); data.on('error', function(err) { callback(err); }); data.on('end', function() { callback(null, hash.digest(digest)); }); } else if (callback && sliceFn && !isBuffer && typeof FileReader !== 'undefined') { // this might be a File/Blob var index = 0, size = 1024 * 512; var reader = new FileReader(); reader.onerror = function() { callback(new Error('Failed to read data.')); }; reader.onload = function() { var buf = new util.Buffer(new Uint8Array(reader.result)); hash.update(buf); index += buf.length; reader._continueReading(); }; reader._continueReading = function() { if (index >= data.size) { callback(null, hash.digest(digest)); return; } var back = index + size; if (back > data.size) back = data.size; reader.readAsArrayBuffer(sliceFn.call(data, index, back)); }; reader._continueReading(); } else { if (util.isBrowser() && typeof data === 'object' && !isBuffer) { data = new util.Buffer(new Uint8Array(data)); } var out = hash.update(data).digest(digest); if (callback) callback(null, out); return out; } }, toHex: function toHex(data) { var out = []; for (var i = 0; i < data.length; i++) { out.push(('0' + data.charCodeAt(i).toString(16)).substr(-2, 2)); } return out.join(''); }, createHash: function createHash(algorithm) { return util.crypto.lib.createHash(algorithm); } }, /** @!ignore */ /* Abort constant */ abort: {}, each: function each(object, iterFunction) { for (var key in object) { if (Object.prototype.hasOwnProperty.call(object, key)) { var ret = iterFunction.call(this, key, object[key]); if (ret === util.abort) break; } } }, arrayEach: function arrayEach(array, iterFunction) { for (var idx in array) { if (Object.prototype.hasOwnProperty.call(array, idx)) { var ret = iterFunction.call(this, array[idx], parseInt(idx, 10)); if (ret === util.abort) break; } } }, update: function update(obj1, obj2) { util.each(obj2, function iterator(key, item) { obj1[key] = item; }); return obj1; }, merge: function merge(obj1, obj2) { return util.update(util.copy(obj1), obj2); }, copy: function copy(object) { if (object === null || object === undefined) return object; var dupe = {}; // jshint forin:false for (var key in object) { dupe[key] = object[key]; } return dupe; }, isEmpty: function isEmpty(obj) { for (var prop in obj) { if (Object.prototype.hasOwnProperty.call(obj, prop)) { return false; } } return true; }, arraySliceFn: function arraySliceFn(obj) { var fn = obj.slice || obj.webkitSlice || obj.mozSlice; return typeof fn === 'function' ? fn : null; }, isType: function isType(obj, type) { // handle cross-"frame" objects if (typeof type === 'function') type = util.typeName(type); return Object.prototype.toString.call(obj) === '[object ' + type + ']'; }, typeName: function typeName(type) { if (Object.prototype.hasOwnProperty.call(type, 'name')) return type.name; var str = type.toString(); var match = str.match(/^\s*function (.+)\(/); return match ? match[1] : str; }, error: function error(err, options) { var originalError = null; if (typeof err.message === 'string' && err.message !== '') { if (typeof options === 'string' || (options && options.message)) { originalError = util.copy(err); originalError.message = err.message; } } err.message = err.message || null; if (typeof options === 'string') { err.message = options; } else if (typeof options === 'object' && options !== null) { util.update(err, options); if (options.message) err.message = options.message; if (options.code || options.name) err.code = options.code || options.name; if (options.stack) err.stack = options.stack; } if (typeof Object.defineProperty === 'function') { Object.defineProperty(err, 'name', {writable: true, enumerable: false}); Object.defineProperty(err, 'message', {enumerable: true}); } err.name = String(options && options.name || err.name || err.code || 'Error'); err.time = new Date(); if (originalError) err.originalError = originalError; return err; }, /** * @api private */ inherit: function inherit(klass, features) { var newObject = null; if (features === undefined) { features = klass; klass = Object; newObject = {}; } else { var ctor = function ConstructorWrapper() {}; ctor.prototype = klass.prototype; newObject = new ctor(); } // constructor not supplied, create pass-through ctor if (features.constructor === Object) { features.constructor = function() { if (klass !== Object) { return klass.apply(this, arguments); } }; } features.constructor.prototype = newObject; util.update(features.constructor.prototype, features); features.constructor.__super__ = klass; return features.constructor; }, /** * @api private */ mixin: function mixin() { var klass = arguments[0]; for (var i = 1; i < arguments.length; i++) { // jshint forin:false for (var prop in arguments[i].prototype) { var fn = arguments[i].prototype[prop]; if (prop !== 'constructor') { klass.prototype[prop] = fn; } } } return klass; }, /** * @api private */ hideProperties: function hideProperties(obj, props) { if (typeof Object.defineProperty !== 'function') return; util.arrayEach(props, function (key) { Object.defineProperty(obj, key, { enumerable: false, writable: true, configurable: true }); }); }, /** * @api private */ property: function property(obj, name, value, enumerable, isValue) { var opts = { configurable: true, enumerable: enumerable !== undefined ? enumerable : true }; if (typeof value === 'function' && !isValue) { opts.get = value; } else { opts.value = value; opts.writable = true; } Object.defineProperty(obj, name, opts); }, /** * @api private */ memoizedProperty: function memoizedProperty(obj, name, get, enumerable) { var cachedValue = null; // build enumerable attribute for each value with lazy accessor. util.property(obj, name, function() { if (cachedValue === null) { cachedValue = get(); } return cachedValue; }, enumerable); }, /** * TODO Remove in major version revision * This backfill populates response data without the * top-level payload name. * * @api private */ hoistPayloadMember: function hoistPayloadMember(resp) { var req = resp.request; var operationName = req.operation; var operation = req.service.api.operations[operationName]; var output = operation.output; if (output.payload && !operation.hasEventOutput) { var payloadMember = output.members[output.payload]; var responsePayload = resp.data[output.payload]; if (payloadMember.type === 'structure') { util.each(responsePayload, function(key, value) { util.property(resp.data, key, value, false); }); } } }, /** * Compute SHA-256 checksums of streams * * @api private */ computeSha256: function computeSha256(body, done) { if (util.isNode()) { var Stream = util.stream.Stream; var fs = __webpack_require__(35747); if (typeof Stream === 'function' && body instanceof Stream) { if (typeof body.path === 'string') { // assume file object var settings = {}; if (typeof body.start === 'number') { settings.start = body.start; } if (typeof body.end === 'number') { settings.end = body.end; } body = fs.createReadStream(body.path, settings); } else { // TODO support other stream types return done(new Error('Non-file stream objects are ' + 'not supported with SigV4')); } } } util.crypto.sha256(body, 'hex', function(err, sha) { if (err) done(err); else done(null, sha); }); }, /** * @api private */ isClockSkewed: function isClockSkewed(serverTime) { if (serverTime) { util.property(AWS.config, 'isClockSkewed', Math.abs(new Date().getTime() - serverTime) >= 300000, false); return AWS.config.isClockSkewed; } }, applyClockOffset: function applyClockOffset(serverTime) { if (serverTime) AWS.config.systemClockOffset = serverTime - new Date().getTime(); }, /** * @api private */ extractRequestId: function extractRequestId(resp) { var requestId = resp.httpResponse.headers['x-amz-request-id'] || resp.httpResponse.headers['x-amzn-requestid']; if (!requestId && resp.data && resp.data.ResponseMetadata) { requestId = resp.data.ResponseMetadata.RequestId; } if (requestId) { resp.requestId = requestId; } if (resp.error) { resp.error.requestId = requestId; } }, /** * @api private */ addPromises: function addPromises(constructors, PromiseDependency) { var deletePromises = false; if (PromiseDependency === undefined && AWS && AWS.config) { PromiseDependency = AWS.config.getPromisesDependency(); } if (PromiseDependency === undefined && typeof Promise !== 'undefined') { PromiseDependency = Promise; } if (typeof PromiseDependency !== 'function') deletePromises = true; if (!Array.isArray(constructors)) constructors = [constructors]; for (var ind = 0; ind < constructors.length; ind++) { var constructor = constructors[ind]; if (deletePromises) { if (constructor.deletePromisesFromClass) { constructor.deletePromisesFromClass(); } } else if (constructor.addPromisesToClass) { constructor.addPromisesToClass(PromiseDependency); } } }, /** * @api private * Return a function that will return a promise whose fate is decided by the * callback behavior of the given method with `methodName`. The method to be * promisified should conform to node.js convention of accepting a callback as * last argument and calling that callback with error as the first argument * and success value on the second argument. */ promisifyMethod: function promisifyMethod(methodName, PromiseDependency) { return function promise() { var self = this; var args = Array.prototype.slice.call(arguments); return new PromiseDependency(function(resolve, reject) { args.push(function(err, data) { if (err) { reject(err); } else { resolve(data); } }); self[methodName].apply(self, args); }); }; }, /** * @api private */ isDualstackAvailable: function isDualstackAvailable(service) { if (!service) return false; var metadata = __webpack_require__(49497); if (typeof service !== 'string') service = service.serviceIdentifier; if (typeof service !== 'string' || !metadata.hasOwnProperty(service)) return false; return !!metadata[service].dualstackAvailable; }, /** * @api private */ calculateRetryDelay: function calculateRetryDelay(retryCount, retryDelayOptions, err) { if (!retryDelayOptions) retryDelayOptions = {}; var customBackoff = retryDelayOptions.customBackoff || null; if (typeof customBackoff === 'function') { return customBackoff(retryCount, err); } var base = typeof retryDelayOptions.base === 'number' ? retryDelayOptions.base : 100; var delay = Math.random() * (Math.pow(2, retryCount) * base); return delay; }, /** * @api private */ handleRequestWithRetries: function handleRequestWithRetries(httpRequest, options, cb) { if (!options) options = {}; var http = AWS.HttpClient.getInstance(); var httpOptions = options.httpOptions || {}; var retryCount = 0; var errCallback = function(err) { var maxRetries = options.maxRetries || 0; if (err && err.code === 'TimeoutError') err.retryable = true; // Call `calculateRetryDelay()` only when relevant, see #3401 if (err && err.retryable && retryCount < maxRetries) { var delay = util.calculateRetryDelay(retryCount, options.retryDelayOptions, err); if (delay >= 0) { retryCount++; setTimeout(sendRequest, delay + (err.retryAfter || 0)); return; } } cb(err); }; var sendRequest = function() { var data = ''; http.handleRequest(httpRequest, httpOptions, function(httpResponse) { httpResponse.on('data', function(chunk) { data += chunk.toString(); }); httpResponse.on('end', function() { var statusCode = httpResponse.statusCode; if (statusCode < 300) { cb(null, data); } else { var retryAfter = parseInt(httpResponse.headers['retry-after'], 10) * 1000 || 0; var err = util.error(new Error(), { statusCode: statusCode, retryable: statusCode >= 500 || statusCode === 429 } ); if (retryAfter && err.retryable) err.retryAfter = retryAfter; errCallback(err); } }); }, errCallback); }; AWS.util.defer(sendRequest); }, /** * @api private */ uuid: { v4: function uuidV4() { return __webpack_require__(2155).v4(); } }, /** * @api private */ convertPayloadToString: function convertPayloadToString(resp) { var req = resp.request; var operation = req.operation; var rules = req.service.api.operations[operation].output || {}; if (rules.payload && resp.data[rules.payload]) { resp.data[rules.payload] = resp.data[rules.payload].toString(); } }, /** * @api private */ defer: function defer(callback) { if (typeof process === 'object' && typeof process.nextTick === 'function') { process.nextTick(callback); } else if (typeof setImmediate === 'function') { setImmediate(callback); } else { setTimeout(callback, 0); } }, /** * @api private */ getRequestPayloadShape: function getRequestPayloadShape(req) { var operations = req.service.api.operations; if (!operations) return undefined; var operation = (operations || {})[req.operation]; if (!operation || !operation.input || !operation.input.payload) return undefined; return operation.input.members[operation.input.payload]; }, getProfilesFromSharedConfig: function getProfilesFromSharedConfig(iniLoader, filename) { var profiles = {}; var profilesFromConfig = {}; if (process.env[util.configOptInEnv]) { var profilesFromConfig = iniLoader.loadFrom({ isConfig: true, filename: process.env[util.sharedConfigFileEnv] }); } var profilesFromCreds= {}; try { var profilesFromCreds = iniLoader.loadFrom({ filename: filename || (process.env[util.configOptInEnv] && process.env[util.sharedCredentialsFileEnv]) }); } catch (error) { // if using config, assume it is fully descriptive without a credentials file: if (!process.env[util.configOptInEnv]) throw error; } for (var i = 0, profileNames = Object.keys(profilesFromConfig); i < profileNames.length; i++) { profiles[profileNames[i]] = objectAssign(profiles[profileNames[i]] || {}, profilesFromConfig[profileNames[i]]); } for (var i = 0, profileNames = Object.keys(profilesFromCreds); i < profileNames.length; i++) { profiles[profileNames[i]] = objectAssign(profiles[profileNames[i]] || {}, profilesFromCreds[profileNames[i]]); } return profiles; /** * Roughly the semantics of `Object.assign(target, source)` */ function objectAssign(target, source) { for (var i = 0, keys = Object.keys(source); i < keys.length; i++) { target[keys[i]] = source[keys[i]]; } return target; } }, /** * @api private */ ARN: { validate: function validateARN(str) { return str && str.indexOf('arn:') === 0 && str.split(':').length >= 6; }, parse: function parseARN(arn) { var matched = arn.split(':'); return { partition: matched[1], service: matched[2], region: matched[3], accountId: matched[4], resource: matched.slice(5).join(':') }; }, build: function buildARN(arnObject) { if ( arnObject.service === undefined || arnObject.region === undefined || arnObject.accountId === undefined || arnObject.resource === undefined ) throw util.error(new Error('Input ARN object is invalid')); return 'arn:'+ (arnObject.partition || 'aws') + ':' + arnObject.service + ':' + arnObject.region + ':' + arnObject.accountId + ':' + arnObject.resource; } }, /** * @api private */ defaultProfile: 'default', /** * @api private */ configOptInEnv: 'AWS_SDK_LOAD_CONFIG', /** * @api private */ sharedCredentialsFileEnv: 'AWS_SHARED_CREDENTIALS_FILE', /** * @api private */ sharedConfigFileEnv: 'AWS_CONFIG_FILE', /** * @api private */ imdsDisabledEnv: 'AWS_EC2_METADATA_DISABLED' }; /** * @api private */ module.exports = util; /***/ }), /***/ 23546: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { var util = __webpack_require__(77985); var XmlNode = __webpack_require__(20397).XmlNode; var XmlText = __webpack_require__(90971).XmlText; function XmlBuilder() { } XmlBuilder.prototype.toXML = function(params, shape, rootElement, noEmpty) { var xml = new XmlNode(rootElement); applyNamespaces(xml, shape, true); serialize(xml, params, shape); return xml.children.length > 0 || noEmpty ? xml.toString() : ''; }; function serialize(xml, value, shape) { switch (shape.type) { case 'structure': return serializeStructure(xml, value, shape); case 'map': return serializeMap(xml, value, shape); case 'list': return serializeList(xml, value, shape); default: return serializeScalar(xml, value, shape); } } function serializeStructure(xml, params, shape) { util.arrayEach(shape.memberNames, function(memberName) { var memberShape = shape.members[memberName]; if (memberShape.location !== 'body') return; var value = params[memberName]; var name = memberShape.name; if (value !== undefined && value !== null) { if (memberShape.isXmlAttribute) { xml.addAttribute(name, value); } else if (memberShape.flattened) { serialize(xml, value, memberShape); } else { var element = new XmlNode(name); xml.addChildNode(element); applyNamespaces(element, memberShape); serialize(element, value, memberShape); } } }); } function serializeMap(xml, map, shape) { var xmlKey = shape.key.name || 'key'; var xmlValue = shape.value.name || 'value'; util.each(map, function(key, value) { var entry = new XmlNode(shape.flattened ? shape.name : 'entry'); xml.addChildNode(entry); var entryKey = new XmlNode(xmlKey); var entryValue = new XmlNode(xmlValue); entry.addChildNode(entryKey); entry.addChildNode(entryValue); serialize(entryKey, key, shape.key); serialize(entryValue, value, shape.value); }); } function serializeList(xml, list, shape) { if (shape.flattened) { util.arrayEach(list, function(value) { var name = shape.member.name || shape.name; var element = new XmlNode(name); xml.addChildNode(element); serialize(element, value, shape.member); }); } else { util.arrayEach(list, function(value) { var name = shape.member.name || 'member'; var element = new XmlNode(name); xml.addChildNode(element); serialize(element, value, shape.member); }); } } function serializeScalar(xml, value, shape) { xml.addChildNode( new XmlText(shape.toWireFormat(value)) ); } function applyNamespaces(xml, shape, isRoot) { var uri, prefix = 'xmlns'; if (shape.xmlNamespaceUri) { uri = shape.xmlNamespaceUri; if (shape.xmlNamespacePrefix) prefix += ':' + shape.xmlNamespacePrefix; } else if (isRoot && shape.api.xmlNamespaceUri) { uri = shape.api.xmlNamespaceUri; } if (uri) xml.addAttribute(prefix, uri); } /** * @api private */ module.exports = XmlBuilder; /***/ }), /***/ 98241: /***/ ((module) => { /** * Escapes characters that can not be in an XML attribute. */ function escapeAttribute(value) { return value.replace(/&/g, '&').replace(/'/g, ''').replace(//g, '>').replace(/"/g, '"'); } /** * @api private */ module.exports = { escapeAttribute: escapeAttribute }; /***/ }), /***/ 98464: /***/ ((module) => { /** * Escapes characters that can not be in an XML element. */ function escapeElement(value) { return value.replace(/&/g, '&').replace(//g, '>'); } /** * @api private */ module.exports = { escapeElement: escapeElement }; /***/ }), /***/ 96752: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { var AWS = __webpack_require__(28437); var util = AWS.util; var Shape = AWS.Model.Shape; var xml2js = __webpack_require__(66189); /** * @api private */ var options = { // options passed to xml2js parser explicitCharkey: false, // undocumented trim: false, // trim the leading/trailing whitespace from text nodes normalize: false, // trim interior whitespace inside text nodes explicitRoot: false, // return the root node in the resulting object? emptyTag: null, // the default value for empty nodes explicitArray: true, // always put child nodes in an array ignoreAttrs: false, // ignore attributes, only create text nodes mergeAttrs: false, // merge attributes and child elements validator: null // a callable validator }; function NodeXmlParser() { } NodeXmlParser.prototype.parse = function(xml, shape) { shape = shape || {}; var result = null; var error = null; var parser = new xml2js.Parser(options); parser.parseString(xml, function (e, r) { error = e; result = r; }); if (result) { var data = parseXml(result, shape); if (result.ResponseMetadata) { data.ResponseMetadata = parseXml(result.ResponseMetadata[0], {}); } return data; } else if (error) { throw util.error(error, {code: 'XMLParserError', retryable: true}); } else { // empty xml document return parseXml({}, shape); } }; function parseXml(xml, shape) { switch (shape.type) { case 'structure': return parseStructure(xml, shape); case 'map': return parseMap(xml, shape); case 'list': return parseList(xml, shape); case undefined: case null: return parseUnknown(xml); default: return parseScalar(xml, shape); } } function parseStructure(xml, shape) { var data = {}; if (xml === null) return data; util.each(shape.members, function(memberName, memberShape) { var xmlName = memberShape.name; if (Object.prototype.hasOwnProperty.call(xml, xmlName) && Array.isArray(xml[xmlName])) { var xmlChild = xml[xmlName]; if (!memberShape.flattened) xmlChild = xmlChild[0]; data[memberName] = parseXml(xmlChild, memberShape); } else if (memberShape.isXmlAttribute && xml.$ && Object.prototype.hasOwnProperty.call(xml.$, xmlName)) { data[memberName] = parseScalar(xml.$[xmlName], memberShape); } else if (memberShape.type === 'list' && !shape.api.xmlNoDefaultLists) { data[memberName] = memberShape.defaultValue; } }); return data; } function parseMap(xml, shape) { var data = {}; if (xml === null) return data; var xmlKey = shape.key.name || 'key'; var xmlValue = shape.value.name || 'value'; var iterable = shape.flattened ? xml : xml.entry; if (Array.isArray(iterable)) { util.arrayEach(iterable, function(child) { data[child[xmlKey][0]] = parseXml(child[xmlValue][0], shape.value); }); } return data; } function parseList(xml, shape) { var data = []; var name = shape.member.name || 'member'; if (shape.flattened) { util.arrayEach(xml, function(xmlChild) { data.push(parseXml(xmlChild, shape.member)); }); } else if (xml && Array.isArray(xml[name])) { util.arrayEach(xml[name], function(child) { data.push(parseXml(child, shape.member)); }); } return data; } function parseScalar(text, shape) { if (text && text.$ && text.$.encoding === 'base64') { shape = new Shape.create({type: text.$.encoding}); } if (text && text._) text = text._; if (typeof shape.toType === 'function') { return shape.toType(text); } else { return text; } } function parseUnknown(xml) { if (xml === undefined || xml === null) return ''; if (typeof xml === 'string') return xml; // parse a list if (Array.isArray(xml)) { var arr = []; for (i = 0; i < xml.length; i++) { arr.push(parseXml(xml[i], {})); } return arr; } // empty object var keys = Object.keys(xml), i; if (keys.length === 0 || (keys.length === 1 && keys[0] === '$')) { return {}; } // object, parse as structure var data = {}; for (i = 0; i < keys.length; i++) { var key = keys[i], value = xml[key]; if (key === '$') continue; if (value.length > 1) { // this member is a list data[key] = parseList(value, {member: {}}); } else { // this member is a single item data[key] = parseXml(value[0], {}); } } return data; } /** * @api private */ module.exports = NodeXmlParser; /***/ }), /***/ 20397: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { var escapeAttribute = __webpack_require__(98241).escapeAttribute; /** * Represents an XML node. * @api private */ function XmlNode(name, children) { if (children === void 0) { children = []; } this.name = name; this.children = children; this.attributes = {}; } XmlNode.prototype.addAttribute = function (name, value) { this.attributes[name] = value; return this; }; XmlNode.prototype.addChildNode = function (child) { this.children.push(child); return this; }; XmlNode.prototype.removeAttribute = function (name) { delete this.attributes[name]; return this; }; XmlNode.prototype.toString = function () { var hasChildren = Boolean(this.children.length); var xmlText = '<' + this.name; // add attributes var attributes = this.attributes; for (var i = 0, attributeNames = Object.keys(attributes); i < attributeNames.length; i++) { var attributeName = attributeNames[i]; var attribute = attributes[attributeName]; if (typeof attribute !== 'undefined' && attribute !== null) { xmlText += ' ' + attributeName + '=\"' + escapeAttribute('' + attribute) + '\"'; } } return xmlText += !hasChildren ? '/>' : '>' + this.children.map(function (c) { return c.toString(); }).join('') + ''; }; /** * @api private */ module.exports = { XmlNode: XmlNode }; /***/ }), /***/ 90971: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { var escapeElement = __webpack_require__(98464).escapeElement; /** * Represents an XML text value. * @api private */ function XmlText(value) { this.value = value; } XmlText.prototype.toString = function () { return escapeElement('' + this.value); }; /** * @api private */ module.exports = { XmlText: XmlText }; /***/ }), /***/ 96323: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; var __webpack_unused_export__; __webpack_unused_export__ = ({ value: true }); var LRU_1 = __webpack_require__(77710); var CACHE_SIZE = 1000; /** * Inspired node-lru-cache[https://github.com/isaacs/node-lru-cache] */ var EndpointCache = /** @class */ (function () { function EndpointCache(maxSize) { if (maxSize === void 0) { maxSize = CACHE_SIZE; } this.maxSize = maxSize; this.cache = new LRU_1.LRUCache(maxSize); } ; Object.defineProperty(EndpointCache.prototype, "size", { get: function () { return this.cache.length; }, enumerable: true, configurable: true }); EndpointCache.prototype.put = function (key, value) { var keyString = typeof key !== 'string' ? EndpointCache.getKeyString(key) : key; var endpointRecord = this.populateValue(value); this.cache.put(keyString, endpointRecord); }; EndpointCache.prototype.get = function (key) { var keyString = typeof key !== 'string' ? EndpointCache.getKeyString(key) : key; var now = Date.now(); var records = this.cache.get(keyString); if (records) { for (var i = 0; i < records.length; i++) { var record = records[i]; if (record.Expire < now) { this.cache.remove(keyString); return undefined; } } } return records; }; EndpointCache.getKeyString = function (key) { var identifiers = []; var identifierNames = Object.keys(key).sort(); for (var i = 0; i < identifierNames.length; i++) { var identifierName = identifierNames[i]; if (key[identifierName] === undefined) continue; identifiers.push(key[identifierName]); } return identifiers.join(' '); }; EndpointCache.prototype.populateValue = function (endpoints) { var now = Date.now(); return endpoints.map(function (endpoint) { return ({ Address: endpoint.Address || '', Expire: now + (endpoint.CachePeriodInMinutes || 1) * 60 * 1000 }); }); }; EndpointCache.prototype.empty = function () { this.cache.empty(); }; EndpointCache.prototype.remove = function (key) { var keyString = typeof key !== 'string' ? EndpointCache.getKeyString(key) : key; this.cache.remove(keyString); }; return EndpointCache; }()); exports.$ = EndpointCache; /***/ }), /***/ 77710: /***/ ((__unused_webpack_module, exports) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); var LinkedListNode = /** @class */ (function () { function LinkedListNode(key, value) { this.key = key; this.value = value; } return LinkedListNode; }()); var LRUCache = /** @class */ (function () { function LRUCache(size) { this.nodeMap = {}; this.size = 0; if (typeof size !== 'number' || size < 1) { throw new Error('Cache size can only be positive number'); } this.sizeLimit = size; } Object.defineProperty(LRUCache.prototype, "length", { get: function () { return this.size; }, enumerable: true, configurable: true }); LRUCache.prototype.prependToList = function (node) { if (!this.headerNode) { this.tailNode = node; } else { this.headerNode.prev = node; node.next = this.headerNode; } this.headerNode = node; this.size++; }; LRUCache.prototype.removeFromTail = function () { if (!this.tailNode) { return undefined; } var node = this.tailNode; var prevNode = node.prev; if (prevNode) { prevNode.next = undefined; } node.prev = undefined; this.tailNode = prevNode; this.size--; return node; }; LRUCache.prototype.detachFromList = function (node) { if (this.headerNode === node) { this.headerNode = node.next; } if (this.tailNode === node) { this.tailNode = node.prev; } if (node.prev) { node.prev.next = node.next; } if (node.next) { node.next.prev = node.prev; } node.next = undefined; node.prev = undefined; this.size--; }; LRUCache.prototype.get = function (key) { if (this.nodeMap[key]) { var node = this.nodeMap[key]; this.detachFromList(node); this.prependToList(node); return node.value; } }; LRUCache.prototype.remove = function (key) { if (this.nodeMap[key]) { var node = this.nodeMap[key]; this.detachFromList(node); delete this.nodeMap[key]; } }; LRUCache.prototype.put = function (key, value) { if (this.nodeMap[key]) { this.remove(key); } else if (this.size === this.sizeLimit) { var tailNode = this.removeFromTail(); var key_1 = tailNode.key; delete this.nodeMap[key_1]; } var newNode = new LinkedListNode(key, value); this.nodeMap[key] = newNode; this.prependToList(newNode); }; LRUCache.prototype.empty = function () { var keys = Object.keys(this.nodeMap); for (var i = 0; i < keys.length; i++) { var key = keys[i]; var node = this.nodeMap[key]; this.detachFromList(node); delete this.nodeMap[key]; } }; return LRUCache; }()); exports.LRUCache = LRUCache; /***/ }), /***/ 96342: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { /*! * Copyright 2010 LearnBoost * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /** * Module dependencies. */ var crypto = __webpack_require__(33373) , parse = __webpack_require__(78835).parse ; /** * Valid keys. */ var keys = [ 'acl' , 'location' , 'logging' , 'notification' , 'partNumber' , 'policy' , 'requestPayment' , 'torrent' , 'uploadId' , 'uploads' , 'versionId' , 'versioning' , 'versions' , 'website' ] /** * Return an "Authorization" header value with the given `options` * in the form of "AWS :" * * @param {Object} options * @return {String} * @api private */ function authorization (options) { return 'AWS ' + options.key + ':' + sign(options) } module.exports = authorization module.exports.authorization = authorization /** * Simple HMAC-SHA1 Wrapper * * @param {Object} options * @return {String} * @api private */ function hmacSha1 (options) { return crypto.createHmac('sha1', options.secret).update(options.message).digest('base64') } module.exports.hmacSha1 = hmacSha1 /** * Create a base64 sha1 HMAC for `options`. * * @param {Object} options * @return {String} * @api private */ function sign (options) { options.message = stringToSign(options) return hmacSha1(options) } module.exports.sign = sign /** * Create a base64 sha1 HMAC for `options`. * * Specifically to be used with S3 presigned URLs * * @param {Object} options * @return {String} * @api private */ function signQuery (options) { options.message = queryStringToSign(options) return hmacSha1(options) } module.exports.signQuery= signQuery /** * Return a string for sign() with the given `options`. * * Spec: * * \n * \n * \n * \n * [headers\n] * * * @param {Object} options * @return {String} * @api private */ function stringToSign (options) { var headers = options.amazonHeaders || '' if (headers) headers += '\n' var r = [ options.verb , options.md5 , options.contentType , options.date ? options.date.toUTCString() : '' , headers + options.resource ] return r.join('\n') } module.exports.stringToSign = stringToSign /** * Return a string for sign() with the given `options`, but is meant exclusively * for S3 presigned URLs * * Spec: * * \n * * * @param {Object} options * @return {String} * @api private */ function queryStringToSign (options){ return 'GET\n\n\n' + options.date + '\n' + options.resource } module.exports.queryStringToSign = queryStringToSign /** * Perform the following: * * - ignore non-amazon headers * - lowercase fields * - sort lexicographically * - trim whitespace between ":" * - join with newline * * @param {Object} headers * @return {String} * @api private */ function canonicalizeHeaders (headers) { var buf = [] , fields = Object.keys(headers) ; for (var i = 0, len = fields.length; i < len; ++i) { var field = fields[i] , val = headers[field] , field = field.toLowerCase() ; if (0 !== field.indexOf('x-amz')) continue buf.push(field + ':' + val) } return buf.sort().join('\n') } module.exports.canonicalizeHeaders = canonicalizeHeaders /** * Perform the following: * * - ignore non sub-resources * - sort lexicographically * * @param {String} resource * @return {String} * @api private */ function canonicalizeResource (resource) { var url = parse(resource, true) , path = url.pathname , buf = [] ; Object.keys(url.query).forEach(function(key){ if (!~keys.indexOf(key)) return var val = '' == url.query[key] ? '' : '=' + encodeURIComponent(url.query[key]) buf.push(key + val) }) return path + (buf.length ? '?' + buf.sort().join('&') : '') } module.exports.canonicalizeResource = canonicalizeResource /***/ }), /***/ 16071: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { var aws4 = exports, url = __webpack_require__(78835), querystring = __webpack_require__(71191), crypto = __webpack_require__(33373), lru = __webpack_require__(74225), credentialsCache = lru(1000) // http://docs.amazonwebservices.com/general/latest/gr/signature-version-4.html function hmac(key, string, encoding) { return crypto.createHmac('sha256', key).update(string, 'utf8').digest(encoding) } function hash(string, encoding) { return crypto.createHash('sha256').update(string, 'utf8').digest(encoding) } // This function assumes the string has already been percent encoded function encodeRfc3986(urlEncodedString) { return urlEncodedString.replace(/[!'()*]/g, function(c) { return '%' + c.charCodeAt(0).toString(16).toUpperCase() }) } function encodeRfc3986Full(str) { return encodeRfc3986(encodeURIComponent(str)) } // A bit of a combination of: // https://github.com/aws/aws-sdk-java-v2/blob/dc695de6ab49ad03934e1b02e7263abbd2354be0/core/auth/src/main/java/software/amazon/awssdk/auth/signer/internal/AbstractAws4Signer.java#L59 // https://github.com/aws/aws-sdk-js/blob/18cb7e5b463b46239f9fdd4a65e2ff8c81831e8f/lib/signers/v4.js#L191-L199 // https://github.com/mhart/aws4fetch/blob/b3aed16b6f17384cf36ea33bcba3c1e9f3bdfefd/src/main.js#L25-L34 var HEADERS_TO_IGNORE = { 'authorization': true, 'connection': true, 'x-amzn-trace-id': true, 'user-agent': true, 'expect': true, 'presigned-expires': true, 'range': true, } // request: { path | body, [host], [method], [headers], [service], [region] } // credentials: { accessKeyId, secretAccessKey, [sessionToken] } function RequestSigner(request, credentials) { if (typeof request === 'string') request = url.parse(request) var headers = request.headers = (request.headers || {}), hostParts = (!this.service || !this.region) && this.matchHost(request.hostname || request.host || headers.Host || headers.host) this.request = request this.credentials = credentials || this.defaultCredentials() this.service = request.service || hostParts[0] || '' this.region = request.region || hostParts[1] || 'us-east-1' // SES uses a different domain from the service name if (this.service === 'email') this.service = 'ses' if (!request.method && request.body) request.method = 'POST' if (!headers.Host && !headers.host) { headers.Host = request.hostname || request.host || this.createHost() // If a port is specified explicitly, use it as is if (request.port) headers.Host += ':' + request.port } if (!request.hostname && !request.host) request.hostname = headers.Host || headers.host this.isCodeCommitGit = this.service === 'codecommit' && request.method === 'GIT' } RequestSigner.prototype.matchHost = function(host) { var match = (host || '').match(/([^\.]+)\.(?:([^\.]*)\.)?amazonaws\.com(\.cn)?$/) var hostParts = (match || []).slice(1, 3) // ES's hostParts are sometimes the other way round, if the value that is expected // to be region equals ‘es’ switch them back // e.g. search-cluster-name-aaaa00aaaa0aaa0aaaaaaa0aaa.us-east-1.es.amazonaws.com if (hostParts[1] === 'es') hostParts = hostParts.reverse() if (hostParts[1] == 's3') { hostParts[0] = 's3' hostParts[1] = 'us-east-1' } else { for (var i = 0; i < 2; i++) { if (/^s3-/.test(hostParts[i])) { hostParts[1] = hostParts[i].slice(3) hostParts[0] = 's3' break } } } return hostParts } // http://docs.aws.amazon.com/general/latest/gr/rande.html RequestSigner.prototype.isSingleRegion = function() { // Special case for S3 and SimpleDB in us-east-1 if (['s3', 'sdb'].indexOf(this.service) >= 0 && this.region === 'us-east-1') return true return ['cloudfront', 'ls', 'route53', 'iam', 'importexport', 'sts'] .indexOf(this.service) >= 0 } RequestSigner.prototype.createHost = function() { var region = this.isSingleRegion() ? '' : '.' + this.region, subdomain = this.service === 'ses' ? 'email' : this.service return subdomain + region + '.amazonaws.com' } RequestSigner.prototype.prepareRequest = function() { this.parsePath() var request = this.request, headers = request.headers, query if (request.signQuery) { this.parsedPath.query = query = this.parsedPath.query || {} if (this.credentials.sessionToken) query['X-Amz-Security-Token'] = this.credentials.sessionToken if (this.service === 's3' && !query['X-Amz-Expires']) query['X-Amz-Expires'] = 86400 if (query['X-Amz-Date']) this.datetime = query['X-Amz-Date'] else query['X-Amz-Date'] = this.getDateTime() query['X-Amz-Algorithm'] = 'AWS4-HMAC-SHA256' query['X-Amz-Credential'] = this.credentials.accessKeyId + '/' + this.credentialString() query['X-Amz-SignedHeaders'] = this.signedHeaders() } else { if (!request.doNotModifyHeaders && !this.isCodeCommitGit) { if (request.body && !headers['Content-Type'] && !headers['content-type']) headers['Content-Type'] = 'application/x-www-form-urlencoded; charset=utf-8' if (request.body && !headers['Content-Length'] && !headers['content-length']) headers['Content-Length'] = Buffer.byteLength(request.body) if (this.credentials.sessionToken && !headers['X-Amz-Security-Token'] && !headers['x-amz-security-token']) headers['X-Amz-Security-Token'] = this.credentials.sessionToken if (this.service === 's3' && !headers['X-Amz-Content-Sha256'] && !headers['x-amz-content-sha256']) headers['X-Amz-Content-Sha256'] = hash(this.request.body || '', 'hex') if (headers['X-Amz-Date'] || headers['x-amz-date']) this.datetime = headers['X-Amz-Date'] || headers['x-amz-date'] else headers['X-Amz-Date'] = this.getDateTime() } delete headers.Authorization delete headers.authorization } } RequestSigner.prototype.sign = function() { if (!this.parsedPath) this.prepareRequest() if (this.request.signQuery) { this.parsedPath.query['X-Amz-Signature'] = this.signature() } else { this.request.headers.Authorization = this.authHeader() } this.request.path = this.formatPath() return this.request } RequestSigner.prototype.getDateTime = function() { if (!this.datetime) { var headers = this.request.headers, date = new Date(headers.Date || headers.date || new Date) this.datetime = date.toISOString().replace(/[:\-]|\.\d{3}/g, '') // Remove the trailing 'Z' on the timestamp string for CodeCommit git access if (this.isCodeCommitGit) this.datetime = this.datetime.slice(0, -1) } return this.datetime } RequestSigner.prototype.getDate = function() { return this.getDateTime().substr(0, 8) } RequestSigner.prototype.authHeader = function() { return [ 'AWS4-HMAC-SHA256 Credential=' + this.credentials.accessKeyId + '/' + this.credentialString(), 'SignedHeaders=' + this.signedHeaders(), 'Signature=' + this.signature(), ].join(', ') } RequestSigner.prototype.signature = function() { var date = this.getDate(), cacheKey = [this.credentials.secretAccessKey, date, this.region, this.service].join(), kDate, kRegion, kService, kCredentials = credentialsCache.get(cacheKey) if (!kCredentials) { kDate = hmac('AWS4' + this.credentials.secretAccessKey, date) kRegion = hmac(kDate, this.region) kService = hmac(kRegion, this.service) kCredentials = hmac(kService, 'aws4_request') credentialsCache.set(cacheKey, kCredentials) } return hmac(kCredentials, this.stringToSign(), 'hex') } RequestSigner.prototype.stringToSign = function() { return [ 'AWS4-HMAC-SHA256', this.getDateTime(), this.credentialString(), hash(this.canonicalString(), 'hex'), ].join('\n') } RequestSigner.prototype.canonicalString = function() { if (!this.parsedPath) this.prepareRequest() var pathStr = this.parsedPath.path, query = this.parsedPath.query, headers = this.request.headers, queryStr = '', normalizePath = this.service !== 's3', decodePath = this.service === 's3' || this.request.doNotEncodePath, decodeSlashesInPath = this.service === 's3', firstValOnly = this.service === 's3', bodyHash if (this.service === 's3' && this.request.signQuery) { bodyHash = 'UNSIGNED-PAYLOAD' } else if (this.isCodeCommitGit) { bodyHash = '' } else { bodyHash = headers['X-Amz-Content-Sha256'] || headers['x-amz-content-sha256'] || hash(this.request.body || '', 'hex') } if (query) { var reducedQuery = Object.keys(query).reduce(function(obj, key) { if (!key) return obj obj[encodeRfc3986Full(key)] = !Array.isArray(query[key]) ? query[key] : (firstValOnly ? query[key][0] : query[key]) return obj }, {}) var encodedQueryPieces = [] Object.keys(reducedQuery).sort().forEach(function(key) { if (!Array.isArray(reducedQuery[key])) { encodedQueryPieces.push(key + '=' + encodeRfc3986Full(reducedQuery[key])) } else { reducedQuery[key].map(encodeRfc3986Full).sort() .forEach(function(val) { encodedQueryPieces.push(key + '=' + val) }) } }) queryStr = encodedQueryPieces.join('&') } if (pathStr !== '/') { if (normalizePath) pathStr = pathStr.replace(/\/{2,}/g, '/') pathStr = pathStr.split('/').reduce(function(path, piece) { if (normalizePath && piece === '..') { path.pop() } else if (!normalizePath || piece !== '.') { if (decodePath) piece = decodeURIComponent(piece.replace(/\+/g, ' ')) path.push(encodeRfc3986Full(piece)) } return path }, []).join('/') if (pathStr[0] !== '/') pathStr = '/' + pathStr if (decodeSlashesInPath) pathStr = pathStr.replace(/%2F/g, '/') } return [ this.request.method || 'GET', pathStr, queryStr, this.canonicalHeaders() + '\n', this.signedHeaders(), bodyHash, ].join('\n') } RequestSigner.prototype.canonicalHeaders = function() { var headers = this.request.headers function trimAll(header) { return header.toString().trim().replace(/\s+/g, ' ') } return Object.keys(headers) .filter(function(key) { return HEADERS_TO_IGNORE[key.toLowerCase()] == null }) .sort(function(a, b) { return a.toLowerCase() < b.toLowerCase() ? -1 : 1 }) .map(function(key) { return key.toLowerCase() + ':' + trimAll(headers[key]) }) .join('\n') } RequestSigner.prototype.signedHeaders = function() { return Object.keys(this.request.headers) .map(function(key) { return key.toLowerCase() }) .filter(function(key) { return HEADERS_TO_IGNORE[key] == null }) .sort() .join(';') } RequestSigner.prototype.credentialString = function() { return [ this.getDate(), this.region, this.service, 'aws4_request', ].join('/') } RequestSigner.prototype.defaultCredentials = function() { var env = process.env return { accessKeyId: env.AWS_ACCESS_KEY_ID || env.AWS_ACCESS_KEY, secretAccessKey: env.AWS_SECRET_ACCESS_KEY || env.AWS_SECRET_KEY, sessionToken: env.AWS_SESSION_TOKEN, } } RequestSigner.prototype.parsePath = function() { var path = this.request.path || '/' // S3 doesn't always encode characters > 127 correctly and // all services don't encode characters > 255 correctly // So if there are non-reserved chars (and it's not already all % encoded), just encode them all if (/[^0-9A-Za-z;,/?:@&=+$\-_.!~*'()#%]/.test(path)) { path = encodeURI(decodeURI(path)) } var queryIx = path.indexOf('?'), query = null if (queryIx >= 0) { query = querystring.parse(path.slice(queryIx + 1)) path = path.slice(0, queryIx) } this.parsedPath = { path: path, query: query, } } RequestSigner.prototype.formatPath = function() { var path = this.parsedPath.path, query = this.parsedPath.query if (!query) return path // Services don't support empty query string keys if (query[''] != null) delete query[''] return path + '?' + encodeRfc3986(querystring.stringify(query)) } aws4.RequestSigner = RequestSigner aws4.sign = function(request, credentials) { return new RequestSigner(request, credentials).sign() } /***/ }), /***/ 74225: /***/ ((module) => { module.exports = function(size) { return new LruCache(size) } function LruCache(size) { this.capacity = size | 0 this.map = Object.create(null) this.list = new DoublyLinkedList() } LruCache.prototype.get = function(key) { var node = this.map[key] if (node == null) return undefined this.used(node) return node.val } LruCache.prototype.set = function(key, val) { var node = this.map[key] if (node != null) { node.val = val } else { if (!this.capacity) this.prune() if (!this.capacity) return false node = new DoublyLinkedNode(key, val) this.map[key] = node this.capacity-- } this.used(node) return true } LruCache.prototype.used = function(node) { this.list.moveToFront(node) } LruCache.prototype.prune = function() { var node = this.list.pop() if (node != null) { delete this.map[node.key] this.capacity++ } } function DoublyLinkedList() { this.firstNode = null this.lastNode = null } DoublyLinkedList.prototype.moveToFront = function(node) { if (this.firstNode == node) return this.remove(node) if (this.firstNode == null) { this.firstNode = node this.lastNode = node node.prev = null node.next = null } else { node.prev = null node.next = this.firstNode node.next.prev = node this.firstNode = node } } DoublyLinkedList.prototype.pop = function() { var lastNode = this.lastNode if (lastNode != null) { this.remove(lastNode) } return lastNode } DoublyLinkedList.prototype.remove = function(node) { if (this.firstNode == node) { this.firstNode = node.next } else if (node.prev != null) { node.prev.next = node.next } if (this.lastNode == node) { this.lastNode = node.prev } else if (node.next != null) { node.next.prev = node.prev } } function DoublyLinkedNode(key, val) { this.key = key this.val = val this.prev = null this.next = null } /***/ }), /***/ 9417: /***/ ((module) => { "use strict"; module.exports = balanced; function balanced(a, b, str) { if (a instanceof RegExp) a = maybeMatch(a, str); if (b instanceof RegExp) b = maybeMatch(b, str); var r = range(a, b, str); return r && { start: r[0], end: r[1], pre: str.slice(0, r[0]), body: str.slice(r[0] + a.length, r[1]), post: str.slice(r[1] + b.length) }; } function maybeMatch(reg, str) { var m = str.match(reg); return m ? m[0] : null; } balanced.range = range; function range(a, b, str) { var begs, beg, left, right, result; var ai = str.indexOf(a); var bi = str.indexOf(b, ai + 1); var i = ai; if (ai >= 0 && bi > 0) { if(a===b) { return [ai, bi]; } begs = []; left = str.length; while (i >= 0 && !result) { if (i == ai) { begs.push(i); ai = str.indexOf(a, i + 1); } else if (begs.length == 1) { result = [ begs.pop(), bi ]; } else { beg = begs.pop(); if (beg < left) { left = beg; right = bi; } bi = str.indexOf(b, i + 1); } i = ai < bi && ai >= 0 ? ai : bi; } if (begs.length) { result = [ left, right ]; } } return result; } /***/ }), /***/ 85848: /***/ (function(module, exports, __webpack_require__) { /* module decorator */ module = __webpack_require__.nmd(module); /*! https://mths.be/base64 v1.0.0 by @mathias | MIT license */ ;(function(root) { // Detect free variables `exports`. var freeExports = true && exports; // Detect free variable `module`. var freeModule = true && module && module.exports == freeExports && module; // Detect free variable `global`, from Node.js or Browserified code, and use // it as `root`. var freeGlobal = typeof global == 'object' && global; if (freeGlobal.global === freeGlobal || freeGlobal.window === freeGlobal) { root = freeGlobal; } /*--------------------------------------------------------------------------*/ var InvalidCharacterError = function(message) { this.message = message; }; InvalidCharacterError.prototype = new Error; InvalidCharacterError.prototype.name = 'InvalidCharacterError'; var error = function(message) { // Note: the error messages used throughout this file match those used by // the native `atob`/`btoa` implementation in Chromium. throw new InvalidCharacterError(message); }; var TABLE = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/'; // http://whatwg.org/html/common-microsyntaxes.html#space-character var REGEX_SPACE_CHARACTERS = /[\t\n\f\r ]/g; // `decode` is designed to be fully compatible with `atob` as described in the // HTML Standard. http://whatwg.org/html/webappapis.html#dom-windowbase64-atob // The optimized base64-decoding algorithm used is based on @atk’s excellent // implementation. https://gist.github.com/atk/1020396 var decode = function(input) { input = String(input) .replace(REGEX_SPACE_CHARACTERS, ''); var length = input.length; if (length % 4 == 0) { input = input.replace(/==?$/, ''); length = input.length; } if ( length % 4 == 1 || // http://whatwg.org/C#alphanumeric-ascii-characters /[^+a-zA-Z0-9/]/.test(input) ) { error( 'Invalid character: the string to be decoded is not correctly encoded.' ); } var bitCounter = 0; var bitStorage; var buffer; var output = ''; var position = -1; while (++position < length) { buffer = TABLE.indexOf(input.charAt(position)); bitStorage = bitCounter % 4 ? bitStorage * 64 + buffer : buffer; // Unless this is the first of a group of 4 characters… if (bitCounter++ % 4) { // …convert the first 8 bits to a single ASCII character. output += String.fromCharCode( 0xFF & bitStorage >> (-2 * bitCounter & 6) ); } } return output; }; // `encode` is designed to be fully compatible with `btoa` as described in the // HTML Standard: http://whatwg.org/html/webappapis.html#dom-windowbase64-btoa var encode = function(input) { input = String(input); if (/[^\0-\xFF]/.test(input)) { // Note: no need to special-case astral symbols here, as surrogates are // matched, and the input is supposed to only contain ASCII anyway. error( 'The string to be encoded contains characters outside of the ' + 'Latin1 range.' ); } var padding = input.length % 3; var output = ''; var position = -1; var a; var b; var c; var buffer; // Make sure any padding is handled outside of the loop. var length = input.length - padding; while (++position < length) { // Read three bytes, i.e. 24 bits. a = input.charCodeAt(position) << 16; b = input.charCodeAt(++position) << 8; c = input.charCodeAt(++position); buffer = a + b + c; // Turn the 24 bits into four chunks of 6 bits each, and append the // matching character for each of them to the output. output += ( TABLE.charAt(buffer >> 18 & 0x3F) + TABLE.charAt(buffer >> 12 & 0x3F) + TABLE.charAt(buffer >> 6 & 0x3F) + TABLE.charAt(buffer & 0x3F) ); } if (padding == 2) { a = input.charCodeAt(position) << 8; b = input.charCodeAt(++position); buffer = a + b; output += ( TABLE.charAt(buffer >> 10) + TABLE.charAt((buffer >> 4) & 0x3F) + TABLE.charAt((buffer << 2) & 0x3F) + '=' ); } else if (padding == 1) { buffer = input.charCodeAt(position); output += ( TABLE.charAt(buffer >> 2) + TABLE.charAt((buffer << 4) & 0x3F) + '==' ); } return output; }; var base64 = { 'encode': encode, 'decode': decode, 'version': '1.0.0' }; // Some AMD build optimizers, like r.js, check for specific condition patterns // like the following: if ( typeof define == 'function' && typeof define.amd == 'object' && define.amd ) { define(function() { return base64; }); } else if (freeExports && !freeExports.nodeType) { if (freeModule) { // in Node.js or RingoJS v0.8.0+ freeModule.exports = base64; } else { // in Narwhal or RingoJS v0.7.0- for (var key in base64) { base64.hasOwnProperty(key) && (freeExports[key] = base64[key]); } } } else { // in Rhino or a web browser root.base64 = base64; } }(this)); /***/ }), /***/ 18348: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; var __webpack_unused_export__; __webpack_unused_export__ = ({ value: true }); var pad_string_1 = __webpack_require__(14155); function encode(input, encoding) { if (encoding === void 0) { encoding = "utf8"; } if (Buffer.isBuffer(input)) { return fromBase64(input.toString("base64")); } return fromBase64(Buffer.from(input, encoding).toString("base64")); } ; function decode(base64url, encoding) { if (encoding === void 0) { encoding = "utf8"; } return Buffer.from(toBase64(base64url), "base64").toString(encoding); } function toBase64(base64url) { base64url = base64url.toString(); return pad_string_1.default(base64url) .replace(/\-/g, "+") .replace(/_/g, "/"); } function fromBase64(base64) { return base64 .replace(/=/g, "") .replace(/\+/g, "-") .replace(/\//g, "_"); } function toBuffer(base64url) { return Buffer.from(toBase64(base64url), "base64"); } var base64url = encode; base64url.encode = encode; base64url.decode = decode; base64url.toBase64 = toBase64; base64url.fromBase64 = fromBase64; base64url.toBuffer = toBuffer; exports.default = base64url; /***/ }), /***/ 14155: /***/ ((__unused_webpack_module, exports) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); function padString(input) { var segmentLength = 4; var stringLength = input.length; var diff = stringLength % segmentLength; if (!diff) { return input; } var position = stringLength; var padLength = segmentLength - diff; var paddedStringLength = stringLength + padLength; var buffer = Buffer.alloc(paddedStringLength); buffer.write(input); while (padLength--) { buffer.write("=", position++); } return buffer.toString(); } exports.default = padString; /***/ }), /***/ 27291: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { module.exports = __webpack_require__(18348).default; module.exports.default = module.exports; /***/ }), /***/ 45447: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; var crypto_hash_sha512 = __webpack_require__(68729).lowlevel.crypto_hash; /* * This file is a 1:1 port from the OpenBSD blowfish.c and bcrypt_pbkdf.c. As a * result, it retains the original copyright and license. The two files are * under slightly different (but compatible) licenses, and are here combined in * one file. * * Credit for the actual porting work goes to: * Devi Mandiri */ /* * The Blowfish portions are under the following license: * * Blowfish block cipher for OpenBSD * Copyright 1997 Niels Provos * All rights reserved. * * Implementation advice by David Mazieres . * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * 3. The name of the author may not be used to endorse or promote products * derived from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /* * The bcrypt_pbkdf portions are under the following license: * * Copyright (c) 2013 Ted Unangst * * Permission to use, copy, modify, and distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ /* * Performance improvements (Javascript-specific): * * Copyright 2016, Joyent Inc * Author: Alex Wilson * * Permission to use, copy, modify, and distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ // Ported from OpenBSD bcrypt_pbkdf.c v1.9 var BLF_J = 0; var Blowfish = function() { this.S = [ new Uint32Array([ 0xd1310ba6, 0x98dfb5ac, 0x2ffd72db, 0xd01adfb7, 0xb8e1afed, 0x6a267e96, 0xba7c9045, 0xf12c7f99, 0x24a19947, 0xb3916cf7, 0x0801f2e2, 0x858efc16, 0x636920d8, 0x71574e69, 0xa458fea3, 0xf4933d7e, 0x0d95748f, 0x728eb658, 0x718bcd58, 0x82154aee, 0x7b54a41d, 0xc25a59b5, 0x9c30d539, 0x2af26013, 0xc5d1b023, 0x286085f0, 0xca417918, 0xb8db38ef, 0x8e79dcb0, 0x603a180e, 0x6c9e0e8b, 0xb01e8a3e, 0xd71577c1, 0xbd314b27, 0x78af2fda, 0x55605c60, 0xe65525f3, 0xaa55ab94, 0x57489862, 0x63e81440, 0x55ca396a, 0x2aab10b6, 0xb4cc5c34, 0x1141e8ce, 0xa15486af, 0x7c72e993, 0xb3ee1411, 0x636fbc2a, 0x2ba9c55d, 0x741831f6, 0xce5c3e16, 0x9b87931e, 0xafd6ba33, 0x6c24cf5c, 0x7a325381, 0x28958677, 0x3b8f4898, 0x6b4bb9af, 0xc4bfe81b, 0x66282193, 0x61d809cc, 0xfb21a991, 0x487cac60, 0x5dec8032, 0xef845d5d, 0xe98575b1, 0xdc262302, 0xeb651b88, 0x23893e81, 0xd396acc5, 0x0f6d6ff3, 0x83f44239, 0x2e0b4482, 0xa4842004, 0x69c8f04a, 0x9e1f9b5e, 0x21c66842, 0xf6e96c9a, 0x670c9c61, 0xabd388f0, 0x6a51a0d2, 0xd8542f68, 0x960fa728, 0xab5133a3, 0x6eef0b6c, 0x137a3be4, 0xba3bf050, 0x7efb2a98, 0xa1f1651d, 0x39af0176, 0x66ca593e, 0x82430e88, 0x8cee8619, 0x456f9fb4, 0x7d84a5c3, 0x3b8b5ebe, 0xe06f75d8, 0x85c12073, 0x401a449f, 0x56c16aa6, 0x4ed3aa62, 0x363f7706, 0x1bfedf72, 0x429b023d, 0x37d0d724, 0xd00a1248, 0xdb0fead3, 0x49f1c09b, 0x075372c9, 0x80991b7b, 0x25d479d8, 0xf6e8def7, 0xe3fe501a, 0xb6794c3b, 0x976ce0bd, 0x04c006ba, 0xc1a94fb6, 0x409f60c4, 0x5e5c9ec2, 0x196a2463, 0x68fb6faf, 0x3e6c53b5, 0x1339b2eb, 0x3b52ec6f, 0x6dfc511f, 0x9b30952c, 0xcc814544, 0xaf5ebd09, 0xbee3d004, 0xde334afd, 0x660f2807, 0x192e4bb3, 0xc0cba857, 0x45c8740f, 0xd20b5f39, 0xb9d3fbdb, 0x5579c0bd, 0x1a60320a, 0xd6a100c6, 0x402c7279, 0x679f25fe, 0xfb1fa3cc, 0x8ea5e9f8, 0xdb3222f8, 0x3c7516df, 0xfd616b15, 0x2f501ec8, 0xad0552ab, 0x323db5fa, 0xfd238760, 0x53317b48, 0x3e00df82, 0x9e5c57bb, 0xca6f8ca0, 0x1a87562e, 0xdf1769db, 0xd542a8f6, 0x287effc3, 0xac6732c6, 0x8c4f5573, 0x695b27b0, 0xbbca58c8, 0xe1ffa35d, 0xb8f011a0, 0x10fa3d98, 0xfd2183b8, 0x4afcb56c, 0x2dd1d35b, 0x9a53e479, 0xb6f84565, 0xd28e49bc, 0x4bfb9790, 0xe1ddf2da, 0xa4cb7e33, 0x62fb1341, 0xcee4c6e8, 0xef20cada, 0x36774c01, 0xd07e9efe, 0x2bf11fb4, 0x95dbda4d, 0xae909198, 0xeaad8e71, 0x6b93d5a0, 0xd08ed1d0, 0xafc725e0, 0x8e3c5b2f, 0x8e7594b7, 0x8ff6e2fb, 0xf2122b64, 0x8888b812, 0x900df01c, 0x4fad5ea0, 0x688fc31c, 0xd1cff191, 0xb3a8c1ad, 0x2f2f2218, 0xbe0e1777, 0xea752dfe, 0x8b021fa1, 0xe5a0cc0f, 0xb56f74e8, 0x18acf3d6, 0xce89e299, 0xb4a84fe0, 0xfd13e0b7, 0x7cc43b81, 0xd2ada8d9, 0x165fa266, 0x80957705, 0x93cc7314, 0x211a1477, 0xe6ad2065, 0x77b5fa86, 0xc75442f5, 0xfb9d35cf, 0xebcdaf0c, 0x7b3e89a0, 0xd6411bd3, 0xae1e7e49, 0x00250e2d, 0x2071b35e, 0x226800bb, 0x57b8e0af, 0x2464369b, 0xf009b91e, 0x5563911d, 0x59dfa6aa, 0x78c14389, 0xd95a537f, 0x207d5ba2, 0x02e5b9c5, 0x83260376, 0x6295cfa9, 0x11c81968, 0x4e734a41, 0xb3472dca, 0x7b14a94a, 0x1b510052, 0x9a532915, 0xd60f573f, 0xbc9bc6e4, 0x2b60a476, 0x81e67400, 0x08ba6fb5, 0x571be91f, 0xf296ec6b, 0x2a0dd915, 0xb6636521, 0xe7b9f9b6, 0xff34052e, 0xc5855664, 0x53b02d5d, 0xa99f8fa1, 0x08ba4799, 0x6e85076a]), new Uint32Array([ 0x4b7a70e9, 0xb5b32944, 0xdb75092e, 0xc4192623, 0xad6ea6b0, 0x49a7df7d, 0x9cee60b8, 0x8fedb266, 0xecaa8c71, 0x699a17ff, 0x5664526c, 0xc2b19ee1, 0x193602a5, 0x75094c29, 0xa0591340, 0xe4183a3e, 0x3f54989a, 0x5b429d65, 0x6b8fe4d6, 0x99f73fd6, 0xa1d29c07, 0xefe830f5, 0x4d2d38e6, 0xf0255dc1, 0x4cdd2086, 0x8470eb26, 0x6382e9c6, 0x021ecc5e, 0x09686b3f, 0x3ebaefc9, 0x3c971814, 0x6b6a70a1, 0x687f3584, 0x52a0e286, 0xb79c5305, 0xaa500737, 0x3e07841c, 0x7fdeae5c, 0x8e7d44ec, 0x5716f2b8, 0xb03ada37, 0xf0500c0d, 0xf01c1f04, 0x0200b3ff, 0xae0cf51a, 0x3cb574b2, 0x25837a58, 0xdc0921bd, 0xd19113f9, 0x7ca92ff6, 0x94324773, 0x22f54701, 0x3ae5e581, 0x37c2dadc, 0xc8b57634, 0x9af3dda7, 0xa9446146, 0x0fd0030e, 0xecc8c73e, 0xa4751e41, 0xe238cd99, 0x3bea0e2f, 0x3280bba1, 0x183eb331, 0x4e548b38, 0x4f6db908, 0x6f420d03, 0xf60a04bf, 0x2cb81290, 0x24977c79, 0x5679b072, 0xbcaf89af, 0xde9a771f, 0xd9930810, 0xb38bae12, 0xdccf3f2e, 0x5512721f, 0x2e6b7124, 0x501adde6, 0x9f84cd87, 0x7a584718, 0x7408da17, 0xbc9f9abc, 0xe94b7d8c, 0xec7aec3a, 0xdb851dfa, 0x63094366, 0xc464c3d2, 0xef1c1847, 0x3215d908, 0xdd433b37, 0x24c2ba16, 0x12a14d43, 0x2a65c451, 0x50940002, 0x133ae4dd, 0x71dff89e, 0x10314e55, 0x81ac77d6, 0x5f11199b, 0x043556f1, 0xd7a3c76b, 0x3c11183b, 0x5924a509, 0xf28fe6ed, 0x97f1fbfa, 0x9ebabf2c, 0x1e153c6e, 0x86e34570, 0xeae96fb1, 0x860e5e0a, 0x5a3e2ab3, 0x771fe71c, 0x4e3d06fa, 0x2965dcb9, 0x99e71d0f, 0x803e89d6, 0x5266c825, 0x2e4cc978, 0x9c10b36a, 0xc6150eba, 0x94e2ea78, 0xa5fc3c53, 0x1e0a2df4, 0xf2f74ea7, 0x361d2b3d, 0x1939260f, 0x19c27960, 0x5223a708, 0xf71312b6, 0xebadfe6e, 0xeac31f66, 0xe3bc4595, 0xa67bc883, 0xb17f37d1, 0x018cff28, 0xc332ddef, 0xbe6c5aa5, 0x65582185, 0x68ab9802, 0xeecea50f, 0xdb2f953b, 0x2aef7dad, 0x5b6e2f84, 0x1521b628, 0x29076170, 0xecdd4775, 0x619f1510, 0x13cca830, 0xeb61bd96, 0x0334fe1e, 0xaa0363cf, 0xb5735c90, 0x4c70a239, 0xd59e9e0b, 0xcbaade14, 0xeecc86bc, 0x60622ca7, 0x9cab5cab, 0xb2f3846e, 0x648b1eaf, 0x19bdf0ca, 0xa02369b9, 0x655abb50, 0x40685a32, 0x3c2ab4b3, 0x319ee9d5, 0xc021b8f7, 0x9b540b19, 0x875fa099, 0x95f7997e, 0x623d7da8, 0xf837889a, 0x97e32d77, 0x11ed935f, 0x16681281, 0x0e358829, 0xc7e61fd6, 0x96dedfa1, 0x7858ba99, 0x57f584a5, 0x1b227263, 0x9b83c3ff, 0x1ac24696, 0xcdb30aeb, 0x532e3054, 0x8fd948e4, 0x6dbc3128, 0x58ebf2ef, 0x34c6ffea, 0xfe28ed61, 0xee7c3c73, 0x5d4a14d9, 0xe864b7e3, 0x42105d14, 0x203e13e0, 0x45eee2b6, 0xa3aaabea, 0xdb6c4f15, 0xfacb4fd0, 0xc742f442, 0xef6abbb5, 0x654f3b1d, 0x41cd2105, 0xd81e799e, 0x86854dc7, 0xe44b476a, 0x3d816250, 0xcf62a1f2, 0x5b8d2646, 0xfc8883a0, 0xc1c7b6a3, 0x7f1524c3, 0x69cb7492, 0x47848a0b, 0x5692b285, 0x095bbf00, 0xad19489d, 0x1462b174, 0x23820e00, 0x58428d2a, 0x0c55f5ea, 0x1dadf43e, 0x233f7061, 0x3372f092, 0x8d937e41, 0xd65fecf1, 0x6c223bdb, 0x7cde3759, 0xcbee7460, 0x4085f2a7, 0xce77326e, 0xa6078084, 0x19f8509e, 0xe8efd855, 0x61d99735, 0xa969a7aa, 0xc50c06c2, 0x5a04abfc, 0x800bcadc, 0x9e447a2e, 0xc3453484, 0xfdd56705, 0x0e1e9ec9, 0xdb73dbd3, 0x105588cd, 0x675fda79, 0xe3674340, 0xc5c43465, 0x713e38d8, 0x3d28f89e, 0xf16dff20, 0x153e21e7, 0x8fb03d4a, 0xe6e39f2b, 0xdb83adf7]), new Uint32Array([ 0xe93d5a68, 0x948140f7, 0xf64c261c, 0x94692934, 0x411520f7, 0x7602d4f7, 0xbcf46b2e, 0xd4a20068, 0xd4082471, 0x3320f46a, 0x43b7d4b7, 0x500061af, 0x1e39f62e, 0x97244546, 0x14214f74, 0xbf8b8840, 0x4d95fc1d, 0x96b591af, 0x70f4ddd3, 0x66a02f45, 0xbfbc09ec, 0x03bd9785, 0x7fac6dd0, 0x31cb8504, 0x96eb27b3, 0x55fd3941, 0xda2547e6, 0xabca0a9a, 0x28507825, 0x530429f4, 0x0a2c86da, 0xe9b66dfb, 0x68dc1462, 0xd7486900, 0x680ec0a4, 0x27a18dee, 0x4f3ffea2, 0xe887ad8c, 0xb58ce006, 0x7af4d6b6, 0xaace1e7c, 0xd3375fec, 0xce78a399, 0x406b2a42, 0x20fe9e35, 0xd9f385b9, 0xee39d7ab, 0x3b124e8b, 0x1dc9faf7, 0x4b6d1856, 0x26a36631, 0xeae397b2, 0x3a6efa74, 0xdd5b4332, 0x6841e7f7, 0xca7820fb, 0xfb0af54e, 0xd8feb397, 0x454056ac, 0xba489527, 0x55533a3a, 0x20838d87, 0xfe6ba9b7, 0xd096954b, 0x55a867bc, 0xa1159a58, 0xcca92963, 0x99e1db33, 0xa62a4a56, 0x3f3125f9, 0x5ef47e1c, 0x9029317c, 0xfdf8e802, 0x04272f70, 0x80bb155c, 0x05282ce3, 0x95c11548, 0xe4c66d22, 0x48c1133f, 0xc70f86dc, 0x07f9c9ee, 0x41041f0f, 0x404779a4, 0x5d886e17, 0x325f51eb, 0xd59bc0d1, 0xf2bcc18f, 0x41113564, 0x257b7834, 0x602a9c60, 0xdff8e8a3, 0x1f636c1b, 0x0e12b4c2, 0x02e1329e, 0xaf664fd1, 0xcad18115, 0x6b2395e0, 0x333e92e1, 0x3b240b62, 0xeebeb922, 0x85b2a20e, 0xe6ba0d99, 0xde720c8c, 0x2da2f728, 0xd0127845, 0x95b794fd, 0x647d0862, 0xe7ccf5f0, 0x5449a36f, 0x877d48fa, 0xc39dfd27, 0xf33e8d1e, 0x0a476341, 0x992eff74, 0x3a6f6eab, 0xf4f8fd37, 0xa812dc60, 0xa1ebddf8, 0x991be14c, 0xdb6e6b0d, 0xc67b5510, 0x6d672c37, 0x2765d43b, 0xdcd0e804, 0xf1290dc7, 0xcc00ffa3, 0xb5390f92, 0x690fed0b, 0x667b9ffb, 0xcedb7d9c, 0xa091cf0b, 0xd9155ea3, 0xbb132f88, 0x515bad24, 0x7b9479bf, 0x763bd6eb, 0x37392eb3, 0xcc115979, 0x8026e297, 0xf42e312d, 0x6842ada7, 0xc66a2b3b, 0x12754ccc, 0x782ef11c, 0x6a124237, 0xb79251e7, 0x06a1bbe6, 0x4bfb6350, 0x1a6b1018, 0x11caedfa, 0x3d25bdd8, 0xe2e1c3c9, 0x44421659, 0x0a121386, 0xd90cec6e, 0xd5abea2a, 0x64af674e, 0xda86a85f, 0xbebfe988, 0x64e4c3fe, 0x9dbc8057, 0xf0f7c086, 0x60787bf8, 0x6003604d, 0xd1fd8346, 0xf6381fb0, 0x7745ae04, 0xd736fccc, 0x83426b33, 0xf01eab71, 0xb0804187, 0x3c005e5f, 0x77a057be, 0xbde8ae24, 0x55464299, 0xbf582e61, 0x4e58f48f, 0xf2ddfda2, 0xf474ef38, 0x8789bdc2, 0x5366f9c3, 0xc8b38e74, 0xb475f255, 0x46fcd9b9, 0x7aeb2661, 0x8b1ddf84, 0x846a0e79, 0x915f95e2, 0x466e598e, 0x20b45770, 0x8cd55591, 0xc902de4c, 0xb90bace1, 0xbb8205d0, 0x11a86248, 0x7574a99e, 0xb77f19b6, 0xe0a9dc09, 0x662d09a1, 0xc4324633, 0xe85a1f02, 0x09f0be8c, 0x4a99a025, 0x1d6efe10, 0x1ab93d1d, 0x0ba5a4df, 0xa186f20f, 0x2868f169, 0xdcb7da83, 0x573906fe, 0xa1e2ce9b, 0x4fcd7f52, 0x50115e01, 0xa70683fa, 0xa002b5c4, 0x0de6d027, 0x9af88c27, 0x773f8641, 0xc3604c06, 0x61a806b5, 0xf0177a28, 0xc0f586e0, 0x006058aa, 0x30dc7d62, 0x11e69ed7, 0x2338ea63, 0x53c2dd94, 0xc2c21634, 0xbbcbee56, 0x90bcb6de, 0xebfc7da1, 0xce591d76, 0x6f05e409, 0x4b7c0188, 0x39720a3d, 0x7c927c24, 0x86e3725f, 0x724d9db9, 0x1ac15bb4, 0xd39eb8fc, 0xed545578, 0x08fca5b5, 0xd83d7cd3, 0x4dad0fc4, 0x1e50ef5e, 0xb161e6f8, 0xa28514d9, 0x6c51133c, 0x6fd5c7e7, 0x56e14ec4, 0x362abfce, 0xddc6c837, 0xd79a3234, 0x92638212, 0x670efa8e, 0x406000e0]), new Uint32Array([ 0x3a39ce37, 0xd3faf5cf, 0xabc27737, 0x5ac52d1b, 0x5cb0679e, 0x4fa33742, 0xd3822740, 0x99bc9bbe, 0xd5118e9d, 0xbf0f7315, 0xd62d1c7e, 0xc700c47b, 0xb78c1b6b, 0x21a19045, 0xb26eb1be, 0x6a366eb4, 0x5748ab2f, 0xbc946e79, 0xc6a376d2, 0x6549c2c8, 0x530ff8ee, 0x468dde7d, 0xd5730a1d, 0x4cd04dc6, 0x2939bbdb, 0xa9ba4650, 0xac9526e8, 0xbe5ee304, 0xa1fad5f0, 0x6a2d519a, 0x63ef8ce2, 0x9a86ee22, 0xc089c2b8, 0x43242ef6, 0xa51e03aa, 0x9cf2d0a4, 0x83c061ba, 0x9be96a4d, 0x8fe51550, 0xba645bd6, 0x2826a2f9, 0xa73a3ae1, 0x4ba99586, 0xef5562e9, 0xc72fefd3, 0xf752f7da, 0x3f046f69, 0x77fa0a59, 0x80e4a915, 0x87b08601, 0x9b09e6ad, 0x3b3ee593, 0xe990fd5a, 0x9e34d797, 0x2cf0b7d9, 0x022b8b51, 0x96d5ac3a, 0x017da67d, 0xd1cf3ed6, 0x7c7d2d28, 0x1f9f25cf, 0xadf2b89b, 0x5ad6b472, 0x5a88f54c, 0xe029ac71, 0xe019a5e6, 0x47b0acfd, 0xed93fa9b, 0xe8d3c48d, 0x283b57cc, 0xf8d56629, 0x79132e28, 0x785f0191, 0xed756055, 0xf7960e44, 0xe3d35e8c, 0x15056dd4, 0x88f46dba, 0x03a16125, 0x0564f0bd, 0xc3eb9e15, 0x3c9057a2, 0x97271aec, 0xa93a072a, 0x1b3f6d9b, 0x1e6321f5, 0xf59c66fb, 0x26dcf319, 0x7533d928, 0xb155fdf5, 0x03563482, 0x8aba3cbb, 0x28517711, 0xc20ad9f8, 0xabcc5167, 0xccad925f, 0x4de81751, 0x3830dc8e, 0x379d5862, 0x9320f991, 0xea7a90c2, 0xfb3e7bce, 0x5121ce64, 0x774fbe32, 0xa8b6e37e, 0xc3293d46, 0x48de5369, 0x6413e680, 0xa2ae0810, 0xdd6db224, 0x69852dfd, 0x09072166, 0xb39a460a, 0x6445c0dd, 0x586cdecf, 0x1c20c8ae, 0x5bbef7dd, 0x1b588d40, 0xccd2017f, 0x6bb4e3bb, 0xdda26a7e, 0x3a59ff45, 0x3e350a44, 0xbcb4cdd5, 0x72eacea8, 0xfa6484bb, 0x8d6612ae, 0xbf3c6f47, 0xd29be463, 0x542f5d9e, 0xaec2771b, 0xf64e6370, 0x740e0d8d, 0xe75b1357, 0xf8721671, 0xaf537d5d, 0x4040cb08, 0x4eb4e2cc, 0x34d2466a, 0x0115af84, 0xe1b00428, 0x95983a1d, 0x06b89fb4, 0xce6ea048, 0x6f3f3b82, 0x3520ab82, 0x011a1d4b, 0x277227f8, 0x611560b1, 0xe7933fdc, 0xbb3a792b, 0x344525bd, 0xa08839e1, 0x51ce794b, 0x2f32c9b7, 0xa01fbac9, 0xe01cc87e, 0xbcc7d1f6, 0xcf0111c3, 0xa1e8aac7, 0x1a908749, 0xd44fbd9a, 0xd0dadecb, 0xd50ada38, 0x0339c32a, 0xc6913667, 0x8df9317c, 0xe0b12b4f, 0xf79e59b7, 0x43f5bb3a, 0xf2d519ff, 0x27d9459c, 0xbf97222c, 0x15e6fc2a, 0x0f91fc71, 0x9b941525, 0xfae59361, 0xceb69ceb, 0xc2a86459, 0x12baa8d1, 0xb6c1075e, 0xe3056a0c, 0x10d25065, 0xcb03a442, 0xe0ec6e0e, 0x1698db3b, 0x4c98a0be, 0x3278e964, 0x9f1f9532, 0xe0d392df, 0xd3a0342b, 0x8971f21e, 0x1b0a7441, 0x4ba3348c, 0xc5be7120, 0xc37632d8, 0xdf359f8d, 0x9b992f2e, 0xe60b6f47, 0x0fe3f11d, 0xe54cda54, 0x1edad891, 0xce6279cf, 0xcd3e7e6f, 0x1618b166, 0xfd2c1d05, 0x848fd2c5, 0xf6fb2299, 0xf523f357, 0xa6327623, 0x93a83531, 0x56cccd02, 0xacf08162, 0x5a75ebb5, 0x6e163697, 0x88d273cc, 0xde966292, 0x81b949d0, 0x4c50901b, 0x71c65614, 0xe6c6c7bd, 0x327a140a, 0x45e1d006, 0xc3f27b9a, 0xc9aa53fd, 0x62a80f00, 0xbb25bfe2, 0x35bdd2f6, 0x71126905, 0xb2040222, 0xb6cbcf7c, 0xcd769c2b, 0x53113ec0, 0x1640e3d3, 0x38abbd60, 0x2547adf0, 0xba38209c, 0xf746ce76, 0x77afa1c5, 0x20756060, 0x85cbfe4e, 0x8ae88dd8, 0x7aaaf9b0, 0x4cf9aa7e, 0x1948c25c, 0x02fb8a8c, 0x01c36ae4, 0xd6ebe1f9, 0x90d4f869, 0xa65cdea0, 0x3f09252d, 0xc208e69f, 0xb74e6132, 0xce77e25b, 0x578fdfe3, 0x3ac372e6]) ]; this.P = new Uint32Array([ 0x243f6a88, 0x85a308d3, 0x13198a2e, 0x03707344, 0xa4093822, 0x299f31d0, 0x082efa98, 0xec4e6c89, 0x452821e6, 0x38d01377, 0xbe5466cf, 0x34e90c6c, 0xc0ac29b7, 0xc97c50dd, 0x3f84d5b5, 0xb5470917, 0x9216d5d9, 0x8979fb1b]); }; function F(S, x8, i) { return (((S[0][x8[i+3]] + S[1][x8[i+2]]) ^ S[2][x8[i+1]]) + S[3][x8[i]]); }; Blowfish.prototype.encipher = function(x, x8) { if (x8 === undefined) { x8 = new Uint8Array(x.buffer); if (x.byteOffset !== 0) x8 = x8.subarray(x.byteOffset); } x[0] ^= this.P[0]; for (var i = 1; i < 16; i += 2) { x[1] ^= F(this.S, x8, 0) ^ this.P[i]; x[0] ^= F(this.S, x8, 4) ^ this.P[i+1]; } var t = x[0]; x[0] = x[1] ^ this.P[17]; x[1] = t; }; Blowfish.prototype.decipher = function(x) { var x8 = new Uint8Array(x.buffer); if (x.byteOffset !== 0) x8 = x8.subarray(x.byteOffset); x[0] ^= this.P[17]; for (var i = 16; i > 0; i -= 2) { x[1] ^= F(this.S, x8, 0) ^ this.P[i]; x[0] ^= F(this.S, x8, 4) ^ this.P[i-1]; } var t = x[0]; x[0] = x[1] ^ this.P[0]; x[1] = t; }; function stream2word(data, databytes){ var i, temp = 0; for (i = 0; i < 4; i++, BLF_J++) { if (BLF_J >= databytes) BLF_J = 0; temp = (temp << 8) | data[BLF_J]; } return temp; }; Blowfish.prototype.expand0state = function(key, keybytes) { var d = new Uint32Array(2), i, k; var d8 = new Uint8Array(d.buffer); for (i = 0, BLF_J = 0; i < 18; i++) { this.P[i] ^= stream2word(key, keybytes); } BLF_J = 0; for (i = 0; i < 18; i += 2) { this.encipher(d, d8); this.P[i] = d[0]; this.P[i+1] = d[1]; } for (i = 0; i < 4; i++) { for (k = 0; k < 256; k += 2) { this.encipher(d, d8); this.S[i][k] = d[0]; this.S[i][k+1] = d[1]; } } }; Blowfish.prototype.expandstate = function(data, databytes, key, keybytes) { var d = new Uint32Array(2), i, k; for (i = 0, BLF_J = 0; i < 18; i++) { this.P[i] ^= stream2word(key, keybytes); } for (i = 0, BLF_J = 0; i < 18; i += 2) { d[0] ^= stream2word(data, databytes); d[1] ^= stream2word(data, databytes); this.encipher(d); this.P[i] = d[0]; this.P[i+1] = d[1]; } for (i = 0; i < 4; i++) { for (k = 0; k < 256; k += 2) { d[0] ^= stream2word(data, databytes); d[1] ^= stream2word(data, databytes); this.encipher(d); this.S[i][k] = d[0]; this.S[i][k+1] = d[1]; } } BLF_J = 0; }; Blowfish.prototype.enc = function(data, blocks) { for (var i = 0; i < blocks; i++) { this.encipher(data.subarray(i*2)); } }; Blowfish.prototype.dec = function(data, blocks) { for (var i = 0; i < blocks; i++) { this.decipher(data.subarray(i*2)); } }; var BCRYPT_BLOCKS = 8, BCRYPT_HASHSIZE = 32; function bcrypt_hash(sha2pass, sha2salt, out) { var state = new Blowfish(), cdata = new Uint32Array(BCRYPT_BLOCKS), i, ciphertext = new Uint8Array([79,120,121,99,104,114,111,109,97,116,105, 99,66,108,111,119,102,105,115,104,83,119,97,116,68,121,110,97,109, 105,116,101]); //"OxychromaticBlowfishSwatDynamite" state.expandstate(sha2salt, 64, sha2pass, 64); for (i = 0; i < 64; i++) { state.expand0state(sha2salt, 64); state.expand0state(sha2pass, 64); } for (i = 0; i < BCRYPT_BLOCKS; i++) cdata[i] = stream2word(ciphertext, ciphertext.byteLength); for (i = 0; i < 64; i++) state.enc(cdata, cdata.byteLength / 8); for (i = 0; i < BCRYPT_BLOCKS; i++) { out[4*i+3] = cdata[i] >>> 24; out[4*i+2] = cdata[i] >>> 16; out[4*i+1] = cdata[i] >>> 8; out[4*i+0] = cdata[i]; } }; function bcrypt_pbkdf(pass, passlen, salt, saltlen, key, keylen, rounds) { var sha2pass = new Uint8Array(64), sha2salt = new Uint8Array(64), out = new Uint8Array(BCRYPT_HASHSIZE), tmpout = new Uint8Array(BCRYPT_HASHSIZE), countsalt = new Uint8Array(saltlen+4), i, j, amt, stride, dest, count, origkeylen = keylen; if (rounds < 1) return -1; if (passlen === 0 || saltlen === 0 || keylen === 0 || keylen > (out.byteLength * out.byteLength) || saltlen > (1<<20)) return -1; stride = Math.floor((keylen + out.byteLength - 1) / out.byteLength); amt = Math.floor((keylen + stride - 1) / stride); for (i = 0; i < saltlen; i++) countsalt[i] = salt[i]; crypto_hash_sha512(sha2pass, pass, passlen); for (count = 1; keylen > 0; count++) { countsalt[saltlen+0] = count >>> 24; countsalt[saltlen+1] = count >>> 16; countsalt[saltlen+2] = count >>> 8; countsalt[saltlen+3] = count; crypto_hash_sha512(sha2salt, countsalt, saltlen + 4); bcrypt_hash(sha2pass, sha2salt, tmpout); for (i = out.byteLength; i--;) out[i] = tmpout[i]; for (i = 1; i < rounds; i++) { crypto_hash_sha512(sha2salt, tmpout, tmpout.byteLength); bcrypt_hash(sha2pass, sha2salt, tmpout); for (j = 0; j < out.byteLength; j++) out[j] ^= tmpout[j]; } amt = Math.min(amt, keylen); for (i = 0; i < amt; i++) { dest = i * stride + (count - 1); if (dest >= origkeylen) break; key[dest] = out[i]; } keylen -= i; } return 0; }; module.exports = { BLOCKS: BCRYPT_BLOCKS, HASHSIZE: BCRYPT_HASHSIZE, hash: bcrypt_hash, pbkdf: bcrypt_pbkdf }; /***/ }), /***/ 33717: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { var concatMap = __webpack_require__(86891); var balanced = __webpack_require__(9417); module.exports = expandTop; var escSlash = '\0SLASH'+Math.random()+'\0'; var escOpen = '\0OPEN'+Math.random()+'\0'; var escClose = '\0CLOSE'+Math.random()+'\0'; var escComma = '\0COMMA'+Math.random()+'\0'; var escPeriod = '\0PERIOD'+Math.random()+'\0'; function numeric(str) { return parseInt(str, 10) == str ? parseInt(str, 10) : str.charCodeAt(0); } function escapeBraces(str) { return str.split('\\\\').join(escSlash) .split('\\{').join(escOpen) .split('\\}').join(escClose) .split('\\,').join(escComma) .split('\\.').join(escPeriod); } function unescapeBraces(str) { return str.split(escSlash).join('\\') .split(escOpen).join('{') .split(escClose).join('}') .split(escComma).join(',') .split(escPeriod).join('.'); } // Basically just str.split(","), but handling cases // where we have nested braced sections, which should be // treated as individual members, like {a,{b,c},d} function parseCommaParts(str) { if (!str) return ['']; var parts = []; var m = balanced('{', '}', str); if (!m) return str.split(','); var pre = m.pre; var body = m.body; var post = m.post; var p = pre.split(','); p[p.length-1] += '{' + body + '}'; var postParts = parseCommaParts(post); if (post.length) { p[p.length-1] += postParts.shift(); p.push.apply(p, postParts); } parts.push.apply(parts, p); return parts; } function expandTop(str) { if (!str) return []; // I don't know why Bash 4.3 does this, but it does. // Anything starting with {} will have the first two bytes preserved // but *only* at the top level, so {},a}b will not expand to anything, // but a{},b}c will be expanded to [a}c,abc]. // One could argue that this is a bug in Bash, but since the goal of // this module is to match Bash's rules, we escape a leading {} if (str.substr(0, 2) === '{}') { str = '\\{\\}' + str.substr(2); } return expand(escapeBraces(str), true).map(unescapeBraces); } function identity(e) { return e; } function embrace(str) { return '{' + str + '}'; } function isPadded(el) { return /^-?0\d/.test(el); } function lte(i, y) { return i <= y; } function gte(i, y) { return i >= y; } function expand(str, isTop) { var expansions = []; var m = balanced('{', '}', str); if (!m || /\$$/.test(m.pre)) return [str]; var isNumericSequence = /^-?\d+\.\.-?\d+(?:\.\.-?\d+)?$/.test(m.body); var isAlphaSequence = /^[a-zA-Z]\.\.[a-zA-Z](?:\.\.-?\d+)?$/.test(m.body); var isSequence = isNumericSequence || isAlphaSequence; var isOptions = m.body.indexOf(',') >= 0; if (!isSequence && !isOptions) { // {a},b} if (m.post.match(/,.*\}/)) { str = m.pre + '{' + m.body + escClose + m.post; return expand(str); } return [str]; } var n; if (isSequence) { n = m.body.split(/\.\./); } else { n = parseCommaParts(m.body); if (n.length === 1) { // x{{a,b}}y ==> x{a}y x{b}y n = expand(n[0], false).map(embrace); if (n.length === 1) { var post = m.post.length ? expand(m.post, false) : ['']; return post.map(function(p) { return m.pre + n[0] + p; }); } } } // at this point, n is the parts, and we know it's not a comma set // with a single entry. // no need to expand pre, since it is guaranteed to be free of brace-sets var pre = m.pre; var post = m.post.length ? expand(m.post, false) : ['']; var N; if (isSequence) { var x = numeric(n[0]); var y = numeric(n[1]); var width = Math.max(n[0].length, n[1].length) var incr = n.length == 3 ? Math.abs(numeric(n[2])) : 1; var test = lte; var reverse = y < x; if (reverse) { incr *= -1; test = gte; } var pad = n.some(isPadded); N = []; for (var i = x; test(i, y); i += incr) { var c; if (isAlphaSequence) { c = String.fromCharCode(i); if (c === '\\') c = ''; } else { c = String(i); if (pad) { var need = width - c.length; if (need > 0) { var z = new Array(need + 1).join('0'); if (i < 0) c = '-' + z + c.slice(1); else c = z + c; } } } N.push(c); } } else { N = concatMap(n, function(el) { return expand(el, false) }); } for (var j = 0; j < N.length; j++) { for (var k = 0; k < post.length; k++) { var expansion = pre + N[j] + post[k]; if (!isTop || isSequence || expansion) expansions.push(expansion); } } return expansions; } /***/ }), /***/ 24340: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; const {PassThrough: PassThroughStream} = __webpack_require__(92413); module.exports = options => { options = {...options}; const {array} = options; let {encoding} = options; const isBuffer = encoding === 'buffer'; let objectMode = false; if (array) { objectMode = !(encoding || isBuffer); } else { encoding = encoding || 'utf8'; } if (isBuffer) { encoding = null; } const stream = new PassThroughStream({objectMode}); if (encoding) { stream.setEncoding(encoding); } let length = 0; const chunks = []; stream.on('data', chunk => { chunks.push(chunk); if (objectMode) { length = chunks.length; } else { length += chunk.length; } }); stream.getBufferedValue = () => { if (array) { return chunks; } return isBuffer ? Buffer.concat(chunks, length) : chunks.join(''); }; stream.getBufferedLength = () => length; return stream; }; /***/ }), /***/ 97040: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; const {constants: BufferConstants} = __webpack_require__(64293); const pump = __webpack_require__(18341); const bufferStream = __webpack_require__(24340); class MaxBufferError extends Error { constructor() { super('maxBuffer exceeded'); this.name = 'MaxBufferError'; } } async function getStream(inputStream, options) { if (!inputStream) { return Promise.reject(new Error('Expected a stream')); } options = { maxBuffer: Infinity, ...options }; const {maxBuffer} = options; let stream; await new Promise((resolve, reject) => { const rejectPromise = error => { // Don't retrieve an oversized buffer. if (error && stream.getBufferedLength() <= BufferConstants.MAX_LENGTH) { error.bufferedData = stream.getBufferedValue(); } reject(error); }; stream = pump(inputStream, bufferStream(options), error => { if (error) { rejectPromise(error); return; } resolve(); }); stream.on('data', () => { if (stream.getBufferedLength() > maxBuffer) { rejectPromise(new MaxBufferError()); } }); }); return stream.getBufferedValue(); } module.exports = getStream; // TODO: Remove this for the next major release module.exports.default = getStream; module.exports.buffer = (stream, options) => getStream(stream, {...options, encoding: 'buffer'}); module.exports.array = (stream, options) => getStream(stream, {...options, array: true}); module.exports.MaxBufferError = MaxBufferError; /***/ }), /***/ 15993: /***/ ((module) => { "use strict"; module.exports = object => { const result = {}; for (const [key, value] of Object.entries(object)) { result[key.toLowerCase()] = value; } return result; }; /***/ }), /***/ 78116: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; const EventEmitter = __webpack_require__(28614); const urlLib = __webpack_require__(78835); const normalizeUrl = __webpack_require__(17952); const getStream = __webpack_require__(97040); const CachePolicy = __webpack_require__(61002); const Response = __webpack_require__(9004); const lowercaseKeys = __webpack_require__(15993); const cloneResponse = __webpack_require__(81312); const Keyv = __webpack_require__(51531); class CacheableRequest { constructor(request, cacheAdapter) { if (typeof request !== 'function') { throw new TypeError('Parameter `request` must be a function'); } this.cache = new Keyv({ uri: typeof cacheAdapter === 'string' && cacheAdapter, store: typeof cacheAdapter !== 'string' && cacheAdapter, namespace: 'cacheable-request' }); return this.createCacheableRequest(request); } createCacheableRequest(request) { return (opts, cb) => { let url; if (typeof opts === 'string') { url = normalizeUrlObject(urlLib.parse(opts)); opts = {}; } else if (opts instanceof urlLib.URL) { url = normalizeUrlObject(urlLib.parse(opts.toString())); opts = {}; } else { const [pathname, ...searchParts] = (opts.path || '').split('?'); const search = searchParts.length > 0 ? `?${searchParts.join('?')}` : ''; url = normalizeUrlObject({ ...opts, pathname, search }); } opts = { headers: {}, method: 'GET', cache: true, strictTtl: false, automaticFailover: false, ...opts, ...urlObjectToRequestOptions(url) }; opts.headers = lowercaseKeys(opts.headers); const ee = new EventEmitter(); const normalizedUrlString = normalizeUrl( urlLib.format(url), { stripWWW: false, removeTrailingSlash: false, stripAuthentication: false } ); const key = `${opts.method}:${normalizedUrlString}`; let revalidate = false; let madeRequest = false; const makeRequest = opts => { madeRequest = true; let requestErrored = false; let requestErrorCallback; const requestErrorPromise = new Promise(resolve => { requestErrorCallback = () => { if (!requestErrored) { requestErrored = true; resolve(); } }; }); const handler = response => { if (revalidate && !opts.forceRefresh) { response.status = response.statusCode; const revalidatedPolicy = CachePolicy.fromObject(revalidate.cachePolicy).revalidatedPolicy(opts, response); if (!revalidatedPolicy.modified) { const headers = revalidatedPolicy.policy.responseHeaders(); response = new Response(revalidate.statusCode, headers, revalidate.body, revalidate.url); response.cachePolicy = revalidatedPolicy.policy; response.fromCache = true; } } if (!response.fromCache) { response.cachePolicy = new CachePolicy(opts, response, opts); response.fromCache = false; } let clonedResponse; if (opts.cache && response.cachePolicy.storable()) { clonedResponse = cloneResponse(response); (async () => { try { const bodyPromise = getStream.buffer(response); await Promise.race([ requestErrorPromise, new Promise(resolve => response.once('end', resolve)) ]); if (requestErrored) { return; } const body = await bodyPromise; const value = { cachePolicy: response.cachePolicy.toObject(), url: response.url, statusCode: response.fromCache ? revalidate.statusCode : response.statusCode, body }; let ttl = opts.strictTtl ? response.cachePolicy.timeToLive() : undefined; if (opts.maxTtl) { ttl = ttl ? Math.min(ttl, opts.maxTtl) : opts.maxTtl; } await this.cache.set(key, value, ttl); } catch (error) { ee.emit('error', new CacheableRequest.CacheError(error)); } })(); } else if (opts.cache && revalidate) { (async () => { try { await this.cache.delete(key); } catch (error) { ee.emit('error', new CacheableRequest.CacheError(error)); } })(); } ee.emit('response', clonedResponse || response); if (typeof cb === 'function') { cb(clonedResponse || response); } }; try { const req = request(opts, handler); req.once('error', requestErrorCallback); req.once('abort', requestErrorCallback); ee.emit('request', req); } catch (error) { ee.emit('error', new CacheableRequest.RequestError(error)); } }; (async () => { const get = async opts => { await Promise.resolve(); const cacheEntry = opts.cache ? await this.cache.get(key) : undefined; if (typeof cacheEntry === 'undefined') { return makeRequest(opts); } const policy = CachePolicy.fromObject(cacheEntry.cachePolicy); if (policy.satisfiesWithoutRevalidation(opts) && !opts.forceRefresh) { const headers = policy.responseHeaders(); const response = new Response(cacheEntry.statusCode, headers, cacheEntry.body, cacheEntry.url); response.cachePolicy = policy; response.fromCache = true; ee.emit('response', response); if (typeof cb === 'function') { cb(response); } } else { revalidate = cacheEntry; opts.headers = policy.revalidationHeaders(opts); makeRequest(opts); } }; const errorHandler = error => ee.emit('error', new CacheableRequest.CacheError(error)); this.cache.once('error', errorHandler); ee.on('response', () => this.cache.removeListener('error', errorHandler)); try { await get(opts); } catch (error) { if (opts.automaticFailover && !madeRequest) { makeRequest(opts); } ee.emit('error', new CacheableRequest.CacheError(error)); } })(); return ee; }; } } function urlObjectToRequestOptions(url) { const options = { ...url }; options.path = `${url.pathname || '/'}${url.search || ''}`; delete options.pathname; delete options.search; return options; } function normalizeUrlObject(url) { // If url was parsed by url.parse or new URL: // - hostname will be set // - host will be hostname[:port] // - port will be set if it was explicit in the parsed string // Otherwise, url was from request options: // - hostname or host may be set // - host shall not have port encoded return { protocol: url.protocol, auth: url.auth, hostname: url.hostname || url.host || 'localhost', port: url.port, pathname: url.pathname, search: url.search }; } CacheableRequest.RequestError = class extends Error { constructor(error) { super(error.message); this.name = 'RequestError'; Object.assign(this, error); } }; CacheableRequest.CacheError = class extends Error { constructor(error) { super(error.message); this.name = 'CacheError'; Object.assign(this, error); } }; module.exports = CacheableRequest; /***/ }), /***/ 28803: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; var GetIntrinsic = __webpack_require__(74538); var callBind = __webpack_require__(62977); var $indexOf = callBind(GetIntrinsic('String.prototype.indexOf')); module.exports = function callBoundIntrinsic(name, allowMissing) { var intrinsic = GetIntrinsic(name, !!allowMissing); if (typeof intrinsic === 'function' && $indexOf(name, '.prototype.') > -1) { return callBind(intrinsic); } return intrinsic; }; /***/ }), /***/ 62977: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; var bind = __webpack_require__(88334); var GetIntrinsic = __webpack_require__(74538); var $apply = GetIntrinsic('%Function.prototype.apply%'); var $call = GetIntrinsic('%Function.prototype.call%'); var $reflectApply = GetIntrinsic('%Reflect.apply%', true) || bind.call($call, $apply); var $gOPD = GetIntrinsic('%Object.getOwnPropertyDescriptor%', true); var $defineProperty = GetIntrinsic('%Object.defineProperty%', true); var $max = GetIntrinsic('%Math.max%'); if ($defineProperty) { try { $defineProperty({}, 'a', { value: 1 }); } catch (e) { // IE 8 has a broken defineProperty $defineProperty = null; } } module.exports = function callBind(originalFunction) { var func = $reflectApply(bind, $call, arguments); if ($gOPD && $defineProperty) { var desc = $gOPD(func, 'length'); if (desc.configurable) { // original length, plus the receiver, minus any additional arguments (after the receiver) $defineProperty( func, 'length', { value: 1 + $max(0, originalFunction.length - (arguments.length - 1)) } ); } } return func; }; var applyBind = function applyBind() { return $reflectApply(bind, $apply, arguments); }; if ($defineProperty) { $defineProperty(module.exports, 'apply', { value: applyBind }); } else { module.exports.apply = applyBind; } /***/ }), /***/ 35684: /***/ ((module) => { function Caseless (dict) { this.dict = dict || {} } Caseless.prototype.set = function (name, value, clobber) { if (typeof name === 'object') { for (var i in name) { this.set(i, name[i], value) } } else { if (typeof clobber === 'undefined') clobber = true var has = this.has(name) if (!clobber && has) this.dict[has] = this.dict[has] + ',' + value else this.dict[has || name] = value return has } } Caseless.prototype.has = function (name) { var keys = Object.keys(this.dict) , name = name.toLowerCase() ; for (var i=0;i { "use strict"; const os = __webpack_require__(12087); const extractPathRegex = /\s+at.*(?:\(|\s)(.*)\)?/; const pathRegex = /^(?:(?:(?:node|(?:internal\/[\w/]*|.*node_modules\/(?:babel-polyfill|pirates)\/.*)?\w+)\.js:\d+:\d+)|native)/; const homeDir = typeof os.homedir === 'undefined' ? '' : os.homedir(); module.exports = (stack, options) => { options = Object.assign({pretty: false}, options); return stack.replace(/\\/g, '/') .split('\n') .filter(line => { const pathMatches = line.match(extractPathRegex); if (pathMatches === null || !pathMatches[1]) { return true; } const match = pathMatches[1]; // Electron if ( match.includes('.app/Contents/Resources/electron.asar') || match.includes('.app/Contents/Resources/default_app.asar') ) { return false; } return !pathRegex.test(match); }) .filter(line => line.trim() !== '') .map(line => { if (options.pretty) { return line.replace(extractPathRegex, (m, p1) => m.replace(p1, p1.replace(homeDir, '~'))); } return line; }) .join('\n'); }; /***/ }), /***/ 81312: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; const PassThrough = __webpack_require__(92413).PassThrough; const mimicResponse = __webpack_require__(42610); const cloneResponse = response => { if (!(response && response.pipe)) { throw new TypeError('Parameter `response` must be a response stream.'); } const clone = new PassThrough(); mimicResponse(response, clone); return response.pipe(clone); }; module.exports = cloneResponse; /***/ }), /***/ 85443: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { var util = __webpack_require__(31669); var Stream = __webpack_require__(92413).Stream; var DelayedStream = __webpack_require__(18611); module.exports = CombinedStream; function CombinedStream() { this.writable = false; this.readable = true; this.dataSize = 0; this.maxDataSize = 2 * 1024 * 1024; this.pauseStreams = true; this._released = false; this._streams = []; this._currentStream = null; this._insideLoop = false; this._pendingNext = false; } util.inherits(CombinedStream, Stream); CombinedStream.create = function(options) { var combinedStream = new this(); options = options || {}; for (var option in options) { combinedStream[option] = options[option]; } return combinedStream; }; CombinedStream.isStreamLike = function(stream) { return (typeof stream !== 'function') && (typeof stream !== 'string') && (typeof stream !== 'boolean') && (typeof stream !== 'number') && (!Buffer.isBuffer(stream)); }; CombinedStream.prototype.append = function(stream) { var isStreamLike = CombinedStream.isStreamLike(stream); if (isStreamLike) { if (!(stream instanceof DelayedStream)) { var newStream = DelayedStream.create(stream, { maxDataSize: Infinity, pauseStream: this.pauseStreams, }); stream.on('data', this._checkDataSize.bind(this)); stream = newStream; } this._handleErrors(stream); if (this.pauseStreams) { stream.pause(); } } this._streams.push(stream); return this; }; CombinedStream.prototype.pipe = function(dest, options) { Stream.prototype.pipe.call(this, dest, options); this.resume(); return dest; }; CombinedStream.prototype._getNext = function() { this._currentStream = null; if (this._insideLoop) { this._pendingNext = true; return; // defer call } this._insideLoop = true; try { do { this._pendingNext = false; this._realGetNext(); } while (this._pendingNext); } finally { this._insideLoop = false; } }; CombinedStream.prototype._realGetNext = function() { var stream = this._streams.shift(); if (typeof stream == 'undefined') { this.end(); return; } if (typeof stream !== 'function') { this._pipeNext(stream); return; } var getStream = stream; getStream(function(stream) { var isStreamLike = CombinedStream.isStreamLike(stream); if (isStreamLike) { stream.on('data', this._checkDataSize.bind(this)); this._handleErrors(stream); } this._pipeNext(stream); }.bind(this)); }; CombinedStream.prototype._pipeNext = function(stream) { this._currentStream = stream; var isStreamLike = CombinedStream.isStreamLike(stream); if (isStreamLike) { stream.on('end', this._getNext.bind(this)); stream.pipe(this, {end: false}); return; } var value = stream; this.write(value); this._getNext(); }; CombinedStream.prototype._handleErrors = function(stream) { var self = this; stream.on('error', function(err) { self._emitError(err); }); }; CombinedStream.prototype.write = function(data) { this.emit('data', data); }; CombinedStream.prototype.pause = function() { if (!this.pauseStreams) { return; } if(this.pauseStreams && this._currentStream && typeof(this._currentStream.pause) == 'function') this._currentStream.pause(); this.emit('pause'); }; CombinedStream.prototype.resume = function() { if (!this._released) { this._released = true; this.writable = true; this._getNext(); } if(this.pauseStreams && this._currentStream && typeof(this._currentStream.resume) == 'function') this._currentStream.resume(); this.emit('resume'); }; CombinedStream.prototype.end = function() { this._reset(); this.emit('end'); }; CombinedStream.prototype.destroy = function() { this._reset(); this.emit('close'); }; CombinedStream.prototype._reset = function() { this.writable = false; this._streams = []; this._currentStream = null; }; CombinedStream.prototype._checkDataSize = function() { this._updateDataSize(); if (this.dataSize <= this.maxDataSize) { return; } var message = 'DelayedStream#maxDataSize of ' + this.maxDataSize + ' bytes exceeded.'; this._emitError(new Error(message)); }; CombinedStream.prototype._updateDataSize = function() { this.dataSize = 0; var self = this; this._streams.forEach(function(stream) { if (!stream.dataSize) { return; } self.dataSize += stream.dataSize; }); if (this._currentStream && this._currentStream.dataSize) { this.dataSize += this._currentStream.dataSize; } }; CombinedStream.prototype._emitError = function(err) { this._reset(); this.emit('error', err); }; /***/ }), /***/ 86891: /***/ ((module) => { module.exports = function (xs, fn) { var res = []; for (var i = 0; i < xs.length; i++) { var x = fn(xs[i], i); if (isArray(x)) res.push.apply(res, x); else res.push(x); } return res; }; var isArray = Array.isArray || function (xs) { return Object.prototype.toString.call(xs) === '[object Array]'; }; /***/ }), /***/ 95898: /***/ ((__unused_webpack_module, exports) => { var __webpack_unused_export__; // Copyright Joyent, Inc. and other Node contributors. // // Permission is hereby granted, free of charge, to any person obtaining a // copy of this software and associated documentation files (the // "Software"), to deal in the Software without restriction, including // without limitation the rights to use, copy, modify, merge, publish, // distribute, sublicense, and/or sell copies of the Software, and to permit // persons to whom the Software is furnished to do so, subject to the // following conditions: // // The above copyright notice and this permission notice shall be included // in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS // OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN // NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, // DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE // USE OR OTHER DEALINGS IN THE SOFTWARE. // NOTE: These type checking functions intentionally don't use `instanceof` // because it is fragile and can be easily faked with `Object.create()`. function isArray(arg) { if (Array.isArray) { return Array.isArray(arg); } return objectToString(arg) === '[object Array]'; } __webpack_unused_export__ = isArray; function isBoolean(arg) { return typeof arg === 'boolean'; } __webpack_unused_export__ = isBoolean; function isNull(arg) { return arg === null; } __webpack_unused_export__ = isNull; function isNullOrUndefined(arg) { return arg == null; } __webpack_unused_export__ = isNullOrUndefined; function isNumber(arg) { return typeof arg === 'number'; } __webpack_unused_export__ = isNumber; function isString(arg) { return typeof arg === 'string'; } __webpack_unused_export__ = isString; function isSymbol(arg) { return typeof arg === 'symbol'; } __webpack_unused_export__ = isSymbol; function isUndefined(arg) { return arg === void 0; } __webpack_unused_export__ = isUndefined; function isRegExp(re) { return objectToString(re) === '[object RegExp]'; } __webpack_unused_export__ = isRegExp; function isObject(arg) { return typeof arg === 'object' && arg !== null; } __webpack_unused_export__ = isObject; function isDate(d) { return objectToString(d) === '[object Date]'; } __webpack_unused_export__ = isDate; function isError(e) { return (objectToString(e) === '[object Error]' || e instanceof Error); } exports.VZ = isError; function isFunction(arg) { return typeof arg === 'function'; } __webpack_unused_export__ = isFunction; function isPrimitive(arg) { return arg === null || typeof arg === 'boolean' || typeof arg === 'number' || typeof arg === 'string' || typeof arg === 'symbol' || // ES6 symbol typeof arg === 'undefined'; } __webpack_unused_export__ = isPrimitive; __webpack_unused_export__ = Buffer.isBuffer; function objectToString(o) { return Object.prototype.toString.call(o); } /***/ }), /***/ 82391: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; const PassThrough = __webpack_require__(92413).PassThrough; const zlib = __webpack_require__(78761); const mimicResponse = __webpack_require__(42610); module.exports = response => { // TODO: Use Array#includes when targeting Node.js 6 if (['gzip', 'deflate'].indexOf(response.headers['content-encoding']) === -1) { return response; } const unzip = zlib.createUnzip(); const stream = new PassThrough(); mimicResponse(response, stream); unzip.on('error', err => { if (err.code === 'Z_BUF_ERROR') { stream.end(); return; } stream.emit('error', err); }); response.pipe(unzip).pipe(stream); return stream; }; /***/ }), /***/ 56323: /***/ ((module) => { "use strict"; var isMergeableObject = function isMergeableObject(value) { return isNonNullObject(value) && !isSpecial(value) }; function isNonNullObject(value) { return !!value && typeof value === 'object' } function isSpecial(value) { var stringValue = Object.prototype.toString.call(value); return stringValue === '[object RegExp]' || stringValue === '[object Date]' || isReactElement(value) } // see https://github.com/facebook/react/blob/b5ac963fb791d1298e7f396236383bc955f916c1/src/isomorphic/classic/element/ReactElement.js#L21-L25 var canUseSymbol = typeof Symbol === 'function' && Symbol.for; var REACT_ELEMENT_TYPE = canUseSymbol ? Symbol.for('react.element') : 0xeac7; function isReactElement(value) { return value.$$typeof === REACT_ELEMENT_TYPE } function emptyTarget(val) { return Array.isArray(val) ? [] : {} } function cloneUnlessOtherwiseSpecified(value, options) { return (options.clone !== false && options.isMergeableObject(value)) ? deepmerge(emptyTarget(value), value, options) : value } function defaultArrayMerge(target, source, options) { return target.concat(source).map(function(element) { return cloneUnlessOtherwiseSpecified(element, options) }) } function getMergeFunction(key, options) { if (!options.customMerge) { return deepmerge } var customMerge = options.customMerge(key); return typeof customMerge === 'function' ? customMerge : deepmerge } function getEnumerableOwnPropertySymbols(target) { return Object.getOwnPropertySymbols ? Object.getOwnPropertySymbols(target).filter(function(symbol) { return target.propertyIsEnumerable(symbol) }) : [] } function getKeys(target) { return Object.keys(target).concat(getEnumerableOwnPropertySymbols(target)) } function propertyIsOnObject(object, property) { try { return property in object } catch(_) { return false } } // Protects from prototype poisoning and unexpected merging up the prototype chain. function propertyIsUnsafe(target, key) { return propertyIsOnObject(target, key) // Properties are safe to merge if they don't exist in the target yet, && !(Object.hasOwnProperty.call(target, key) // unsafe if they exist up the prototype chain, && Object.propertyIsEnumerable.call(target, key)) // and also unsafe if they're nonenumerable. } function mergeObject(target, source, options) { var destination = {}; if (options.isMergeableObject(target)) { getKeys(target).forEach(function(key) { destination[key] = cloneUnlessOtherwiseSpecified(target[key], options); }); } getKeys(source).forEach(function(key) { if (propertyIsUnsafe(target, key)) { return } if (propertyIsOnObject(target, key) && options.isMergeableObject(source[key])) { destination[key] = getMergeFunction(key, options)(target[key], source[key], options); } else { destination[key] = cloneUnlessOtherwiseSpecified(source[key], options); } }); return destination } function deepmerge(target, source, options) { options = options || {}; options.arrayMerge = options.arrayMerge || defaultArrayMerge; options.isMergeableObject = options.isMergeableObject || isMergeableObject; // cloneUnlessOtherwiseSpecified is added to `options` so that custom arrayMerge() // implementations can use it. The caller may not replace it. options.cloneUnlessOtherwiseSpecified = cloneUnlessOtherwiseSpecified; var sourceIsArray = Array.isArray(source); var targetIsArray = Array.isArray(target); var sourceAndTargetTypesMatch = sourceIsArray === targetIsArray; if (!sourceAndTargetTypesMatch) { return cloneUnlessOtherwiseSpecified(source, options) } else if (sourceIsArray) { return options.arrayMerge(target, source, options) } else { return mergeObject(target, source, options) } } deepmerge.all = function deepmergeAll(array, options) { if (!Array.isArray(array)) { throw new Error('first argument should be an array') } return array.reduce(function(prev, next) { return deepmerge(prev, next, options) }, {}) }; var deepmerge_1 = deepmerge; module.exports = deepmerge_1; /***/ }), /***/ 17611: /***/ ((module, exports, __webpack_require__) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); const tls_1 = __webpack_require__(4016); const deferToConnect = (socket, fn) => { let listeners; if (typeof fn === 'function') { const connect = fn; listeners = { connect }; } else { listeners = fn; } const hasConnectListener = typeof listeners.connect === 'function'; const hasSecureConnectListener = typeof listeners.secureConnect === 'function'; const hasCloseListener = typeof listeners.close === 'function'; const onConnect = () => { if (hasConnectListener) { listeners.connect(); } if (socket instanceof tls_1.TLSSocket && hasSecureConnectListener) { if (socket.authorized) { listeners.secureConnect(); } else if (!socket.authorizationError) { socket.once('secureConnect', listeners.secureConnect); } } if (hasCloseListener) { socket.once('close', listeners.close); } }; if (socket.writable && !socket.connecting) { onConnect(); } else if (socket.connecting) { socket.once('connect', onConnect); } else if (socket.destroyed && hasCloseListener) { listeners.close(socket._hadError); } }; exports.default = deferToConnect; // For CommonJS default export support module.exports = deferToConnect; module.exports.default = deferToConnect; /***/ }), /***/ 18611: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { var Stream = __webpack_require__(92413).Stream; var util = __webpack_require__(31669); module.exports = DelayedStream; function DelayedStream() { this.source = null; this.dataSize = 0; this.maxDataSize = 1024 * 1024; this.pauseStream = true; this._maxDataSizeExceeded = false; this._released = false; this._bufferedEvents = []; } util.inherits(DelayedStream, Stream); DelayedStream.create = function(source, options) { var delayedStream = new this(); options = options || {}; for (var option in options) { delayedStream[option] = options[option]; } delayedStream.source = source; var realEmit = source.emit; source.emit = function() { delayedStream._handleEmit(arguments); return realEmit.apply(source, arguments); }; source.on('error', function() {}); if (delayedStream.pauseStream) { source.pause(); } return delayedStream; }; Object.defineProperty(DelayedStream.prototype, 'readable', { configurable: true, enumerable: true, get: function() { return this.source.readable; } }); DelayedStream.prototype.setEncoding = function() { return this.source.setEncoding.apply(this.source, arguments); }; DelayedStream.prototype.resume = function() { if (!this._released) { this.release(); } this.source.resume(); }; DelayedStream.prototype.pause = function() { this.source.pause(); }; DelayedStream.prototype.release = function() { this._released = true; this._bufferedEvents.forEach(function(args) { this.emit.apply(this, args); }.bind(this)); this._bufferedEvents = []; }; DelayedStream.prototype.pipe = function() { var r = Stream.prototype.pipe.apply(this, arguments); this.resume(); return r; }; DelayedStream.prototype._handleEmit = function(args) { if (this._released) { this.emit.apply(this, args); return; } if (args[0] === 'data') { this.dataSize += args[1].length; this._checkIfMaxDataSizeExceeded(); } this._bufferedEvents.push(args); }; DelayedStream.prototype._checkIfMaxDataSizeExceeded = function() { if (this._maxDataSizeExceeded) { return; } if (this.dataSize <= this.maxDataSize) { return; } this._maxDataSizeExceeded = true; var message = 'DelayedStream#maxDataSize of ' + this.maxDataSize + ' bytes exceeded.' this.emit('error', new Error(message)); }; /***/ }), /***/ 18883: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { /*! * depd * Copyright(c) 2014-2018 Douglas Christopher Wilson * MIT Licensed */ /** * Module dependencies. */ var relative = __webpack_require__(85622).relative /** * Module exports. */ module.exports = depd /** * Get the path to base files on. */ var basePath = process.cwd() /** * Determine if namespace is contained in the string. */ function containsNamespace (str, namespace) { var vals = str.split(/[ ,]+/) var ns = String(namespace).toLowerCase() for (var i = 0; i < vals.length; i++) { var val = vals[i] // namespace contained if (val && (val === '*' || val.toLowerCase() === ns)) { return true } } return false } /** * Convert a data descriptor to accessor descriptor. */ function convertDataDescriptorToAccessor (obj, prop, message) { var descriptor = Object.getOwnPropertyDescriptor(obj, prop) var value = descriptor.value descriptor.get = function getter () { return value } if (descriptor.writable) { descriptor.set = function setter (val) { return (value = val) } } delete descriptor.value delete descriptor.writable Object.defineProperty(obj, prop, descriptor) return descriptor } /** * Create arguments string to keep arity. */ function createArgumentsString (arity) { var str = '' for (var i = 0; i < arity; i++) { str += ', arg' + i } return str.substr(2) } /** * Create stack string from stack. */ function createStackString (stack) { var str = this.name + ': ' + this.namespace if (this.message) { str += ' deprecated ' + this.message } for (var i = 0; i < stack.length; i++) { str += '\n at ' + stack[i].toString() } return str } /** * Create deprecate for namespace in caller. */ function depd (namespace) { if (!namespace) { throw new TypeError('argument namespace is required') } var stack = getStack() var site = callSiteLocation(stack[1]) var file = site[0] function deprecate (message) { // call to self as log log.call(deprecate, message) } deprecate._file = file deprecate._ignored = isignored(namespace) deprecate._namespace = namespace deprecate._traced = istraced(namespace) deprecate._warned = Object.create(null) deprecate.function = wrapfunction deprecate.property = wrapproperty return deprecate } /** * Determine if event emitter has listeners of a given type. * * The way to do this check is done three different ways in Node.js >= 0.8 * so this consolidates them into a minimal set using instance methods. * * @param {EventEmitter} emitter * @param {string} type * @returns {boolean} * @private */ function eehaslisteners (emitter, type) { var count = typeof emitter.listenerCount !== 'function' ? emitter.listeners(type).length : emitter.listenerCount(type) return count > 0 } /** * Determine if namespace is ignored. */ function isignored (namespace) { if (process.noDeprecation) { // --no-deprecation support return true } var str = process.env.NO_DEPRECATION || '' // namespace ignored return containsNamespace(str, namespace) } /** * Determine if namespace is traced. */ function istraced (namespace) { if (process.traceDeprecation) { // --trace-deprecation support return true } var str = process.env.TRACE_DEPRECATION || '' // namespace traced return containsNamespace(str, namespace) } /** * Display deprecation message. */ function log (message, site) { var haslisteners = eehaslisteners(process, 'deprecation') // abort early if no destination if (!haslisteners && this._ignored) { return } var caller var callFile var callSite var depSite var i = 0 var seen = false var stack = getStack() var file = this._file if (site) { // provided site depSite = site callSite = callSiteLocation(stack[1]) callSite.name = depSite.name file = callSite[0] } else { // get call site i = 2 depSite = callSiteLocation(stack[i]) callSite = depSite } // get caller of deprecated thing in relation to file for (; i < stack.length; i++) { caller = callSiteLocation(stack[i]) callFile = caller[0] if (callFile === file) { seen = true } else if (callFile === this._file) { file = this._file } else if (seen) { break } } var key = caller ? depSite.join(':') + '__' + caller.join(':') : undefined if (key !== undefined && key in this._warned) { // already warned return } this._warned[key] = true // generate automatic message from call site var msg = message if (!msg) { msg = callSite === depSite || !callSite.name ? defaultMessage(depSite) : defaultMessage(callSite) } // emit deprecation if listeners exist if (haslisteners) { var err = DeprecationError(this._namespace, msg, stack.slice(i)) process.emit('deprecation', err) return } // format and write message var format = process.stderr.isTTY ? formatColor : formatPlain var output = format.call(this, msg, caller, stack.slice(i)) process.stderr.write(output + '\n', 'utf8') } /** * Get call site location as array. */ function callSiteLocation (callSite) { var file = callSite.getFileName() || '' var line = callSite.getLineNumber() var colm = callSite.getColumnNumber() if (callSite.isEval()) { file = callSite.getEvalOrigin() + ', ' + file } var site = [file, line, colm] site.callSite = callSite site.name = callSite.getFunctionName() return site } /** * Generate a default message from the site. */ function defaultMessage (site) { var callSite = site.callSite var funcName = site.name // make useful anonymous name if (!funcName) { funcName = '' } var context = callSite.getThis() var typeName = context && callSite.getTypeName() // ignore useless type name if (typeName === 'Object') { typeName = undefined } // make useful type name if (typeName === 'Function') { typeName = context.name || typeName } return typeName && callSite.getMethodName() ? typeName + '.' + funcName : funcName } /** * Format deprecation message without color. */ function formatPlain (msg, caller, stack) { var timestamp = new Date().toUTCString() var formatted = timestamp + ' ' + this._namespace + ' deprecated ' + msg // add stack trace if (this._traced) { for (var i = 0; i < stack.length; i++) { formatted += '\n at ' + stack[i].toString() } return formatted } if (caller) { formatted += ' at ' + formatLocation(caller) } return formatted } /** * Format deprecation message with color. */ function formatColor (msg, caller, stack) { var formatted = '\x1b[36;1m' + this._namespace + '\x1b[22;39m' + // bold cyan ' \x1b[33;1mdeprecated\x1b[22;39m' + // bold yellow ' \x1b[0m' + msg + '\x1b[39m' // reset // add stack trace if (this._traced) { for (var i = 0; i < stack.length; i++) { formatted += '\n \x1b[36mat ' + stack[i].toString() + '\x1b[39m' // cyan } return formatted } if (caller) { formatted += ' \x1b[36m' + formatLocation(caller) + '\x1b[39m' // cyan } return formatted } /** * Format call site location. */ function formatLocation (callSite) { return relative(basePath, callSite[0]) + ':' + callSite[1] + ':' + callSite[2] } /** * Get the stack as array of call sites. */ function getStack () { var limit = Error.stackTraceLimit var obj = {} var prep = Error.prepareStackTrace Error.prepareStackTrace = prepareObjectStackTrace Error.stackTraceLimit = Math.max(10, limit) // capture the stack Error.captureStackTrace(obj) // slice this function off the top var stack = obj.stack.slice(1) Error.prepareStackTrace = prep Error.stackTraceLimit = limit return stack } /** * Capture call site stack from v8. */ function prepareObjectStackTrace (obj, stack) { return stack } /** * Return a wrapped function in a deprecation message. */ function wrapfunction (fn, message) { if (typeof fn !== 'function') { throw new TypeError('argument fn must be a function') } var args = createArgumentsString(fn.length) var stack = getStack() var site = callSiteLocation(stack[1]) site.name = fn.name // eslint-disable-next-line no-new-func var deprecatedfn = new Function('fn', 'log', 'deprecate', 'message', 'site', '"use strict"\n' + 'return function (' + args + ') {' + 'log.call(deprecate, message, site)\n' + 'return fn.apply(this, arguments)\n' + '}')(fn, log, this, message, site) return deprecatedfn } /** * Wrap property in a deprecation message. */ function wrapproperty (obj, prop, message) { if (!obj || (typeof obj !== 'object' && typeof obj !== 'function')) { throw new TypeError('argument obj must be object') } var descriptor = Object.getOwnPropertyDescriptor(obj, prop) if (!descriptor) { throw new TypeError('must call property on owner object') } if (!descriptor.configurable) { throw new TypeError('property must be configurable') } var deprecate = this var stack = getStack() var site = callSiteLocation(stack[1]) // set site name site.name = prop // convert data descriptor if ('value' in descriptor) { descriptor = convertDataDescriptorToAccessor(obj, prop, message) } var get = descriptor.get var set = descriptor.set // wrap getter if (typeof get === 'function') { descriptor.get = function getter () { log.call(deprecate, message, site) return get.apply(this, arguments) } } // wrap setter if (typeof set === 'function') { descriptor.set = function setter () { log.call(deprecate, message, site) return set.apply(this, arguments) } } Object.defineProperty(obj, prop, descriptor) } /** * Create DeprecationError for deprecation */ function DeprecationError (namespace, message, stack) { var error = new Error() var stackString Object.defineProperty(error, 'constructor', { value: DeprecationError }) Object.defineProperty(error, 'message', { configurable: true, enumerable: false, value: message, writable: true }) Object.defineProperty(error, 'name', { enumerable: false, configurable: true, value: 'DeprecationError', writable: true }) Object.defineProperty(error, 'namespace', { configurable: true, enumerable: false, value: namespace, writable: true }) Object.defineProperty(error, 'stack', { configurable: true, enumerable: false, get: function () { if (stackString !== undefined) { return stackString } // prepare stack trace return (stackString = createStackString.call(this, stack)) }, set: function setter (val) { stackString = val } }) return error } /***/ }), /***/ 7994: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; var stream = __webpack_require__(92413); function DuplexWrapper(options, writable, readable) { if (typeof readable === "undefined") { readable = writable; writable = options; options = null; } stream.Duplex.call(this, options); if (typeof readable.read !== "function") { readable = (new stream.Readable(options)).wrap(readable); } this._writable = writable; this._readable = readable; this._waiting = false; var self = this; writable.once("finish", function() { self.end(); }); this.once("finish", function() { writable.end(); }); readable.on("readable", function() { if (self._waiting) { self._waiting = false; self._read(); } }); readable.once("end", function() { self.push(null); }); if (!options || typeof options.bubbleErrors === "undefined" || options.bubbleErrors) { writable.on("error", function(err) { self.emit("error", err); }); readable.on("error", function(err) { self.emit("error", err); }); } } DuplexWrapper.prototype = Object.create(stream.Duplex.prototype, {constructor: {value: DuplexWrapper}}); DuplexWrapper.prototype._write = function _write(input, encoding, done) { this._writable.write(input, encoding, done); }; DuplexWrapper.prototype._read = function _read() { var buf; var reads = 0; while ((buf = this._readable.read()) !== null) { this.push(buf); reads++; } if (reads === 0) { this._waiting = true; } }; module.exports = function duplex2(options, writable, readable) { return new DuplexWrapper(options, writable, readable); }; module.exports.DuplexWrapper = DuplexWrapper; /***/ }), /***/ 49865: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { var crypto = __webpack_require__(33373); var BigInteger = __webpack_require__(85587).BigInteger; var ECPointFp = __webpack_require__(3943).ECPointFp; var Buffer = __webpack_require__(15118).Buffer; exports.ECCurves = __webpack_require__(41452); // zero prepad function unstupid(hex,len) { return (hex.length >= len) ? hex : unstupid("0"+hex,len); } exports.ECKey = function(curve, key, isPublic) { var priv; var c = curve(); var n = c.getN(); var bytes = Math.floor(n.bitLength()/8); if(key) { if(isPublic) { var curve = c.getCurve(); // var x = key.slice(1,bytes+1); // skip the 04 for uncompressed format // var y = key.slice(bytes+1); // this.P = new ECPointFp(curve, // curve.fromBigInteger(new BigInteger(x.toString("hex"), 16)), // curve.fromBigInteger(new BigInteger(y.toString("hex"), 16))); this.P = curve.decodePointHex(key.toString("hex")); }else{ if(key.length != bytes) return false; priv = new BigInteger(key.toString("hex"), 16); } }else{ var n1 = n.subtract(BigInteger.ONE); var r = new BigInteger(crypto.randomBytes(n.bitLength())); priv = r.mod(n1).add(BigInteger.ONE); this.P = c.getG().multiply(priv); } if(this.P) { // var pubhex = unstupid(this.P.getX().toBigInteger().toString(16),bytes*2)+unstupid(this.P.getY().toBigInteger().toString(16),bytes*2); // this.PublicKey = Buffer.from("04"+pubhex,"hex"); this.PublicKey = Buffer.from(c.getCurve().encodeCompressedPointHex(this.P),"hex"); } if(priv) { this.PrivateKey = Buffer.from(unstupid(priv.toString(16),bytes*2),"hex"); this.deriveSharedSecret = function(key) { if(!key || !key.P) return false; var S = key.P.multiply(priv); return Buffer.from(unstupid(S.getX().toBigInteger().toString(16),bytes*2),"hex"); } } } /***/ }), /***/ 3943: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { // Basic Javascript Elliptic Curve implementation // Ported loosely from BouncyCastle's Java EC code // Only Fp curves implemented for now // Requires jsbn.js and jsbn2.js var BigInteger = __webpack_require__(85587).BigInteger var Barrett = BigInteger.prototype.Barrett // ---------------- // ECFieldElementFp // constructor function ECFieldElementFp(q,x) { this.x = x; // TODO if(x.compareTo(q) >= 0) error this.q = q; } function feFpEquals(other) { if(other == this) return true; return (this.q.equals(other.q) && this.x.equals(other.x)); } function feFpToBigInteger() { return this.x; } function feFpNegate() { return new ECFieldElementFp(this.q, this.x.negate().mod(this.q)); } function feFpAdd(b) { return new ECFieldElementFp(this.q, this.x.add(b.toBigInteger()).mod(this.q)); } function feFpSubtract(b) { return new ECFieldElementFp(this.q, this.x.subtract(b.toBigInteger()).mod(this.q)); } function feFpMultiply(b) { return new ECFieldElementFp(this.q, this.x.multiply(b.toBigInteger()).mod(this.q)); } function feFpSquare() { return new ECFieldElementFp(this.q, this.x.square().mod(this.q)); } function feFpDivide(b) { return new ECFieldElementFp(this.q, this.x.multiply(b.toBigInteger().modInverse(this.q)).mod(this.q)); } ECFieldElementFp.prototype.equals = feFpEquals; ECFieldElementFp.prototype.toBigInteger = feFpToBigInteger; ECFieldElementFp.prototype.negate = feFpNegate; ECFieldElementFp.prototype.add = feFpAdd; ECFieldElementFp.prototype.subtract = feFpSubtract; ECFieldElementFp.prototype.multiply = feFpMultiply; ECFieldElementFp.prototype.square = feFpSquare; ECFieldElementFp.prototype.divide = feFpDivide; // ---------------- // ECPointFp // constructor function ECPointFp(curve,x,y,z) { this.curve = curve; this.x = x; this.y = y; // Projective coordinates: either zinv == null or z * zinv == 1 // z and zinv are just BigIntegers, not fieldElements if(z == null) { this.z = BigInteger.ONE; } else { this.z = z; } this.zinv = null; //TODO: compression flag } function pointFpGetX() { if(this.zinv == null) { this.zinv = this.z.modInverse(this.curve.q); } var r = this.x.toBigInteger().multiply(this.zinv); this.curve.reduce(r); return this.curve.fromBigInteger(r); } function pointFpGetY() { if(this.zinv == null) { this.zinv = this.z.modInverse(this.curve.q); } var r = this.y.toBigInteger().multiply(this.zinv); this.curve.reduce(r); return this.curve.fromBigInteger(r); } function pointFpEquals(other) { if(other == this) return true; if(this.isInfinity()) return other.isInfinity(); if(other.isInfinity()) return this.isInfinity(); var u, v; // u = Y2 * Z1 - Y1 * Z2 u = other.y.toBigInteger().multiply(this.z).subtract(this.y.toBigInteger().multiply(other.z)).mod(this.curve.q); if(!u.equals(BigInteger.ZERO)) return false; // v = X2 * Z1 - X1 * Z2 v = other.x.toBigInteger().multiply(this.z).subtract(this.x.toBigInteger().multiply(other.z)).mod(this.curve.q); return v.equals(BigInteger.ZERO); } function pointFpIsInfinity() { if((this.x == null) && (this.y == null)) return true; return this.z.equals(BigInteger.ZERO) && !this.y.toBigInteger().equals(BigInteger.ZERO); } function pointFpNegate() { return new ECPointFp(this.curve, this.x, this.y.negate(), this.z); } function pointFpAdd(b) { if(this.isInfinity()) return b; if(b.isInfinity()) return this; // u = Y2 * Z1 - Y1 * Z2 var u = b.y.toBigInteger().multiply(this.z).subtract(this.y.toBigInteger().multiply(b.z)).mod(this.curve.q); // v = X2 * Z1 - X1 * Z2 var v = b.x.toBigInteger().multiply(this.z).subtract(this.x.toBigInteger().multiply(b.z)).mod(this.curve.q); if(BigInteger.ZERO.equals(v)) { if(BigInteger.ZERO.equals(u)) { return this.twice(); // this == b, so double } return this.curve.getInfinity(); // this = -b, so infinity } var THREE = new BigInteger("3"); var x1 = this.x.toBigInteger(); var y1 = this.y.toBigInteger(); var x2 = b.x.toBigInteger(); var y2 = b.y.toBigInteger(); var v2 = v.square(); var v3 = v2.multiply(v); var x1v2 = x1.multiply(v2); var zu2 = u.square().multiply(this.z); // x3 = v * (z2 * (z1 * u^2 - 2 * x1 * v^2) - v^3) var x3 = zu2.subtract(x1v2.shiftLeft(1)).multiply(b.z).subtract(v3).multiply(v).mod(this.curve.q); // y3 = z2 * (3 * x1 * u * v^2 - y1 * v^3 - z1 * u^3) + u * v^3 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); // z3 = v^3 * z1 * z2 var z3 = v3.multiply(this.z).multiply(b.z).mod(this.curve.q); return new ECPointFp(this.curve, this.curve.fromBigInteger(x3), this.curve.fromBigInteger(y3), z3); } function pointFpTwice() { if(this.isInfinity()) return this; if(this.y.toBigInteger().signum() == 0) return this.curve.getInfinity(); // TODO: optimized handling of constants var THREE = new BigInteger("3"); var x1 = this.x.toBigInteger(); var y1 = this.y.toBigInteger(); var y1z1 = y1.multiply(this.z); var y1sqz1 = y1z1.multiply(y1).mod(this.curve.q); var a = this.curve.a.toBigInteger(); // w = 3 * x1^2 + a * z1^2 var w = x1.square().multiply(THREE); if(!BigInteger.ZERO.equals(a)) { w = w.add(this.z.square().multiply(a)); } w = w.mod(this.curve.q); //this.curve.reduce(w); // x3 = 2 * y1 * z1 * (w^2 - 8 * x1 * y1^2 * z1) var x3 = w.square().subtract(x1.shiftLeft(3).multiply(y1sqz1)).shiftLeft(1).multiply(y1z1).mod(this.curve.q); // y3 = 4 * y1^2 * z1 * (3 * w * x1 - 2 * y1^2 * z1) - w^3 var y3 = w.multiply(THREE).multiply(x1).subtract(y1sqz1.shiftLeft(1)).shiftLeft(2).multiply(y1sqz1).subtract(w.square().multiply(w)).mod(this.curve.q); // z3 = 8 * (y1 * z1)^3 var z3 = y1z1.square().multiply(y1z1).shiftLeft(3).mod(this.curve.q); return new ECPointFp(this.curve, this.curve.fromBigInteger(x3), this.curve.fromBigInteger(y3), z3); } // Simple NAF (Non-Adjacent Form) multiplication algorithm // TODO: modularize the multiplication algorithm function pointFpMultiply(k) { if(this.isInfinity()) return this; if(k.signum() == 0) return this.curve.getInfinity(); var e = k; var h = e.multiply(new BigInteger("3")); var neg = this.negate(); var R = this; var i; for(i = h.bitLength() - 2; i > 0; --i) { R = R.twice(); var hBit = h.testBit(i); var eBit = e.testBit(i); if (hBit != eBit) { R = R.add(hBit ? this : neg); } } return R; } // Compute this*j + x*k (simultaneous multiplication) function pointFpMultiplyTwo(j,x,k) { var i; if(j.bitLength() > k.bitLength()) i = j.bitLength() - 1; else i = k.bitLength() - 1; var R = this.curve.getInfinity(); var both = this.add(x); while(i >= 0) { R = R.twice(); if(j.testBit(i)) { if(k.testBit(i)) { R = R.add(both); } else { R = R.add(this); } } else { if(k.testBit(i)) { R = R.add(x); } } --i; } return R; } ECPointFp.prototype.getX = pointFpGetX; ECPointFp.prototype.getY = pointFpGetY; ECPointFp.prototype.equals = pointFpEquals; ECPointFp.prototype.isInfinity = pointFpIsInfinity; ECPointFp.prototype.negate = pointFpNegate; ECPointFp.prototype.add = pointFpAdd; ECPointFp.prototype.twice = pointFpTwice; ECPointFp.prototype.multiply = pointFpMultiply; ECPointFp.prototype.multiplyTwo = pointFpMultiplyTwo; // ---------------- // ECCurveFp // constructor function ECCurveFp(q,a,b) { this.q = q; this.a = this.fromBigInteger(a); this.b = this.fromBigInteger(b); this.infinity = new ECPointFp(this, null, null); this.reducer = new Barrett(this.q); } function curveFpGetQ() { return this.q; } function curveFpGetA() { return this.a; } function curveFpGetB() { return this.b; } function curveFpEquals(other) { if(other == this) return true; return(this.q.equals(other.q) && this.a.equals(other.a) && this.b.equals(other.b)); } function curveFpGetInfinity() { return this.infinity; } function curveFpFromBigInteger(x) { return new ECFieldElementFp(this.q, x); } function curveReduce(x) { this.reducer.reduce(x); } // for now, work with hex strings because they're easier in JS function curveFpDecodePointHex(s) { switch(parseInt(s.substr(0,2), 16)) { // first byte case 0: return this.infinity; case 2: case 3: // point compression not supported yet return null; case 4: case 6: case 7: var len = (s.length - 2) / 2; var xHex = s.substr(2, len); var yHex = s.substr(len+2, len); return new ECPointFp(this, this.fromBigInteger(new BigInteger(xHex, 16)), this.fromBigInteger(new BigInteger(yHex, 16))); default: // unsupported return null; } } function curveFpEncodePointHex(p) { if (p.isInfinity()) return "00"; var xHex = p.getX().toBigInteger().toString(16); var yHex = p.getY().toBigInteger().toString(16); var oLen = this.getQ().toString(16).length; if ((oLen % 2) != 0) oLen++; while (xHex.length < oLen) { xHex = "0" + xHex; } while (yHex.length < oLen) { yHex = "0" + yHex; } return "04" + xHex + yHex; } ECCurveFp.prototype.getQ = curveFpGetQ; ECCurveFp.prototype.getA = curveFpGetA; ECCurveFp.prototype.getB = curveFpGetB; ECCurveFp.prototype.equals = curveFpEquals; ECCurveFp.prototype.getInfinity = curveFpGetInfinity; ECCurveFp.prototype.fromBigInteger = curveFpFromBigInteger; ECCurveFp.prototype.reduce = curveReduce; //ECCurveFp.prototype.decodePointHex = curveFpDecodePointHex; ECCurveFp.prototype.encodePointHex = curveFpEncodePointHex; // from: https://github.com/kaielvin/jsbn-ec-point-compression ECCurveFp.prototype.decodePointHex = function(s) { var yIsEven; switch(parseInt(s.substr(0,2), 16)) { // first byte case 0: return this.infinity; case 2: yIsEven = false; case 3: if(yIsEven == undefined) yIsEven = true; var len = s.length - 2; var xHex = s.substr(2, len); var x = this.fromBigInteger(new BigInteger(xHex,16)); var alpha = x.multiply(x.square().add(this.getA())).add(this.getB()); var beta = alpha.sqrt(); if (beta == null) throw "Invalid point compression"; var betaValue = beta.toBigInteger(); if (betaValue.testBit(0) != yIsEven) { // Use the other root beta = this.fromBigInteger(this.getQ().subtract(betaValue)); } return new ECPointFp(this,x,beta); case 4: case 6: case 7: var len = (s.length - 2) / 2; var xHex = s.substr(2, len); var yHex = s.substr(len+2, len); return new ECPointFp(this, this.fromBigInteger(new BigInteger(xHex, 16)), this.fromBigInteger(new BigInteger(yHex, 16))); default: // unsupported return null; } } ECCurveFp.prototype.encodeCompressedPointHex = function(p) { if (p.isInfinity()) return "00"; var xHex = p.getX().toBigInteger().toString(16); var oLen = this.getQ().toString(16).length; if ((oLen % 2) != 0) oLen++; while (xHex.length < oLen) xHex = "0" + xHex; var yPrefix; if(p.getY().toBigInteger().isEven()) yPrefix = "02"; else yPrefix = "03"; return yPrefix + xHex; } ECFieldElementFp.prototype.getR = function() { if(this.r != undefined) return this.r; this.r = null; var bitLength = this.q.bitLength(); if (bitLength > 128) { var firstWord = this.q.shiftRight(bitLength - 64); if (firstWord.intValue() == -1) { this.r = BigInteger.ONE.shiftLeft(bitLength).subtract(this.q); } } return this.r; } ECFieldElementFp.prototype.modMult = function(x1,x2) { return this.modReduce(x1.multiply(x2)); } ECFieldElementFp.prototype.modReduce = function(x) { if (this.getR() != null) { var qLen = q.bitLength(); while (x.bitLength() > (qLen + 1)) { var u = x.shiftRight(qLen); var v = x.subtract(u.shiftLeft(qLen)); if (!this.getR().equals(BigInteger.ONE)) { u = u.multiply(this.getR()); } x = u.add(v); } while (x.compareTo(q) >= 0) { x = x.subtract(q); } } else { x = x.mod(q); } return x; } ECFieldElementFp.prototype.sqrt = function() { if (!this.q.testBit(0)) throw "unsupported"; // p mod 4 == 3 if (this.q.testBit(1)) { var z = new ECFieldElementFp(this.q,this.x.modPow(this.q.shiftRight(2).add(BigInteger.ONE),this.q)); return z.square().equals(this) ? z : null; } // p mod 4 == 1 var qMinusOne = this.q.subtract(BigInteger.ONE); var legendreExponent = qMinusOne.shiftRight(1); if (!(this.x.modPow(legendreExponent, this.q).equals(BigInteger.ONE))) { return null; } var u = qMinusOne.shiftRight(2); var k = u.shiftLeft(1).add(BigInteger.ONE); var Q = this.x; var fourQ = modDouble(modDouble(Q)); var U, V; do { var P; do { P = new BigInteger(this.q.bitLength(), new SecureRandom()); } while (P.compareTo(this.q) >= 0 || !(P.multiply(P).subtract(fourQ).modPow(legendreExponent, this.q).equals(qMinusOne))); var result = this.lucasSequence(P, Q, k); U = result[0]; V = result[1]; if (this.modMult(V, V).equals(fourQ)) { // Integer division by 2, mod q if (V.testBit(0)) { V = V.add(q); } V = V.shiftRight(1); return new ECFieldElementFp(q,V); } } while (U.equals(BigInteger.ONE) || U.equals(qMinusOne)); return null; } ECFieldElementFp.prototype.lucasSequence = function(P,Q,k) { var n = k.bitLength(); var s = k.getLowestSetBit(); var Uh = BigInteger.ONE; var Vl = BigInteger.TWO; var Vh = P; var Ql = BigInteger.ONE; var Qh = BigInteger.ONE; for (var j = n - 1; j >= s + 1; --j) { Ql = this.modMult(Ql, Qh); if (k.testBit(j)) { Qh = this.modMult(Ql, Q); Uh = this.modMult(Uh, Vh); Vl = this.modReduce(Vh.multiply(Vl).subtract(P.multiply(Ql))); Vh = this.modReduce(Vh.multiply(Vh).subtract(Qh.shiftLeft(1))); } else { Qh = Ql; Uh = this.modReduce(Uh.multiply(Vl).subtract(Ql)); Vh = this.modReduce(Vh.multiply(Vl).subtract(P.multiply(Ql))); Vl = this.modReduce(Vl.multiply(Vl).subtract(Ql.shiftLeft(1))); } } Ql = this.modMult(Ql, Qh); Qh = this.modMult(Ql, Q); Uh = this.modReduce(Uh.multiply(Vl).subtract(Ql)); Vl = this.modReduce(Vh.multiply(Vl).subtract(P.multiply(Ql))); Ql = this.modMult(Ql, Qh); for (var j = 1; j <= s; ++j) { Uh = this.modMult(Uh, Vl); Vl = this.modReduce(Vl.multiply(Vl).subtract(Ql.shiftLeft(1))); Ql = this.modMult(Ql, Ql); } return [ Uh, Vl ]; } var exports = { ECCurveFp: ECCurveFp, ECPointFp: ECPointFp, ECFieldElementFp: ECFieldElementFp } module.exports = exports /***/ }), /***/ 41452: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { // Named EC curves // Requires ec.js, jsbn.js, and jsbn2.js var BigInteger = __webpack_require__(85587).BigInteger var ECCurveFp = __webpack_require__(3943).ECCurveFp // ---------------- // X9ECParameters // constructor function X9ECParameters(curve,g,n,h) { this.curve = curve; this.g = g; this.n = n; this.h = h; } function x9getCurve() { return this.curve; } function x9getG() { return this.g; } function x9getN() { return this.n; } function x9getH() { return this.h; } X9ECParameters.prototype.getCurve = x9getCurve; X9ECParameters.prototype.getG = x9getG; X9ECParameters.prototype.getN = x9getN; X9ECParameters.prototype.getH = x9getH; // ---------------- // SECNamedCurves function fromHex(s) { return new BigInteger(s, 16); } function secp128r1() { // p = 2^128 - 2^97 - 1 var p = fromHex("FFFFFFFDFFFFFFFFFFFFFFFFFFFFFFFF"); var a = fromHex("FFFFFFFDFFFFFFFFFFFFFFFFFFFFFFFC"); var b = fromHex("E87579C11079F43DD824993C2CEE5ED3"); //byte[] S = Hex.decode("000E0D4D696E6768756151750CC03A4473D03679"); var n = fromHex("FFFFFFFE0000000075A30D1B9038A115"); var h = BigInteger.ONE; var curve = new ECCurveFp(p, a, b); var G = curve.decodePointHex("04" + "161FF7528B899B2D0C28607CA52C5B86" + "CF5AC8395BAFEB13C02DA292DDED7A83"); return new X9ECParameters(curve, G, n, h); } function secp160k1() { // p = 2^160 - 2^32 - 2^14 - 2^12 - 2^9 - 2^8 - 2^7 - 2^3 - 2^2 - 1 var p = fromHex("FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFAC73"); var a = BigInteger.ZERO; var b = fromHex("7"); //byte[] S = null; var n = fromHex("0100000000000000000001B8FA16DFAB9ACA16B6B3"); var h = BigInteger.ONE; var curve = new ECCurveFp(p, a, b); var G = curve.decodePointHex("04" + "3B4C382CE37AA192A4019E763036F4F5DD4D7EBB" + "938CF935318FDCED6BC28286531733C3F03C4FEE"); return new X9ECParameters(curve, G, n, h); } function secp160r1() { // p = 2^160 - 2^31 - 1 var p = fromHex("FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF7FFFFFFF"); var a = fromHex("FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF7FFFFFFC"); var b = fromHex("1C97BEFC54BD7A8B65ACF89F81D4D4ADC565FA45"); //byte[] S = Hex.decode("1053CDE42C14D696E67687561517533BF3F83345"); var n = fromHex("0100000000000000000001F4C8F927AED3CA752257"); var h = BigInteger.ONE; var curve = new ECCurveFp(p, a, b); var G = curve.decodePointHex("04" + "4A96B5688EF573284664698968C38BB913CBFC82" + "23A628553168947D59DCC912042351377AC5FB32"); return new X9ECParameters(curve, G, n, h); } function secp192k1() { // p = 2^192 - 2^32 - 2^12 - 2^8 - 2^7 - 2^6 - 2^3 - 1 var p = fromHex("FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFEE37"); var a = BigInteger.ZERO; var b = fromHex("3"); //byte[] S = null; var n = fromHex("FFFFFFFFFFFFFFFFFFFFFFFE26F2FC170F69466A74DEFD8D"); var h = BigInteger.ONE; var curve = new ECCurveFp(p, a, b); var G = curve.decodePointHex("04" + "DB4FF10EC057E9AE26B07D0280B7F4341DA5D1B1EAE06C7D" + "9B2F2F6D9C5628A7844163D015BE86344082AA88D95E2F9D"); return new X9ECParameters(curve, G, n, h); } function secp192r1() { // p = 2^192 - 2^64 - 1 var p = fromHex("FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFFFFFFFFFFFFF"); var a = fromHex("FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFFFFFFFFFFFFC"); var b = fromHex("64210519E59C80E70FA7E9AB72243049FEB8DEECC146B9B1"); //byte[] S = Hex.decode("3045AE6FC8422F64ED579528D38120EAE12196D5"); var n = fromHex("FFFFFFFFFFFFFFFFFFFFFFFF99DEF836146BC9B1B4D22831"); var h = BigInteger.ONE; var curve = new ECCurveFp(p, a, b); var G = curve.decodePointHex("04" + "188DA80EB03090F67CBF20EB43A18800F4FF0AFD82FF1012" + "07192B95FFC8DA78631011ED6B24CDD573F977A11E794811"); return new X9ECParameters(curve, G, n, h); } function secp224r1() { // p = 2^224 - 2^96 + 1 var p = fromHex("FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF000000000000000000000001"); var a = fromHex("FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFFFFFFFFFFFFFFFFFFFFE"); var b = fromHex("B4050A850C04B3ABF54132565044B0B7D7BFD8BA270B39432355FFB4"); //byte[] S = Hex.decode("BD71344799D5C7FCDC45B59FA3B9AB8F6A948BC5"); var n = fromHex("FFFFFFFFFFFFFFFFFFFFFFFFFFFF16A2E0B8F03E13DD29455C5C2A3D"); var h = BigInteger.ONE; var curve = new ECCurveFp(p, a, b); var G = curve.decodePointHex("04" + "B70E0CBD6BB4BF7F321390B94A03C1D356C21122343280D6115C1D21" + "BD376388B5F723FB4C22DFE6CD4375A05A07476444D5819985007E34"); return new X9ECParameters(curve, G, n, h); } function secp256r1() { // p = 2^224 (2^32 - 1) + 2^192 + 2^96 - 1 var p = fromHex("FFFFFFFF00000001000000000000000000000000FFFFFFFFFFFFFFFFFFFFFFFF"); var a = fromHex("FFFFFFFF00000001000000000000000000000000FFFFFFFFFFFFFFFFFFFFFFFC"); var b = fromHex("5AC635D8AA3A93E7B3EBBD55769886BC651D06B0CC53B0F63BCE3C3E27D2604B"); //byte[] S = Hex.decode("C49D360886E704936A6678E1139D26B7819F7E90"); var n = fromHex("FFFFFFFF00000000FFFFFFFFFFFFFFFFBCE6FAADA7179E84F3B9CAC2FC632551"); var h = BigInteger.ONE; var curve = new ECCurveFp(p, a, b); var G = curve.decodePointHex("04" + "6B17D1F2E12C4247F8BCE6E563A440F277037D812DEB33A0F4A13945D898C296" + "4FE342E2FE1A7F9B8EE7EB4A7C0F9E162BCE33576B315ECECBB6406837BF51F5"); return new X9ECParameters(curve, G, n, h); } // TODO: make this into a proper hashtable function getSECCurveByName(name) { if(name == "secp128r1") return secp128r1(); if(name == "secp160k1") return secp160k1(); if(name == "secp160r1") return secp160r1(); if(name == "secp192k1") return secp192k1(); if(name == "secp192r1") return secp192r1(); if(name == "secp224r1") return secp224r1(); if(name == "secp256r1") return secp256r1(); return null; } module.exports = { "secp128r1":secp128r1, "secp160k1":secp160k1, "secp160r1":secp160r1, "secp192k1":secp192k1, "secp192r1":secp192r1, "secp224r1":secp224r1, "secp256r1":secp256r1 } /***/ }), /***/ 81205: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { var once = __webpack_require__(1223); var noop = function() {}; var isRequest = function(stream) { return stream.setHeader && typeof stream.abort === 'function'; }; var isChildProcess = function(stream) { return stream.stdio && Array.isArray(stream.stdio) && stream.stdio.length === 3 }; var eos = function(stream, opts, callback) { if (typeof opts === 'function') return eos(stream, null, opts); if (!opts) opts = {}; callback = once(callback || noop); var ws = stream._writableState; var rs = stream._readableState; var readable = opts.readable || (opts.readable !== false && stream.readable); var writable = opts.writable || (opts.writable !== false && stream.writable); var cancelled = false; var onlegacyfinish = function() { if (!stream.writable) onfinish(); }; var onfinish = function() { writable = false; if (!readable) callback.call(stream); }; var onend = function() { readable = false; if (!writable) callback.call(stream); }; var onexit = function(exitCode) { callback.call(stream, exitCode ? new Error('exited with error code: ' + exitCode) : null); }; var onerror = function(err) { callback.call(stream, err); }; var onclose = function() { process.nextTick(onclosenexttick); }; var onclosenexttick = function() { if (cancelled) return; if (readable && !(rs && (rs.ended && !rs.destroyed))) return callback.call(stream, new Error('premature close')); if (writable && !(ws && (ws.ended && !ws.destroyed))) return callback.call(stream, new Error('premature close')); }; var onrequest = function() { stream.req.on('finish', onfinish); }; if (isRequest(stream)) { stream.on('complete', onfinish); stream.on('abort', onclose); if (stream.req) onrequest(); else stream.on('request', onrequest); } else if (writable && !ws) { // legacy streams stream.on('end', onlegacyfinish); stream.on('close', onlegacyfinish); } if (isChildProcess(stream)) stream.on('exit', onexit); stream.on('end', onend); stream.on('finish', onfinish); if (opts.error !== false) stream.on('error', onerror); stream.on('close', onclose); return function() { cancelled = true; stream.removeListener('complete', onfinish); stream.removeListener('abort', onclose); stream.removeListener('request', onrequest); if (stream.req) stream.req.removeListener('finish', onfinish); stream.removeListener('end', onlegacyfinish); stream.removeListener('close', onlegacyfinish); stream.removeListener('finish', onfinish); stream.removeListener('exit', onexit); stream.removeListener('end', onend); stream.removeListener('error', onerror); stream.removeListener('close', onclose); }; }; module.exports = eos; /***/ }), /***/ 38171: /***/ ((module) => { "use strict"; var hasOwn = Object.prototype.hasOwnProperty; var toStr = Object.prototype.toString; var defineProperty = Object.defineProperty; var gOPD = Object.getOwnPropertyDescriptor; var isArray = function isArray(arr) { if (typeof Array.isArray === 'function') { return Array.isArray(arr); } return toStr.call(arr) === '[object Array]'; }; var isPlainObject = function isPlainObject(obj) { if (!obj || toStr.call(obj) !== '[object Object]') { return false; } var hasOwnConstructor = hasOwn.call(obj, 'constructor'); var hasIsPrototypeOf = obj.constructor && obj.constructor.prototype && hasOwn.call(obj.constructor.prototype, 'isPrototypeOf'); // Not own constructor property must be Object if (obj.constructor && !hasOwnConstructor && !hasIsPrototypeOf) { return false; } // Own properties are enumerated firstly, so to speed up, // if last one is own, then all properties are own. var key; for (key in obj) { /**/ } return typeof key === 'undefined' || hasOwn.call(obj, key); }; // If name is '__proto__', and Object.defineProperty is available, define __proto__ as an own property on target var setProperty = function setProperty(target, options) { if (defineProperty && options.name === '__proto__') { defineProperty(target, options.name, { enumerable: true, configurable: true, value: options.newValue, writable: true }); } else { target[options.name] = options.newValue; } }; // Return undefined instead of __proto__ if '__proto__' is not an own property var getProperty = function getProperty(obj, name) { if (name === '__proto__') { if (!hasOwn.call(obj, name)) { return void 0; } else if (gOPD) { // In early versions of node, obj['__proto__'] is buggy when obj has // __proto__ as an own property. Object.getOwnPropertyDescriptor() works. return gOPD(obj, name).value; } } return obj[name]; }; module.exports = function extend() { var options, name, src, copy, copyIsArray, clone; var target = arguments[0]; var i = 1; var length = arguments.length; var deep = false; // Handle a deep copy situation if (typeof target === 'boolean') { deep = target; target = arguments[1] || {}; // skip the boolean and the target i = 2; } if (target == null || (typeof target !== 'object' && typeof target !== 'function')) { target = {}; } for (; i < length; ++i) { options = arguments[i]; // Only deal with non-null/undefined values if (options != null) { // Extend the base object for (name in options) { src = getProperty(target, name); copy = getProperty(options, name); // Prevent never-ending loop if (target !== copy) { // Recurse if we're merging plain objects or arrays if (deep && copy && (isPlainObject(copy) || (copyIsArray = isArray(copy)))) { if (copyIsArray) { copyIsArray = false; clone = src && isArray(src) ? src : []; } else { clone = src && isPlainObject(src) ? src : {}; } // Never move original objects, clone them setProperty(target, { name: name, newValue: extend(deep, clone, copy) }); // Don't bring in undefined values } else if (typeof copy !== 'undefined') { setProperty(target, { name: name, newValue: copy }); } } } } } // Return the modified object return target; }; /***/ }), /***/ 87264: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { /* * extsprintf.js: extended POSIX-style sprintf */ var mod_assert = __webpack_require__(42357); var mod_util = __webpack_require__(31669); /* * Public interface */ exports.sprintf = jsSprintf; exports.printf = jsPrintf; exports.fprintf = jsFprintf; /* * Stripped down version of s[n]printf(3c). We make a best effort to throw an * exception when given a format string we don't understand, rather than * ignoring it, so that we won't break existing programs if/when we go implement * the rest of this. * * This implementation currently supports specifying * - field alignment ('-' flag), * - zero-pad ('0' flag) * - always show numeric sign ('+' flag), * - field width * - conversions for strings, decimal integers, and floats (numbers). * - argument size specifiers. These are all accepted but ignored, since * Javascript has no notion of the physical size of an argument. * * Everything else is currently unsupported, most notably precision, unsigned * numbers, non-decimal numbers, and characters. */ function jsSprintf(fmt) { var regex = [ '([^%]*)', /* normal text */ '%', /* start of format */ '([\'\\-+ #0]*?)', /* flags (optional) */ '([1-9]\\d*)?', /* width (optional) */ '(\\.([1-9]\\d*))?', /* precision (optional) */ '[lhjztL]*?', /* length mods (ignored) */ '([diouxXfFeEgGaAcCsSp%jr])' /* conversion */ ].join(''); var re = new RegExp(regex); var args = Array.prototype.slice.call(arguments, 1); var flags, width, precision, conversion; var left, pad, sign, arg, match; var ret = ''; var argn = 1; mod_assert.equal('string', typeof (fmt)); while ((match = re.exec(fmt)) !== null) { ret += match[1]; fmt = fmt.substring(match[0].length); flags = match[2] || ''; width = match[3] || 0; precision = match[4] || ''; conversion = match[6]; left = false; sign = false; pad = ' '; if (conversion == '%') { ret += '%'; continue; } if (args.length === 0) throw (new Error('too few args to sprintf')); arg = args.shift(); argn++; if (flags.match(/[\' #]/)) throw (new Error( 'unsupported flags: ' + flags)); if (precision.length > 0) throw (new Error( 'non-zero precision not supported')); if (flags.match(/-/)) left = true; if (flags.match(/0/)) pad = '0'; if (flags.match(/\+/)) sign = true; switch (conversion) { case 's': if (arg === undefined || arg === null) throw (new Error('argument ' + argn + ': attempted to print undefined or null ' + 'as a string')); ret += doPad(pad, width, left, arg.toString()); break; case 'd': arg = Math.floor(arg); /*jsl:fallthru*/ case 'f': sign = sign && arg > 0 ? '+' : ''; ret += sign + doPad(pad, width, left, arg.toString()); break; case 'x': ret += doPad(pad, width, left, arg.toString(16)); break; case 'j': /* non-standard */ if (width === 0) width = 10; ret += mod_util.inspect(arg, false, width); break; case 'r': /* non-standard */ ret += dumpException(arg); break; default: throw (new Error('unsupported conversion: ' + conversion)); } } ret += fmt; return (ret); } function jsPrintf() { var args = Array.prototype.slice.call(arguments); args.unshift(process.stdout); jsFprintf.apply(null, args); } function jsFprintf(stream) { var args = Array.prototype.slice.call(arguments, 1); return (stream.write(jsSprintf.apply(this, args))); } function doPad(chr, width, left, str) { var ret = str; while (ret.length < width) { if (left) ret += chr; else ret = chr + ret; } return (ret); } /* * This function dumps long stack traces for exceptions having a cause() method. * See node-verror for an example. */ function dumpException(ex) { var ret; if (!(ex instanceof Error)) throw (new Error(jsSprintf('invalid type for %%r: %j', ex))); /* Note that V8 prepends "ex.stack" with ex.toString(). */ ret = 'EXCEPTION: ' + ex.constructor.name + ': ' + ex.stack; if (ex.cause && typeof (ex.cause) === 'function') { var cex = ex.cause(); if (cex) { ret += '\nCaused by: ' + dumpException(cex); } } return (ret); } /***/ }), /***/ 28206: /***/ ((module) => { "use strict"; // do not edit .js files directly - edit src/index.jst module.exports = function equal(a, b) { if (a === b) return true; if (a && b && typeof a == 'object' && typeof b == 'object') { if (a.constructor !== b.constructor) return false; var length, i, keys; if (Array.isArray(a)) { length = a.length; if (length != b.length) return false; for (i = length; i-- !== 0;) if (!equal(a[i], b[i])) return false; return true; } if (a.constructor === RegExp) return a.source === b.source && a.flags === b.flags; if (a.valueOf !== Object.prototype.valueOf) return a.valueOf() === b.valueOf(); if (a.toString !== Object.prototype.toString) return a.toString() === b.toString(); keys = Object.keys(a); length = keys.length; if (length !== Object.keys(b).length) return false; for (i = length; i-- !== 0;) if (!Object.prototype.hasOwnProperty.call(b, keys[i])) return false; for (i = length; i-- !== 0;) { var key = keys[i]; if (!equal(a[key], b[key])) return false; } return true; } // true if both NaN, false otherwise return a!==a && b!==b; }; /***/ }), /***/ 30969: /***/ ((module) => { "use strict"; module.exports = function (data, opts) { if (!opts) opts = {}; if (typeof opts === 'function') opts = { cmp: opts }; var cycles = (typeof opts.cycles === 'boolean') ? opts.cycles : false; var cmp = opts.cmp && (function (f) { return function (node) { return function (a, b) { var aobj = { key: a, value: node[a] }; var bobj = { key: b, value: node[b] }; return f(aobj, bobj); }; }; })(opts.cmp); var seen = []; return (function stringify (node) { if (node && node.toJSON && typeof node.toJSON === 'function') { node = node.toJSON(); } if (node === undefined) return; if (typeof node == 'number') return isFinite(node) ? '' + node : 'null'; if (typeof node !== 'object') return JSON.stringify(node); var i, out; if (Array.isArray(node)) { out = '['; for (i = 0; i < node.length; i++) { if (i) out += ','; out += stringify(node[i]) || 'null'; } return out + ']'; } if (node === null) return 'null'; if (seen.indexOf(node) !== -1) { if (cycles) return JSON.stringify('__cycle__'); throw new TypeError('Converting circular structure to JSON'); } var seenIndex = seen.push(node) - 1; var keys = Object.keys(node).sort(cmp && cmp(node)); out = ''; for (i = 0; i < keys.length; i++) { var key = keys[i]; var value = stringify(node[key]); if (!value) continue; if (out) out += ','; out += JSON.stringify(key) + ':' + value; } seen.splice(seenIndex, 1); return '{' + out + '}'; })(data); }; /***/ }), /***/ 47568: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { module.exports = ForeverAgent ForeverAgent.SSL = ForeverAgentSSL var util = __webpack_require__(31669) , Agent = __webpack_require__(98605).Agent , net = __webpack_require__(11631) , tls = __webpack_require__(4016) , AgentSSL = __webpack_require__(57211).Agent function getConnectionName(host, port) { var name = '' if (typeof host === 'string') { name = host + ':' + port } else { // For node.js v012.0 and iojs-v1.5.1, host is an object. And any existing localAddress is part of the connection name. name = host.host + ':' + host.port + ':' + (host.localAddress ? (host.localAddress + ':') : ':') } return name } function ForeverAgent(options) { var self = this self.options = options || {} self.requests = {} self.sockets = {} self.freeSockets = {} self.maxSockets = self.options.maxSockets || Agent.defaultMaxSockets self.minSockets = self.options.minSockets || ForeverAgent.defaultMinSockets self.on('free', function(socket, host, port) { var name = getConnectionName(host, port) if (self.requests[name] && self.requests[name].length) { self.requests[name].shift().onSocket(socket) } else if (self.sockets[name].length < self.minSockets) { if (!self.freeSockets[name]) self.freeSockets[name] = [] self.freeSockets[name].push(socket) // if an error happens while we don't use the socket anyway, meh, throw the socket away var onIdleError = function() { socket.destroy() } socket._onIdleError = onIdleError socket.on('error', onIdleError) } else { // If there are no pending requests just destroy the // socket and it will get removed from the pool. This // gets us out of timeout issues and allows us to // default to Connection:keep-alive. socket.destroy() } }) } util.inherits(ForeverAgent, Agent) ForeverAgent.defaultMinSockets = 5 ForeverAgent.prototype.createConnection = net.createConnection ForeverAgent.prototype.addRequestNoreuse = Agent.prototype.addRequest ForeverAgent.prototype.addRequest = function(req, host, port) { var name = getConnectionName(host, port) if (typeof host !== 'string') { var options = host port = options.port host = options.host } if (this.freeSockets[name] && this.freeSockets[name].length > 0 && !req.useChunkedEncodingByDefault) { var idleSocket = this.freeSockets[name].pop() idleSocket.removeListener('error', idleSocket._onIdleError) delete idleSocket._onIdleError req._reusedSocket = true req.onSocket(idleSocket) } else { this.addRequestNoreuse(req, host, port) } } ForeverAgent.prototype.removeSocket = function(s, name, host, port) { if (this.sockets[name]) { var index = this.sockets[name].indexOf(s) if (index !== -1) { this.sockets[name].splice(index, 1) } } else if (this.sockets[name] && this.sockets[name].length === 0) { // don't leak delete this.sockets[name] delete this.requests[name] } if (this.freeSockets[name]) { var index = this.freeSockets[name].indexOf(s) if (index !== -1) { this.freeSockets[name].splice(index, 1) if (this.freeSockets[name].length === 0) { delete this.freeSockets[name] } } } if (this.requests[name] && this.requests[name].length) { // If we have pending requests and a socket gets closed a new one // needs to be created to take over in the pool for the one that closed. this.createSocket(name, host, port).emit('free') } } function ForeverAgentSSL (options) { ForeverAgent.call(this, options) } util.inherits(ForeverAgentSSL, ForeverAgent) ForeverAgentSSL.prototype.createConnection = createConnectionSSL ForeverAgentSSL.prototype.addRequestNoreuse = AgentSSL.prototype.addRequest function createConnectionSSL (port, host, options) { if (typeof port === 'object') { options = port; } else if (typeof host === 'object') { options = host; } else if (typeof options === 'object') { options = options; } else { options = {}; } if (typeof port === 'number') { options.port = port; } if (typeof host === 'string') { options.host = host; } return tls.connect(options); } /***/ }), /***/ 46863: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { module.exports = realpath realpath.realpath = realpath realpath.sync = realpathSync realpath.realpathSync = realpathSync realpath.monkeypatch = monkeypatch realpath.unmonkeypatch = unmonkeypatch var fs = __webpack_require__(35747) var origRealpath = fs.realpath var origRealpathSync = fs.realpathSync var version = process.version var ok = /^v[0-5]\./.test(version) var old = __webpack_require__(71734) function newError (er) { return er && er.syscall === 'realpath' && ( er.code === 'ELOOP' || er.code === 'ENOMEM' || er.code === 'ENAMETOOLONG' ) } function realpath (p, cache, cb) { if (ok) { return origRealpath(p, cache, cb) } if (typeof cache === 'function') { cb = cache cache = null } origRealpath(p, cache, function (er, result) { if (newError(er)) { old.realpath(p, cache, cb) } else { cb(er, result) } }) } function realpathSync (p, cache) { if (ok) { return origRealpathSync(p, cache) } try { return origRealpathSync(p, cache) } catch (er) { if (newError(er)) { return old.realpathSync(p, cache) } else { throw er } } } function monkeypatch () { fs.realpath = realpath fs.realpathSync = realpathSync } function unmonkeypatch () { fs.realpath = origRealpath fs.realpathSync = origRealpathSync } /***/ }), /***/ 71734: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { // Copyright Joyent, Inc. and other Node contributors. // // Permission is hereby granted, free of charge, to any person obtaining a // copy of this software and associated documentation files (the // "Software"), to deal in the Software without restriction, including // without limitation the rights to use, copy, modify, merge, publish, // distribute, sublicense, and/or sell copies of the Software, and to permit // persons to whom the Software is furnished to do so, subject to the // following conditions: // // The above copyright notice and this permission notice shall be included // in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS // OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN // NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, // DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE // USE OR OTHER DEALINGS IN THE SOFTWARE. var pathModule = __webpack_require__(85622); var isWindows = process.platform === 'win32'; var fs = __webpack_require__(35747); // JavaScript implementation of realpath, ported from node pre-v6 var DEBUG = process.env.NODE_DEBUG && /fs/.test(process.env.NODE_DEBUG); function rethrow() { // Only enable in debug mode. A backtrace uses ~1000 bytes of heap space and // is fairly slow to generate. var callback; if (DEBUG) { var backtrace = new Error; callback = debugCallback; } else callback = missingCallback; return callback; function debugCallback(err) { if (err) { backtrace.message = err.message; err = backtrace; missingCallback(err); } } function missingCallback(err) { if (err) { if (process.throwDeprecation) throw err; // Forgot a callback but don't know where? Use NODE_DEBUG=fs else if (!process.noDeprecation) { var msg = 'fs: missing callback ' + (err.stack || err.message); if (process.traceDeprecation) console.trace(msg); else console.error(msg); } } } } function maybeCallback(cb) { return typeof cb === 'function' ? cb : rethrow(); } var normalize = pathModule.normalize; // Regexp that finds the next partion of a (partial) path // result is [base_with_slash, base], e.g. ['somedir/', 'somedir'] if (isWindows) { var nextPartRe = /(.*?)(?:[\/\\]+|$)/g; } else { var nextPartRe = /(.*?)(?:[\/]+|$)/g; } // Regex to find the device root, including trailing slash. E.g. 'c:\\'. if (isWindows) { var splitRootRe = /^(?:[a-zA-Z]:|[\\\/]{2}[^\\\/]+[\\\/][^\\\/]+)?[\\\/]*/; } else { var splitRootRe = /^[\/]*/; } exports.realpathSync = function realpathSync(p, cache) { // make p is absolute p = pathModule.resolve(p); if (cache && Object.prototype.hasOwnProperty.call(cache, p)) { return cache[p]; } var original = p, seenLinks = {}, knownHard = {}; // current character position in p var pos; // the partial path so far, including a trailing slash if any var current; // the partial path without a trailing slash (except when pointing at a root) var base; // the partial path scanned in the previous round, with slash var previous; start(); function start() { // Skip over roots var m = splitRootRe.exec(p); pos = m[0].length; current = m[0]; base = m[0]; previous = ''; // On windows, check that the root exists. On unix there is no need. if (isWindows && !knownHard[base]) { fs.lstatSync(base); knownHard[base] = true; } } // walk down the path, swapping out linked pathparts for their real // values // NB: p.length changes. while (pos < p.length) { // find the next part nextPartRe.lastIndex = pos; var result = nextPartRe.exec(p); previous = current; current += result[0]; base = previous + result[1]; pos = nextPartRe.lastIndex; // continue if not a symlink if (knownHard[base] || (cache && cache[base] === base)) { continue; } var resolvedLink; if (cache && Object.prototype.hasOwnProperty.call(cache, base)) { // some known symbolic link. no need to stat again. resolvedLink = cache[base]; } else { var stat = fs.lstatSync(base); if (!stat.isSymbolicLink()) { knownHard[base] = true; if (cache) cache[base] = base; continue; } // read the link if it wasn't read before // dev/ino always return 0 on windows, so skip the check. var linkTarget = null; if (!isWindows) { var id = stat.dev.toString(32) + ':' + stat.ino.toString(32); if (seenLinks.hasOwnProperty(id)) { linkTarget = seenLinks[id]; } } if (linkTarget === null) { fs.statSync(base); linkTarget = fs.readlinkSync(base); } resolvedLink = pathModule.resolve(previous, linkTarget); // track this, if given a cache. if (cache) cache[base] = resolvedLink; if (!isWindows) seenLinks[id] = linkTarget; } // resolve the link, then start over p = pathModule.resolve(resolvedLink, p.slice(pos)); start(); } if (cache) cache[original] = p; return p; }; exports.realpath = function realpath(p, cache, cb) { if (typeof cb !== 'function') { cb = maybeCallback(cache); cache = null; } // make p is absolute p = pathModule.resolve(p); if (cache && Object.prototype.hasOwnProperty.call(cache, p)) { return process.nextTick(cb.bind(null, null, cache[p])); } var original = p, seenLinks = {}, knownHard = {}; // current character position in p var pos; // the partial path so far, including a trailing slash if any var current; // the partial path without a trailing slash (except when pointing at a root) var base; // the partial path scanned in the previous round, with slash var previous; start(); function start() { // Skip over roots var m = splitRootRe.exec(p); pos = m[0].length; current = m[0]; base = m[0]; previous = ''; // On windows, check that the root exists. On unix there is no need. if (isWindows && !knownHard[base]) { fs.lstat(base, function(err) { if (err) return cb(err); knownHard[base] = true; LOOP(); }); } else { process.nextTick(LOOP); } } // walk down the path, swapping out linked pathparts for their real // values function LOOP() { // stop if scanned past end of path if (pos >= p.length) { if (cache) cache[original] = p; return cb(null, p); } // find the next part nextPartRe.lastIndex = pos; var result = nextPartRe.exec(p); previous = current; current += result[0]; base = previous + result[1]; pos = nextPartRe.lastIndex; // continue if not a symlink if (knownHard[base] || (cache && cache[base] === base)) { return process.nextTick(LOOP); } if (cache && Object.prototype.hasOwnProperty.call(cache, base)) { // known symbolic link. no need to stat again. return gotResolvedLink(cache[base]); } return fs.lstat(base, gotStat); } function gotStat(err, stat) { if (err) return cb(err); // if not a symlink, skip to the next path part if (!stat.isSymbolicLink()) { knownHard[base] = true; if (cache) cache[base] = base; return process.nextTick(LOOP); } // stat & read the link if not read before // call gotTarget as soon as the link target is known // dev/ino always return 0 on windows, so skip the check. if (!isWindows) { var id = stat.dev.toString(32) + ':' + stat.ino.toString(32); if (seenLinks.hasOwnProperty(id)) { return gotTarget(null, seenLinks[id], base); } } fs.stat(base, function(err) { if (err) return cb(err); fs.readlink(base, function(err, target) { if (!isWindows) seenLinks[id] = target; gotTarget(err, target); }); }); } function gotTarget(err, target, base) { if (err) return cb(err); var resolvedLink = pathModule.resolve(previous, target); if (cache) cache[base] = resolvedLink; gotResolvedLink(resolvedLink); } function gotResolvedLink(resolvedLink) { // resolve the link, then start over p = pathModule.resolve(resolvedLink, p.slice(pos)); start(); } }; /***/ }), /***/ 19320: /***/ ((module) => { "use strict"; /* eslint no-invalid-this: 1 */ var ERROR_MESSAGE = 'Function.prototype.bind called on incompatible '; var slice = Array.prototype.slice; var toStr = Object.prototype.toString; var funcType = '[object Function]'; module.exports = function bind(that) { var target = this; if (typeof target !== 'function' || toStr.call(target) !== funcType) { throw new TypeError(ERROR_MESSAGE + target); } var args = slice.call(arguments, 1); var bound; var binder = function () { if (this instanceof bound) { var result = target.apply( this, args.concat(slice.call(arguments)) ); if (Object(result) === result) { return result; } return this; } else { return target.apply( that, args.concat(slice.call(arguments)) ); } }; var boundLength = Math.max(0, target.length - args.length); var boundArgs = []; for (var i = 0; i < boundLength; i++) { boundArgs.push('$' + i); } bound = Function('binder', 'return function (' + boundArgs.join(',') + '){ return binder.apply(this,arguments); }')(binder); if (target.prototype) { var Empty = function Empty() {}; Empty.prototype = target.prototype; bound.prototype = new Empty(); Empty.prototype = null; } return bound; }; /***/ }), /***/ 88334: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; var implementation = __webpack_require__(19320); module.exports = Function.prototype.bind || implementation; /***/ }), /***/ 74538: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; var undefined; var $SyntaxError = SyntaxError; var $Function = Function; var $TypeError = TypeError; // eslint-disable-next-line consistent-return var getEvalledConstructor = function (expressionSyntax) { try { return $Function('"use strict"; return (' + expressionSyntax + ').constructor;')(); } catch (e) {} }; var $gOPD = Object.getOwnPropertyDescriptor; if ($gOPD) { try { $gOPD({}, ''); } catch (e) { $gOPD = null; // this is IE 8, which has a broken gOPD } } var throwTypeError = function () { throw new $TypeError(); }; var ThrowTypeError = $gOPD ? (function () { try { // eslint-disable-next-line no-unused-expressions, no-caller, no-restricted-properties arguments.callee; // IE 8 does not throw here return throwTypeError; } catch (calleeThrows) { try { // IE 8 throws on Object.getOwnPropertyDescriptor(arguments, '') return $gOPD(arguments, 'callee').get; } catch (gOPDthrows) { return throwTypeError; } } }()) : throwTypeError; var hasSymbols = __webpack_require__(40587)(); var getProto = Object.getPrototypeOf || function (x) { return x.__proto__; }; // eslint-disable-line no-proto var needsEval = {}; var TypedArray = typeof Uint8Array === 'undefined' ? undefined : getProto(Uint8Array); var INTRINSICS = { '%AggregateError%': typeof AggregateError === 'undefined' ? undefined : AggregateError, '%Array%': Array, '%ArrayBuffer%': typeof ArrayBuffer === 'undefined' ? undefined : ArrayBuffer, '%ArrayIteratorPrototype%': hasSymbols ? getProto([][Symbol.iterator]()) : undefined, '%AsyncFromSyncIteratorPrototype%': undefined, '%AsyncFunction%': needsEval, '%AsyncGenerator%': needsEval, '%AsyncGeneratorFunction%': needsEval, '%AsyncIteratorPrototype%': needsEval, '%Atomics%': typeof Atomics === 'undefined' ? undefined : Atomics, '%BigInt%': typeof BigInt === 'undefined' ? undefined : BigInt, '%Boolean%': Boolean, '%DataView%': typeof DataView === 'undefined' ? undefined : DataView, '%Date%': Date, '%decodeURI%': decodeURI, '%decodeURIComponent%': decodeURIComponent, '%encodeURI%': encodeURI, '%encodeURIComponent%': encodeURIComponent, '%Error%': Error, '%eval%': eval, // eslint-disable-line no-eval '%EvalError%': EvalError, '%Float32Array%': typeof Float32Array === 'undefined' ? undefined : Float32Array, '%Float64Array%': typeof Float64Array === 'undefined' ? undefined : Float64Array, '%FinalizationRegistry%': typeof FinalizationRegistry === 'undefined' ? undefined : FinalizationRegistry, '%Function%': $Function, '%GeneratorFunction%': needsEval, '%Int8Array%': typeof Int8Array === 'undefined' ? undefined : Int8Array, '%Int16Array%': typeof Int16Array === 'undefined' ? undefined : Int16Array, '%Int32Array%': typeof Int32Array === 'undefined' ? undefined : Int32Array, '%isFinite%': isFinite, '%isNaN%': isNaN, '%IteratorPrototype%': hasSymbols ? getProto(getProto([][Symbol.iterator]())) : undefined, '%JSON%': typeof JSON === 'object' ? JSON : undefined, '%Map%': typeof Map === 'undefined' ? undefined : Map, '%MapIteratorPrototype%': typeof Map === 'undefined' || !hasSymbols ? undefined : getProto(new Map()[Symbol.iterator]()), '%Math%': Math, '%Number%': Number, '%Object%': Object, '%parseFloat%': parseFloat, '%parseInt%': parseInt, '%Promise%': typeof Promise === 'undefined' ? undefined : Promise, '%Proxy%': typeof Proxy === 'undefined' ? undefined : Proxy, '%RangeError%': RangeError, '%ReferenceError%': ReferenceError, '%Reflect%': typeof Reflect === 'undefined' ? undefined : Reflect, '%RegExp%': RegExp, '%Set%': typeof Set === 'undefined' ? undefined : Set, '%SetIteratorPrototype%': typeof Set === 'undefined' || !hasSymbols ? undefined : getProto(new Set()[Symbol.iterator]()), '%SharedArrayBuffer%': typeof SharedArrayBuffer === 'undefined' ? undefined : SharedArrayBuffer, '%String%': String, '%StringIteratorPrototype%': hasSymbols ? getProto(''[Symbol.iterator]()) : undefined, '%Symbol%': hasSymbols ? Symbol : undefined, '%SyntaxError%': $SyntaxError, '%ThrowTypeError%': ThrowTypeError, '%TypedArray%': TypedArray, '%TypeError%': $TypeError, '%Uint8Array%': typeof Uint8Array === 'undefined' ? undefined : Uint8Array, '%Uint8ClampedArray%': typeof Uint8ClampedArray === 'undefined' ? undefined : Uint8ClampedArray, '%Uint16Array%': typeof Uint16Array === 'undefined' ? undefined : Uint16Array, '%Uint32Array%': typeof Uint32Array === 'undefined' ? undefined : Uint32Array, '%URIError%': URIError, '%WeakMap%': typeof WeakMap === 'undefined' ? undefined : WeakMap, '%WeakRef%': typeof WeakRef === 'undefined' ? undefined : WeakRef, '%WeakSet%': typeof WeakSet === 'undefined' ? undefined : WeakSet }; var doEval = function doEval(name) { var value; if (name === '%AsyncFunction%') { value = getEvalledConstructor('async function () {}'); } else if (name === '%GeneratorFunction%') { value = getEvalledConstructor('function* () {}'); } else if (name === '%AsyncGeneratorFunction%') { value = getEvalledConstructor('async function* () {}'); } else if (name === '%AsyncGenerator%') { var fn = doEval('%AsyncGeneratorFunction%'); if (fn) { value = fn.prototype; } } else if (name === '%AsyncIteratorPrototype%') { var gen = doEval('%AsyncGenerator%'); if (gen) { value = getProto(gen.prototype); } } INTRINSICS[name] = value; return value; }; var LEGACY_ALIASES = { '%ArrayBufferPrototype%': ['ArrayBuffer', 'prototype'], '%ArrayPrototype%': ['Array', 'prototype'], '%ArrayProto_entries%': ['Array', 'prototype', 'entries'], '%ArrayProto_forEach%': ['Array', 'prototype', 'forEach'], '%ArrayProto_keys%': ['Array', 'prototype', 'keys'], '%ArrayProto_values%': ['Array', 'prototype', 'values'], '%AsyncFunctionPrototype%': ['AsyncFunction', 'prototype'], '%AsyncGenerator%': ['AsyncGeneratorFunction', 'prototype'], '%AsyncGeneratorPrototype%': ['AsyncGeneratorFunction', 'prototype', 'prototype'], '%BooleanPrototype%': ['Boolean', 'prototype'], '%DataViewPrototype%': ['DataView', 'prototype'], '%DatePrototype%': ['Date', 'prototype'], '%ErrorPrototype%': ['Error', 'prototype'], '%EvalErrorPrototype%': ['EvalError', 'prototype'], '%Float32ArrayPrototype%': ['Float32Array', 'prototype'], '%Float64ArrayPrototype%': ['Float64Array', 'prototype'], '%FunctionPrototype%': ['Function', 'prototype'], '%Generator%': ['GeneratorFunction', 'prototype'], '%GeneratorPrototype%': ['GeneratorFunction', 'prototype', 'prototype'], '%Int8ArrayPrototype%': ['Int8Array', 'prototype'], '%Int16ArrayPrototype%': ['Int16Array', 'prototype'], '%Int32ArrayPrototype%': ['Int32Array', 'prototype'], '%JSONParse%': ['JSON', 'parse'], '%JSONStringify%': ['JSON', 'stringify'], '%MapPrototype%': ['Map', 'prototype'], '%NumberPrototype%': ['Number', 'prototype'], '%ObjectPrototype%': ['Object', 'prototype'], '%ObjProto_toString%': ['Object', 'prototype', 'toString'], '%ObjProto_valueOf%': ['Object', 'prototype', 'valueOf'], '%PromisePrototype%': ['Promise', 'prototype'], '%PromiseProto_then%': ['Promise', 'prototype', 'then'], '%Promise_all%': ['Promise', 'all'], '%Promise_reject%': ['Promise', 'reject'], '%Promise_resolve%': ['Promise', 'resolve'], '%RangeErrorPrototype%': ['RangeError', 'prototype'], '%ReferenceErrorPrototype%': ['ReferenceError', 'prototype'], '%RegExpPrototype%': ['RegExp', 'prototype'], '%SetPrototype%': ['Set', 'prototype'], '%SharedArrayBufferPrototype%': ['SharedArrayBuffer', 'prototype'], '%StringPrototype%': ['String', 'prototype'], '%SymbolPrototype%': ['Symbol', 'prototype'], '%SyntaxErrorPrototype%': ['SyntaxError', 'prototype'], '%TypedArrayPrototype%': ['TypedArray', 'prototype'], '%TypeErrorPrototype%': ['TypeError', 'prototype'], '%Uint8ArrayPrototype%': ['Uint8Array', 'prototype'], '%Uint8ClampedArrayPrototype%': ['Uint8ClampedArray', 'prototype'], '%Uint16ArrayPrototype%': ['Uint16Array', 'prototype'], '%Uint32ArrayPrototype%': ['Uint32Array', 'prototype'], '%URIErrorPrototype%': ['URIError', 'prototype'], '%WeakMapPrototype%': ['WeakMap', 'prototype'], '%WeakSetPrototype%': ['WeakSet', 'prototype'] }; var bind = __webpack_require__(88334); var hasOwn = __webpack_require__(76339); var $concat = bind.call(Function.call, Array.prototype.concat); var $spliceApply = bind.call(Function.apply, Array.prototype.splice); var $replace = bind.call(Function.call, String.prototype.replace); var $strSlice = bind.call(Function.call, String.prototype.slice); /* adapted from https://github.com/lodash/lodash/blob/4.17.15/dist/lodash.js#L6735-L6744 */ var rePropName = /[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g; var reEscapeChar = /\\(\\)?/g; /** Used to match backslashes in property paths. */ var stringToPath = function stringToPath(string) { var first = $strSlice(string, 0, 1); var last = $strSlice(string, -1); if (first === '%' && last !== '%') { throw new $SyntaxError('invalid intrinsic syntax, expected closing `%`'); } else if (last === '%' && first !== '%') { throw new $SyntaxError('invalid intrinsic syntax, expected opening `%`'); } var result = []; $replace(string, rePropName, function (match, number, quote, subString) { result[result.length] = quote ? $replace(subString, reEscapeChar, '$1') : number || match; }); return result; }; /* end adaptation */ var getBaseIntrinsic = function getBaseIntrinsic(name, allowMissing) { var intrinsicName = name; var alias; if (hasOwn(LEGACY_ALIASES, intrinsicName)) { alias = LEGACY_ALIASES[intrinsicName]; intrinsicName = '%' + alias[0] + '%'; } if (hasOwn(INTRINSICS, intrinsicName)) { var value = INTRINSICS[intrinsicName]; if (value === needsEval) { value = doEval(intrinsicName); } if (typeof value === 'undefined' && !allowMissing) { throw new $TypeError('intrinsic ' + name + ' exists, but is not available. Please file an issue!'); } return { alias: alias, name: intrinsicName, value: value }; } throw new $SyntaxError('intrinsic ' + name + ' does not exist!'); }; module.exports = function GetIntrinsic(name, allowMissing) { if (typeof name !== 'string' || name.length === 0) { throw new $TypeError('intrinsic name must be a non-empty string'); } if (arguments.length > 1 && typeof allowMissing !== 'boolean') { throw new $TypeError('"allowMissing" argument must be a boolean'); } var parts = stringToPath(name); var intrinsicBaseName = parts.length > 0 ? parts[0] : ''; var intrinsic = getBaseIntrinsic('%' + intrinsicBaseName + '%', allowMissing); var intrinsicRealName = intrinsic.name; var value = intrinsic.value; var skipFurtherCaching = false; var alias = intrinsic.alias; if (alias) { intrinsicBaseName = alias[0]; $spliceApply(parts, $concat([0, 1], alias)); } for (var i = 1, isOwn = true; i < parts.length; i += 1) { var part = parts[i]; var first = $strSlice(part, 0, 1); var last = $strSlice(part, -1); if ( ( (first === '"' || first === "'" || first === '`') || (last === '"' || last === "'" || last === '`') ) && first !== last ) { throw new $SyntaxError('property names with quotes must have matching quotes'); } if (part === 'constructor' || !isOwn) { skipFurtherCaching = true; } intrinsicBaseName += '.' + part; intrinsicRealName = '%' + intrinsicBaseName + '%'; if (hasOwn(INTRINSICS, intrinsicRealName)) { value = INTRINSICS[intrinsicRealName]; } else if (value != null) { if (!(part in value)) { if (!allowMissing) { throw new $TypeError('base intrinsic for ' + name + ' exists, but the property is not available.'); } return void undefined; } if ($gOPD && (i + 1) >= parts.length) { var desc = $gOPD(value, part); isOwn = !!desc; // By convention, when a data property is converted to an accessor // property to emulate a data property that does not suffer from // the override mistake, that accessor's getter is marked with // an `originalValue` property. Here, when we detect this, we // uphold the illusion by pretending to see that original data // property, i.e., returning the value rather than the getter // itself. if (isOwn && 'get' in desc && !('originalValue' in desc.get)) { value = desc.get; } else { value = value[part]; } } else { isOwn = hasOwn(value, part); value = value[part]; } if (isOwn && !skipFurtherCaching) { INTRINSICS[intrinsicRealName] = value; } } } return value; }; /***/ }), /***/ 91585: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; const {PassThrough} = __webpack_require__(92413); module.exports = options => { options = Object.assign({}, options); const {array} = options; let {encoding} = options; const buffer = encoding === 'buffer'; let objectMode = false; if (array) { objectMode = !(encoding || buffer); } else { encoding = encoding || 'utf8'; } if (buffer) { encoding = null; } let len = 0; const ret = []; const stream = new PassThrough({objectMode}); if (encoding) { stream.setEncoding(encoding); } stream.on('data', chunk => { ret.push(chunk); if (objectMode) { len = ret.length; } else { len += chunk.length; } }); stream.getBufferedValue = () => { if (array) { return ret; } return buffer ? Buffer.concat(ret, len) : ret.join(''); }; stream.getBufferedLength = () => len; return stream; }; /***/ }), /***/ 21766: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; const pump = __webpack_require__(18341); const bufferStream = __webpack_require__(91585); class MaxBufferError extends Error { constructor() { super('maxBuffer exceeded'); this.name = 'MaxBufferError'; } } function getStream(inputStream, options) { if (!inputStream) { return Promise.reject(new Error('Expected a stream')); } options = Object.assign({maxBuffer: Infinity}, options); const {maxBuffer} = options; let stream; return new Promise((resolve, reject) => { const rejectPromise = error => { if (error) { // A null check error.bufferedData = stream.getBufferedValue(); } reject(error); }; stream = pump(inputStream, bufferStream(options), error => { if (error) { rejectPromise(error); return; } resolve(); }); stream.on('data', () => { if (stream.getBufferedLength() > maxBuffer) { rejectPromise(new MaxBufferError()); } }); }).then(() => stream.getBufferedValue()); } module.exports = getStream; module.exports.buffer = (stream, options) => getStream(stream, Object.assign({}, options, {encoding: 'buffer'})); module.exports.array = (stream, options) => getStream(stream, Object.assign({}, options, {array: true})); module.exports.MaxBufferError = MaxBufferError; /***/ }), /***/ 47625: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { exports.setopts = setopts exports.ownProp = ownProp exports.makeAbs = makeAbs exports.finish = finish exports.mark = mark exports.isIgnored = isIgnored exports.childrenIgnored = childrenIgnored function ownProp (obj, field) { return Object.prototype.hasOwnProperty.call(obj, field) } var fs = __webpack_require__(35747) var path = __webpack_require__(85622) var minimatch = __webpack_require__(83973) var isAbsolute = __webpack_require__(38714) var Minimatch = minimatch.Minimatch function alphasort (a, b) { return a.localeCompare(b, 'en') } function setupIgnores (self, options) { self.ignore = options.ignore || [] if (!Array.isArray(self.ignore)) self.ignore = [self.ignore] if (self.ignore.length) { self.ignore = self.ignore.map(ignoreMap) } } // ignore patterns are always in dot:true mode. function ignoreMap (pattern) { var gmatcher = null if (pattern.slice(-3) === '/**') { var gpattern = pattern.replace(/(\/\*\*)+$/, '') gmatcher = new Minimatch(gpattern, { dot: true }) } return { matcher: new Minimatch(pattern, { dot: true }), gmatcher: gmatcher } } function setopts (self, pattern, options) { if (!options) options = {} // base-matching: just use globstar for that. if (options.matchBase && -1 === pattern.indexOf("/")) { if (options.noglobstar) { throw new Error("base matching requires globstar") } pattern = "**/" + pattern } self.silent = !!options.silent self.pattern = pattern self.strict = options.strict !== false self.realpath = !!options.realpath self.realpathCache = options.realpathCache || Object.create(null) self.follow = !!options.follow self.dot = !!options.dot self.mark = !!options.mark self.nodir = !!options.nodir if (self.nodir) self.mark = true self.sync = !!options.sync self.nounique = !!options.nounique self.nonull = !!options.nonull self.nosort = !!options.nosort self.nocase = !!options.nocase self.stat = !!options.stat self.noprocess = !!options.noprocess self.absolute = !!options.absolute self.fs = options.fs || fs self.maxLength = options.maxLength || Infinity self.cache = options.cache || Object.create(null) self.statCache = options.statCache || Object.create(null) self.symlinks = options.symlinks || Object.create(null) setupIgnores(self, options) self.changedCwd = false var cwd = process.cwd() if (!ownProp(options, "cwd")) self.cwd = cwd else { self.cwd = path.resolve(options.cwd) self.changedCwd = self.cwd !== cwd } self.root = options.root || path.resolve(self.cwd, "/") self.root = path.resolve(self.root) if (process.platform === "win32") self.root = self.root.replace(/\\/g, "/") // TODO: is an absolute `cwd` supposed to be resolved against `root`? // e.g. { cwd: '/test', root: __dirname } === path.join(__dirname, '/test') self.cwdAbs = isAbsolute(self.cwd) ? self.cwd : makeAbs(self, self.cwd) if (process.platform === "win32") self.cwdAbs = self.cwdAbs.replace(/\\/g, "/") self.nomount = !!options.nomount // disable comments and negation in Minimatch. // Note that they are not supported in Glob itself anyway. options.nonegate = true options.nocomment = true self.minimatch = new Minimatch(pattern, options) self.options = self.minimatch.options } function finish (self) { var nou = self.nounique var all = nou ? [] : Object.create(null) for (var i = 0, l = self.matches.length; i < l; i ++) { var matches = self.matches[i] if (!matches || Object.keys(matches).length === 0) { if (self.nonull) { // do like the shell, and spit out the literal glob var literal = self.minimatch.globSet[i] if (nou) all.push(literal) else all[literal] = true } } else { // had matches var m = Object.keys(matches) if (nou) all.push.apply(all, m) else m.forEach(function (m) { all[m] = true }) } } if (!nou) all = Object.keys(all) if (!self.nosort) all = all.sort(alphasort) // at *some* point we statted all of these if (self.mark) { for (var i = 0; i < all.length; i++) { all[i] = self._mark(all[i]) } if (self.nodir) { all = all.filter(function (e) { var notDir = !(/\/$/.test(e)) var c = self.cache[e] || self.cache[makeAbs(self, e)] if (notDir && c) notDir = c !== 'DIR' && !Array.isArray(c) return notDir }) } } if (self.ignore.length) all = all.filter(function(m) { return !isIgnored(self, m) }) self.found = all } function mark (self, p) { var abs = makeAbs(self, p) var c = self.cache[abs] var m = p if (c) { var isDir = c === 'DIR' || Array.isArray(c) var slash = p.slice(-1) === '/' if (isDir && !slash) m += '/' else if (!isDir && slash) m = m.slice(0, -1) if (m !== p) { var mabs = makeAbs(self, m) self.statCache[mabs] = self.statCache[abs] self.cache[mabs] = self.cache[abs] } } return m } // lotta situps... function makeAbs (self, f) { var abs = f if (f.charAt(0) === '/') { abs = path.join(self.root, f) } else if (isAbsolute(f) || f === '') { abs = f } else if (self.changedCwd) { abs = path.resolve(self.cwd, f) } else { abs = path.resolve(f) } if (process.platform === 'win32') abs = abs.replace(/\\/g, '/') return abs } // Return true, if pattern ends with globstar '**', for the accompanying parent directory. // Ex:- If node_modules/** is the pattern, add 'node_modules' to ignore list along with it's contents function isIgnored (self, path) { if (!self.ignore.length) return false return self.ignore.some(function(item) { return item.matcher.match(path) || !!(item.gmatcher && item.gmatcher.match(path)) }) } function childrenIgnored (self, path) { if (!self.ignore.length) return false return self.ignore.some(function(item) { return !!(item.gmatcher && item.gmatcher.match(path)) }) } /***/ }), /***/ 91957: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { // Approach: // // 1. Get the minimatch set // 2. For each pattern in the set, PROCESS(pattern, false) // 3. Store matches per-set, then uniq them // // PROCESS(pattern, inGlobStar) // Get the first [n] items from pattern that are all strings // Join these together. This is PREFIX. // If there is no more remaining, then stat(PREFIX) and // add to matches if it succeeds. END. // // If inGlobStar and PREFIX is symlink and points to dir // set ENTRIES = [] // else readdir(PREFIX) as ENTRIES // If fail, END // // with ENTRIES // If pattern[n] is GLOBSTAR // // handle the case where the globstar match is empty // // by pruning it out, and testing the resulting pattern // PROCESS(pattern[0..n] + pattern[n+1 .. $], false) // // handle other cases. // for ENTRY in ENTRIES (not dotfiles) // // attach globstar + tail onto the entry // // Mark that this entry is a globstar match // PROCESS(pattern[0..n] + ENTRY + pattern[n .. $], true) // // else // not globstar // for ENTRY in ENTRIES (not dotfiles, unless pattern[n] is dot) // Test ENTRY against pattern[n] // If fails, continue // If passes, PROCESS(pattern[0..n] + item + pattern[n+1 .. $]) // // Caveat: // Cache all stats and readdirs results to minimize syscall. Since all // we ever care about is existence and directory-ness, we can just keep // `true` for files, and [children,...] for directories, or `false` for // things that don't exist. module.exports = glob var rp = __webpack_require__(46863) var minimatch = __webpack_require__(83973) var Minimatch = minimatch.Minimatch var inherits = __webpack_require__(44124) var EE = __webpack_require__(28614).EventEmitter var path = __webpack_require__(85622) var assert = __webpack_require__(42357) var isAbsolute = __webpack_require__(38714) var globSync = __webpack_require__(29010) var common = __webpack_require__(47625) var setopts = common.setopts var ownProp = common.ownProp var inflight = __webpack_require__(52492) var util = __webpack_require__(31669) var childrenIgnored = common.childrenIgnored var isIgnored = common.isIgnored var once = __webpack_require__(1223) function glob (pattern, options, cb) { if (typeof options === 'function') cb = options, options = {} if (!options) options = {} if (options.sync) { if (cb) throw new TypeError('callback provided to sync glob') return globSync(pattern, options) } return new Glob(pattern, options, cb) } glob.sync = globSync var GlobSync = glob.GlobSync = globSync.GlobSync // old api surface glob.glob = glob function extend (origin, add) { if (add === null || typeof add !== 'object') { return origin } var keys = Object.keys(add) var i = keys.length while (i--) { origin[keys[i]] = add[keys[i]] } return origin } glob.hasMagic = function (pattern, options_) { var options = extend({}, options_) options.noprocess = true var g = new Glob(pattern, options) var set = g.minimatch.set if (!pattern) return false if (set.length > 1) return true for (var j = 0; j < set[0].length; j++) { if (typeof set[0][j] !== 'string') return true } return false } glob.Glob = Glob inherits(Glob, EE) function Glob (pattern, options, cb) { if (typeof options === 'function') { cb = options options = null } if (options && options.sync) { if (cb) throw new TypeError('callback provided to sync glob') return new GlobSync(pattern, options) } if (!(this instanceof Glob)) return new Glob(pattern, options, cb) setopts(this, pattern, options) this._didRealPath = false // process each pattern in the minimatch set var n = this.minimatch.set.length // The matches are stored as {: true,...} so that // duplicates are automagically pruned. // Later, we do an Object.keys() on these. // Keep them as a list so we can fill in when nonull is set. this.matches = new Array(n) if (typeof cb === 'function') { cb = once(cb) this.on('error', cb) this.on('end', function (matches) { cb(null, matches) }) } var self = this this._processing = 0 this._emitQueue = [] this._processQueue = [] this.paused = false if (this.noprocess) return this if (n === 0) return done() var sync = true for (var i = 0; i < n; i ++) { this._process(this.minimatch.set[i], i, false, done) } sync = false function done () { --self._processing if (self._processing <= 0) { if (sync) { process.nextTick(function () { self._finish() }) } else { self._finish() } } } } Glob.prototype._finish = function () { assert(this instanceof Glob) if (this.aborted) return if (this.realpath && !this._didRealpath) return this._realpath() common.finish(this) this.emit('end', this.found) } Glob.prototype._realpath = function () { if (this._didRealpath) return this._didRealpath = true var n = this.matches.length if (n === 0) return this._finish() var self = this for (var i = 0; i < this.matches.length; i++) this._realpathSet(i, next) function next () { if (--n === 0) self._finish() } } Glob.prototype._realpathSet = function (index, cb) { var matchset = this.matches[index] if (!matchset) return cb() var found = Object.keys(matchset) var self = this var n = found.length if (n === 0) return cb() var set = this.matches[index] = Object.create(null) found.forEach(function (p, i) { // If there's a problem with the stat, then it means that // one or more of the links in the realpath couldn't be // resolved. just return the abs value in that case. p = self._makeAbs(p) rp.realpath(p, self.realpathCache, function (er, real) { if (!er) set[real] = true else if (er.syscall === 'stat') set[p] = true else self.emit('error', er) // srsly wtf right here if (--n === 0) { self.matches[index] = set cb() } }) }) } Glob.prototype._mark = function (p) { return common.mark(this, p) } Glob.prototype._makeAbs = function (f) { return common.makeAbs(this, f) } Glob.prototype.abort = function () { this.aborted = true this.emit('abort') } Glob.prototype.pause = function () { if (!this.paused) { this.paused = true this.emit('pause') } } Glob.prototype.resume = function () { if (this.paused) { this.emit('resume') this.paused = false if (this._emitQueue.length) { var eq = this._emitQueue.slice(0) this._emitQueue.length = 0 for (var i = 0; i < eq.length; i ++) { var e = eq[i] this._emitMatch(e[0], e[1]) } } if (this._processQueue.length) { var pq = this._processQueue.slice(0) this._processQueue.length = 0 for (var i = 0; i < pq.length; i ++) { var p = pq[i] this._processing-- this._process(p[0], p[1], p[2], p[3]) } } } } Glob.prototype._process = function (pattern, index, inGlobStar, cb) { assert(this instanceof Glob) assert(typeof cb === 'function') if (this.aborted) return this._processing++ if (this.paused) { this._processQueue.push([pattern, index, inGlobStar, cb]) return } //console.error('PROCESS %d', this._processing, pattern) // Get the first [n] parts of pattern that are all strings. var n = 0 while (typeof pattern[n] === 'string') { n ++ } // now n is the index of the first one that is *not* a string. // see if there's anything else var prefix switch (n) { // if not, then this is rather simple case pattern.length: this._processSimple(pattern.join('/'), index, cb) return case 0: // pattern *starts* with some non-trivial item. // going to readdir(cwd), but not include the prefix in matches. prefix = null break default: // pattern has some string bits in the front. // whatever it starts with, whether that's 'absolute' like /foo/bar, // or 'relative' like '../baz' prefix = pattern.slice(0, n).join('/') break } var remain = pattern.slice(n) // get the list of entries. var read if (prefix === null) read = '.' else if (isAbsolute(prefix) || isAbsolute(pattern.join('/'))) { if (!prefix || !isAbsolute(prefix)) prefix = '/' + prefix read = prefix } else read = prefix var abs = this._makeAbs(read) //if ignored, skip _processing if (childrenIgnored(this, read)) return cb() var isGlobStar = remain[0] === minimatch.GLOBSTAR if (isGlobStar) this._processGlobStar(prefix, read, abs, remain, index, inGlobStar, cb) else this._processReaddir(prefix, read, abs, remain, index, inGlobStar, cb) } Glob.prototype._processReaddir = function (prefix, read, abs, remain, index, inGlobStar, cb) { var self = this this._readdir(abs, inGlobStar, function (er, entries) { return self._processReaddir2(prefix, read, abs, remain, index, inGlobStar, entries, cb) }) } Glob.prototype._processReaddir2 = function (prefix, read, abs, remain, index, inGlobStar, entries, cb) { // if the abs isn't a dir, then nothing can match! if (!entries) return cb() // It will only match dot entries if it starts with a dot, or if // dot is set. Stuff like @(.foo|.bar) isn't allowed. var pn = remain[0] var negate = !!this.minimatch.negate var rawGlob = pn._glob var dotOk = this.dot || rawGlob.charAt(0) === '.' var matchedEntries = [] for (var i = 0; i < entries.length; i++) { var e = entries[i] if (e.charAt(0) !== '.' || dotOk) { var m if (negate && !prefix) { m = !e.match(pn) } else { m = e.match(pn) } if (m) matchedEntries.push(e) } } //console.error('prd2', prefix, entries, remain[0]._glob, matchedEntries) var len = matchedEntries.length // If there are no matched entries, then nothing matches. if (len === 0) return cb() // if this is the last remaining pattern bit, then no need for // an additional stat *unless* the user has specified mark or // stat explicitly. We know they exist, since readdir returned // them. if (remain.length === 1 && !this.mark && !this.stat) { if (!this.matches[index]) this.matches[index] = Object.create(null) for (var i = 0; i < len; i ++) { var e = matchedEntries[i] if (prefix) { if (prefix !== '/') e = prefix + '/' + e else e = prefix + e } if (e.charAt(0) === '/' && !this.nomount) { e = path.join(this.root, e) } this._emitMatch(index, e) } // This was the last one, and no stats were needed return cb() } // now test all matched entries as stand-ins for that part // of the pattern. remain.shift() for (var i = 0; i < len; i ++) { var e = matchedEntries[i] var newPattern if (prefix) { if (prefix !== '/') e = prefix + '/' + e else e = prefix + e } this._process([e].concat(remain), index, inGlobStar, cb) } cb() } Glob.prototype._emitMatch = function (index, e) { if (this.aborted) return if (isIgnored(this, e)) return if (this.paused) { this._emitQueue.push([index, e]) return } var abs = isAbsolute(e) ? e : this._makeAbs(e) if (this.mark) e = this._mark(e) if (this.absolute) e = abs if (this.matches[index][e]) return if (this.nodir) { var c = this.cache[abs] if (c === 'DIR' || Array.isArray(c)) return } this.matches[index][e] = true var st = this.statCache[abs] if (st) this.emit('stat', e, st) this.emit('match', e) } Glob.prototype._readdirInGlobStar = function (abs, cb) { if (this.aborted) return // follow all symlinked directories forever // just proceed as if this is a non-globstar situation if (this.follow) return this._readdir(abs, false, cb) var lstatkey = 'lstat\0' + abs var self = this var lstatcb = inflight(lstatkey, lstatcb_) if (lstatcb) self.fs.lstat(abs, lstatcb) function lstatcb_ (er, lstat) { if (er && er.code === 'ENOENT') return cb() var isSym = lstat && lstat.isSymbolicLink() self.symlinks[abs] = isSym // If it's not a symlink or a dir, then it's definitely a regular file. // don't bother doing a readdir in that case. if (!isSym && lstat && !lstat.isDirectory()) { self.cache[abs] = 'FILE' cb() } else self._readdir(abs, false, cb) } } Glob.prototype._readdir = function (abs, inGlobStar, cb) { if (this.aborted) return cb = inflight('readdir\0'+abs+'\0'+inGlobStar, cb) if (!cb) return //console.error('RD %j %j', +inGlobStar, abs) if (inGlobStar && !ownProp(this.symlinks, abs)) return this._readdirInGlobStar(abs, cb) if (ownProp(this.cache, abs)) { var c = this.cache[abs] if (!c || c === 'FILE') return cb() if (Array.isArray(c)) return cb(null, c) } var self = this self.fs.readdir(abs, readdirCb(this, abs, cb)) } function readdirCb (self, abs, cb) { return function (er, entries) { if (er) self._readdirError(abs, er, cb) else self._readdirEntries(abs, entries, cb) } } Glob.prototype._readdirEntries = function (abs, entries, cb) { if (this.aborted) return // if we haven't asked to stat everything, then just // assume that everything in there exists, so we can avoid // having to stat it a second time. if (!this.mark && !this.stat) { for (var i = 0; i < entries.length; i ++) { var e = entries[i] if (abs === '/') e = abs + e else e = abs + '/' + e this.cache[e] = true } } this.cache[abs] = entries return cb(null, entries) } Glob.prototype._readdirError = function (f, er, cb) { if (this.aborted) return // handle errors, and cache the information switch (er.code) { case 'ENOTSUP': // https://github.com/isaacs/node-glob/issues/205 case 'ENOTDIR': // totally normal. means it *does* exist. var abs = this._makeAbs(f) this.cache[abs] = 'FILE' if (abs === this.cwdAbs) { var error = new Error(er.code + ' invalid cwd ' + this.cwd) error.path = this.cwd error.code = er.code this.emit('error', error) this.abort() } break case 'ENOENT': // not terribly unusual case 'ELOOP': case 'ENAMETOOLONG': case 'UNKNOWN': this.cache[this._makeAbs(f)] = false break default: // some unusual error. Treat as failure. this.cache[this._makeAbs(f)] = false if (this.strict) { this.emit('error', er) // If the error is handled, then we abort // if not, we threw out of here this.abort() } if (!this.silent) console.error('glob error', er) break } return cb() } Glob.prototype._processGlobStar = function (prefix, read, abs, remain, index, inGlobStar, cb) { var self = this this._readdir(abs, inGlobStar, function (er, entries) { self._processGlobStar2(prefix, read, abs, remain, index, inGlobStar, entries, cb) }) } Glob.prototype._processGlobStar2 = function (prefix, read, abs, remain, index, inGlobStar, entries, cb) { //console.error('pgs2', prefix, remain[0], entries) // no entries means not a dir, so it can never have matches // foo.txt/** doesn't match foo.txt if (!entries) return cb() // test without the globstar, and with every child both below // and replacing the globstar. var remainWithoutGlobStar = remain.slice(1) var gspref = prefix ? [ prefix ] : [] var noGlobStar = gspref.concat(remainWithoutGlobStar) // the noGlobStar pattern exits the inGlobStar state this._process(noGlobStar, index, false, cb) var isSym = this.symlinks[abs] var len = entries.length // If it's a symlink, and we're in a globstar, then stop if (isSym && inGlobStar) return cb() for (var i = 0; i < len; i++) { var e = entries[i] if (e.charAt(0) === '.' && !this.dot) continue // these two cases enter the inGlobStar state var instead = gspref.concat(entries[i], remainWithoutGlobStar) this._process(instead, index, true, cb) var below = gspref.concat(entries[i], remain) this._process(below, index, true, cb) } cb() } Glob.prototype._processSimple = function (prefix, index, cb) { // XXX review this. Shouldn't it be doing the mounting etc // before doing stat? kinda weird? var self = this this._stat(prefix, function (er, exists) { self._processSimple2(prefix, index, er, exists, cb) }) } Glob.prototype._processSimple2 = function (prefix, index, er, exists, cb) { //console.error('ps2', prefix, exists) if (!this.matches[index]) this.matches[index] = Object.create(null) // If it doesn't exist, then just mark the lack of results if (!exists) return cb() if (prefix && isAbsolute(prefix) && !this.nomount) { var trail = /[\/\\]$/.test(prefix) if (prefix.charAt(0) === '/') { prefix = path.join(this.root, prefix) } else { prefix = path.resolve(this.root, prefix) if (trail) prefix += '/' } } if (process.platform === 'win32') prefix = prefix.replace(/\\/g, '/') // Mark this as a match this._emitMatch(index, prefix) cb() } // Returns either 'DIR', 'FILE', or false Glob.prototype._stat = function (f, cb) { var abs = this._makeAbs(f) var needDir = f.slice(-1) === '/' if (f.length > this.maxLength) return cb() if (!this.stat && ownProp(this.cache, abs)) { var c = this.cache[abs] if (Array.isArray(c)) c = 'DIR' // It exists, but maybe not how we need it if (!needDir || c === 'DIR') return cb(null, c) if (needDir && c === 'FILE') return cb() // otherwise we have to stat, because maybe c=true // if we know it exists, but not what it is. } var exists var stat = this.statCache[abs] if (stat !== undefined) { if (stat === false) return cb(null, stat) else { var type = stat.isDirectory() ? 'DIR' : 'FILE' if (needDir && type === 'FILE') return cb() else return cb(null, type, stat) } } var self = this var statcb = inflight('stat\0' + abs, lstatcb_) if (statcb) self.fs.lstat(abs, statcb) function lstatcb_ (er, lstat) { if (lstat && lstat.isSymbolicLink()) { // If it's a symlink, then treat it as the target, unless // the target does not exist, then treat it as a file. return self.fs.stat(abs, function (er, stat) { if (er) self._stat2(f, abs, null, lstat, cb) else self._stat2(f, abs, er, stat, cb) }) } else { self._stat2(f, abs, er, lstat, cb) } } } Glob.prototype._stat2 = function (f, abs, er, stat, cb) { if (er && (er.code === 'ENOENT' || er.code === 'ENOTDIR')) { this.statCache[abs] = false return cb() } var needDir = f.slice(-1) === '/' this.statCache[abs] = stat if (abs.slice(-1) === '/' && stat && !stat.isDirectory()) return cb(null, false, stat) var c = true if (stat) c = stat.isDirectory() ? 'DIR' : 'FILE' this.cache[abs] = this.cache[abs] || c if (needDir && c === 'FILE') return cb() return cb(null, c, stat) } /***/ }), /***/ 29010: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { module.exports = globSync globSync.GlobSync = GlobSync var rp = __webpack_require__(46863) var minimatch = __webpack_require__(83973) var Minimatch = minimatch.Minimatch var Glob = __webpack_require__(91957).Glob var util = __webpack_require__(31669) var path = __webpack_require__(85622) var assert = __webpack_require__(42357) var isAbsolute = __webpack_require__(38714) var common = __webpack_require__(47625) var setopts = common.setopts var ownProp = common.ownProp var childrenIgnored = common.childrenIgnored var isIgnored = common.isIgnored function globSync (pattern, options) { if (typeof options === 'function' || arguments.length === 3) throw new TypeError('callback provided to sync glob\n'+ 'See: https://github.com/isaacs/node-glob/issues/167') return new GlobSync(pattern, options).found } function GlobSync (pattern, options) { if (!pattern) throw new Error('must provide pattern') if (typeof options === 'function' || arguments.length === 3) throw new TypeError('callback provided to sync glob\n'+ 'See: https://github.com/isaacs/node-glob/issues/167') if (!(this instanceof GlobSync)) return new GlobSync(pattern, options) setopts(this, pattern, options) if (this.noprocess) return this var n = this.minimatch.set.length this.matches = new Array(n) for (var i = 0; i < n; i ++) { this._process(this.minimatch.set[i], i, false) } this._finish() } GlobSync.prototype._finish = function () { assert(this instanceof GlobSync) if (this.realpath) { var self = this this.matches.forEach(function (matchset, index) { var set = self.matches[index] = Object.create(null) for (var p in matchset) { try { p = self._makeAbs(p) var real = rp.realpathSync(p, self.realpathCache) set[real] = true } catch (er) { if (er.syscall === 'stat') set[self._makeAbs(p)] = true else throw er } } }) } common.finish(this) } GlobSync.prototype._process = function (pattern, index, inGlobStar) { assert(this instanceof GlobSync) // Get the first [n] parts of pattern that are all strings. var n = 0 while (typeof pattern[n] === 'string') { n ++ } // now n is the index of the first one that is *not* a string. // See if there's anything else var prefix switch (n) { // if not, then this is rather simple case pattern.length: this._processSimple(pattern.join('/'), index) return case 0: // pattern *starts* with some non-trivial item. // going to readdir(cwd), but not include the prefix in matches. prefix = null break default: // pattern has some string bits in the front. // whatever it starts with, whether that's 'absolute' like /foo/bar, // or 'relative' like '../baz' prefix = pattern.slice(0, n).join('/') break } var remain = pattern.slice(n) // get the list of entries. var read if (prefix === null) read = '.' else if (isAbsolute(prefix) || isAbsolute(pattern.join('/'))) { if (!prefix || !isAbsolute(prefix)) prefix = '/' + prefix read = prefix } else read = prefix var abs = this._makeAbs(read) //if ignored, skip processing if (childrenIgnored(this, read)) return var isGlobStar = remain[0] === minimatch.GLOBSTAR if (isGlobStar) this._processGlobStar(prefix, read, abs, remain, index, inGlobStar) else this._processReaddir(prefix, read, abs, remain, index, inGlobStar) } GlobSync.prototype._processReaddir = function (prefix, read, abs, remain, index, inGlobStar) { var entries = this._readdir(abs, inGlobStar) // if the abs isn't a dir, then nothing can match! if (!entries) return // It will only match dot entries if it starts with a dot, or if // dot is set. Stuff like @(.foo|.bar) isn't allowed. var pn = remain[0] var negate = !!this.minimatch.negate var rawGlob = pn._glob var dotOk = this.dot || rawGlob.charAt(0) === '.' var matchedEntries = [] for (var i = 0; i < entries.length; i++) { var e = entries[i] if (e.charAt(0) !== '.' || dotOk) { var m if (negate && !prefix) { m = !e.match(pn) } else { m = e.match(pn) } if (m) matchedEntries.push(e) } } var len = matchedEntries.length // If there are no matched entries, then nothing matches. if (len === 0) return // if this is the last remaining pattern bit, then no need for // an additional stat *unless* the user has specified mark or // stat explicitly. We know they exist, since readdir returned // them. if (remain.length === 1 && !this.mark && !this.stat) { if (!this.matches[index]) this.matches[index] = Object.create(null) for (var i = 0; i < len; i ++) { var e = matchedEntries[i] if (prefix) { if (prefix.slice(-1) !== '/') e = prefix + '/' + e else e = prefix + e } if (e.charAt(0) === '/' && !this.nomount) { e = path.join(this.root, e) } this._emitMatch(index, e) } // This was the last one, and no stats were needed return } // now test all matched entries as stand-ins for that part // of the pattern. remain.shift() for (var i = 0; i < len; i ++) { var e = matchedEntries[i] var newPattern if (prefix) newPattern = [prefix, e] else newPattern = [e] this._process(newPattern.concat(remain), index, inGlobStar) } } GlobSync.prototype._emitMatch = function (index, e) { if (isIgnored(this, e)) return var abs = this._makeAbs(e) if (this.mark) e = this._mark(e) if (this.absolute) { e = abs } if (this.matches[index][e]) return if (this.nodir) { var c = this.cache[abs] if (c === 'DIR' || Array.isArray(c)) return } this.matches[index][e] = true if (this.stat) this._stat(e) } GlobSync.prototype._readdirInGlobStar = function (abs) { // follow all symlinked directories forever // just proceed as if this is a non-globstar situation if (this.follow) return this._readdir(abs, false) var entries var lstat var stat try { lstat = this.fs.lstatSync(abs) } catch (er) { if (er.code === 'ENOENT') { // lstat failed, doesn't exist return null } } var isSym = lstat && lstat.isSymbolicLink() this.symlinks[abs] = isSym // If it's not a symlink or a dir, then it's definitely a regular file. // don't bother doing a readdir in that case. if (!isSym && lstat && !lstat.isDirectory()) this.cache[abs] = 'FILE' else entries = this._readdir(abs, false) return entries } GlobSync.prototype._readdir = function (abs, inGlobStar) { var entries if (inGlobStar && !ownProp(this.symlinks, abs)) return this._readdirInGlobStar(abs) if (ownProp(this.cache, abs)) { var c = this.cache[abs] if (!c || c === 'FILE') return null if (Array.isArray(c)) return c } try { return this._readdirEntries(abs, this.fs.readdirSync(abs)) } catch (er) { this._readdirError(abs, er) return null } } GlobSync.prototype._readdirEntries = function (abs, entries) { // if we haven't asked to stat everything, then just // assume that everything in there exists, so we can avoid // having to stat it a second time. if (!this.mark && !this.stat) { for (var i = 0; i < entries.length; i ++) { var e = entries[i] if (abs === '/') e = abs + e else e = abs + '/' + e this.cache[e] = true } } this.cache[abs] = entries // mark and cache dir-ness return entries } GlobSync.prototype._readdirError = function (f, er) { // handle errors, and cache the information switch (er.code) { case 'ENOTSUP': // https://github.com/isaacs/node-glob/issues/205 case 'ENOTDIR': // totally normal. means it *does* exist. var abs = this._makeAbs(f) this.cache[abs] = 'FILE' if (abs === this.cwdAbs) { var error = new Error(er.code + ' invalid cwd ' + this.cwd) error.path = this.cwd error.code = er.code throw error } break case 'ENOENT': // not terribly unusual case 'ELOOP': case 'ENAMETOOLONG': case 'UNKNOWN': this.cache[this._makeAbs(f)] = false break default: // some unusual error. Treat as failure. this.cache[this._makeAbs(f)] = false if (this.strict) throw er if (!this.silent) console.error('glob error', er) break } } GlobSync.prototype._processGlobStar = function (prefix, read, abs, remain, index, inGlobStar) { var entries = this._readdir(abs, inGlobStar) // no entries means not a dir, so it can never have matches // foo.txt/** doesn't match foo.txt if (!entries) return // test without the globstar, and with every child both below // and replacing the globstar. var remainWithoutGlobStar = remain.slice(1) var gspref = prefix ? [ prefix ] : [] var noGlobStar = gspref.concat(remainWithoutGlobStar) // the noGlobStar pattern exits the inGlobStar state this._process(noGlobStar, index, false) var len = entries.length var isSym = this.symlinks[abs] // If it's a symlink, and we're in a globstar, then stop if (isSym && inGlobStar) return for (var i = 0; i < len; i++) { var e = entries[i] if (e.charAt(0) === '.' && !this.dot) continue // these two cases enter the inGlobStar state var instead = gspref.concat(entries[i], remainWithoutGlobStar) this._process(instead, index, true) var below = gspref.concat(entries[i], remain) this._process(below, index, true) } } GlobSync.prototype._processSimple = function (prefix, index) { // XXX review this. Shouldn't it be doing the mounting etc // before doing stat? kinda weird? var exists = this._stat(prefix) if (!this.matches[index]) this.matches[index] = Object.create(null) // If it doesn't exist, then just mark the lack of results if (!exists) return if (prefix && isAbsolute(prefix) && !this.nomount) { var trail = /[\/\\]$/.test(prefix) if (prefix.charAt(0) === '/') { prefix = path.join(this.root, prefix) } else { prefix = path.resolve(this.root, prefix) if (trail) prefix += '/' } } if (process.platform === 'win32') prefix = prefix.replace(/\\/g, '/') // Mark this as a match this._emitMatch(index, prefix) } // Returns either 'DIR', 'FILE', or false GlobSync.prototype._stat = function (f) { var abs = this._makeAbs(f) var needDir = f.slice(-1) === '/' if (f.length > this.maxLength) return false if (!this.stat && ownProp(this.cache, abs)) { var c = this.cache[abs] if (Array.isArray(c)) c = 'DIR' // It exists, but maybe not how we need it if (!needDir || c === 'DIR') return c if (needDir && c === 'FILE') return false // otherwise we have to stat, because maybe c=true // if we know it exists, but not what it is. } var exists var stat = this.statCache[abs] if (!stat) { var lstat try { lstat = this.fs.lstatSync(abs) } catch (er) { if (er && (er.code === 'ENOENT' || er.code === 'ENOTDIR')) { this.statCache[abs] = false return false } } if (lstat && lstat.isSymbolicLink()) { try { stat = this.fs.statSync(abs) } catch (er) { stat = lstat } } else { stat = lstat } } this.statCache[abs] = stat var c = true if (stat) c = stat.isDirectory() ? 'DIR' : 'FILE' this.cache[abs] = this.cache[abs] || c if (needDir && c === 'FILE') return false return c } GlobSync.prototype._mark = function (p) { return common.mark(this, p) } GlobSync.prototype._makeAbs = function (f) { return common.makeAbs(this, f) } /***/ }), /***/ 97152: /***/ ((module) => { "use strict"; class CancelError extends Error { constructor(reason) { super(reason || 'Promise was canceled'); this.name = 'CancelError'; } get isCanceled() { return true; } } class PCancelable { static fn(userFn) { return (...args) => { return new PCancelable((resolve, reject, onCancel) => { args.push(onCancel); userFn(...args).then(resolve, reject); }); }; } constructor(executor) { this._cancelHandlers = []; this._isPending = true; this._isCanceled = false; this._rejectOnCancel = true; this._promise = new Promise((resolve, reject) => { this._reject = reject; const onResolve = value => { this._isPending = false; resolve(value); }; const onReject = error => { this._isPending = false; reject(error); }; const onCancel = handler => { this._cancelHandlers.push(handler); }; Object.defineProperties(onCancel, { shouldReject: { get: () => this._rejectOnCancel, set: bool => { this._rejectOnCancel = bool; } } }); return executor(onResolve, onReject, onCancel); }); } then(onFulfilled, onRejected) { return this._promise.then(onFulfilled, onRejected); } catch(onRejected) { return this._promise.catch(onRejected); } finally(onFinally) { return this._promise.finally(onFinally); } cancel(reason) { if (!this._isPending || this._isCanceled) { return; } if (this._cancelHandlers.length > 0) { try { for (const handler of this._cancelHandlers) { handler(); } } catch (error) { this._reject(error); } } this._isCanceled = true; if (this._rejectOnCancel) { this._reject(new CancelError(reason)); } } get isCanceled() { return this._isCanceled; } } Object.setPrototypeOf(PCancelable.prototype, Promise.prototype); module.exports = PCancelable; module.exports.default = PCancelable; module.exports.CancelError = CancelError; /***/ }), /***/ 32013: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; const EventEmitter = __webpack_require__(28614); const getStream = __webpack_require__(21766); const is = __webpack_require__(7678); const PCancelable = __webpack_require__(97152); const requestAsEventEmitter = __webpack_require__(45296); const {HTTPError, ParseError, ReadError} = __webpack_require__(57083); const {options: mergeOptions} = __webpack_require__(47339); const {reNormalize} = __webpack_require__(76034); const asPromise = options => { const proxy = new EventEmitter(); const promise = new PCancelable((resolve, reject, onCancel) => { const emitter = requestAsEventEmitter(options); onCancel(emitter.abort); emitter.on('response', async response => { proxy.emit('response', response); const stream = is.null(options.encoding) ? getStream.buffer(response) : getStream(response, options); let data; try { data = await stream; } catch (error) { reject(new ReadError(error, options)); return; } const limitStatusCode = options.followRedirect ? 299 : 399; response.body = data; try { for (const [index, hook] of Object.entries(options.hooks.afterResponse)) { // eslint-disable-next-line no-await-in-loop response = await hook(response, updatedOptions => { updatedOptions = reNormalize(mergeOptions(options, { ...updatedOptions, retry: 0, throwHttpErrors: false })); // Remove any further hooks for that request, because we we'll call them anyway. // The loop continues. We don't want duplicates (asPromise recursion). updatedOptions.hooks.afterResponse = options.hooks.afterResponse.slice(0, index); return asPromise(updatedOptions); }); } } catch (error) { reject(error); return; } const {statusCode} = response; if (options.json && response.body) { try { response.body = JSON.parse(response.body); } catch (error) { if (statusCode >= 200 && statusCode < 300) { const parseError = new ParseError(error, statusCode, options, data); Object.defineProperty(parseError, 'response', {value: response}); reject(parseError); return; } } } if (statusCode !== 304 && (statusCode < 200 || statusCode > limitStatusCode)) { const error = new HTTPError(response, options); Object.defineProperty(error, 'response', {value: response}); if (emitter.retry(error) === false) { if (options.throwHttpErrors) { reject(error); return; } resolve(response); } return; } resolve(response); }); emitter.once('error', reject); [ 'request', 'redirect', 'uploadProgress', 'downloadProgress' ].forEach(event => emitter.on(event, (...args) => proxy.emit(event, ...args))); }); promise.on = (name, fn) => { proxy.on(name, fn); return promise; }; return promise; }; module.exports = asPromise; /***/ }), /***/ 93900: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; const {PassThrough} = __webpack_require__(92413); const duplexer3 = __webpack_require__(7994); const requestAsEventEmitter = __webpack_require__(45296); const {HTTPError, ReadError} = __webpack_require__(57083); module.exports = options => { const input = new PassThrough(); const output = new PassThrough(); const proxy = duplexer3(input, output); const piped = new Set(); let isFinished = false; options.retry.retries = () => 0; if (options.body) { proxy.write = () => { throw new Error('Got\'s stream is not writable when the `body` option is used'); }; } const emitter = requestAsEventEmitter(options, input); // Cancels the request proxy._destroy = emitter.abort; emitter.on('response', response => { const {statusCode} = response; response.on('error', error => { proxy.emit('error', new ReadError(error, options)); }); if (options.throwHttpErrors && statusCode !== 304 && (statusCode < 200 || statusCode > 299)) { proxy.emit('error', new HTTPError(response, options), null, response); return; } isFinished = true; response.pipe(output); for (const destination of piped) { if (destination.headersSent) { continue; } for (const [key, value] of Object.entries(response.headers)) { // Got gives *decompressed* data. Overriding `content-encoding` header would result in an error. // It's not possible to decompress already decompressed data, is it? const allowed = options.decompress ? key !== 'content-encoding' : true; if (allowed) { destination.setHeader(key, value); } } destination.statusCode = response.statusCode; } proxy.emit('response', response); }); [ 'error', 'request', 'redirect', 'uploadProgress', 'downloadProgress' ].forEach(event => emitter.on(event, (...args) => proxy.emit(event, ...args))); const pipe = proxy.pipe.bind(proxy); const unpipe = proxy.unpipe.bind(proxy); proxy.pipe = (destination, options) => { if (isFinished) { throw new Error('Failed to pipe. The response has been emitted already.'); } const result = pipe(destination, options); if (Reflect.has(destination, 'setHeader')) { piped.add(destination); } return result; }; proxy.unpipe = stream => { piped.delete(stream); return unpipe(stream); }; return proxy; }; /***/ }), /***/ 36030: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; const errors = __webpack_require__(57083); const asStream = __webpack_require__(93900); const asPromise = __webpack_require__(32013); const normalizeArguments = __webpack_require__(76034); const merge = __webpack_require__(47339); const deepFreeze = __webpack_require__(53970); const getPromiseOrStream = options => options.stream ? asStream(options) : asPromise(options); const aliases = [ 'get', 'post', 'put', 'patch', 'head', 'delete' ]; const create = defaults => { defaults = merge({}, defaults); normalizeArguments.preNormalize(defaults.options); if (!defaults.handler) { // This can't be getPromiseOrStream, because when merging // the chain would stop at this point and no further handlers would be called. defaults.handler = (options, next) => next(options); } function got(url, options) { try { return defaults.handler(normalizeArguments(url, options, defaults), getPromiseOrStream); } catch (error) { if (options && options.stream) { throw error; } else { return Promise.reject(error); } } } got.create = create; got.extend = options => { let mutableDefaults; if (options && Reflect.has(options, 'mutableDefaults')) { mutableDefaults = options.mutableDefaults; delete options.mutableDefaults; } else { mutableDefaults = defaults.mutableDefaults; } return create({ options: merge.options(defaults.options, options), handler: defaults.handler, mutableDefaults }); }; got.mergeInstances = (...args) => create(merge.instances(args)); got.stream = (url, options) => got(url, {...options, stream: true}); for (const method of aliases) { got[method] = (url, options) => got(url, {...options, method}); got.stream[method] = (url, options) => got.stream(url, {...options, method}); } Object.assign(got, {...errors, mergeOptions: merge.options}); Object.defineProperty(got, 'defaults', { value: defaults.mutableDefaults ? defaults : deepFreeze(defaults), writable: defaults.mutableDefaults, configurable: defaults.mutableDefaults, enumerable: true }); return got; }; module.exports = create; /***/ }), /***/ 57083: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; const urlLib = __webpack_require__(78835); const http = __webpack_require__(98605); const PCancelable = __webpack_require__(97152); const is = __webpack_require__(7678); class GotError extends Error { constructor(message, error, options) { super(message); Error.captureStackTrace(this, this.constructor); this.name = 'GotError'; if (!is.undefined(error.code)) { this.code = error.code; } Object.assign(this, { host: options.host, hostname: options.hostname, method: options.method, path: options.path, socketPath: options.socketPath, protocol: options.protocol, url: options.href, gotOptions: options }); } } module.exports.GotError = GotError; module.exports.CacheError = class extends GotError { constructor(error, options) { super(error.message, error, options); this.name = 'CacheError'; } }; module.exports.RequestError = class extends GotError { constructor(error, options) { super(error.message, error, options); this.name = 'RequestError'; } }; module.exports.ReadError = class extends GotError { constructor(error, options) { super(error.message, error, options); this.name = 'ReadError'; } }; module.exports.ParseError = class extends GotError { constructor(error, statusCode, options, data) { super(`${error.message} in "${urlLib.format(options)}": \n${data.slice(0, 77)}...`, error, options); this.name = 'ParseError'; this.statusCode = statusCode; this.statusMessage = http.STATUS_CODES[this.statusCode]; } }; module.exports.HTTPError = class extends GotError { constructor(response, options) { const {statusCode} = response; let {statusMessage} = response; if (statusMessage) { statusMessage = statusMessage.replace(/\r?\n/g, ' ').trim(); } else { statusMessage = http.STATUS_CODES[statusCode]; } super(`Response code ${statusCode} (${statusMessage})`, {}, options); this.name = 'HTTPError'; this.statusCode = statusCode; this.statusMessage = statusMessage; this.headers = response.headers; this.body = response.body; } }; module.exports.MaxRedirectsError = class extends GotError { constructor(statusCode, redirectUrls, options) { super('Redirected 10 times. Aborting.', {}, options); this.name = 'MaxRedirectsError'; this.statusCode = statusCode; this.statusMessage = http.STATUS_CODES[this.statusCode]; this.redirectUrls = redirectUrls; } }; module.exports.UnsupportedProtocolError = class extends GotError { constructor(options) { super(`Unsupported protocol "${options.protocol}"`, {}, options); this.name = 'UnsupportedProtocolError'; } }; module.exports.TimeoutError = class extends GotError { constructor(error, options) { super(error.message, {code: 'ETIMEDOUT'}, options); this.name = 'TimeoutError'; this.event = error.event; } }; module.exports.CancelError = PCancelable.CancelError; /***/ }), /***/ 46715: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; const decompressResponse = __webpack_require__(82391); const is = __webpack_require__(7678); const mimicResponse = __webpack_require__(42610); const progress = __webpack_require__(12308); module.exports = (response, options, emitter) => { const downloadBodySize = Number(response.headers['content-length']) || null; const progressStream = progress.download(response, emitter, downloadBodySize); mimicResponse(response, progressStream); const newResponse = options.decompress === true && is.function(decompressResponse) && options.method !== 'HEAD' ? decompressResponse(progressStream) : progressStream; if (!options.decompress && ['gzip', 'deflate'].includes(response.headers['content-encoding'])) { options.encoding = null; } emitter.emit('response', newResponse); emitter.emit('downloadProgress', { percent: 0, transferred: 0, total: downloadBodySize }); response.pipe(progressStream); }; /***/ }), /***/ 44462: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; const pkg = __webpack_require__(9248); const create = __webpack_require__(36030); const defaults = { options: { retry: { retries: 2, methods: [ 'GET', 'PUT', 'HEAD', 'DELETE', 'OPTIONS', 'TRACE' ], statusCodes: [ 408, 413, 429, 500, 502, 503, 504 ], errorCodes: [ 'ETIMEDOUT', 'ECONNRESET', 'EADDRINUSE', 'ECONNREFUSED', 'EPIPE', 'ENOTFOUND', 'ENETUNREACH', 'EAI_AGAIN' ] }, headers: { 'user-agent': `${pkg.name}/${pkg.version} (https://github.com/sindresorhus/got)` }, hooks: { beforeRequest: [], beforeRedirect: [], beforeRetry: [], afterResponse: [] }, decompress: true, throwHttpErrors: true, followRedirect: true, stream: false, form: false, json: false, cache: false, useElectronNet: false }, mutableDefaults: false }; const got = create(defaults); module.exports = got; /***/ }), /***/ 21924: /***/ ((module) => { "use strict"; module.exports = [ 'beforeError', 'init', 'beforeRequest', 'beforeRedirect', 'beforeRetry', 'afterResponse' ]; /***/ }), /***/ 47339: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; const {URL} = __webpack_require__(78835); const is = __webpack_require__(7678); const knownHookEvents = __webpack_require__(21924); const merge = (target, ...sources) => { for (const source of sources) { for (const [key, sourceValue] of Object.entries(source)) { if (is.undefined(sourceValue)) { continue; } const targetValue = target[key]; if (is.urlInstance(targetValue) && (is.urlInstance(sourceValue) || is.string(sourceValue))) { target[key] = new URL(sourceValue, targetValue); } else if (is.plainObject(sourceValue)) { if (is.plainObject(targetValue)) { target[key] = merge({}, targetValue, sourceValue); } else { target[key] = merge({}, sourceValue); } } else if (is.array(sourceValue)) { target[key] = merge([], sourceValue); } else { target[key] = sourceValue; } } } return target; }; const mergeOptions = (...sources) => { sources = sources.map(source => source || {}); const merged = merge({}, ...sources); const hooks = {}; for (const hook of knownHookEvents) { hooks[hook] = []; } for (const source of sources) { if (source.hooks) { for (const hook of knownHookEvents) { hooks[hook] = hooks[hook].concat(source.hooks[hook]); } } } merged.hooks = hooks; return merged; }; const mergeInstances = (instances, methods) => { const handlers = instances.map(instance => instance.defaults.handler); const size = instances.length - 1; return { methods, options: mergeOptions(...instances.map(instance => instance.defaults.options)), handler: (options, next) => { let iteration = -1; const iterate = options => handlers[++iteration](options, iteration === size ? next : iterate); return iterate(options); } }; }; module.exports = merge; module.exports.options = mergeOptions; module.exports.instances = mergeInstances; /***/ }), /***/ 76034: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; const {URL, URLSearchParams} = __webpack_require__(78835); // TODO: Use the `URL` global when targeting Node.js 10 const urlLib = __webpack_require__(78835); const is = __webpack_require__(7678); const urlParseLax = __webpack_require__(13194); const lowercaseKeys = __webpack_require__(9662); const urlToOptions = __webpack_require__(65491); const isFormData = __webpack_require__(18272); const merge = __webpack_require__(47339); const knownHookEvents = __webpack_require__(21924); const retryAfterStatusCodes = new Set([413, 429, 503]); // `preNormalize` handles static options (e.g. headers). // For example, when you create a custom instance and make a request // with no static changes, they won't be normalized again. // // `normalize` operates on dynamic options - they cannot be saved. // For example, `body` is everytime different per request. // When it's done normalizing the new options, it performs merge() // on the prenormalized options and the normalized ones. const preNormalize = (options, defaults) => { if (is.nullOrUndefined(options.headers)) { options.headers = {}; } else { options.headers = lowercaseKeys(options.headers); } if (options.baseUrl && !options.baseUrl.toString().endsWith('/')) { options.baseUrl += '/'; } if (options.stream) { options.json = false; } if (is.nullOrUndefined(options.hooks)) { options.hooks = {}; } else if (!is.object(options.hooks)) { throw new TypeError(`Parameter \`hooks\` must be an object, not ${is(options.hooks)}`); } for (const event of knownHookEvents) { if (is.nullOrUndefined(options.hooks[event])) { if (defaults) { options.hooks[event] = [...defaults.hooks[event]]; } else { options.hooks[event] = []; } } } if (is.number(options.timeout)) { options.gotTimeout = {request: options.timeout}; } else if (is.object(options.timeout)) { options.gotTimeout = options.timeout; } delete options.timeout; const {retry} = options; options.retry = { retries: 0, methods: [], statusCodes: [], errorCodes: [] }; if (is.nonEmptyObject(defaults) && retry !== false) { options.retry = {...defaults.retry}; } if (retry !== false) { if (is.number(retry)) { options.retry.retries = retry; } else { options.retry = {...options.retry, ...retry}; } } if (options.gotTimeout) { options.retry.maxRetryAfter = Math.min(...[options.gotTimeout.request, options.gotTimeout.connection].filter(n => !is.nullOrUndefined(n))); } if (is.array(options.retry.methods)) { options.retry.methods = new Set(options.retry.methods.map(method => method.toUpperCase())); } if (is.array(options.retry.statusCodes)) { options.retry.statusCodes = new Set(options.retry.statusCodes); } if (is.array(options.retry.errorCodes)) { options.retry.errorCodes = new Set(options.retry.errorCodes); } return options; }; const normalize = (url, options, defaults) => { if (is.plainObject(url)) { options = {...url, ...options}; url = options.url || {}; delete options.url; } if (defaults) { options = merge({}, defaults.options, options ? preNormalize(options, defaults.options) : {}); } else { options = merge({}, preNormalize(options)); } if (!is.string(url) && !is.object(url)) { throw new TypeError(`Parameter \`url\` must be a string or object, not ${is(url)}`); } if (is.string(url)) { if (options.baseUrl) { if (url.toString().startsWith('/')) { url = url.toString().slice(1); } url = urlToOptions(new URL(url, options.baseUrl)); } else { url = url.replace(/^unix:/, 'http://$&'); url = urlParseLax(url); } } else if (is(url) === 'URL') { url = urlToOptions(url); } // Override both null/undefined with default protocol options = merge({path: ''}, url, {protocol: url.protocol || 'https:'}, options); for (const hook of options.hooks.init) { const called = hook(options); if (is.promise(called)) { throw new TypeError('The `init` hook must be a synchronous function'); } } const {baseUrl} = options; Object.defineProperty(options, 'baseUrl', { set: () => { throw new Error('Failed to set baseUrl. Options are normalized already.'); }, get: () => baseUrl }); const {query} = options; if (is.nonEmptyString(query) || is.nonEmptyObject(query) || query instanceof URLSearchParams) { if (!is.string(query)) { options.query = (new URLSearchParams(query)).toString(); } options.path = `${options.path.split('?')[0]}?${options.query}`; delete options.query; } if (options.hostname === 'unix') { const matches = /(.+?):(.+)/.exec(options.path); if (matches) { const [, socketPath, path] = matches; options = { ...options, socketPath, path, host: null }; } } const {headers} = options; for (const [key, value] of Object.entries(headers)) { if (is.nullOrUndefined(value)) { delete headers[key]; } } if (options.json && is.undefined(headers.accept)) { headers.accept = 'application/json'; } if (options.decompress && is.undefined(headers['accept-encoding'])) { headers['accept-encoding'] = 'gzip, deflate'; } const {body} = options; if (is.nullOrUndefined(body)) { options.method = options.method ? options.method.toUpperCase() : 'GET'; } else { const isObject = is.object(body) && !is.buffer(body) && !is.nodeStream(body); if (!is.nodeStream(body) && !is.string(body) && !is.buffer(body) && !(options.form || options.json)) { throw new TypeError('The `body` option must be a stream.Readable, string or Buffer'); } if (options.json && !(isObject || is.array(body))) { throw new TypeError('The `body` option must be an Object or Array when the `json` option is used'); } if (options.form && !isObject) { throw new TypeError('The `body` option must be an Object when the `form` option is used'); } if (isFormData(body)) { // Special case for https://github.com/form-data/form-data headers['content-type'] = headers['content-type'] || `multipart/form-data; boundary=${body.getBoundary()}`; } else if (options.form) { headers['content-type'] = headers['content-type'] || 'application/x-www-form-urlencoded'; options.body = (new URLSearchParams(body)).toString(); } else if (options.json) { headers['content-type'] = headers['content-type'] || 'application/json'; options.body = JSON.stringify(body); } options.method = options.method ? options.method.toUpperCase() : 'POST'; } if (!is.function(options.retry.retries)) { const {retries} = options.retry; options.retry.retries = (iteration, error) => { if (iteration > retries) { return 0; } if ((!error || !options.retry.errorCodes.has(error.code)) && (!options.retry.methods.has(error.method) || !options.retry.statusCodes.has(error.statusCode))) { return 0; } if (Reflect.has(error, 'headers') && Reflect.has(error.headers, 'retry-after') && retryAfterStatusCodes.has(error.statusCode)) { let after = Number(error.headers['retry-after']); if (is.nan(after)) { after = Date.parse(error.headers['retry-after']) - Date.now(); } else { after *= 1000; } if (after > options.retry.maxRetryAfter) { return 0; } return after; } if (error.statusCode === 413) { return 0; } const noise = Math.random() * 100; return ((2 ** (iteration - 1)) * 1000) + noise; }; } return options; }; const reNormalize = options => normalize(urlLib.format(options), options); module.exports = normalize; module.exports.preNormalize = preNormalize; module.exports.reNormalize = reNormalize; /***/ }), /***/ 12308: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; const {Transform} = __webpack_require__(92413); module.exports = { download(response, emitter, downloadBodySize) { let downloaded = 0; return new Transform({ transform(chunk, encoding, callback) { downloaded += chunk.length; const percent = downloadBodySize ? downloaded / downloadBodySize : 0; // Let `flush()` be responsible for emitting the last event if (percent < 1) { emitter.emit('downloadProgress', { percent, transferred: downloaded, total: downloadBodySize }); } callback(null, chunk); }, flush(callback) { emitter.emit('downloadProgress', { percent: 1, transferred: downloaded, total: downloadBodySize }); callback(); } }); }, upload(request, emitter, uploadBodySize) { const uploadEventFrequency = 150; let uploaded = 0; let progressInterval; emitter.emit('uploadProgress', { percent: 0, transferred: 0, total: uploadBodySize }); request.once('error', () => { clearInterval(progressInterval); }); request.once('response', () => { clearInterval(progressInterval); emitter.emit('uploadProgress', { percent: 1, transferred: uploaded, total: uploadBodySize }); }); request.once('socket', socket => { const onSocketConnect = () => { progressInterval = setInterval(() => { const lastUploaded = uploaded; /* istanbul ignore next: see #490 (occurs randomly!) */ const headersSize = request._header ? Buffer.byteLength(request._header) : 0; uploaded = socket.bytesWritten - headersSize; // Don't emit events with unchanged progress and // prevent last event from being emitted, because // it's emitted when `response` is emitted if (uploaded === lastUploaded || uploaded === uploadBodySize) { return; } emitter.emit('uploadProgress', { percent: uploadBodySize ? uploaded / uploadBodySize : 0, transferred: uploaded, total: uploadBodySize }); }, uploadEventFrequency); }; /* istanbul ignore next: hard to test */ if (socket.connecting) { socket.once('connect', onSocketConnect); } else if (socket.writable) { // The socket is being reused from pool, // so the connect event will not be emitted onSocketConnect(); } }); } }; /***/ }), /***/ 45296: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; const {URL} = __webpack_require__(78835); // TODO: Use the `URL` global when targeting Node.js 10 const util = __webpack_require__(31669); const EventEmitter = __webpack_require__(28614); const http = __webpack_require__(98605); const https = __webpack_require__(57211); const urlLib = __webpack_require__(78835); const CacheableRequest = __webpack_require__(78116); const toReadableStream = __webpack_require__(53158); const is = __webpack_require__(7678); const timer = __webpack_require__(19308); const timedOut = __webpack_require__(44477); const getBodySize = __webpack_require__(78891); const getResponse = __webpack_require__(46715); const progress = __webpack_require__(12308); const {CacheError, UnsupportedProtocolError, MaxRedirectsError, RequestError, TimeoutError} = __webpack_require__(57083); const urlToOptions = __webpack_require__(65491); const getMethodRedirectCodes = new Set([300, 301, 302, 303, 304, 305, 307, 308]); const allMethodRedirectCodes = new Set([300, 303, 307, 308]); module.exports = (options, input) => { const emitter = new EventEmitter(); const redirects = []; let currentRequest; let requestUrl; let redirectString; let uploadBodySize; let retryCount = 0; let shouldAbort = false; const setCookie = options.cookieJar ? util.promisify(options.cookieJar.setCookie.bind(options.cookieJar)) : null; const getCookieString = options.cookieJar ? util.promisify(options.cookieJar.getCookieString.bind(options.cookieJar)) : null; const agents = is.object(options.agent) ? options.agent : null; const emitError = async error => { try { for (const hook of options.hooks.beforeError) { // eslint-disable-next-line no-await-in-loop error = await hook(error); } emitter.emit('error', error); } catch (error2) { emitter.emit('error', error2); } }; const get = async options => { const currentUrl = redirectString || requestUrl; if (options.protocol !== 'http:' && options.protocol !== 'https:') { throw new UnsupportedProtocolError(options); } decodeURI(currentUrl); let fn; if (is.function(options.request)) { fn = {request: options.request}; } else { fn = options.protocol === 'https:' ? https : http; } if (agents) { const protocolName = options.protocol === 'https:' ? 'https' : 'http'; options.agent = agents[protocolName] || options.agent; } /* istanbul ignore next: electron.net is broken */ if (options.useElectronNet && process.versions.electron) { const r = ({x: require})['yx'.slice(1)]; // Trick webpack const electron = r('electron'); fn = electron.net || electron.remote.net; } if (options.cookieJar) { const cookieString = await getCookieString(currentUrl, {}); if (is.nonEmptyString(cookieString)) { options.headers.cookie = cookieString; } } let timings; const handleResponse = async response => { try { /* istanbul ignore next: fixes https://github.com/electron/electron/blob/cbb460d47628a7a146adf4419ed48550a98b2923/lib/browser/api/net.js#L59-L65 */ if (options.useElectronNet) { response = new Proxy(response, { get: (target, name) => { if (name === 'trailers' || name === 'rawTrailers') { return []; } const value = target[name]; return is.function(value) ? value.bind(target) : value; } }); } const {statusCode} = response; response.url = currentUrl; response.requestUrl = requestUrl; response.retryCount = retryCount; response.timings = timings; response.redirectUrls = redirects; response.request = { gotOptions: options }; const rawCookies = response.headers['set-cookie']; if (options.cookieJar && rawCookies) { await Promise.all(rawCookies.map(rawCookie => setCookie(rawCookie, response.url))); } if (options.followRedirect && 'location' in response.headers) { if (allMethodRedirectCodes.has(statusCode) || (getMethodRedirectCodes.has(statusCode) && (options.method === 'GET' || options.method === 'HEAD'))) { response.resume(); // We're being redirected, we don't care about the response. if (statusCode === 303) { // Server responded with "see other", indicating that the resource exists at another location, // and the client should request it from that location via GET or HEAD. options.method = 'GET'; } if (redirects.length >= 10) { throw new MaxRedirectsError(statusCode, redirects, options); } // Handles invalid URLs. See https://github.com/sindresorhus/got/issues/604 const redirectBuffer = Buffer.from(response.headers.location, 'binary').toString(); const redirectURL = new URL(redirectBuffer, currentUrl); redirectString = redirectURL.toString(); redirects.push(redirectString); const redirectOptions = { ...options, ...urlToOptions(redirectURL) }; for (const hook of options.hooks.beforeRedirect) { // eslint-disable-next-line no-await-in-loop await hook(redirectOptions); } emitter.emit('redirect', response, redirectOptions); await get(redirectOptions); return; } } getResponse(response, options, emitter); } catch (error) { emitError(error); } }; const handleRequest = request => { if (shouldAbort) { request.once('error', () => {}); request.abort(); return; } currentRequest = request; request.once('error', error => { if (request.aborted) { return; } if (error instanceof timedOut.TimeoutError) { error = new TimeoutError(error, options); } else { error = new RequestError(error, options); } if (emitter.retry(error) === false) { emitError(error); } }); timings = timer(request); progress.upload(request, emitter, uploadBodySize); if (options.gotTimeout) { timedOut(request, options.gotTimeout, options); } emitter.emit('request', request); const uploadComplete = () => { request.emit('upload-complete'); }; try { if (is.nodeStream(options.body)) { options.body.once('end', uploadComplete); options.body.pipe(request); options.body = undefined; } else if (options.body) { request.end(options.body, uploadComplete); } else if (input && (options.method === 'POST' || options.method === 'PUT' || options.method === 'PATCH')) { input.once('end', uploadComplete); input.pipe(request); } else { request.end(uploadComplete); } } catch (error) { emitError(new RequestError(error, options)); } }; if (options.cache) { const cacheableRequest = new CacheableRequest(fn.request, options.cache); const cacheRequest = cacheableRequest(options, handleResponse); cacheRequest.once('error', error => { if (error instanceof CacheableRequest.RequestError) { emitError(new RequestError(error, options)); } else { emitError(new CacheError(error, options)); } }); cacheRequest.once('request', handleRequest); } else { // Catches errors thrown by calling fn.request(...) try { handleRequest(fn.request(options, handleResponse)); } catch (error) { emitError(new RequestError(error, options)); } } }; emitter.retry = error => { let backoff; try { backoff = options.retry.retries(++retryCount, error); } catch (error2) { emitError(error2); return; } if (backoff) { const retry = async options => { try { for (const hook of options.hooks.beforeRetry) { // eslint-disable-next-line no-await-in-loop await hook(options, error, retryCount); } await get(options); } catch (error) { emitError(error); } }; setTimeout(retry, backoff, {...options, forceRefresh: true}); return true; } return false; }; emitter.abort = () => { if (currentRequest) { currentRequest.once('error', () => {}); currentRequest.abort(); } else { shouldAbort = true; } }; setImmediate(async () => { try { // Convert buffer to stream to receive upload progress events (#322) const {body} = options; if (is.buffer(body)) { options.body = toReadableStream(body); uploadBodySize = body.length; } else { uploadBodySize = await getBodySize(options); } if (is.undefined(options.headers['content-length']) && is.undefined(options.headers['transfer-encoding'])) { if ((uploadBodySize > 0 || options.method === 'PUT') && !is.null(uploadBodySize)) { options.headers['content-length'] = uploadBodySize; } } for (const hook of options.hooks.beforeRequest) { // eslint-disable-next-line no-await-in-loop await hook(options); } requestUrl = options.href || (new URL(options.path, urlLib.format(options))).toString(); await get(options); } catch (error) { emitError(error); } }); return emitter; }; /***/ }), /***/ 53970: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; const is = __webpack_require__(7678); module.exports = function deepFreeze(object) { for (const [key, value] of Object.entries(object)) { if (is.plainObject(value) || is.array(value)) { deepFreeze(object[key]); } } return Object.freeze(object); }; /***/ }), /***/ 78891: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; const fs = __webpack_require__(35747); const util = __webpack_require__(31669); const is = __webpack_require__(7678); const isFormData = __webpack_require__(18272); module.exports = async options => { const {body} = options; if (options.headers['content-length']) { return Number(options.headers['content-length']); } if (!body && !options.stream) { return 0; } if (is.string(body)) { return Buffer.byteLength(body); } if (isFormData(body)) { return util.promisify(body.getLength.bind(body))(); } if (body instanceof fs.ReadStream) { const {size} = await util.promisify(fs.stat)(body.path); return size; } return null; }; /***/ }), /***/ 18272: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; const is = __webpack_require__(7678); module.exports = body => is.nodeStream(body) && is.function(body.getBoundary); /***/ }), /***/ 44477: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; const net = __webpack_require__(11631); class TimeoutError extends Error { constructor(threshold, event) { super(`Timeout awaiting '${event}' for ${threshold}ms`); this.name = 'TimeoutError'; this.code = 'ETIMEDOUT'; this.event = event; } } const reentry = Symbol('reentry'); const noop = () => {}; module.exports = (request, delays, options) => { /* istanbul ignore next: this makes sure timed-out isn't called twice */ if (request[reentry]) { return; } request[reentry] = true; let stopNewTimeouts = false; const addTimeout = (delay, callback, ...args) => { // An error had been thrown before. Going further would result in uncaught errors. // See https://github.com/sindresorhus/got/issues/631#issuecomment-435675051 if (stopNewTimeouts) { return noop; } // Event loop order is timers, poll, immediates. // The timed event may emit during the current tick poll phase, so // defer calling the handler until the poll phase completes. let immediate; const timeout = setTimeout(() => { immediate = setImmediate(callback, delay, ...args); /* istanbul ignore next: added in node v9.7.0 */ if (immediate.unref) { immediate.unref(); } }, delay); /* istanbul ignore next: in order to support electron renderer */ if (timeout.unref) { timeout.unref(); } const cancel = () => { clearTimeout(timeout); clearImmediate(immediate); }; cancelers.push(cancel); return cancel; }; const {host, hostname} = options; const timeoutHandler = (delay, event) => { request.emit('error', new TimeoutError(delay, event)); request.once('error', () => {}); // Ignore the `socket hung up` error made by request.abort() request.abort(); }; const cancelers = []; const cancelTimeouts = () => { stopNewTimeouts = true; cancelers.forEach(cancelTimeout => cancelTimeout()); }; request.once('error', cancelTimeouts); request.once('response', response => { response.once('end', cancelTimeouts); }); if (delays.request !== undefined) { addTimeout(delays.request, timeoutHandler, 'request'); } if (delays.socket !== undefined) { const socketTimeoutHandler = () => { timeoutHandler(delays.socket, 'socket'); }; request.setTimeout(delays.socket, socketTimeoutHandler); // `request.setTimeout(0)` causes a memory leak. // We can just remove the listener and forget about the timer - it's unreffed. // See https://github.com/sindresorhus/got/issues/690 cancelers.push(() => request.removeListener('timeout', socketTimeoutHandler)); } if (delays.lookup !== undefined && !request.socketPath && !net.isIP(hostname || host)) { request.once('socket', socket => { /* istanbul ignore next: hard to test */ if (socket.connecting) { const cancelTimeout = addTimeout(delays.lookup, timeoutHandler, 'lookup'); socket.once('lookup', cancelTimeout); } }); } if (delays.connect !== undefined) { request.once('socket', socket => { /* istanbul ignore next: hard to test */ if (socket.connecting) { const timeConnect = () => addTimeout(delays.connect, timeoutHandler, 'connect'); if (request.socketPath || net.isIP(hostname || host)) { socket.once('connect', timeConnect()); } else { socket.once('lookup', error => { if (error === null) { socket.once('connect', timeConnect()); } }); } } }); } if (delays.secureConnect !== undefined && options.protocol === 'https:') { request.once('socket', socket => { /* istanbul ignore next: hard to test */ if (socket.connecting) { socket.once('connect', () => { const cancelTimeout = addTimeout(delays.secureConnect, timeoutHandler, 'secureConnect'); socket.once('secureConnect', cancelTimeout); }); } }); } if (delays.send !== undefined) { request.once('socket', socket => { const timeRequest = () => addTimeout(delays.send, timeoutHandler, 'send'); /* istanbul ignore next: hard to test */ if (socket.connecting) { socket.once('connect', () => { request.once('upload-complete', timeRequest()); }); } else { request.once('upload-complete', timeRequest()); } }); } if (delays.response !== undefined) { request.once('upload-complete', () => { const cancelTimeout = addTimeout(delays.response, timeoutHandler, 'response'); request.once('response', cancelTimeout); }); } }; module.exports.TimeoutError = TimeoutError; /***/ }), /***/ 65491: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; const is = __webpack_require__(7678); module.exports = url => { const options = { protocol: url.protocol, hostname: url.hostname.startsWith('[') ? url.hostname.slice(1, -1) : url.hostname, hash: url.hash, search: url.search, pathname: url.pathname, href: url.href }; if (is.string(url.port) && url.port.length > 0) { options.port = Number(url.port); } if (url.username || url.password) { options.auth = `${url.username}:${url.password}`; } options.path = is.null(url.search) ? url.pathname : `${url.pathname}${url.search}`; return options; }; /***/ }), /***/ 13679: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; module.exports = { afterRequest: __webpack_require__(24391), beforeRequest: __webpack_require__(94440), browser: __webpack_require__(99850), cache: __webpack_require__(77654), content: __webpack_require__(73656), cookie: __webpack_require__(67948), creator: __webpack_require__(33412), entry: __webpack_require__(32525), har: __webpack_require__(84943), header: __webpack_require__(68344), log: __webpack_require__(69142), page: __webpack_require__(29075), pageTimings: __webpack_require__(15096), postData: __webpack_require__(73697), query: __webpack_require__(70877), request: __webpack_require__(92084), response: __webpack_require__(20702), timings: __webpack_require__(36941) } /***/ }), /***/ 74944: /***/ ((module) => { function HARError (errors) { var message = 'validation failed' this.name = 'HARError' this.message = message this.errors = errors if (typeof Error.captureStackTrace === 'function') { Error.captureStackTrace(this, this.constructor) } else { this.stack = (new Error(message)).stack } } HARError.prototype = Error.prototype module.exports = HARError /***/ }), /***/ 75697: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { var Ajv = __webpack_require__(64941) var HARError = __webpack_require__(74944) var schemas = __webpack_require__(13679) var ajv function createAjvInstance () { var ajv = new Ajv({ allErrors: true }) ajv.addMetaSchema(__webpack_require__(81030)) ajv.addSchema(schemas) return ajv } function validate (name, data) { data = data || {} // validator config ajv = ajv || createAjvInstance() var validate = ajv.getSchema(name + '.json') return new Promise(function (resolve, reject) { var valid = validate(data) !valid ? reject(new HARError(validate.errors)) : resolve(data) }) } exports.afterRequest = function (data) { return validate('afterRequest', data) } exports.beforeRequest = function (data) { return validate('beforeRequest', data) } exports.browser = function (data) { return validate('browser', data) } exports.cache = function (data) { return validate('cache', data) } exports.content = function (data) { return validate('content', data) } exports.cookie = function (data) { return validate('cookie', data) } exports.creator = function (data) { return validate('creator', data) } exports.entry = function (data) { return validate('entry', data) } exports.har = function (data) { return validate('har', data) } exports.header = function (data) { return validate('header', data) } exports.log = function (data) { return validate('log', data) } exports.page = function (data) { return validate('page', data) } exports.pageTimings = function (data) { return validate('pageTimings', data) } exports.postData = function (data) { return validate('postData', data) } exports.query = function (data) { return validate('query', data) } exports.request = function (data) { return validate('request', data) } exports.response = function (data) { return validate('response', data) } exports.timings = function (data) { return validate('timings', data) } /***/ }), /***/ 40587: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; var origSymbol = typeof Symbol !== 'undefined' && Symbol; var hasSymbolSham = __webpack_require__(57747); module.exports = function hasNativeSymbols() { if (typeof origSymbol !== 'function') { return false; } if (typeof Symbol !== 'function') { return false; } if (typeof origSymbol('foo') !== 'symbol') { return false; } if (typeof Symbol('bar') !== 'symbol') { return false; } return hasSymbolSham(); }; /***/ }), /***/ 57747: /***/ ((module) => { "use strict"; /* eslint complexity: [2, 18], max-statements: [2, 33] */ module.exports = function hasSymbols() { if (typeof Symbol !== 'function' || typeof Object.getOwnPropertySymbols !== 'function') { return false; } if (typeof Symbol.iterator === 'symbol') { return true; } var obj = {}; var sym = Symbol('test'); var symObj = Object(sym); if (typeof sym === 'string') { return false; } if (Object.prototype.toString.call(sym) !== '[object Symbol]') { return false; } if (Object.prototype.toString.call(symObj) !== '[object Symbol]') { return false; } // temp disabled per https://github.com/ljharb/object.assign/issues/17 // if (sym instanceof Symbol) { return false; } // temp disabled per https://github.com/WebReflection/get-own-property-symbols/issues/4 // if (!(symObj instanceof Symbol)) { return false; } // if (typeof Symbol.prototype.toString !== 'function') { return false; } // if (String(sym) !== Symbol.prototype.toString.call(sym)) { return false; } var symVal = 42; obj[sym] = symVal; for (sym in obj) { return false; } // eslint-disable-line no-restricted-syntax, no-unreachable-loop if (typeof Object.keys === 'function' && Object.keys(obj).length !== 0) { return false; } if (typeof Object.getOwnPropertyNames === 'function' && Object.getOwnPropertyNames(obj).length !== 0) { return false; } var syms = Object.getOwnPropertySymbols(obj); if (syms.length !== 1 || syms[0] !== sym) { return false; } if (!Object.prototype.propertyIsEnumerable.call(obj, sym)) { return false; } if (typeof Object.getOwnPropertyDescriptor === 'function') { var descriptor = Object.getOwnPropertyDescriptor(obj, sym); if (descriptor.value !== symVal || descriptor.enumerable !== true) { return false; } } return true; }; /***/ }), /***/ 76339: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; var bind = __webpack_require__(88334); module.exports = bind.call(Function.call, Object.prototype.hasOwnProperty); /***/ }), /***/ 61002: /***/ ((module) => { "use strict"; // rfc7231 6.1 const statusCodeCacheableByDefault = new Set([ 200, 203, 204, 206, 300, 301, 404, 405, 410, 414, 501, ]); // This implementation does not understand partial responses (206) const understoodStatuses = new Set([ 200, 203, 204, 300, 301, 302, 303, 307, 308, 404, 405, 410, 414, 501, ]); const errorStatusCodes = new Set([ 500, 502, 503, 504, ]); const hopByHopHeaders = { date: true, // included, because we add Age update Date connection: true, 'keep-alive': true, 'proxy-authenticate': true, 'proxy-authorization': true, te: true, trailer: true, 'transfer-encoding': true, upgrade: true, }; const excludedFromRevalidationUpdate = { // Since the old body is reused, it doesn't make sense to change properties of the body 'content-length': true, 'content-encoding': true, 'transfer-encoding': true, 'content-range': true, }; function toNumberOrZero(s) { const n = parseInt(s, 10); return isFinite(n) ? n : 0; } // RFC 5861 function isErrorResponse(response) { // consider undefined response as faulty if(!response) { return true } return errorStatusCodes.has(response.status); } function parseCacheControl(header) { const cc = {}; if (!header) return cc; // 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), // the directive's value is considered invalid. Caches are encouraged to consider responses that have invalid freshness information to be stale const parts = header.trim().split(/\s*,\s*/); // TODO: lame parsing for (const part of parts) { const [k, v] = part.split(/\s*=\s*/, 2); cc[k] = v === undefined ? true : v.replace(/^"|"$/g, ''); // TODO: lame unquoting } return cc; } function formatCacheControl(cc) { let parts = []; for (const k in cc) { const v = cc[k]; parts.push(v === true ? k : k + '=' + v); } if (!parts.length) { return undefined; } return parts.join(', '); } module.exports = class CachePolicy { constructor( req, res, { shared, cacheHeuristic, immutableMinTimeToLive, ignoreCargoCult, _fromObject, } = {} ) { if (_fromObject) { this._fromObject(_fromObject); return; } if (!res || !res.headers) { throw Error('Response headers missing'); } this._assertRequestHasHeaders(req); this._responseTime = this.now(); this._isShared = shared !== false; this._cacheHeuristic = undefined !== cacheHeuristic ? cacheHeuristic : 0.1; // 10% matches IE this._immutableMinTtl = undefined !== immutableMinTimeToLive ? immutableMinTimeToLive : 24 * 3600 * 1000; this._status = 'status' in res ? res.status : 200; this._resHeaders = res.headers; this._rescc = parseCacheControl(res.headers['cache-control']); this._method = 'method' in req ? req.method : 'GET'; this._url = req.url; this._host = req.headers.host; this._noAuthorization = !req.headers.authorization; this._reqHeaders = res.headers.vary ? req.headers : null; // Don't keep all request headers if they won't be used this._reqcc = parseCacheControl(req.headers['cache-control']); // Assume that if someone uses legacy, non-standard uncecessary options they don't understand caching, // so there's no point stricly adhering to the blindly copy&pasted directives. if ( ignoreCargoCult && 'pre-check' in this._rescc && 'post-check' in this._rescc ) { delete this._rescc['pre-check']; delete this._rescc['post-check']; delete this._rescc['no-cache']; delete this._rescc['no-store']; delete this._rescc['must-revalidate']; this._resHeaders = Object.assign({}, this._resHeaders, { 'cache-control': formatCacheControl(this._rescc), }); delete this._resHeaders.expires; delete this._resHeaders.pragma; } // When the Cache-Control header field is not present in a request, caches MUST consider the no-cache request pragma-directive // as having the same effect as if "Cache-Control: no-cache" were present (see Section 5.2.1). if ( res.headers['cache-control'] == null && /no-cache/.test(res.headers.pragma) ) { this._rescc['no-cache'] = true; } } now() { return Date.now(); } storable() { // The "no-store" request directive indicates that a cache MUST NOT store any part of either this request or any response to it. return !!( !this._reqcc['no-store'] && // A cache MUST NOT store a response to any request, unless: // The request method is understood by the cache and defined as being cacheable, and ('GET' === this._method || 'HEAD' === this._method || ('POST' === this._method && this._hasExplicitExpiration())) && // the response status code is understood by the cache, and understoodStatuses.has(this._status) && // the "no-store" cache directive does not appear in request or response header fields, and !this._rescc['no-store'] && // the "private" response directive does not appear in the response, if the cache is shared, and (!this._isShared || !this._rescc.private) && // the Authorization header field does not appear in the request, if the cache is shared, (!this._isShared || this._noAuthorization || this._allowsStoringAuthenticated()) && // the response either: // contains an Expires header field, or (this._resHeaders.expires || // contains a max-age response directive, or // contains a s-maxage response directive and the cache is shared, or // contains a public response directive. this._rescc['max-age'] || (this._isShared && this._rescc['s-maxage']) || this._rescc.public || // has a status code that is defined as cacheable by default statusCodeCacheableByDefault.has(this._status)) ); } _hasExplicitExpiration() { // 4.2.1 Calculating Freshness Lifetime return ( (this._isShared && this._rescc['s-maxage']) || this._rescc['max-age'] || this._resHeaders.expires ); } _assertRequestHasHeaders(req) { if (!req || !req.headers) { throw Error('Request headers missing'); } } satisfiesWithoutRevalidation(req) { this._assertRequestHasHeaders(req); // When presented with a request, a cache MUST NOT reuse a stored response, unless: // the presented request does not contain the no-cache pragma (Section 5.4), nor the no-cache cache directive, // unless the stored response is successfully validated (Section 4.3), and const requestCC = parseCacheControl(req.headers['cache-control']); if (requestCC['no-cache'] || /no-cache/.test(req.headers.pragma)) { return false; } if (requestCC['max-age'] && this.age() > requestCC['max-age']) { return false; } if ( requestCC['min-fresh'] && this.timeToLive() < 1000 * requestCC['min-fresh'] ) { return false; } // the stored response is either: // fresh, or allowed to be served stale if (this.stale()) { const allowsStale = requestCC['max-stale'] && !this._rescc['must-revalidate'] && (true === requestCC['max-stale'] || requestCC['max-stale'] > this.age() - this.maxAge()); if (!allowsStale) { return false; } } return this._requestMatches(req, false); } _requestMatches(req, allowHeadMethod) { // The presented effective request URI and that of the stored response match, and return ( (!this._url || this._url === req.url) && this._host === req.headers.host && // the request method associated with the stored response allows it to be used for the presented request, and (!req.method || this._method === req.method || (allowHeadMethod && 'HEAD' === req.method)) && // selecting header fields nominated by the stored response (if any) match those presented, and this._varyMatches(req) ); } _allowsStoringAuthenticated() { // following Cache-Control response directives (Section 5.2.2) have such an effect: must-revalidate, public, and s-maxage. return ( this._rescc['must-revalidate'] || this._rescc.public || this._rescc['s-maxage'] ); } _varyMatches(req) { if (!this._resHeaders.vary) { return true; } // A Vary header field-value of "*" always fails to match if (this._resHeaders.vary === '*') { return false; } const fields = this._resHeaders.vary .trim() .toLowerCase() .split(/\s*,\s*/); for (const name of fields) { if (req.headers[name] !== this._reqHeaders[name]) return false; } return true; } _copyWithoutHopByHopHeaders(inHeaders) { const headers = {}; for (const name in inHeaders) { if (hopByHopHeaders[name]) continue; headers[name] = inHeaders[name]; } // 9.1. Connection if (inHeaders.connection) { const tokens = inHeaders.connection.trim().split(/\s*,\s*/); for (const name of tokens) { delete headers[name]; } } if (headers.warning) { const warnings = headers.warning.split(/,/).filter(warning => { return !/^\s*1[0-9][0-9]/.test(warning); }); if (!warnings.length) { delete headers.warning; } else { headers.warning = warnings.join(',').trim(); } } return headers; } responseHeaders() { const headers = this._copyWithoutHopByHopHeaders(this._resHeaders); const age = this.age(); // A cache SHOULD generate 113 warning if it heuristically chose a freshness // lifetime greater than 24 hours and the response's age is greater than 24 hours. if ( age > 3600 * 24 && !this._hasExplicitExpiration() && this.maxAge() > 3600 * 24 ) { headers.warning = (headers.warning ? `${headers.warning}, ` : '') + '113 - "rfc7234 5.5.4"'; } headers.age = `${Math.round(age)}`; headers.date = new Date(this.now()).toUTCString(); return headers; } /** * Value of the Date response header or current time if Date was invalid * @return timestamp */ date() { const serverDate = Date.parse(this._resHeaders.date); if (isFinite(serverDate)) { return serverDate; } return this._responseTime; } /** * Value of the Age header, in seconds, updated for the current time. * May be fractional. * * @return Number */ age() { let age = this._ageValue(); const residentTime = (this.now() - this._responseTime) / 1000; return age + residentTime; } _ageValue() { return toNumberOrZero(this._resHeaders.age); } /** * Value of applicable max-age (or heuristic equivalent) in seconds. This counts since response's `Date`. * * For an up-to-date value, see `timeToLive()`. * * @return Number */ maxAge() { if (!this.storable() || this._rescc['no-cache']) { return 0; } // Shared responses with cookies are cacheable according to the RFC, but IMHO it'd be unwise to do so by default // so this implementation requires explicit opt-in via public header if ( this._isShared && (this._resHeaders['set-cookie'] && !this._rescc.public && !this._rescc.immutable) ) { return 0; } if (this._resHeaders.vary === '*') { return 0; } if (this._isShared) { if (this._rescc['proxy-revalidate']) { return 0; } // if a response includes the s-maxage directive, a shared cache recipient MUST ignore the Expires field. if (this._rescc['s-maxage']) { return toNumberOrZero(this._rescc['s-maxage']); } } // If a response includes a Cache-Control field with the max-age directive, a recipient MUST ignore the Expires field. if (this._rescc['max-age']) { return toNumberOrZero(this._rescc['max-age']); } const defaultMinTtl = this._rescc.immutable ? this._immutableMinTtl : 0; const serverDate = this.date(); if (this._resHeaders.expires) { const expires = Date.parse(this._resHeaders.expires); // A cache recipient MUST interpret invalid date formats, especially the value "0", as representing a time in the past (i.e., "already expired"). if (Number.isNaN(expires) || expires < serverDate) { return 0; } return Math.max(defaultMinTtl, (expires - serverDate) / 1000); } if (this._resHeaders['last-modified']) { const lastModified = Date.parse(this._resHeaders['last-modified']); if (isFinite(lastModified) && serverDate > lastModified) { return Math.max( defaultMinTtl, ((serverDate - lastModified) / 1000) * this._cacheHeuristic ); } } return defaultMinTtl; } timeToLive() { const age = this.maxAge() - this.age(); const staleIfErrorAge = age + toNumberOrZero(this._rescc['stale-if-error']); const staleWhileRevalidateAge = age + toNumberOrZero(this._rescc['stale-while-revalidate']); return Math.max(0, age, staleIfErrorAge, staleWhileRevalidateAge) * 1000; } stale() { return this.maxAge() <= this.age(); } _useStaleIfError() { return this.maxAge() + toNumberOrZero(this._rescc['stale-if-error']) > this.age(); } useStaleWhileRevalidate() { return this.maxAge() + toNumberOrZero(this._rescc['stale-while-revalidate']) > this.age(); } static fromObject(obj) { return new this(undefined, undefined, { _fromObject: obj }); } _fromObject(obj) { if (this._responseTime) throw Error('Reinitialized'); if (!obj || obj.v !== 1) throw Error('Invalid serialization'); this._responseTime = obj.t; this._isShared = obj.sh; this._cacheHeuristic = obj.ch; this._immutableMinTtl = obj.imm !== undefined ? obj.imm : 24 * 3600 * 1000; this._status = obj.st; this._resHeaders = obj.resh; this._rescc = obj.rescc; this._method = obj.m; this._url = obj.u; this._host = obj.h; this._noAuthorization = obj.a; this._reqHeaders = obj.reqh; this._reqcc = obj.reqcc; } toObject() { return { v: 1, t: this._responseTime, sh: this._isShared, ch: this._cacheHeuristic, imm: this._immutableMinTtl, st: this._status, resh: this._resHeaders, rescc: this._rescc, m: this._method, u: this._url, h: this._host, a: this._noAuthorization, reqh: this._reqHeaders, reqcc: this._reqcc, }; } /** * Headers for sending to the origin server to revalidate stale response. * Allows server to return 304 to allow reuse of the previous response. * * Hop by hop headers are always stripped. * Revalidation headers may be added or removed, depending on request. */ revalidationHeaders(incomingReq) { this._assertRequestHasHeaders(incomingReq); const headers = this._copyWithoutHopByHopHeaders(incomingReq.headers); // This implementation does not understand range requests delete headers['if-range']; if (!this._requestMatches(incomingReq, true) || !this.storable()) { // revalidation allowed via HEAD // not for the same resource, or wasn't allowed to be cached anyway delete headers['if-none-match']; delete headers['if-modified-since']; return headers; } /* 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. */ if (this._resHeaders.etag) { headers['if-none-match'] = headers['if-none-match'] ? `${headers['if-none-match']}, ${this._resHeaders.etag}` : this._resHeaders.etag; } // 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. const forbidsWeakValidators = headers['accept-ranges'] || headers['if-match'] || headers['if-unmodified-since'] || (this._method && this._method != 'GET'); /* 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. Note: This implementation does not understand partial responses (206) */ if (forbidsWeakValidators) { delete headers['if-modified-since']; if (headers['if-none-match']) { const etags = headers['if-none-match'] .split(/,/) .filter(etag => { return !/^\s*W\//.test(etag); }); if (!etags.length) { delete headers['if-none-match']; } else { headers['if-none-match'] = etags.join(',').trim(); } } } else if ( this._resHeaders['last-modified'] && !headers['if-modified-since'] ) { headers['if-modified-since'] = this._resHeaders['last-modified']; } return headers; } /** * Creates new CachePolicy with information combined from the previews response, * and the new revalidation response. * * Returns {policy, modified} where modified is a boolean indicating * whether the response body has been modified, and old cached body can't be used. * * @return {Object} {policy: CachePolicy, modified: Boolean} */ revalidatedPolicy(request, response) { this._assertRequestHasHeaders(request); if(this._useStaleIfError() && isErrorResponse(response)) { // I consider the revalidation request unsuccessful return { modified: false, matches: false, policy: this, }; } if (!response || !response.headers) { throw Error('Response headers missing'); } // These aren't going to be supported exactly, since one CachePolicy object // doesn't know about all the other cached objects. let matches = false; if (response.status !== undefined && response.status != 304) { matches = false; } else if ( response.headers.etag && !/^\s*W\//.test(response.headers.etag) ) { // "All of the stored responses with the same strong validator are selected. // If none of the stored responses contain the same strong validator, // then the cache MUST NOT use the new response to update any stored responses." matches = this._resHeaders.etag && this._resHeaders.etag.replace(/^\s*W\//, '') === response.headers.etag; } else if (this._resHeaders.etag && response.headers.etag) { // "If the new response contains a weak validator and that validator corresponds // to one of the cache's stored responses, // then the most recent of those matching stored responses is selected for update." matches = this._resHeaders.etag.replace(/^\s*W\//, '') === response.headers.etag.replace(/^\s*W\//, ''); } else if (this._resHeaders['last-modified']) { matches = this._resHeaders['last-modified'] === response.headers['last-modified']; } else { // If the new response does not include any form of validator (such as in the case where // a client generates an If-Modified-Since request from a source other than the Last-Modified // response header field), and there is only one stored response, and that stored response also // lacks a validator, then that stored response is selected for update. if ( !this._resHeaders.etag && !this._resHeaders['last-modified'] && !response.headers.etag && !response.headers['last-modified'] ) { matches = true; } } if (!matches) { return { policy: new this.constructor(request, response), // Client receiving 304 without body, even if it's invalid/mismatched has no option // but to reuse a cached body. We don't have a good way to tell clients to do // error recovery in such case. modified: response.status != 304, matches: false, }; } // use other header fields provided in the 304 (Not Modified) response to replace all instances // of the corresponding header fields in the stored response. const headers = {}; for (const k in this._resHeaders) { headers[k] = k in response.headers && !excludedFromRevalidationUpdate[k] ? response.headers[k] : this._resHeaders[k]; } const newResponse = Object.assign({}, response, { status: this._status, method: this._method, headers, }); return { policy: new this.constructor(request, newResponse, { shared: this._isShared, cacheHeuristic: this._cacheHeuristic, immutableMinTimeToLive: this._immutableMinTtl, }), modified: false, matches: true, }; } }; /***/ }), /***/ 42479: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { // Copyright 2015 Joyent, Inc. var parser = __webpack_require__(95086); var signer = __webpack_require__(38143); var verify = __webpack_require__(51227); var utils = __webpack_require__(65689); ///--- API module.exports = { parse: parser.parseRequest, parseRequest: parser.parseRequest, sign: signer.signRequest, signRequest: signer.signRequest, createSigner: signer.createSigner, isSigner: signer.isSigner, sshKeyToPEM: utils.sshKeyToPEM, sshKeyFingerprint: utils.fingerprint, pemToRsaSSHKey: utils.pemToRsaSSHKey, verify: verify.verifySignature, verifySignature: verify.verifySignature, verifyHMAC: verify.verifyHMAC }; /***/ }), /***/ 95086: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { // Copyright 2012 Joyent, Inc. All rights reserved. var assert = __webpack_require__(66631); var util = __webpack_require__(31669); var utils = __webpack_require__(65689); ///--- Globals var HASH_ALGOS = utils.HASH_ALGOS; var PK_ALGOS = utils.PK_ALGOS; var HttpSignatureError = utils.HttpSignatureError; var InvalidAlgorithmError = utils.InvalidAlgorithmError; var validateAlgorithm = utils.validateAlgorithm; var State = { New: 0, Params: 1 }; var ParamsState = { Name: 0, Quote: 1, Value: 2, Comma: 3 }; ///--- Specific Errors function ExpiredRequestError(message) { HttpSignatureError.call(this, message, ExpiredRequestError); } util.inherits(ExpiredRequestError, HttpSignatureError); function InvalidHeaderError(message) { HttpSignatureError.call(this, message, InvalidHeaderError); } util.inherits(InvalidHeaderError, HttpSignatureError); function InvalidParamsError(message) { HttpSignatureError.call(this, message, InvalidParamsError); } util.inherits(InvalidParamsError, HttpSignatureError); function MissingHeaderError(message) { HttpSignatureError.call(this, message, MissingHeaderError); } util.inherits(MissingHeaderError, HttpSignatureError); function StrictParsingError(message) { HttpSignatureError.call(this, message, StrictParsingError); } util.inherits(StrictParsingError, HttpSignatureError); ///--- Exported API module.exports = { /** * Parses the 'Authorization' header out of an http.ServerRequest object. * * Note that this API will fully validate the Authorization header, and throw * on any error. It will not however check the signature, or the keyId format * as those are specific to your environment. You can use the options object * to pass in extra constraints. * * As a response object you can expect this: * * { * "scheme": "Signature", * "params": { * "keyId": "foo", * "algorithm": "rsa-sha256", * "headers": [ * "date" or "x-date", * "digest" * ], * "signature": "base64" * }, * "signingString": "ready to be passed to crypto.verify()" * } * * @param {Object} request an http.ServerRequest. * @param {Object} options an optional options object with: * - clockSkew: allowed clock skew in seconds (default 300). * - headers: required header names (def: date or x-date) * - algorithms: algorithms to support (default: all). * - strict: should enforce latest spec parsing * (default: false). * @return {Object} parsed out object (see above). * @throws {TypeError} on invalid input. * @throws {InvalidHeaderError} on an invalid Authorization header error. * @throws {InvalidParamsError} if the params in the scheme are invalid. * @throws {MissingHeaderError} if the params indicate a header not present, * either in the request headers from the params, * or not in the params from a required header * in options. * @throws {StrictParsingError} if old attributes are used in strict parsing * mode. * @throws {ExpiredRequestError} if the value of date or x-date exceeds skew. */ parseRequest: function parseRequest(request, options) { assert.object(request, 'request'); assert.object(request.headers, 'request.headers'); if (options === undefined) { options = {}; } if (options.headers === undefined) { options.headers = [request.headers['x-date'] ? 'x-date' : 'date']; } assert.object(options, 'options'); assert.arrayOfString(options.headers, 'options.headers'); assert.optionalFinite(options.clockSkew, 'options.clockSkew'); var authzHeaderName = options.authorizationHeaderName || 'authorization'; if (!request.headers[authzHeaderName]) { throw new MissingHeaderError('no ' + authzHeaderName + ' header ' + 'present in the request'); } options.clockSkew = options.clockSkew || 300; var i = 0; var state = State.New; var substate = ParamsState.Name; var tmpName = ''; var tmpValue = ''; var parsed = { scheme: '', params: {}, signingString: '' }; var authz = request.headers[authzHeaderName]; for (i = 0; i < authz.length; i++) { var c = authz.charAt(i); switch (Number(state)) { case State.New: if (c !== ' ') parsed.scheme += c; else state = State.Params; break; case State.Params: switch (Number(substate)) { case ParamsState.Name: var code = c.charCodeAt(0); // restricted name of A-Z / a-z if ((code >= 0x41 && code <= 0x5a) || // A-Z (code >= 0x61 && code <= 0x7a)) { // a-z tmpName += c; } else if (c === '=') { if (tmpName.length === 0) throw new InvalidHeaderError('bad param format'); substate = ParamsState.Quote; } else { throw new InvalidHeaderError('bad param format'); } break; case ParamsState.Quote: if (c === '"') { tmpValue = ''; substate = ParamsState.Value; } else { throw new InvalidHeaderError('bad param format'); } break; case ParamsState.Value: if (c === '"') { parsed.params[tmpName] = tmpValue; substate = ParamsState.Comma; } else { tmpValue += c; } break; case ParamsState.Comma: if (c === ',') { tmpName = ''; substate = ParamsState.Name; } else { throw new InvalidHeaderError('bad param format'); } break; default: throw new Error('Invalid substate'); } break; default: throw new Error('Invalid substate'); } } if (!parsed.params.headers || parsed.params.headers === '') { if (request.headers['x-date']) { parsed.params.headers = ['x-date']; } else { parsed.params.headers = ['date']; } } else { parsed.params.headers = parsed.params.headers.split(' '); } // Minimally validate the parsed object if (!parsed.scheme || parsed.scheme !== 'Signature') throw new InvalidHeaderError('scheme was not "Signature"'); if (!parsed.params.keyId) throw new InvalidHeaderError('keyId was not specified'); if (!parsed.params.algorithm) throw new InvalidHeaderError('algorithm was not specified'); if (!parsed.params.signature) throw new InvalidHeaderError('signature was not specified'); // Check the algorithm against the official list parsed.params.algorithm = parsed.params.algorithm.toLowerCase(); try { validateAlgorithm(parsed.params.algorithm); } catch (e) { if (e instanceof InvalidAlgorithmError) throw (new InvalidParamsError(parsed.params.algorithm + ' is not ' + 'supported')); else throw (e); } // Build the signingString for (i = 0; i < parsed.params.headers.length; i++) { var h = parsed.params.headers[i].toLowerCase(); parsed.params.headers[i] = h; if (h === 'request-line') { if (!options.strict) { /* * We allow headers from the older spec drafts if strict parsing isn't * specified in options. */ parsed.signingString += request.method + ' ' + request.url + ' HTTP/' + request.httpVersion; } else { /* Strict parsing doesn't allow older draft headers. */ throw (new StrictParsingError('request-line is not a valid header ' + 'with strict parsing enabled.')); } } else if (h === '(request-target)') { parsed.signingString += '(request-target): ' + request.method.toLowerCase() + ' ' + request.url; } else { var value = request.headers[h]; if (value === undefined) throw new MissingHeaderError(h + ' was not in the request'); parsed.signingString += h + ': ' + value; } if ((i + 1) < parsed.params.headers.length) parsed.signingString += '\n'; } // Check against the constraints var date; if (request.headers.date || request.headers['x-date']) { if (request.headers['x-date']) { date = new Date(request.headers['x-date']); } else { date = new Date(request.headers.date); } var now = new Date(); var skew = Math.abs(now.getTime() - date.getTime()); if (skew > options.clockSkew * 1000) { throw new ExpiredRequestError('clock skew of ' + (skew / 1000) + 's was greater than ' + options.clockSkew + 's'); } } options.headers.forEach(function (hdr) { // Remember that we already checked any headers in the params // were in the request, so if this passes we're good. if (parsed.params.headers.indexOf(hdr.toLowerCase()) < 0) throw new MissingHeaderError(hdr + ' was not a signed header'); }); if (options.algorithms) { if (options.algorithms.indexOf(parsed.params.algorithm) === -1) throw new InvalidParamsError(parsed.params.algorithm + ' is not a supported algorithm'); } parsed.algorithm = parsed.params.algorithm.toUpperCase(); parsed.keyId = parsed.params.keyId; return parsed; } }; /***/ }), /***/ 38143: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { // Copyright 2012 Joyent, Inc. All rights reserved. var assert = __webpack_require__(66631); var crypto = __webpack_require__(33373); var http = __webpack_require__(98605); var util = __webpack_require__(31669); var sshpk = __webpack_require__(87022); var jsprim = __webpack_require__(6287); var utils = __webpack_require__(65689); var sprintf = __webpack_require__(31669).format; var HASH_ALGOS = utils.HASH_ALGOS; var PK_ALGOS = utils.PK_ALGOS; var InvalidAlgorithmError = utils.InvalidAlgorithmError; var HttpSignatureError = utils.HttpSignatureError; var validateAlgorithm = utils.validateAlgorithm; ///--- Globals var AUTHZ_FMT = 'Signature keyId="%s",algorithm="%s",headers="%s",signature="%s"'; ///--- Specific Errors function MissingHeaderError(message) { HttpSignatureError.call(this, message, MissingHeaderError); } util.inherits(MissingHeaderError, HttpSignatureError); function StrictParsingError(message) { HttpSignatureError.call(this, message, StrictParsingError); } util.inherits(StrictParsingError, HttpSignatureError); /* See createSigner() */ function RequestSigner(options) { assert.object(options, 'options'); var alg = []; if (options.algorithm !== undefined) { assert.string(options.algorithm, 'options.algorithm'); alg = validateAlgorithm(options.algorithm); } this.rs_alg = alg; /* * RequestSigners come in two varieties: ones with an rs_signFunc, and ones * with an rs_signer. * * rs_signFunc-based RequestSigners have to build up their entire signing * string within the rs_lines array and give it to rs_signFunc as a single * concat'd blob. rs_signer-based RequestSigners can add a line at a time to * their signing state by using rs_signer.update(), thus only needing to * buffer the hash function state and one line at a time. */ if (options.sign !== undefined) { assert.func(options.sign, 'options.sign'); this.rs_signFunc = options.sign; } else if (alg[0] === 'hmac' && options.key !== undefined) { assert.string(options.keyId, 'options.keyId'); this.rs_keyId = options.keyId; if (typeof (options.key) !== 'string' && !Buffer.isBuffer(options.key)) throw (new TypeError('options.key for HMAC must be a string or Buffer')); /* * Make an rs_signer for HMACs, not a rs_signFunc -- HMACs digest their * data in chunks rather than requiring it all to be given in one go * at the end, so they are more similar to signers than signFuncs. */ this.rs_signer = crypto.createHmac(alg[1].toUpperCase(), options.key); this.rs_signer.sign = function () { var digest = this.digest('base64'); return ({ hashAlgorithm: alg[1], toString: function () { return (digest); } }); }; } else if (options.key !== undefined) { var key = options.key; if (typeof (key) === 'string' || Buffer.isBuffer(key)) key = sshpk.parsePrivateKey(key); assert.ok(sshpk.PrivateKey.isPrivateKey(key, [1, 2]), 'options.key must be a sshpk.PrivateKey'); this.rs_key = key; assert.string(options.keyId, 'options.keyId'); this.rs_keyId = options.keyId; if (!PK_ALGOS[key.type]) { throw (new InvalidAlgorithmError(key.type.toUpperCase() + ' type ' + 'keys are not supported')); } if (alg[0] !== undefined && key.type !== alg[0]) { throw (new InvalidAlgorithmError('options.key must be a ' + alg[0].toUpperCase() + ' key, was given a ' + key.type.toUpperCase() + ' key instead')); } this.rs_signer = key.createSign(alg[1]); } else { throw (new TypeError('options.sign (func) or options.key is required')); } this.rs_headers = []; this.rs_lines = []; } /** * Adds a header to be signed, with its value, into this signer. * * @param {String} header * @param {String} value * @return {String} value written */ RequestSigner.prototype.writeHeader = function (header, value) { assert.string(header, 'header'); header = header.toLowerCase(); assert.string(value, 'value'); this.rs_headers.push(header); if (this.rs_signFunc) { this.rs_lines.push(header + ': ' + value); } else { var line = header + ': ' + value; if (this.rs_headers.length > 0) line = '\n' + line; this.rs_signer.update(line); } return (value); }; /** * Adds a default Date header, returning its value. * * @return {String} */ RequestSigner.prototype.writeDateHeader = function () { return (this.writeHeader('date', jsprim.rfc1123(new Date()))); }; /** * Adds the request target line to be signed. * * @param {String} method, HTTP method (e.g. 'get', 'post', 'put') * @param {String} path */ RequestSigner.prototype.writeTarget = function (method, path) { assert.string(method, 'method'); assert.string(path, 'path'); method = method.toLowerCase(); this.writeHeader('(request-target)', method + ' ' + path); }; /** * Calculate the value for the Authorization header on this request * asynchronously. * * @param {Func} callback (err, authz) */ RequestSigner.prototype.sign = function (cb) { assert.func(cb, 'callback'); if (this.rs_headers.length < 1) throw (new Error('At least one header must be signed')); var alg, authz; if (this.rs_signFunc) { var data = this.rs_lines.join('\n'); var self = this; this.rs_signFunc(data, function (err, sig) { if (err) { cb(err); return; } try { assert.object(sig, 'signature'); assert.string(sig.keyId, 'signature.keyId'); assert.string(sig.algorithm, 'signature.algorithm'); assert.string(sig.signature, 'signature.signature'); alg = validateAlgorithm(sig.algorithm); authz = sprintf(AUTHZ_FMT, sig.keyId, sig.algorithm, self.rs_headers.join(' '), sig.signature); } catch (e) { cb(e); return; } cb(null, authz); }); } else { try { var sigObj = this.rs_signer.sign(); } catch (e) { cb(e); return; } alg = (this.rs_alg[0] || this.rs_key.type) + '-' + sigObj.hashAlgorithm; var signature = sigObj.toString(); authz = sprintf(AUTHZ_FMT, this.rs_keyId, alg, this.rs_headers.join(' '), signature); cb(null, authz); } }; ///--- Exported API module.exports = { /** * Identifies whether a given object is a request signer or not. * * @param {Object} object, the object to identify * @returns {Boolean} */ isSigner: function (obj) { if (typeof (obj) === 'object' && obj instanceof RequestSigner) return (true); return (false); }, /** * Creates a request signer, used to asynchronously build a signature * for a request (does not have to be an http.ClientRequest). * * @param {Object} options, either: * - {String} keyId * - {String|Buffer} key * - {String} algorithm (optional, required for HMAC) * or: * - {Func} sign (data, cb) * @return {RequestSigner} */ createSigner: function createSigner(options) { return (new RequestSigner(options)); }, /** * Adds an 'Authorization' header to an http.ClientRequest object. * * Note that this API will add a Date header if it's not already set. Any * other headers in the options.headers array MUST be present, or this * will throw. * * You shouldn't need to check the return type; it's just there if you want * to be pedantic. * * The optional flag indicates whether parsing should use strict enforcement * of the version draft-cavage-http-signatures-04 of the spec or beyond. * The default is to be loose and support * older versions for compatibility. * * @param {Object} request an instance of http.ClientRequest. * @param {Object} options signing parameters object: * - {String} keyId required. * - {String} key required (either a PEM or HMAC key). * - {Array} headers optional; defaults to ['date']. * - {String} algorithm optional (unless key is HMAC); * default is the same as the sshpk default * signing algorithm for the type of key given * - {String} httpVersion optional; defaults to '1.1'. * - {Boolean} strict optional; defaults to 'false'. * @return {Boolean} true if Authorization (and optionally Date) were added. * @throws {TypeError} on bad parameter types (input). * @throws {InvalidAlgorithmError} if algorithm was bad or incompatible with * the given key. * @throws {sshpk.KeyParseError} if key was bad. * @throws {MissingHeaderError} if a header to be signed was specified but * was not present. */ signRequest: function signRequest(request, options) { assert.object(request, 'request'); assert.object(options, 'options'); assert.optionalString(options.algorithm, 'options.algorithm'); assert.string(options.keyId, 'options.keyId'); assert.optionalArrayOfString(options.headers, 'options.headers'); assert.optionalString(options.httpVersion, 'options.httpVersion'); if (!request.getHeader('Date')) request.setHeader('Date', jsprim.rfc1123(new Date())); if (!options.headers) options.headers = ['date']; if (!options.httpVersion) options.httpVersion = '1.1'; var alg = []; if (options.algorithm) { options.algorithm = options.algorithm.toLowerCase(); alg = validateAlgorithm(options.algorithm); } var i; var stringToSign = ''; for (i = 0; i < options.headers.length; i++) { if (typeof (options.headers[i]) !== 'string') throw new TypeError('options.headers must be an array of Strings'); var h = options.headers[i].toLowerCase(); if (h === 'request-line') { if (!options.strict) { /** * We allow headers from the older spec drafts if strict parsing isn't * specified in options. */ stringToSign += request.method + ' ' + request.path + ' HTTP/' + options.httpVersion; } else { /* Strict parsing doesn't allow older draft headers. */ throw (new StrictParsingError('request-line is not a valid header ' + 'with strict parsing enabled.')); } } else if (h === '(request-target)') { stringToSign += '(request-target): ' + request.method.toLowerCase() + ' ' + request.path; } else { var value = request.getHeader(h); if (value === undefined || value === '') { throw new MissingHeaderError(h + ' was not in the request'); } stringToSign += h + ': ' + value; } if ((i + 1) < options.headers.length) stringToSign += '\n'; } /* This is just for unit tests. */ if (request.hasOwnProperty('_stringToSign')) { request._stringToSign = stringToSign; } var signature; if (alg[0] === 'hmac') { if (typeof (options.key) !== 'string' && !Buffer.isBuffer(options.key)) throw (new TypeError('options.key must be a string or Buffer')); var hmac = crypto.createHmac(alg[1].toUpperCase(), options.key); hmac.update(stringToSign); signature = hmac.digest('base64'); } else { var key = options.key; if (typeof (key) === 'string' || Buffer.isBuffer(key)) key = sshpk.parsePrivateKey(options.key); assert.ok(sshpk.PrivateKey.isPrivateKey(key, [1, 2]), 'options.key must be a sshpk.PrivateKey'); if (!PK_ALGOS[key.type]) { throw (new InvalidAlgorithmError(key.type.toUpperCase() + ' type ' + 'keys are not supported')); } if (alg[0] !== undefined && key.type !== alg[0]) { throw (new InvalidAlgorithmError('options.key must be a ' + alg[0].toUpperCase() + ' key, was given a ' + key.type.toUpperCase() + ' key instead')); } var signer = key.createSign(alg[1]); signer.update(stringToSign); var sigObj = signer.sign(); if (!HASH_ALGOS[sigObj.hashAlgorithm]) { throw (new InvalidAlgorithmError(sigObj.hashAlgorithm.toUpperCase() + ' is not a supported hash algorithm')); } options.algorithm = key.type + '-' + sigObj.hashAlgorithm; signature = sigObj.toString(); assert.notStrictEqual(signature, '', 'empty signature produced'); } var authzHeaderName = options.authorizationHeaderName || 'Authorization'; request.setHeader(authzHeaderName, sprintf(AUTHZ_FMT, options.keyId, options.algorithm, options.headers.join(' '), signature)); return true; } }; /***/ }), /***/ 65689: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { // Copyright 2012 Joyent, Inc. All rights reserved. var assert = __webpack_require__(66631); var sshpk = __webpack_require__(87022); var util = __webpack_require__(31669); var HASH_ALGOS = { 'sha1': true, 'sha256': true, 'sha512': true }; var PK_ALGOS = { 'rsa': true, 'dsa': true, 'ecdsa': true }; function HttpSignatureError(message, caller) { if (Error.captureStackTrace) Error.captureStackTrace(this, caller || HttpSignatureError); this.message = message; this.name = caller.name; } util.inherits(HttpSignatureError, Error); function InvalidAlgorithmError(message) { HttpSignatureError.call(this, message, InvalidAlgorithmError); } util.inherits(InvalidAlgorithmError, HttpSignatureError); function validateAlgorithm(algorithm) { var alg = algorithm.toLowerCase().split('-'); if (alg.length !== 2) { throw (new InvalidAlgorithmError(alg[0].toUpperCase() + ' is not a ' + 'valid algorithm')); } if (alg[0] !== 'hmac' && !PK_ALGOS[alg[0]]) { throw (new InvalidAlgorithmError(alg[0].toUpperCase() + ' type keys ' + 'are not supported')); } if (!HASH_ALGOS[alg[1]]) { throw (new InvalidAlgorithmError(alg[1].toUpperCase() + ' is not a ' + 'supported hash algorithm')); } return (alg); } ///--- API module.exports = { HASH_ALGOS: HASH_ALGOS, PK_ALGOS: PK_ALGOS, HttpSignatureError: HttpSignatureError, InvalidAlgorithmError: InvalidAlgorithmError, validateAlgorithm: validateAlgorithm, /** * Converts an OpenSSH public key (rsa only) to a PKCS#8 PEM file. * * The intent of this module is to interoperate with OpenSSL only, * specifically the node crypto module's `verify` method. * * @param {String} key an OpenSSH public key. * @return {String} PEM encoded form of the RSA public key. * @throws {TypeError} on bad input. * @throws {Error} on invalid ssh key formatted data. */ sshKeyToPEM: function sshKeyToPEM(key) { assert.string(key, 'ssh_key'); var k = sshpk.parseKey(key, 'ssh'); return (k.toString('pem')); }, /** * Generates an OpenSSH fingerprint from an ssh public key. * * @param {String} key an OpenSSH public key. * @return {String} key fingerprint. * @throws {TypeError} on bad input. * @throws {Error} if what you passed doesn't look like an ssh public key. */ fingerprint: function fingerprint(key) { assert.string(key, 'ssh_key'); var k = sshpk.parseKey(key, 'ssh'); return (k.fingerprint('md5').toString('hex')); }, /** * Converts a PKGCS#8 PEM file to an OpenSSH public key (rsa) * * The reverse of the above function. */ pemToRsaSSHKey: function pemToRsaSSHKey(pem, comment) { assert.equal('string', typeof (pem), 'typeof pem'); var k = sshpk.parseKey(pem, 'pem'); k.comment = comment; return (k.toString('ssh')); } }; /***/ }), /***/ 51227: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { // Copyright 2015 Joyent, Inc. var assert = __webpack_require__(66631); var crypto = __webpack_require__(33373); var sshpk = __webpack_require__(87022); var utils = __webpack_require__(65689); var HASH_ALGOS = utils.HASH_ALGOS; var PK_ALGOS = utils.PK_ALGOS; var InvalidAlgorithmError = utils.InvalidAlgorithmError; var HttpSignatureError = utils.HttpSignatureError; var validateAlgorithm = utils.validateAlgorithm; ///--- Exported API module.exports = { /** * Verify RSA/DSA signature against public key. You are expected to pass in * an object that was returned from `parse()`. * * @param {Object} parsedSignature the object you got from `parse`. * @param {String} pubkey RSA/DSA private key PEM. * @return {Boolean} true if valid, false otherwise. * @throws {TypeError} if you pass in bad arguments. * @throws {InvalidAlgorithmError} */ verifySignature: function verifySignature(parsedSignature, pubkey) { assert.object(parsedSignature, 'parsedSignature'); if (typeof (pubkey) === 'string' || Buffer.isBuffer(pubkey)) pubkey = sshpk.parseKey(pubkey); assert.ok(sshpk.Key.isKey(pubkey, [1, 1]), 'pubkey must be a sshpk.Key'); var alg = validateAlgorithm(parsedSignature.algorithm); if (alg[0] === 'hmac' || alg[0] !== pubkey.type) return (false); var v = pubkey.createVerify(alg[1]); v.update(parsedSignature.signingString); return (v.verify(parsedSignature.params.signature, 'base64')); }, /** * Verify HMAC against shared secret. You are expected to pass in an object * that was returned from `parse()`. * * @param {Object} parsedSignature the object you got from `parse`. * @param {String} secret HMAC shared secret. * @return {Boolean} true if valid, false otherwise. * @throws {TypeError} if you pass in bad arguments. * @throws {InvalidAlgorithmError} */ verifyHMAC: function verifyHMAC(parsedSignature, secret) { assert.object(parsedSignature, 'parsedHMAC'); assert.string(secret, 'secret'); var alg = validateAlgorithm(parsedSignature.algorithm); if (alg[0] !== 'hmac') return (false); var hashAlg = alg[1].toUpperCase(); var hmac = crypto.createHmac(hashAlg, secret); hmac.update(parsedSignature.signingString); /* * Now double-hash to avoid leaking timing information - there's * no easy constant-time compare in JS, so we use this approach * instead. See for more info: * https://www.isecpartners.com/blog/2011/february/double-hmac- * verification.aspx */ var h1 = crypto.createHmac(hashAlg, secret); h1.update(hmac.digest()); h1 = h1.digest(); var h2 = crypto.createHmac(hashAlg, secret); h2.update(new Buffer(parsedSignature.params.signature, 'base64')); h2 = h2.digest(); /* Node 0.8 returns strings from .digest(). */ if (typeof (h1) === 'string') return (h1 === h2); /* And node 0.10 lacks the .equals() method on Buffers. */ if (Buffer.isBuffer(h1) && !h1.equals) return (h1.toString('binary') === h2.toString('binary')); return (h1.equals(h2)); } }; /***/ }), /***/ 98043: /***/ ((module) => { "use strict"; module.exports = (string, count = 1, options) => { options = { indent: ' ', includeEmptyLines: false, ...options }; if (typeof string !== 'string') { throw new TypeError( `Expected \`input\` to be a \`string\`, got \`${typeof string}\`` ); } if (typeof count !== 'number') { throw new TypeError( `Expected \`count\` to be a \`number\`, got \`${typeof count}\`` ); } if (typeof options.indent !== 'string') { throw new TypeError( `Expected \`options.indent\` to be a \`string\`, got \`${typeof options.indent}\`` ); } if (count === 0) { return string; } const regex = options.includeEmptyLines ? /^/gm : /^(?!\s*$)/gm; return string.replace(regex, options.indent.repeat(count)); }; /***/ }), /***/ 52492: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { var wrappy = __webpack_require__(62940) var reqs = Object.create(null) var once = __webpack_require__(1223) module.exports = wrappy(inflight) function inflight (key, cb) { if (reqs[key]) { reqs[key].push(cb) return null } else { reqs[key] = [cb] return makeres(key) } } function makeres (key) { return once(function RES () { var cbs = reqs[key] var len = cbs.length var args = slice(arguments) // XXX It's somewhat ambiguous whether a new callback added in this // pass should be queued for later execution if something in the // list of callbacks throws, or if it should just be discarded. // However, it's such an edge case that it hardly matters, and either // choice is likely as surprising as the other. // As it happens, we do go ahead and schedule it for later execution. try { for (var i = 0; i < len; i++) { cbs[i].apply(null, args) } } finally { if (cbs.length > len) { // added more in the interim. // de-zalgo, just in case, but don't call again. cbs.splice(0, len) process.nextTick(function () { RES.apply(null, args) }) } else { delete reqs[key] } } }) } function slice (args) { var length = args.length var array = [] for (var i = 0; i < length; i++) array[i] = args[i] return array } /***/ }), /***/ 44124: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { try { var util = __webpack_require__(31669); /* istanbul ignore next */ if (typeof util.inherits !== 'function') throw ''; module.exports = util.inherits; } catch (e) { /* istanbul ignore next */ module.exports = __webpack_require__(8544); } /***/ }), /***/ 8544: /***/ ((module) => { if (typeof Object.create === 'function') { // implementation from standard node.js 'util' module module.exports = function inherits(ctor, superCtor) { if (superCtor) { ctor.super_ = superCtor ctor.prototype = Object.create(superCtor.prototype, { constructor: { value: ctor, enumerable: false, writable: true, configurable: true } }) } }; } else { // old school shim for old browsers module.exports = function inherits(ctor, superCtor) { if (superCtor) { ctor.super_ = superCtor var TempCtor = function () {} TempCtor.prototype = superCtor.prototype ctor.prototype = new TempCtor() ctor.prototype.constructor = ctor } } } /***/ }), /***/ 10657: /***/ ((module) => { module.exports = isTypedArray isTypedArray.strict = isStrictTypedArray isTypedArray.loose = isLooseTypedArray var toString = Object.prototype.toString var names = { '[object Int8Array]': true , '[object Int16Array]': true , '[object Int32Array]': true , '[object Uint8Array]': true , '[object Uint8ClampedArray]': true , '[object Uint16Array]': true , '[object Uint32Array]': true , '[object Float32Array]': true , '[object Float64Array]': true } function isTypedArray(arr) { return ( isStrictTypedArray(arr) || isLooseTypedArray(arr) ) } function isStrictTypedArray(arr) { return ( arr instanceof Int8Array || arr instanceof Int16Array || arr instanceof Int32Array || arr instanceof Uint8Array || arr instanceof Uint8ClampedArray || arr instanceof Uint16Array || arr instanceof Uint32Array || arr instanceof Float32Array || arr instanceof Float64Array ) } function isLooseTypedArray(arr) { return names[toString.call(arr)] } /***/ }), /***/ 64713: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; module.exports = __webpack_require__(88867); /***/ }), /***/ 83362: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { var stream = __webpack_require__(92413) function isStream (obj) { return obj instanceof stream.Stream } function isReadable (obj) { return isStream(obj) && typeof obj._read == 'function' && typeof obj._readableState == 'object' } function isWritable (obj) { return isStream(obj) && typeof obj._write == 'function' && typeof obj._writableState == 'object' } function isDuplex (obj) { return isReadable(obj) && isWritable(obj) } module.exports = isStream module.exports.isReadable = isReadable module.exports.isWritable = isWritable module.exports.isDuplex = isDuplex /***/ }), /***/ 87783: /***/ ((__unused_webpack_module, exports) => { (function(exports) { "use strict"; function isArray(obj) { if (obj !== null) { return Object.prototype.toString.call(obj) === "[object Array]"; } else { return false; } } function isObject(obj) { if (obj !== null) { return Object.prototype.toString.call(obj) === "[object Object]"; } else { return false; } } function strictDeepEqual(first, second) { // Check the scalar case first. if (first === second) { return true; } // Check if they are the same type. var firstType = Object.prototype.toString.call(first); if (firstType !== Object.prototype.toString.call(second)) { return false; } // We know that first and second have the same type so we can just check the // first type from now on. if (isArray(first) === true) { // Short circuit if they're not the same length; if (first.length !== second.length) { return false; } for (var i = 0; i < first.length; i++) { if (strictDeepEqual(first[i], second[i]) === false) { return false; } } return true; } if (isObject(first) === true) { // An object is equal if it has the same key/value pairs. var keysSeen = {}; for (var key in first) { if (hasOwnProperty.call(first, key)) { if (strictDeepEqual(first[key], second[key]) === false) { return false; } keysSeen[key] = true; } } // Now check that there aren't any keys in second that weren't // in first. for (var key2 in second) { if (hasOwnProperty.call(second, key2)) { if (keysSeen[key2] !== true) { return false; } } } return true; } return false; } function isFalse(obj) { // From the spec: // A false value corresponds to the following values: // Empty list // Empty object // Empty string // False boolean // null value // First check the scalar values. if (obj === "" || obj === false || obj === null) { return true; } else if (isArray(obj) && obj.length === 0) { // Check for an empty array. return true; } else if (isObject(obj)) { // Check for an empty object. for (var key in obj) { // If there are any keys, then // the object is not empty so the object // is not false. if (obj.hasOwnProperty(key)) { return false; } } return true; } else { return false; } } function objValues(obj) { var keys = Object.keys(obj); var values = []; for (var i = 0; i < keys.length; i++) { values.push(obj[keys[i]]); } return values; } function merge(a, b) { var merged = {}; for (var key in a) { merged[key] = a[key]; } for (var key2 in b) { merged[key2] = b[key2]; } return merged; } var trimLeft; if (typeof String.prototype.trimLeft === "function") { trimLeft = function(str) { return str.trimLeft(); }; } else { trimLeft = function(str) { return str.match(/^\s*(.*)/)[1]; }; } // Type constants used to define functions. var TYPE_NUMBER = 0; var TYPE_ANY = 1; var TYPE_STRING = 2; var TYPE_ARRAY = 3; var TYPE_OBJECT = 4; var TYPE_BOOLEAN = 5; var TYPE_EXPREF = 6; var TYPE_NULL = 7; var TYPE_ARRAY_NUMBER = 8; var TYPE_ARRAY_STRING = 9; var TOK_EOF = "EOF"; var TOK_UNQUOTEDIDENTIFIER = "UnquotedIdentifier"; var TOK_QUOTEDIDENTIFIER = "QuotedIdentifier"; var TOK_RBRACKET = "Rbracket"; var TOK_RPAREN = "Rparen"; var TOK_COMMA = "Comma"; var TOK_COLON = "Colon"; var TOK_RBRACE = "Rbrace"; var TOK_NUMBER = "Number"; var TOK_CURRENT = "Current"; var TOK_EXPREF = "Expref"; var TOK_PIPE = "Pipe"; var TOK_OR = "Or"; var TOK_AND = "And"; var TOK_EQ = "EQ"; var TOK_GT = "GT"; var TOK_LT = "LT"; var TOK_GTE = "GTE"; var TOK_LTE = "LTE"; var TOK_NE = "NE"; var TOK_FLATTEN = "Flatten"; var TOK_STAR = "Star"; var TOK_FILTER = "Filter"; var TOK_DOT = "Dot"; var TOK_NOT = "Not"; var TOK_LBRACE = "Lbrace"; var TOK_LBRACKET = "Lbracket"; var TOK_LPAREN= "Lparen"; var TOK_LITERAL= "Literal"; // The "&", "[", "<", ">" tokens // are not in basicToken because // there are two token variants // ("&&", "[?", "<=", ">="). This is specially handled // below. var basicTokens = { ".": TOK_DOT, "*": TOK_STAR, ",": TOK_COMMA, ":": TOK_COLON, "{": TOK_LBRACE, "}": TOK_RBRACE, "]": TOK_RBRACKET, "(": TOK_LPAREN, ")": TOK_RPAREN, "@": TOK_CURRENT }; var operatorStartToken = { "<": true, ">": true, "=": true, "!": true }; var skipChars = { " ": true, "\t": true, "\n": true }; function isAlpha(ch) { return (ch >= "a" && ch <= "z") || (ch >= "A" && ch <= "Z") || ch === "_"; } function isNum(ch) { return (ch >= "0" && ch <= "9") || ch === "-"; } function isAlphaNum(ch) { return (ch >= "a" && ch <= "z") || (ch >= "A" && ch <= "Z") || (ch >= "0" && ch <= "9") || ch === "_"; } function Lexer() { } Lexer.prototype = { tokenize: function(stream) { var tokens = []; this._current = 0; var start; var identifier; var token; while (this._current < stream.length) { if (isAlpha(stream[this._current])) { start = this._current; identifier = this._consumeUnquotedIdentifier(stream); tokens.push({type: TOK_UNQUOTEDIDENTIFIER, value: identifier, start: start}); } else if (basicTokens[stream[this._current]] !== undefined) { tokens.push({type: basicTokens[stream[this._current]], value: stream[this._current], start: this._current}); this._current++; } else if (isNum(stream[this._current])) { token = this._consumeNumber(stream); tokens.push(token); } else if (stream[this._current] === "[") { // No need to increment this._current. This happens // in _consumeLBracket token = this._consumeLBracket(stream); tokens.push(token); } else if (stream[this._current] === "\"") { start = this._current; identifier = this._consumeQuotedIdentifier(stream); tokens.push({type: TOK_QUOTEDIDENTIFIER, value: identifier, start: start}); } else if (stream[this._current] === "'") { start = this._current; identifier = this._consumeRawStringLiteral(stream); tokens.push({type: TOK_LITERAL, value: identifier, start: start}); } else if (stream[this._current] === "`") { start = this._current; var literal = this._consumeLiteral(stream); tokens.push({type: TOK_LITERAL, value: literal, start: start}); } else if (operatorStartToken[stream[this._current]] !== undefined) { tokens.push(this._consumeOperator(stream)); } else if (skipChars[stream[this._current]] !== undefined) { // Ignore whitespace. this._current++; } else if (stream[this._current] === "&") { start = this._current; this._current++; if (stream[this._current] === "&") { this._current++; tokens.push({type: TOK_AND, value: "&&", start: start}); } else { tokens.push({type: TOK_EXPREF, value: "&", start: start}); } } else if (stream[this._current] === "|") { start = this._current; this._current++; if (stream[this._current] === "|") { this._current++; tokens.push({type: TOK_OR, value: "||", start: start}); } else { tokens.push({type: TOK_PIPE, value: "|", start: start}); } } else { var error = new Error("Unknown character:" + stream[this._current]); error.name = "LexerError"; throw error; } } return tokens; }, _consumeUnquotedIdentifier: function(stream) { var start = this._current; this._current++; while (this._current < stream.length && isAlphaNum(stream[this._current])) { this._current++; } return stream.slice(start, this._current); }, _consumeQuotedIdentifier: function(stream) { var start = this._current; this._current++; var maxLength = stream.length; while (stream[this._current] !== "\"" && this._current < maxLength) { // You can escape a double quote and you can escape an escape. var current = this._current; if (stream[current] === "\\" && (stream[current + 1] === "\\" || stream[current + 1] === "\"")) { current += 2; } else { current++; } this._current = current; } this._current++; return JSON.parse(stream.slice(start, this._current)); }, _consumeRawStringLiteral: function(stream) { var start = this._current; this._current++; var maxLength = stream.length; while (stream[this._current] !== "'" && this._current < maxLength) { // You can escape a single quote and you can escape an escape. var current = this._current; if (stream[current] === "\\" && (stream[current + 1] === "\\" || stream[current + 1] === "'")) { current += 2; } else { current++; } this._current = current; } this._current++; var literal = stream.slice(start + 1, this._current - 1); return literal.replace("\\'", "'"); }, _consumeNumber: function(stream) { var start = this._current; this._current++; var maxLength = stream.length; while (isNum(stream[this._current]) && this._current < maxLength) { this._current++; } var value = parseInt(stream.slice(start, this._current)); return {type: TOK_NUMBER, value: value, start: start}; }, _consumeLBracket: function(stream) { var start = this._current; this._current++; if (stream[this._current] === "?") { this._current++; return {type: TOK_FILTER, value: "[?", start: start}; } else if (stream[this._current] === "]") { this._current++; return {type: TOK_FLATTEN, value: "[]", start: start}; } else { return {type: TOK_LBRACKET, value: "[", start: start}; } }, _consumeOperator: function(stream) { var start = this._current; var startingChar = stream[start]; this._current++; if (startingChar === "!") { if (stream[this._current] === "=") { this._current++; return {type: TOK_NE, value: "!=", start: start}; } else { return {type: TOK_NOT, value: "!", start: start}; } } else if (startingChar === "<") { if (stream[this._current] === "=") { this._current++; return {type: TOK_LTE, value: "<=", start: start}; } else { return {type: TOK_LT, value: "<", start: start}; } } else if (startingChar === ">") { if (stream[this._current] === "=") { this._current++; return {type: TOK_GTE, value: ">=", start: start}; } else { return {type: TOK_GT, value: ">", start: start}; } } else if (startingChar === "=") { if (stream[this._current] === "=") { this._current++; return {type: TOK_EQ, value: "==", start: start}; } } }, _consumeLiteral: function(stream) { this._current++; var start = this._current; var maxLength = stream.length; var literal; while(stream[this._current] !== "`" && this._current < maxLength) { // You can escape a literal char or you can escape the escape. var current = this._current; if (stream[current] === "\\" && (stream[current + 1] === "\\" || stream[current + 1] === "`")) { current += 2; } else { current++; } this._current = current; } var literalString = trimLeft(stream.slice(start, this._current)); literalString = literalString.replace("\\`", "`"); if (this._looksLikeJSON(literalString)) { literal = JSON.parse(literalString); } else { // Try to JSON parse it as "" literal = JSON.parse("\"" + literalString + "\""); } // +1 gets us to the ending "`", +1 to move on to the next char. this._current++; return literal; }, _looksLikeJSON: function(literalString) { var startingChars = "[{\""; var jsonLiterals = ["true", "false", "null"]; var numberLooking = "-0123456789"; if (literalString === "") { return false; } else if (startingChars.indexOf(literalString[0]) >= 0) { return true; } else if (jsonLiterals.indexOf(literalString) >= 0) { return true; } else if (numberLooking.indexOf(literalString[0]) >= 0) { try { JSON.parse(literalString); return true; } catch (ex) { return false; } } else { return false; } } }; var bindingPower = {}; bindingPower[TOK_EOF] = 0; bindingPower[TOK_UNQUOTEDIDENTIFIER] = 0; bindingPower[TOK_QUOTEDIDENTIFIER] = 0; bindingPower[TOK_RBRACKET] = 0; bindingPower[TOK_RPAREN] = 0; bindingPower[TOK_COMMA] = 0; bindingPower[TOK_RBRACE] = 0; bindingPower[TOK_NUMBER] = 0; bindingPower[TOK_CURRENT] = 0; bindingPower[TOK_EXPREF] = 0; bindingPower[TOK_PIPE] = 1; bindingPower[TOK_OR] = 2; bindingPower[TOK_AND] = 3; bindingPower[TOK_EQ] = 5; bindingPower[TOK_GT] = 5; bindingPower[TOK_LT] = 5; bindingPower[TOK_GTE] = 5; bindingPower[TOK_LTE] = 5; bindingPower[TOK_NE] = 5; bindingPower[TOK_FLATTEN] = 9; bindingPower[TOK_STAR] = 20; bindingPower[TOK_FILTER] = 21; bindingPower[TOK_DOT] = 40; bindingPower[TOK_NOT] = 45; bindingPower[TOK_LBRACE] = 50; bindingPower[TOK_LBRACKET] = 55; bindingPower[TOK_LPAREN] = 60; function Parser() { } Parser.prototype = { parse: function(expression) { this._loadTokens(expression); this.index = 0; var ast = this.expression(0); if (this._lookahead(0) !== TOK_EOF) { var t = this._lookaheadToken(0); var error = new Error( "Unexpected token type: " + t.type + ", value: " + t.value); error.name = "ParserError"; throw error; } return ast; }, _loadTokens: function(expression) { var lexer = new Lexer(); var tokens = lexer.tokenize(expression); tokens.push({type: TOK_EOF, value: "", start: expression.length}); this.tokens = tokens; }, expression: function(rbp) { var leftToken = this._lookaheadToken(0); this._advance(); var left = this.nud(leftToken); var currentToken = this._lookahead(0); while (rbp < bindingPower[currentToken]) { this._advance(); left = this.led(currentToken, left); currentToken = this._lookahead(0); } return left; }, _lookahead: function(number) { return this.tokens[this.index + number].type; }, _lookaheadToken: function(number) { return this.tokens[this.index + number]; }, _advance: function() { this.index++; }, nud: function(token) { var left; var right; var expression; switch (token.type) { case TOK_LITERAL: return {type: "Literal", value: token.value}; case TOK_UNQUOTEDIDENTIFIER: return {type: "Field", name: token.value}; case TOK_QUOTEDIDENTIFIER: var node = {type: "Field", name: token.value}; if (this._lookahead(0) === TOK_LPAREN) { throw new Error("Quoted identifier not allowed for function names."); } else { return node; } break; case TOK_NOT: right = this.expression(bindingPower.Not); return {type: "NotExpression", children: [right]}; case TOK_STAR: left = {type: "Identity"}; right = null; if (this._lookahead(0) === TOK_RBRACKET) { // This can happen in a multiselect, // [a, b, *] right = {type: "Identity"}; } else { right = this._parseProjectionRHS(bindingPower.Star); } return {type: "ValueProjection", children: [left, right]}; case TOK_FILTER: return this.led(token.type, {type: "Identity"}); case TOK_LBRACE: return this._parseMultiselectHash(); case TOK_FLATTEN: left = {type: TOK_FLATTEN, children: [{type: "Identity"}]}; right = this._parseProjectionRHS(bindingPower.Flatten); return {type: "Projection", children: [left, right]}; case TOK_LBRACKET: if (this._lookahead(0) === TOK_NUMBER || this._lookahead(0) === TOK_COLON) { right = this._parseIndexExpression(); return this._projectIfSlice({type: "Identity"}, right); } else if (this._lookahead(0) === TOK_STAR && this._lookahead(1) === TOK_RBRACKET) { this._advance(); this._advance(); right = this._parseProjectionRHS(bindingPower.Star); return {type: "Projection", children: [{type: "Identity"}, right]}; } else { return this._parseMultiselectList(); } break; case TOK_CURRENT: return {type: TOK_CURRENT}; case TOK_EXPREF: expression = this.expression(bindingPower.Expref); return {type: "ExpressionReference", children: [expression]}; case TOK_LPAREN: var args = []; while (this._lookahead(0) !== TOK_RPAREN) { if (this._lookahead(0) === TOK_CURRENT) { expression = {type: TOK_CURRENT}; this._advance(); } else { expression = this.expression(0); } args.push(expression); } this._match(TOK_RPAREN); return args[0]; default: this._errorToken(token); } }, led: function(tokenName, left) { var right; switch(tokenName) { case TOK_DOT: var rbp = bindingPower.Dot; if (this._lookahead(0) !== TOK_STAR) { right = this._parseDotRHS(rbp); return {type: "Subexpression", children: [left, right]}; } else { // Creating a projection. this._advance(); right = this._parseProjectionRHS(rbp); return {type: "ValueProjection", children: [left, right]}; } break; case TOK_PIPE: right = this.expression(bindingPower.Pipe); return {type: TOK_PIPE, children: [left, right]}; case TOK_OR: right = this.expression(bindingPower.Or); return {type: "OrExpression", children: [left, right]}; case TOK_AND: right = this.expression(bindingPower.And); return {type: "AndExpression", children: [left, right]}; case TOK_LPAREN: var name = left.name; var args = []; var expression, node; while (this._lookahead(0) !== TOK_RPAREN) { if (this._lookahead(0) === TOK_CURRENT) { expression = {type: TOK_CURRENT}; this._advance(); } else { expression = this.expression(0); } if (this._lookahead(0) === TOK_COMMA) { this._match(TOK_COMMA); } args.push(expression); } this._match(TOK_RPAREN); node = {type: "Function", name: name, children: args}; return node; case TOK_FILTER: var condition = this.expression(0); this._match(TOK_RBRACKET); if (this._lookahead(0) === TOK_FLATTEN) { right = {type: "Identity"}; } else { right = this._parseProjectionRHS(bindingPower.Filter); } return {type: "FilterProjection", children: [left, right, condition]}; case TOK_FLATTEN: var leftNode = {type: TOK_FLATTEN, children: [left]}; var rightNode = this._parseProjectionRHS(bindingPower.Flatten); return {type: "Projection", children: [leftNode, rightNode]}; case TOK_EQ: case TOK_NE: case TOK_GT: case TOK_GTE: case TOK_LT: case TOK_LTE: return this._parseComparator(left, tokenName); case TOK_LBRACKET: var token = this._lookaheadToken(0); if (token.type === TOK_NUMBER || token.type === TOK_COLON) { right = this._parseIndexExpression(); return this._projectIfSlice(left, right); } else { this._match(TOK_STAR); this._match(TOK_RBRACKET); right = this._parseProjectionRHS(bindingPower.Star); return {type: "Projection", children: [left, right]}; } break; default: this._errorToken(this._lookaheadToken(0)); } }, _match: function(tokenType) { if (this._lookahead(0) === tokenType) { this._advance(); } else { var t = this._lookaheadToken(0); var error = new Error("Expected " + tokenType + ", got: " + t.type); error.name = "ParserError"; throw error; } }, _errorToken: function(token) { var error = new Error("Invalid token (" + token.type + "): \"" + token.value + "\""); error.name = "ParserError"; throw error; }, _parseIndexExpression: function() { if (this._lookahead(0) === TOK_COLON || this._lookahead(1) === TOK_COLON) { return this._parseSliceExpression(); } else { var node = { type: "Index", value: this._lookaheadToken(0).value}; this._advance(); this._match(TOK_RBRACKET); return node; } }, _projectIfSlice: function(left, right) { var indexExpr = {type: "IndexExpression", children: [left, right]}; if (right.type === "Slice") { return { type: "Projection", children: [indexExpr, this._parseProjectionRHS(bindingPower.Star)] }; } else { return indexExpr; } }, _parseSliceExpression: function() { // [start:end:step] where each part is optional, as well as the last // colon. var parts = [null, null, null]; var index = 0; var currentToken = this._lookahead(0); while (currentToken !== TOK_RBRACKET && index < 3) { if (currentToken === TOK_COLON) { index++; this._advance(); } else if (currentToken === TOK_NUMBER) { parts[index] = this._lookaheadToken(0).value; this._advance(); } else { var t = this._lookahead(0); var error = new Error("Syntax error, unexpected token: " + t.value + "(" + t.type + ")"); error.name = "Parsererror"; throw error; } currentToken = this._lookahead(0); } this._match(TOK_RBRACKET); return { type: "Slice", children: parts }; }, _parseComparator: function(left, comparator) { var right = this.expression(bindingPower[comparator]); return {type: "Comparator", name: comparator, children: [left, right]}; }, _parseDotRHS: function(rbp) { var lookahead = this._lookahead(0); var exprTokens = [TOK_UNQUOTEDIDENTIFIER, TOK_QUOTEDIDENTIFIER, TOK_STAR]; if (exprTokens.indexOf(lookahead) >= 0) { return this.expression(rbp); } else if (lookahead === TOK_LBRACKET) { this._match(TOK_LBRACKET); return this._parseMultiselectList(); } else if (lookahead === TOK_LBRACE) { this._match(TOK_LBRACE); return this._parseMultiselectHash(); } }, _parseProjectionRHS: function(rbp) { var right; if (bindingPower[this._lookahead(0)] < 10) { right = {type: "Identity"}; } else if (this._lookahead(0) === TOK_LBRACKET) { right = this.expression(rbp); } else if (this._lookahead(0) === TOK_FILTER) { right = this.expression(rbp); } else if (this._lookahead(0) === TOK_DOT) { this._match(TOK_DOT); right = this._parseDotRHS(rbp); } else { var t = this._lookaheadToken(0); var error = new Error("Sytanx error, unexpected token: " + t.value + "(" + t.type + ")"); error.name = "ParserError"; throw error; } return right; }, _parseMultiselectList: function() { var expressions = []; while (this._lookahead(0) !== TOK_RBRACKET) { var expression = this.expression(0); expressions.push(expression); if (this._lookahead(0) === TOK_COMMA) { this._match(TOK_COMMA); if (this._lookahead(0) === TOK_RBRACKET) { throw new Error("Unexpected token Rbracket"); } } } this._match(TOK_RBRACKET); return {type: "MultiSelectList", children: expressions}; }, _parseMultiselectHash: function() { var pairs = []; var identifierTypes = [TOK_UNQUOTEDIDENTIFIER, TOK_QUOTEDIDENTIFIER]; var keyToken, keyName, value, node; for (;;) { keyToken = this._lookaheadToken(0); if (identifierTypes.indexOf(keyToken.type) < 0) { throw new Error("Expecting an identifier token, got: " + keyToken.type); } keyName = keyToken.value; this._advance(); this._match(TOK_COLON); value = this.expression(0); node = {type: "KeyValuePair", name: keyName, value: value}; pairs.push(node); if (this._lookahead(0) === TOK_COMMA) { this._match(TOK_COMMA); } else if (this._lookahead(0) === TOK_RBRACE) { this._match(TOK_RBRACE); break; } } return {type: "MultiSelectHash", children: pairs}; } }; function TreeInterpreter(runtime) { this.runtime = runtime; } TreeInterpreter.prototype = { search: function(node, value) { return this.visit(node, value); }, visit: function(node, value) { var matched, current, result, first, second, field, left, right, collected, i; switch (node.type) { case "Field": if (value === null ) { return null; } else if (isObject(value)) { field = value[node.name]; if (field === undefined) { return null; } else { return field; } } else { return null; } break; case "Subexpression": result = this.visit(node.children[0], value); for (i = 1; i < node.children.length; i++) { result = this.visit(node.children[1], result); if (result === null) { return null; } } return result; case "IndexExpression": left = this.visit(node.children[0], value); right = this.visit(node.children[1], left); return right; case "Index": if (!isArray(value)) { return null; } var index = node.value; if (index < 0) { index = value.length + index; } result = value[index]; if (result === undefined) { result = null; } return result; case "Slice": if (!isArray(value)) { return null; } var sliceParams = node.children.slice(0); var computed = this.computeSliceParams(value.length, sliceParams); var start = computed[0]; var stop = computed[1]; var step = computed[2]; result = []; if (step > 0) { for (i = start; i < stop; i += step) { result.push(value[i]); } } else { for (i = start; i > stop; i += step) { result.push(value[i]); } } return result; case "Projection": // Evaluate left child. var base = this.visit(node.children[0], value); if (!isArray(base)) { return null; } collected = []; for (i = 0; i < base.length; i++) { current = this.visit(node.children[1], base[i]); if (current !== null) { collected.push(current); } } return collected; case "ValueProjection": // Evaluate left child. base = this.visit(node.children[0], value); if (!isObject(base)) { return null; } collected = []; var values = objValues(base); for (i = 0; i < values.length; i++) { current = this.visit(node.children[1], values[i]); if (current !== null) { collected.push(current); } } return collected; case "FilterProjection": base = this.visit(node.children[0], value); if (!isArray(base)) { return null; } var filtered = []; var finalResults = []; for (i = 0; i < base.length; i++) { matched = this.visit(node.children[2], base[i]); if (!isFalse(matched)) { filtered.push(base[i]); } } for (var j = 0; j < filtered.length; j++) { current = this.visit(node.children[1], filtered[j]); if (current !== null) { finalResults.push(current); } } return finalResults; case "Comparator": first = this.visit(node.children[0], value); second = this.visit(node.children[1], value); switch(node.name) { case TOK_EQ: result = strictDeepEqual(first, second); break; case TOK_NE: result = !strictDeepEqual(first, second); break; case TOK_GT: result = first > second; break; case TOK_GTE: result = first >= second; break; case TOK_LT: result = first < second; break; case TOK_LTE: result = first <= second; break; default: throw new Error("Unknown comparator: " + node.name); } return result; case TOK_FLATTEN: var original = this.visit(node.children[0], value); if (!isArray(original)) { return null; } var merged = []; for (i = 0; i < original.length; i++) { current = original[i]; if (isArray(current)) { merged.push.apply(merged, current); } else { merged.push(current); } } return merged; case "Identity": return value; case "MultiSelectList": if (value === null) { return null; } collected = []; for (i = 0; i < node.children.length; i++) { collected.push(this.visit(node.children[i], value)); } return collected; case "MultiSelectHash": if (value === null) { return null; } collected = {}; var child; for (i = 0; i < node.children.length; i++) { child = node.children[i]; collected[child.name] = this.visit(child.value, value); } return collected; case "OrExpression": matched = this.visit(node.children[0], value); if (isFalse(matched)) { matched = this.visit(node.children[1], value); } return matched; case "AndExpression": first = this.visit(node.children[0], value); if (isFalse(first) === true) { return first; } return this.visit(node.children[1], value); case "NotExpression": first = this.visit(node.children[0], value); return isFalse(first); case "Literal": return node.value; case TOK_PIPE: left = this.visit(node.children[0], value); return this.visit(node.children[1], left); case TOK_CURRENT: return value; case "Function": var resolvedArgs = []; for (i = 0; i < node.children.length; i++) { resolvedArgs.push(this.visit(node.children[i], value)); } return this.runtime.callFunction(node.name, resolvedArgs); case "ExpressionReference": var refNode = node.children[0]; // Tag the node with a specific attribute so the type // checker verify the type. refNode.jmespathType = TOK_EXPREF; return refNode; default: throw new Error("Unknown node type: " + node.type); } }, computeSliceParams: function(arrayLength, sliceParams) { var start = sliceParams[0]; var stop = sliceParams[1]; var step = sliceParams[2]; var computed = [null, null, null]; if (step === null) { step = 1; } else if (step === 0) { var error = new Error("Invalid slice, step cannot be 0"); error.name = "RuntimeError"; throw error; } var stepValueNegative = step < 0 ? true : false; if (start === null) { start = stepValueNegative ? arrayLength - 1 : 0; } else { start = this.capSliceRange(arrayLength, start, step); } if (stop === null) { stop = stepValueNegative ? -1 : arrayLength; } else { stop = this.capSliceRange(arrayLength, stop, step); } computed[0] = start; computed[1] = stop; computed[2] = step; return computed; }, capSliceRange: function(arrayLength, actualValue, step) { if (actualValue < 0) { actualValue += arrayLength; if (actualValue < 0) { actualValue = step < 0 ? -1 : 0; } } else if (actualValue >= arrayLength) { actualValue = step < 0 ? arrayLength - 1 : arrayLength; } return actualValue; } }; function Runtime(interpreter) { this._interpreter = interpreter; this.functionTable = { // name: [function, ] // The can be: // // { // args: [[type1, type2], [type1, type2]], // variadic: true|false // } // // Each arg in the arg list is a list of valid types // (if the function is overloaded and supports multiple // types. If the type is "any" then no type checking // occurs on the argument. Variadic is optional // and if not provided is assumed to be false. abs: {_func: this._functionAbs, _signature: [{types: [TYPE_NUMBER]}]}, avg: {_func: this._functionAvg, _signature: [{types: [TYPE_ARRAY_NUMBER]}]}, ceil: {_func: this._functionCeil, _signature: [{types: [TYPE_NUMBER]}]}, contains: { _func: this._functionContains, _signature: [{types: [TYPE_STRING, TYPE_ARRAY]}, {types: [TYPE_ANY]}]}, "ends_with": { _func: this._functionEndsWith, _signature: [{types: [TYPE_STRING]}, {types: [TYPE_STRING]}]}, floor: {_func: this._functionFloor, _signature: [{types: [TYPE_NUMBER]}]}, length: { _func: this._functionLength, _signature: [{types: [TYPE_STRING, TYPE_ARRAY, TYPE_OBJECT]}]}, map: { _func: this._functionMap, _signature: [{types: [TYPE_EXPREF]}, {types: [TYPE_ARRAY]}]}, max: { _func: this._functionMax, _signature: [{types: [TYPE_ARRAY_NUMBER, TYPE_ARRAY_STRING]}]}, "merge": { _func: this._functionMerge, _signature: [{types: [TYPE_OBJECT], variadic: true}] }, "max_by": { _func: this._functionMaxBy, _signature: [{types: [TYPE_ARRAY]}, {types: [TYPE_EXPREF]}] }, sum: {_func: this._functionSum, _signature: [{types: [TYPE_ARRAY_NUMBER]}]}, "starts_with": { _func: this._functionStartsWith, _signature: [{types: [TYPE_STRING]}, {types: [TYPE_STRING]}]}, min: { _func: this._functionMin, _signature: [{types: [TYPE_ARRAY_NUMBER, TYPE_ARRAY_STRING]}]}, "min_by": { _func: this._functionMinBy, _signature: [{types: [TYPE_ARRAY]}, {types: [TYPE_EXPREF]}] }, type: {_func: this._functionType, _signature: [{types: [TYPE_ANY]}]}, keys: {_func: this._functionKeys, _signature: [{types: [TYPE_OBJECT]}]}, values: {_func: this._functionValues, _signature: [{types: [TYPE_OBJECT]}]}, sort: {_func: this._functionSort, _signature: [{types: [TYPE_ARRAY_STRING, TYPE_ARRAY_NUMBER]}]}, "sort_by": { _func: this._functionSortBy, _signature: [{types: [TYPE_ARRAY]}, {types: [TYPE_EXPREF]}] }, join: { _func: this._functionJoin, _signature: [ {types: [TYPE_STRING]}, {types: [TYPE_ARRAY_STRING]} ] }, reverse: { _func: this._functionReverse, _signature: [{types: [TYPE_STRING, TYPE_ARRAY]}]}, "to_array": {_func: this._functionToArray, _signature: [{types: [TYPE_ANY]}]}, "to_string": {_func: this._functionToString, _signature: [{types: [TYPE_ANY]}]}, "to_number": {_func: this._functionToNumber, _signature: [{types: [TYPE_ANY]}]}, "not_null": { _func: this._functionNotNull, _signature: [{types: [TYPE_ANY], variadic: true}] } }; } Runtime.prototype = { callFunction: function(name, resolvedArgs) { var functionEntry = this.functionTable[name]; if (functionEntry === undefined) { throw new Error("Unknown function: " + name + "()"); } this._validateArgs(name, resolvedArgs, functionEntry._signature); return functionEntry._func.call(this, resolvedArgs); }, _validateArgs: function(name, args, signature) { // Validating the args requires validating // the correct arity and the correct type of each arg. // If the last argument is declared as variadic, then we need // a minimum number of args to be required. Otherwise it has to // be an exact amount. var pluralized; if (signature[signature.length - 1].variadic) { if (args.length < signature.length) { pluralized = signature.length === 1 ? " argument" : " arguments"; throw new Error("ArgumentError: " + name + "() " + "takes at least" + signature.length + pluralized + " but received " + args.length); } } else if (args.length !== signature.length) { pluralized = signature.length === 1 ? " argument" : " arguments"; throw new Error("ArgumentError: " + name + "() " + "takes " + signature.length + pluralized + " but received " + args.length); } var currentSpec; var actualType; var typeMatched; for (var i = 0; i < signature.length; i++) { typeMatched = false; currentSpec = signature[i].types; actualType = this._getTypeName(args[i]); for (var j = 0; j < currentSpec.length; j++) { if (this._typeMatches(actualType, currentSpec[j], args[i])) { typeMatched = true; break; } } if (!typeMatched) { throw new Error("TypeError: " + name + "() " + "expected argument " + (i + 1) + " to be type " + currentSpec + " but received type " + actualType + " instead."); } } }, _typeMatches: function(actual, expected, argValue) { if (expected === TYPE_ANY) { return true; } if (expected === TYPE_ARRAY_STRING || expected === TYPE_ARRAY_NUMBER || expected === TYPE_ARRAY) { // The expected type can either just be array, // or it can require a specific subtype (array of numbers). // // The simplest case is if "array" with no subtype is specified. if (expected === TYPE_ARRAY) { return actual === TYPE_ARRAY; } else if (actual === TYPE_ARRAY) { // Otherwise we need to check subtypes. // I think this has potential to be improved. var subtype; if (expected === TYPE_ARRAY_NUMBER) { subtype = TYPE_NUMBER; } else if (expected === TYPE_ARRAY_STRING) { subtype = TYPE_STRING; } for (var i = 0; i < argValue.length; i++) { if (!this._typeMatches( this._getTypeName(argValue[i]), subtype, argValue[i])) { return false; } } return true; } } else { return actual === expected; } }, _getTypeName: function(obj) { switch (Object.prototype.toString.call(obj)) { case "[object String]": return TYPE_STRING; case "[object Number]": return TYPE_NUMBER; case "[object Array]": return TYPE_ARRAY; case "[object Boolean]": return TYPE_BOOLEAN; case "[object Null]": return TYPE_NULL; case "[object Object]": // Check if it's an expref. If it has, it's been // tagged with a jmespathType attr of 'Expref'; if (obj.jmespathType === TOK_EXPREF) { return TYPE_EXPREF; } else { return TYPE_OBJECT; } } }, _functionStartsWith: function(resolvedArgs) { return resolvedArgs[0].lastIndexOf(resolvedArgs[1]) === 0; }, _functionEndsWith: function(resolvedArgs) { var searchStr = resolvedArgs[0]; var suffix = resolvedArgs[1]; return searchStr.indexOf(suffix, searchStr.length - suffix.length) !== -1; }, _functionReverse: function(resolvedArgs) { var typeName = this._getTypeName(resolvedArgs[0]); if (typeName === TYPE_STRING) { var originalStr = resolvedArgs[0]; var reversedStr = ""; for (var i = originalStr.length - 1; i >= 0; i--) { reversedStr += originalStr[i]; } return reversedStr; } else { var reversedArray = resolvedArgs[0].slice(0); reversedArray.reverse(); return reversedArray; } }, _functionAbs: function(resolvedArgs) { return Math.abs(resolvedArgs[0]); }, _functionCeil: function(resolvedArgs) { return Math.ceil(resolvedArgs[0]); }, _functionAvg: function(resolvedArgs) { var sum = 0; var inputArray = resolvedArgs[0]; for (var i = 0; i < inputArray.length; i++) { sum += inputArray[i]; } return sum / inputArray.length; }, _functionContains: function(resolvedArgs) { return resolvedArgs[0].indexOf(resolvedArgs[1]) >= 0; }, _functionFloor: function(resolvedArgs) { return Math.floor(resolvedArgs[0]); }, _functionLength: function(resolvedArgs) { if (!isObject(resolvedArgs[0])) { return resolvedArgs[0].length; } else { // As far as I can tell, there's no way to get the length // of an object without O(n) iteration through the object. return Object.keys(resolvedArgs[0]).length; } }, _functionMap: function(resolvedArgs) { var mapped = []; var interpreter = this._interpreter; var exprefNode = resolvedArgs[0]; var elements = resolvedArgs[1]; for (var i = 0; i < elements.length; i++) { mapped.push(interpreter.visit(exprefNode, elements[i])); } return mapped; }, _functionMerge: function(resolvedArgs) { var merged = {}; for (var i = 0; i < resolvedArgs.length; i++) { var current = resolvedArgs[i]; for (var key in current) { merged[key] = current[key]; } } return merged; }, _functionMax: function(resolvedArgs) { if (resolvedArgs[0].length > 0) { var typeName = this._getTypeName(resolvedArgs[0][0]); if (typeName === TYPE_NUMBER) { return Math.max.apply(Math, resolvedArgs[0]); } else { var elements = resolvedArgs[0]; var maxElement = elements[0]; for (var i = 1; i < elements.length; i++) { if (maxElement.localeCompare(elements[i]) < 0) { maxElement = elements[i]; } } return maxElement; } } else { return null; } }, _functionMin: function(resolvedArgs) { if (resolvedArgs[0].length > 0) { var typeName = this._getTypeName(resolvedArgs[0][0]); if (typeName === TYPE_NUMBER) { return Math.min.apply(Math, resolvedArgs[0]); } else { var elements = resolvedArgs[0]; var minElement = elements[0]; for (var i = 1; i < elements.length; i++) { if (elements[i].localeCompare(minElement) < 0) { minElement = elements[i]; } } return minElement; } } else { return null; } }, _functionSum: function(resolvedArgs) { var sum = 0; var listToSum = resolvedArgs[0]; for (var i = 0; i < listToSum.length; i++) { sum += listToSum[i]; } return sum; }, _functionType: function(resolvedArgs) { switch (this._getTypeName(resolvedArgs[0])) { case TYPE_NUMBER: return "number"; case TYPE_STRING: return "string"; case TYPE_ARRAY: return "array"; case TYPE_OBJECT: return "object"; case TYPE_BOOLEAN: return "boolean"; case TYPE_EXPREF: return "expref"; case TYPE_NULL: return "null"; } }, _functionKeys: function(resolvedArgs) { return Object.keys(resolvedArgs[0]); }, _functionValues: function(resolvedArgs) { var obj = resolvedArgs[0]; var keys = Object.keys(obj); var values = []; for (var i = 0; i < keys.length; i++) { values.push(obj[keys[i]]); } return values; }, _functionJoin: function(resolvedArgs) { var joinChar = resolvedArgs[0]; var listJoin = resolvedArgs[1]; return listJoin.join(joinChar); }, _functionToArray: function(resolvedArgs) { if (this._getTypeName(resolvedArgs[0]) === TYPE_ARRAY) { return resolvedArgs[0]; } else { return [resolvedArgs[0]]; } }, _functionToString: function(resolvedArgs) { if (this._getTypeName(resolvedArgs[0]) === TYPE_STRING) { return resolvedArgs[0]; } else { return JSON.stringify(resolvedArgs[0]); } }, _functionToNumber: function(resolvedArgs) { var typeName = this._getTypeName(resolvedArgs[0]); var convertedValue; if (typeName === TYPE_NUMBER) { return resolvedArgs[0]; } else if (typeName === TYPE_STRING) { convertedValue = +resolvedArgs[0]; if (!isNaN(convertedValue)) { return convertedValue; } } return null; }, _functionNotNull: function(resolvedArgs) { for (var i = 0; i < resolvedArgs.length; i++) { if (this._getTypeName(resolvedArgs[i]) !== TYPE_NULL) { return resolvedArgs[i]; } } return null; }, _functionSort: function(resolvedArgs) { var sortedArray = resolvedArgs[0].slice(0); sortedArray.sort(); return sortedArray; }, _functionSortBy: function(resolvedArgs) { var sortedArray = resolvedArgs[0].slice(0); if (sortedArray.length === 0) { return sortedArray; } var interpreter = this._interpreter; var exprefNode = resolvedArgs[1]; var requiredType = this._getTypeName( interpreter.visit(exprefNode, sortedArray[0])); if ([TYPE_NUMBER, TYPE_STRING].indexOf(requiredType) < 0) { throw new Error("TypeError"); } var that = this; // In order to get a stable sort out of an unstable // sort algorithm, we decorate/sort/undecorate (DSU) // by creating a new list of [index, element] pairs. // In the cmp function, if the evaluated elements are // equal, then the index will be used as the tiebreaker. // After the decorated list has been sorted, it will be // undecorated to extract the original elements. var decorated = []; for (var i = 0; i < sortedArray.length; i++) { decorated.push([i, sortedArray[i]]); } decorated.sort(function(a, b) { var exprA = interpreter.visit(exprefNode, a[1]); var exprB = interpreter.visit(exprefNode, b[1]); if (that._getTypeName(exprA) !== requiredType) { throw new Error( "TypeError: expected " + requiredType + ", received " + that._getTypeName(exprA)); } else if (that._getTypeName(exprB) !== requiredType) { throw new Error( "TypeError: expected " + requiredType + ", received " + that._getTypeName(exprB)); } if (exprA > exprB) { return 1; } else if (exprA < exprB) { return -1; } else { // If they're equal compare the items by their // order to maintain relative order of equal keys // (i.e. to get a stable sort). return a[0] - b[0]; } }); // Undecorate: extract out the original list elements. for (var j = 0; j < decorated.length; j++) { sortedArray[j] = decorated[j][1]; } return sortedArray; }, _functionMaxBy: function(resolvedArgs) { var exprefNode = resolvedArgs[1]; var resolvedArray = resolvedArgs[0]; var keyFunction = this.createKeyFunction(exprefNode, [TYPE_NUMBER, TYPE_STRING]); var maxNumber = -Infinity; var maxRecord; var current; for (var i = 0; i < resolvedArray.length; i++) { current = keyFunction(resolvedArray[i]); if (current > maxNumber) { maxNumber = current; maxRecord = resolvedArray[i]; } } return maxRecord; }, _functionMinBy: function(resolvedArgs) { var exprefNode = resolvedArgs[1]; var resolvedArray = resolvedArgs[0]; var keyFunction = this.createKeyFunction(exprefNode, [TYPE_NUMBER, TYPE_STRING]); var minNumber = Infinity; var minRecord; var current; for (var i = 0; i < resolvedArray.length; i++) { current = keyFunction(resolvedArray[i]); if (current < minNumber) { minNumber = current; minRecord = resolvedArray[i]; } } return minRecord; }, createKeyFunction: function(exprefNode, allowedTypes) { var that = this; var interpreter = this._interpreter; var keyFunc = function(x) { var current = interpreter.visit(exprefNode, x); if (allowedTypes.indexOf(that._getTypeName(current)) < 0) { var msg = "TypeError: expected one of " + allowedTypes + ", received " + that._getTypeName(current); throw new Error(msg); } return current; }; return keyFunc; } }; function compile(stream) { var parser = new Parser(); var ast = parser.parse(stream); return ast; } function tokenize(stream) { var lexer = new Lexer(); return lexer.tokenize(stream); } function search(data, expression) { var parser = new Parser(); // This needs to be improved. Both the interpreter and runtime depend on // each other. The runtime needs the interpreter to support exprefs. // There's likely a clean way to avoid the cyclic dependency. var runtime = new Runtime(); var interpreter = new TreeInterpreter(runtime); runtime._interpreter = interpreter; var node = parser.parse(expression); return interpreter.search(node, data); } exports.tokenize = tokenize; exports.compile = compile; exports.search = search; exports.strictDeepEqual = strictDeepEqual; })( false ? 0 : exports); /***/ }), /***/ 52973: /***/ ((module) => { const CODES = { JOSEAlgNotWhitelisted: 'ERR_JOSE_ALG_NOT_WHITELISTED', JOSECritNotUnderstood: 'ERR_JOSE_CRIT_NOT_UNDERSTOOD', JOSEInvalidEncoding: 'ERR_JOSE_INVALID_ENCODING', JOSEMultiError: 'ERR_JOSE_MULTIPLE_ERRORS', JOSENotSupported: 'ERR_JOSE_NOT_SUPPORTED', JWEDecryptionFailed: 'ERR_JWE_DECRYPTION_FAILED', JWEInvalid: 'ERR_JWE_INVALID', JWKImportFailed: 'ERR_JWK_IMPORT_FAILED', JWKInvalid: 'ERR_JWK_INVALID', JWKKeySupport: 'ERR_JWK_KEY_SUPPORT', JWKSNoMatchingKey: 'ERR_JWKS_NO_MATCHING_KEY', JWSInvalid: 'ERR_JWS_INVALID', JWSVerificationFailed: 'ERR_JWS_VERIFICATION_FAILED', JWTClaimInvalid: 'ERR_JWT_CLAIM_INVALID', JWTExpired: 'ERR_JWT_EXPIRED', JWTMalformed: 'ERR_JWT_MALFORMED' } const DEFAULT_MESSAGES = { JWEDecryptionFailed: 'decryption operation failed', JWEInvalid: 'JWE invalid', JWKSNoMatchingKey: 'no matching key found in the KeyStore', JWSInvalid: 'JWS invalid', JWSVerificationFailed: 'signature verification failed' } class JOSEError extends Error { constructor (message) { super(message) if (message === undefined) { this.message = DEFAULT_MESSAGES[this.constructor.name] } this.name = this.constructor.name this.code = CODES[this.constructor.name] Error.captureStackTrace(this, this.constructor) } } const isMulti = e => e instanceof JOSEMultiError class JOSEMultiError extends JOSEError { constructor (errors) { super() let i while ((i = errors.findIndex(isMulti)) && i !== -1) { errors.splice(i, 1, ...errors[i]) } Object.defineProperty(this, 'errors', { value: errors }) } * [Symbol.iterator] () { for (const error of this.errors) { yield error } } } module.exports.JOSEError = JOSEError module.exports.JOSEAlgNotWhitelisted = class JOSEAlgNotWhitelisted extends JOSEError {} module.exports.JOSECritNotUnderstood = class JOSECritNotUnderstood extends JOSEError {} module.exports.JOSEInvalidEncoding = class JOSEInvalidEncoding extends JOSEError {} module.exports.JOSEMultiError = JOSEMultiError module.exports.JOSENotSupported = class JOSENotSupported extends JOSEError {} module.exports.JWEDecryptionFailed = class JWEDecryptionFailed extends JOSEError {} module.exports.JWEInvalid = class JWEInvalid extends JOSEError {} module.exports.JWKImportFailed = class JWKImportFailed extends JOSEError {} module.exports.JWKInvalid = class JWKInvalid extends JOSEError {} module.exports.JWKKeySupport = class JWKKeySupport extends JOSEError {} module.exports.JWKSNoMatchingKey = class JWKSNoMatchingKey extends JOSEError {} module.exports.JWSInvalid = class JWSInvalid extends JOSEError {} module.exports.JWSVerificationFailed = class JWSVerificationFailed extends JOSEError {} class JWTClaimInvalid extends JOSEError { constructor (message, claim = 'unspecified', reason = 'unspecified') { super(message) this.claim = claim this.reason = reason } } module.exports.JWTClaimInvalid = JWTClaimInvalid module.exports.JWTExpired = class JWTExpired extends JWTClaimInvalid {} module.exports.JWTMalformed = class JWTMalformed extends JOSEError {} /***/ }), /***/ 68207: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { const oids = __webpack_require__(72967) module.exports = function () { this.seq().obj( this.key('algorithm').objid(oids), this.key('parameters').optional().choice({ namedCurve: this.objid(oids), null: this.null_() }) ) } /***/ }), /***/ 37707: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { const oids = __webpack_require__(72967) module.exports = function () { this.seq().obj( this.key('version').int(), this.key('privateKey').octstr(), this.key('parameters').explicit(0).optional().choice({ namedCurve: this.objid(oids) }), this.key('publicKey').explicit(1).optional().bitstr() ) } /***/ }), /***/ 16416: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { const asn1 = __webpack_require__(39436) const types = new Map() const AlgorithmIdentifier = asn1.define('AlgorithmIdentifier', __webpack_require__(68207)) types.set('AlgorithmIdentifier', AlgorithmIdentifier) const ECPrivateKey = asn1.define('ECPrivateKey', __webpack_require__(37707)) types.set('ECPrivateKey', ECPrivateKey) const PrivateKeyInfo = asn1.define('PrivateKeyInfo', __webpack_require__(58570)(AlgorithmIdentifier)) types.set('PrivateKeyInfo', PrivateKeyInfo) const PublicKeyInfo = asn1.define('PublicKeyInfo', __webpack_require__(5641)(AlgorithmIdentifier)) types.set('PublicKeyInfo', PublicKeyInfo) const PrivateKey = asn1.define('PrivateKey', __webpack_require__(62624)) types.set('PrivateKey', PrivateKey) const OneAsymmetricKey = asn1.define('OneAsymmetricKey', __webpack_require__(30424)(AlgorithmIdentifier, PrivateKey)) types.set('OneAsymmetricKey', OneAsymmetricKey) const RSAPrivateKey = asn1.define('RSAPrivateKey', __webpack_require__(29822)) types.set('RSAPrivateKey', RSAPrivateKey) const RSAPublicKey = asn1.define('RSAPublicKey', __webpack_require__(39542)) types.set('RSAPublicKey', RSAPublicKey) module.exports = types /***/ }), /***/ 72967: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { const { name: secp256k1 } = __webpack_require__(2044) const oids = { '1 2 840 10045 3 1 7': 'P-256', '1 3 132 0 10': secp256k1, '1 3 132 0 34': 'P-384', '1 3 132 0 35': 'P-521', '1 2 840 10045 2 1': 'ecPublicKey', '1 2 840 113549 1 1 1': 'rsaEncryption', '1 3 101 110': 'X25519', '1 3 101 111': 'X448', '1 3 101 112': 'Ed25519', '1 3 101 113': 'Ed448' } module.exports = oids /***/ }), /***/ 30424: /***/ ((module) => { module.exports = (AlgorithmIdentifier, PrivateKey) => function () { this.seq().obj( this.key('version').int(), this.key('algorithm').use(AlgorithmIdentifier), this.key('privateKey').use(PrivateKey) ) } /***/ }), /***/ 62624: /***/ ((module) => { module.exports = function () { this.octstr().contains().obj( this.key('privateKey').octstr() ) } /***/ }), /***/ 58570: /***/ ((module) => { module.exports = (AlgorithmIdentifier) => function () { this.seq().obj( this.key('version').int(), this.key('algorithm').use(AlgorithmIdentifier), this.key('privateKey').octstr() ) } /***/ }), /***/ 5641: /***/ ((module) => { module.exports = AlgorithmIdentifier => function () { this.seq().obj( this.key('algorithm').use(AlgorithmIdentifier), this.key('publicKey').bitstr() ) } /***/ }), /***/ 29822: /***/ ((module) => { module.exports = function () { this.seq().obj( this.key('version').int({ 0: 'two-prime', 1: 'multi' }), this.key('n').int(), this.key('e').int(), this.key('d').int(), this.key('p').int(), this.key('q').int(), this.key('dp').int(), this.key('dq').int(), this.key('qi').int() ) } /***/ }), /***/ 39542: /***/ ((module) => { module.exports = function () { this.seq().obj( this.key('n').int(), this.key('e').int() ) } /***/ }), /***/ 73385: /***/ ((module) => { /* global BigInt */ const fromBase64 = (base64) => { return base64.replace(/=/g, '').replace(/\+/g, '-').replace(/\//g, '_') } const encode = (input, encoding = 'utf8') => { return fromBase64(Buffer.from(input, encoding).toString('base64')) } const encodeBuffer = (buf) => { return fromBase64(buf.toString('base64')) } const decodeToBuffer = (input) => { return Buffer.from(input, 'base64') } const decode = (input, encoding = 'utf8') => { return decodeToBuffer(input).toString(encoding) } const b64uJSON = { encode: (input) => { return encode(JSON.stringify(input)) }, decode: (input, encoding = 'utf8') => { return JSON.parse(decode(input, encoding)) } } b64uJSON.decode.try = (input, encoding = 'utf8') => { try { return b64uJSON.decode(input, encoding) } catch (err) { return decode(input, encoding) } } const bnToBuf = (bn) => { let hex = BigInt(bn).toString(16) if (hex.length % 2) { hex = `0${hex}` } const len = hex.length / 2 const u8 = new Uint8Array(len) let i = 0 let j = 0 while (i < len) { u8[i] = parseInt(hex.slice(j, j + 2), 16) i += 1 j += 2 } return u8 } const encodeBigInt = (bn) => encodeBuffer(Buffer.from(bnToBuf(bn))) module.exports.decode = decode module.exports.decodeToBuffer = decodeToBuffer module.exports.encode = encode module.exports.encodeBuffer = encodeBuffer module.exports.JSON = b64uJSON module.exports.encodeBigInt = encodeBigInt /***/ }), /***/ 15010: /***/ ((module) => { module.exports.KEYOBJECT = Symbol('KEYOBJECT') module.exports.PRIVATE_MEMBERS = Symbol('PRIVATE_MEMBERS') module.exports.PUBLIC_MEMBERS = Symbol('PUBLIC_MEMBERS') module.exports.THUMBPRINT_MATERIAL = Symbol('THUMBPRINT_MATERIAL') module.exports.JWK_MEMBERS = Symbol('JWK_MEMBERS') module.exports.KEY_MANAGEMENT_ENCRYPT = Symbol('KEY_MANAGEMENT_ENCRYPT') module.exports.KEY_MANAGEMENT_DECRYPT = Symbol('KEY_MANAGEMENT_DECRYPT') const USES_MAPPING = { sig: new Set(['sign', 'verify']), enc: new Set(['encrypt', 'decrypt', 'wrapKey', 'unwrapKey', 'deriveKey']) } const OPS = new Set([...USES_MAPPING.sig, ...USES_MAPPING.enc]) const USES = new Set(Object.keys(USES_MAPPING)) module.exports.USES_MAPPING = USES_MAPPING module.exports.OPS = OPS module.exports.USES = USES /***/ }), /***/ 43653: /***/ ((module) => { module.exports = obj => JSON.parse(JSON.stringify(obj)) /***/ }), /***/ 14451: /***/ ((module) => { const MAX_OCTET = 0x80 const CLASS_UNIVERSAL = 0 const PRIMITIVE_BIT = 0x20 const TAG_SEQ = 0x10 const TAG_INT = 0x02 const ENCODED_TAG_SEQ = (TAG_SEQ | PRIMITIVE_BIT) | (CLASS_UNIVERSAL << 6) const ENCODED_TAG_INT = TAG_INT | (CLASS_UNIVERSAL << 6) const getParamSize = keySize => ((keySize / 8) | 0) + (keySize % 8 === 0 ? 0 : 1) const paramBytesForAlg = { ES256: getParamSize(256), ES256K: getParamSize(256), ES384: getParamSize(384), ES512: getParamSize(521) } const countPadding = (buf, start, stop) => { let padding = 0 while (start + padding < stop && buf[start + padding] === 0) { ++padding } const needsSign = buf[start + padding] >= MAX_OCTET if (needsSign) { --padding } return padding } module.exports.derToJose = (signature, alg) => { if (!Buffer.isBuffer(signature)) { throw new TypeError('ECDSA signature must be a Buffer') } if (!paramBytesForAlg[alg]) { throw new Error(`Unknown algorithm "${alg}"`) } const paramBytes = paramBytesForAlg[alg] // the DER encoded param should at most be the param size, plus a padding // zero, since due to being a signed integer const maxEncodedParamLength = paramBytes + 1 const inputLength = signature.length let offset = 0 if (signature[offset++] !== ENCODED_TAG_SEQ) { throw new Error('Could not find expected "seq"') } let seqLength = signature[offset++] if (seqLength === (MAX_OCTET | 1)) { seqLength = signature[offset++] } if (inputLength - offset < seqLength) { throw new Error(`"seq" specified length of ${seqLength}", only ${inputLength - offset}" remaining`) } if (signature[offset++] !== ENCODED_TAG_INT) { throw new Error('Could not find expected "int" for "r"') } const rLength = signature[offset++] if (inputLength - offset - 2 < rLength) { throw new Error(`"r" specified length of "${rLength}", only "${inputLength - offset - 2}" available`) } if (maxEncodedParamLength < rLength) { throw new Error(`"r" specified length of "${rLength}", max of "${maxEncodedParamLength}" is acceptable`) } const rOffset = offset offset += rLength if (signature[offset++] !== ENCODED_TAG_INT) { throw new Error('Could not find expected "int" for "s"') } const sLength = signature[offset++] if (inputLength - offset !== sLength) { throw new Error(`"s" specified length of "${sLength}", expected "${inputLength - offset}"`) } if (maxEncodedParamLength < sLength) { throw new Error(`"s" specified length of "${sLength}", max of "${maxEncodedParamLength}" is acceptable`) } const sOffset = offset offset += sLength if (offset !== inputLength) { throw new Error(`Expected to consume entire buffer, but "${inputLength - offset}" bytes remain`) } const rPadding = paramBytes - rLength const sPadding = paramBytes - sLength const dst = Buffer.allocUnsafe(rPadding + rLength + sPadding + sLength) for (offset = 0; offset < rPadding; ++offset) { dst[offset] = 0 } signature.copy(dst, offset, rOffset + Math.max(-rPadding, 0), rOffset + rLength) offset = paramBytes for (const o = offset; offset < o + sPadding; ++offset) { dst[offset] = 0 } signature.copy(dst, offset, sOffset + Math.max(-sPadding, 0), sOffset + sLength) return dst } module.exports.joseToDer = (signature, alg) => { if (!Buffer.isBuffer(signature)) { throw new TypeError('ECDSA signature must be a Buffer') } if (!paramBytesForAlg[alg]) { throw new TypeError(`Unknown algorithm "${alg}"`) } const paramBytes = paramBytesForAlg[alg] const signatureBytes = signature.length if (signatureBytes !== paramBytes * 2) { throw new Error(`"${alg}" signatures must be "${paramBytes * 2}" bytes, saw "${signatureBytes}"`) } const rPadding = countPadding(signature, 0, paramBytes) const sPadding = countPadding(signature, paramBytes, signature.length) const rLength = paramBytes - rPadding const sLength = paramBytes - sPadding const rsBytes = 1 + 1 + rLength + 1 + 1 + sLength const shortLength = rsBytes < MAX_OCTET const dst = Buffer.allocUnsafe((shortLength ? 2 : 3) + rsBytes) let offset = 0 dst[offset++] = ENCODED_TAG_SEQ if (shortLength) { // Bit 8 has value "0" // bits 7-1 give the length. dst[offset++] = rsBytes } else { // Bit 8 of first octet has value "1" // bits 7-1 give the number of additional length octets. dst[offset++] = MAX_OCTET | 1 // eslint-disable-line no-tabs // length, base 256 dst[offset++] = rsBytes & 0xff } dst[offset++] = ENCODED_TAG_INT dst[offset++] = rLength if (rPadding < 0) { dst[offset++] = 0 offset += signature.copy(dst, offset, 0, paramBytes) } else { offset += signature.copy(dst, offset, rPadding, paramBytes) } dst[offset++] = ENCODED_TAG_INT dst[offset++] = sLength if (sPadding < 0) { dst[offset++] = 0 signature.copy(dst, offset, paramBytes) } else { signature.copy(dst, offset, paramBytes + sPadding) } return dst } /***/ }), /***/ 47396: /***/ ((module) => { module.exports = (date) => Math.floor(date.getTime() / 1000) /***/ }), /***/ 93137: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { const { randomBytes } = __webpack_require__(33373) const { IVLENGTHS } = __webpack_require__(15501) module.exports = alg => randomBytes(IVLENGTHS.get(alg) / 8) /***/ }), /***/ 31308: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { const errors = __webpack_require__(52973) const Key = __webpack_require__(57841) const importKey = __webpack_require__(13468) const { KeyStore } = __webpack_require__(24998) module.exports = (input, keyStoreAllowed = false) => { if (input instanceof Key) { return input } if (input instanceof KeyStore) { if (!keyStoreAllowed) { throw new TypeError('key argument for this operation must not be a JWKS.KeyStore instance') } return input } try { return importKey(input) } catch (err) { if (err instanceof errors.JOSEError && !(err instanceof errors.JWKImportFailed)) { throw err } let msg if (keyStoreAllowed) { msg = 'key must be an instance of a key instantiated by JWK.asKey, a valid JWK.asKey input, or a JWKS.KeyStore instance' } else { msg = 'key must be an instance of a key instantiated by JWK.asKey, or a valid JWK.asKey input' } throw new TypeError(msg) } } /***/ }), /***/ 56149: /***/ ((module) => { module.exports = (a = {}, b = {}) => { const keysA = Object.keys(a) const keysB = new Set(Object.keys(b)) return !keysA.some((ka) => keysB.has(ka)) } /***/ }), /***/ 41805: /***/ ((module) => { module.exports = a => !!a && a.constructor === Object /***/ }), /***/ 98921: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { /* global BigInt */ const { keyObjectSupported } = __webpack_require__(32457) let createPublicKey let createPrivateKey let createSecretKey let KeyObject let asInput if (keyObjectSupported) { ({ createPublicKey, createPrivateKey, createSecretKey, KeyObject } = __webpack_require__(33373)) asInput = (input) => input } else { const { EOL } = __webpack_require__(12087) const errors = __webpack_require__(52973) const isObject = __webpack_require__(41805) const asn1 = __webpack_require__(16416) const toInput = Symbol('toInput') const namedCurve = Symbol('namedCurve') asInput = (keyObject, needsPublic) => { if (keyObject instanceof KeyObject) { return keyObject[toInput](needsPublic) } return createSecretKey(keyObject)[toInput](needsPublic) } const pemToDer = pem => Buffer.from(pem.replace(/(?:-----(?:BEGIN|END)(?: (?:RSA|EC))? (?:PRIVATE|PUBLIC) KEY-----|\s)/g, ''), 'base64') const derToPem = (der, label) => `-----BEGIN ${label}-----${EOL}${(der.toString('base64').match(/.{1,64}/g) || []).join(EOL)}${EOL}-----END ${label}-----` const unsupported = (input) => { const label = typeof input === 'string' ? input : `OID ${input.join('.')}` throw new errors.JOSENotSupported(`${label} is not supported in your Node.js runtime version`) } KeyObject = class KeyObject { export ({ cipher, passphrase, type, format } = {}) { if (this._type === 'secret') { return this._buffer } if (this._type === 'public') { if (this.asymmetricKeyType === 'rsa') { switch (type) { case 'pkcs1': if (format === 'pem') { return this._pem } return pemToDer(this._pem) case 'spki': { const PublicKeyInfo = asn1.get('PublicKeyInfo') const pem = PublicKeyInfo.encode({ algorithm: { algorithm: 'rsaEncryption', parameters: { type: 'null' } }, publicKey: { unused: 0, data: pemToDer(this._pem) } }, 'pem', { label: 'PUBLIC KEY' }) return format === 'pem' ? pem : pemToDer(pem) } default: throw new TypeError(`The value ${type} is invalid for option "type"`) } } if (this.asymmetricKeyType === 'ec') { if (type !== 'spki') { throw new TypeError(`The value ${type} is invalid for option "type"`) } if (format === 'pem') { return this._pem } return pemToDer(this._pem) } } if (this._type === 'private') { if (passphrase !== undefined || cipher !== undefined) { throw new errors.JOSENotSupported('encrypted private keys are not supported in your Node.js runtime version') } if (type === 'pkcs8') { if (this._pkcs8) { if (format === 'der' && typeof this._pkcs8 === 'string') { return pemToDer(this._pkcs8) } if (format === 'pem' && Buffer.isBuffer(this._pkcs8)) { return derToPem(this._pkcs8, 'PRIVATE KEY') } return this._pkcs8 } if (this.asymmetricKeyType === 'rsa') { const parsed = this._asn1 const RSAPrivateKey = asn1.get('RSAPrivateKey') const privateKey = RSAPrivateKey.encode(parsed) const PrivateKeyInfo = asn1.get('PrivateKeyInfo') const pkcs8 = PrivateKeyInfo.encode({ version: 0, privateKey, algorithm: { algorithm: 'rsaEncryption', parameters: { type: 'null' } } }) this._pkcs8 = pkcs8 return this.export({ type, format }) } if (this.asymmetricKeyType === 'ec') { const parsed = this._asn1 const ECPrivateKey = asn1.get('ECPrivateKey') const privateKey = ECPrivateKey.encode({ version: parsed.version, privateKey: parsed.privateKey, publicKey: parsed.publicKey }) const PrivateKeyInfo = asn1.get('PrivateKeyInfo') const pkcs8 = PrivateKeyInfo.encode({ version: 0, privateKey, algorithm: { algorithm: 'ecPublicKey', parameters: this._asn1.parameters } }) this._pkcs8 = pkcs8 return this.export({ type, format }) } } if (this.asymmetricKeyType === 'rsa' && type === 'pkcs1') { if (format === 'pem') { return this._pem } return pemToDer(this._pem) } else if (this.asymmetricKeyType === 'ec' && type === 'sec1') { if (format === 'pem') { return this._pem } return pemToDer(this._pem) } else { throw new TypeError(`The value ${type} is invalid for option "type"`) } } } get type () { return this._type } get asymmetricKeyType () { return this._asymmetricKeyType } get symmetricKeySize () { return this._symmetricKeySize } [toInput] (needsPublic) { switch (this._type) { case 'secret': return this._buffer case 'public': return this._pem default: if (needsPublic) { if (!('_pub' in this)) { this._pub = createPublicKey(this) } return this._pub[toInput](false) } return this._pem } } } createSecretKey = (buffer) => { if (!Buffer.isBuffer(buffer) || !buffer.length) { throw new TypeError('input must be a non-empty Buffer instance') } const keyObject = new KeyObject() keyObject._buffer = Buffer.from(buffer) keyObject._symmetricKeySize = buffer.length keyObject._type = 'secret' return keyObject } createPublicKey = (input) => { if (input instanceof KeyObject) { if (input.type !== 'private') { throw new TypeError(`Invalid key object type ${input.type}, expected private.`) } switch (input.asymmetricKeyType) { case 'ec': { const PublicKeyInfo = asn1.get('PublicKeyInfo') const key = PublicKeyInfo.encode({ algorithm: { algorithm: 'ecPublicKey', parameters: input._asn1.parameters }, publicKey: input._asn1.publicKey }) return createPublicKey({ key, format: 'der', type: 'spki' }) } case 'rsa': { const RSAPublicKey = asn1.get('RSAPublicKey') const key = RSAPublicKey.encode(input._asn1) return createPublicKey({ key, format: 'der', type: 'pkcs1' }) } } } if (typeof input === 'string' || Buffer.isBuffer(input)) { input = { key: input, format: 'pem' } } if (!isObject(input)) { throw new TypeError('input must be a string, Buffer or an object') } const { format, passphrase } = input let { key, type } = input if (typeof key !== 'string' && !Buffer.isBuffer(key)) { throw new TypeError('key must be a string or Buffer') } if (format !== 'pem' && format !== 'der') { throw new TypeError('format must be one of "pem" or "der"') } let label if (format === 'pem') { key = key.toString() switch (key.split(/\r?\n/g)[0].toString()) { case '-----BEGIN PUBLIC KEY-----': type = 'spki' label = 'PUBLIC KEY' break case '-----BEGIN RSA PUBLIC KEY-----': type = 'pkcs1' label = 'RSA PUBLIC KEY' break case '-----BEGIN CERTIFICATE-----': throw new errors.JOSENotSupported('X.509 certificates are not supported in your Node.js runtime version') case '-----BEGIN PRIVATE KEY-----': case '-----BEGIN EC PRIVATE KEY-----': case '-----BEGIN RSA PRIVATE KEY-----': return createPublicKey(createPrivateKey(key)) default: throw new TypeError('unknown/unsupported PEM type') } } switch (type) { case 'spki': { const PublicKeyInfo = asn1.get('PublicKeyInfo') const parsed = PublicKeyInfo.decode(key, format, { label }) let type, keyObject switch (parsed.algorithm.algorithm) { case 'ecPublicKey': { keyObject = new KeyObject() keyObject._asn1 = parsed keyObject._asymmetricKeyType = 'ec' keyObject._type = 'public' keyObject._pem = PublicKeyInfo.encode(parsed, 'pem', { label: 'PUBLIC KEY' }) break } case 'rsaEncryption': { type = 'pkcs1' keyObject = createPublicKey({ type, key: parsed.publicKey.data, format: 'der' }) break } default: unsupported(parsed.algorithm.algorithm) } return keyObject } case 'pkcs1': { const RSAPublicKey = asn1.get('RSAPublicKey') const parsed = RSAPublicKey.decode(key, format, { label }) // special case when private pkcs1 PEM / DER is used with createPublicKey if (parsed.n === BigInt(0)) { return createPublicKey(createPrivateKey({ key, format, type, passphrase })) } const keyObject = new KeyObject() keyObject._asn1 = parsed keyObject._asymmetricKeyType = 'rsa' keyObject._type = 'public' keyObject._pem = RSAPublicKey.encode(parsed, 'pem', { label: 'RSA PUBLIC KEY' }) return keyObject } case 'pkcs8': case 'sec1': return createPublicKey(createPrivateKey({ format, key, type, passphrase })) default: throw new TypeError(`The value ${type} is invalid for option "type"`) } } createPrivateKey = (input, hints) => { if (typeof input === 'string' || Buffer.isBuffer(input)) { input = { key: input, format: 'pem' } } if (!isObject(input)) { throw new TypeError('input must be a string, Buffer or an object') } const { format, passphrase } = input let { key, type } = input if (typeof key !== 'string' && !Buffer.isBuffer(key)) { throw new TypeError('key must be a string or Buffer') } if (passphrase !== undefined) { throw new errors.JOSENotSupported('encrypted private keys are not supported in your Node.js runtime version') } if (format !== 'pem' && format !== 'der') { throw new TypeError('format must be one of "pem" or "der"') } let label if (format === 'pem') { key = key.toString() switch (key.split(/\r?\n/g)[0].toString()) { case '-----BEGIN PRIVATE KEY-----': type = 'pkcs8' label = 'PRIVATE KEY' break case '-----BEGIN EC PRIVATE KEY-----': type = 'sec1' label = 'EC PRIVATE KEY' break case '-----BEGIN RSA PRIVATE KEY-----': type = 'pkcs1' label = 'RSA PRIVATE KEY' break default: throw new TypeError('unknown/unsupported PEM type') } } switch (type) { case 'pkcs8': { const PrivateKeyInfo = asn1.get('PrivateKeyInfo') const parsed = PrivateKeyInfo.decode(key, format, { label }) let type, keyObject switch (parsed.algorithm.algorithm) { case 'ecPublicKey': { type = 'sec1' keyObject = createPrivateKey({ type, key: parsed.privateKey, format: 'der' }, { [namedCurve]: parsed.algorithm.parameters.value }) break } case 'rsaEncryption': { type = 'pkcs1' keyObject = createPrivateKey({ type, key: parsed.privateKey, format: 'der' }) break } default: unsupported(parsed.algorithm.algorithm) } keyObject._pkcs8 = key return keyObject } case 'pkcs1': { const RSAPrivateKey = asn1.get('RSAPrivateKey') const parsed = RSAPrivateKey.decode(key, format, { label }) const keyObject = new KeyObject() keyObject._asn1 = parsed keyObject._asymmetricKeyType = 'rsa' keyObject._type = 'private' keyObject._pem = RSAPrivateKey.encode(parsed, 'pem', { label: 'RSA PRIVATE KEY' }) return keyObject } case 'sec1': { const ECPrivateKey = asn1.get('ECPrivateKey') let parsed = ECPrivateKey.decode(key, format, { label }) if (!('parameters' in parsed) && !hints[namedCurve]) { throw new Error('invalid sec1') } else if (!('parameters' in parsed)) { parsed = { ...parsed, parameters: { type: 'namedCurve', value: hints[namedCurve] } } } const keyObject = new KeyObject() keyObject._asn1 = parsed keyObject._asymmetricKeyType = 'ec' keyObject._type = 'private' keyObject._pem = ECPrivateKey.encode(parsed, 'pem', { label: 'EC PRIVATE KEY' }) return keyObject } default: throw new TypeError(`The value ${type} is invalid for option "type"`) } } } module.exports = { createPublicKey, createPrivateKey, createSecretKey, KeyObject, asInput } /***/ }), /***/ 69693: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { /* global BigInt */ const { EOL } = __webpack_require__(12087) const errors = __webpack_require__(52973) const { keyObjectSupported } = __webpack_require__(32457) const { createPublicKey } = __webpack_require__(98921) const base64url = __webpack_require__(73385) const asn1 = __webpack_require__(16416) const computePrimes = __webpack_require__(53141) const { OKP_CURVES, EC_CURVES } = __webpack_require__(15501) const formatPem = (base64pem, descriptor) => `-----BEGIN ${descriptor} KEY-----${EOL}${(base64pem.match(/.{1,64}/g) || []).join(EOL)}${EOL}-----END ${descriptor} KEY-----` const okpToJWK = { private (crv, keyObject) { const der = keyObject.export({ type: 'pkcs8', format: 'der' }) const OneAsymmetricKey = asn1.get('OneAsymmetricKey') const { privateKey: { privateKey: d } } = OneAsymmetricKey.decode(der) return { ...okpToJWK.public(crv, createPublicKey(keyObject)), d: base64url.encodeBuffer(d) } }, public (crv, keyObject) { const der = keyObject.export({ type: 'spki', format: 'der' }) const PublicKeyInfo = asn1.get('PublicKeyInfo') const { publicKey: { data: x } } = PublicKeyInfo.decode(der) return { kty: 'OKP', crv, x: base64url.encodeBuffer(x) } } } const keyObjectToJWK = { rsa: { private (keyObject) { const der = keyObject.export({ type: 'pkcs8', format: 'der' }) const PrivateKeyInfo = asn1.get('PrivateKeyInfo') const RSAPrivateKey = asn1.get('RSAPrivateKey') const { privateKey } = PrivateKeyInfo.decode(der) const { version, n, e, d, p, q, dp, dq, qi } = RSAPrivateKey.decode(privateKey) if (version !== 'two-prime') { throw new errors.JOSENotSupported('Private RSA keys with more than two primes are not supported') } return { kty: 'RSA', n: base64url.encodeBigInt(n), e: base64url.encodeBigInt(e), d: base64url.encodeBigInt(d), p: base64url.encodeBigInt(p), q: base64url.encodeBigInt(q), dp: base64url.encodeBigInt(dp), dq: base64url.encodeBigInt(dq), qi: base64url.encodeBigInt(qi) } }, public (keyObject) { const der = keyObject.export({ type: 'spki', format: 'der' }) const PublicKeyInfo = asn1.get('PublicKeyInfo') const RSAPublicKey = asn1.get('RSAPublicKey') const { publicKey: { data: publicKey } } = PublicKeyInfo.decode(der) const { n, e } = RSAPublicKey.decode(publicKey) return { kty: 'RSA', n: base64url.encodeBigInt(n), e: base64url.encodeBigInt(e) } } }, ec: { private (keyObject) { const der = keyObject.export({ type: 'pkcs8', format: 'der' }) const PrivateKeyInfo = asn1.get('PrivateKeyInfo') const ECPrivateKey = asn1.get('ECPrivateKey') const { privateKey, algorithm: { parameters: { value: crv } } } = PrivateKeyInfo.decode(der) const { privateKey: d, publicKey } = ECPrivateKey.decode(privateKey) if (typeof publicKey === 'undefined') { if (keyObjectSupported) { return { ...keyObjectToJWK.ec.public(createPublicKey(keyObject)), d: base64url.encodeBuffer(d) } } throw new errors.JOSENotSupported('Private EC keys without the public key embedded are not supported in your Node.js runtime version') } const x = publicKey.data.slice(1, ((publicKey.data.length - 1) / 2) + 1) const y = publicKey.data.slice(((publicKey.data.length - 1) / 2) + 1) return { kty: 'EC', crv, d: base64url.encodeBuffer(d), x: base64url.encodeBuffer(x), y: base64url.encodeBuffer(y) } }, public (keyObject) { const der = keyObject.export({ type: 'spki', format: 'der' }) const PublicKeyInfo = asn1.get('PublicKeyInfo') const { publicKey: { data: publicKey }, algorithm: { parameters: { value: crv } } } = PublicKeyInfo.decode(der) const x = publicKey.slice(1, ((publicKey.length - 1) / 2) + 1) const y = publicKey.slice(((publicKey.length - 1) / 2) + 1) return { kty: 'EC', crv, x: base64url.encodeBuffer(x), y: base64url.encodeBuffer(y) } } }, ed25519: { private (keyObject) { return okpToJWK.private('Ed25519', keyObject) }, public (keyObject) { return okpToJWK.public('Ed25519', keyObject) } }, ed448: { private (keyObject) { return okpToJWK.private('Ed448', keyObject) }, public (keyObject) { return okpToJWK.public('Ed448', keyObject) } }, x25519: { private (keyObject) { return okpToJWK.private('X25519', keyObject) }, public (keyObject) { return okpToJWK.public('X25519', keyObject) } }, x448: { private (keyObject) { return okpToJWK.private('X448', keyObject) }, public (keyObject) { return okpToJWK.public('X448', keyObject) } } } module.exports.keyObjectToJWK = (keyObject) => { if (keyObject.type === 'private') { return keyObjectToJWK[keyObject.asymmetricKeyType].private(keyObject) } return keyObjectToJWK[keyObject.asymmetricKeyType].public(keyObject) } const concatEcPublicKey = (x, y) => ({ unused: 0, data: Buffer.concat([ Buffer.alloc(1, 4), base64url.decodeToBuffer(x), base64url.decodeToBuffer(y) ]) }) const jwkToPem = { RSA: { private (jwk, { calculateMissingRSAPrimes }) { const RSAPrivateKey = asn1.get('RSAPrivateKey') if ('oth' in jwk) { throw new errors.JOSENotSupported('Private RSA keys with more than two primes are not supported') } if (jwk.p || jwk.q || jwk.dp || jwk.dq || jwk.qi) { if (!(jwk.p && jwk.q && jwk.dp && jwk.dq && jwk.qi)) { throw new errors.JWKInvalid('all other private key parameters must be present when any one of them is present') } } else if (calculateMissingRSAPrimes) { jwk = computePrimes(jwk) } else if (!calculateMissingRSAPrimes) { 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') } return RSAPrivateKey.encode({ version: 0, n: BigInt(`0x${base64url.decodeToBuffer(jwk.n).toString('hex')}`), e: BigInt(`0x${base64url.decodeToBuffer(jwk.e).toString('hex')}`), d: BigInt(`0x${base64url.decodeToBuffer(jwk.d).toString('hex')}`), p: BigInt(`0x${base64url.decodeToBuffer(jwk.p).toString('hex')}`), q: BigInt(`0x${base64url.decodeToBuffer(jwk.q).toString('hex')}`), dp: BigInt(`0x${base64url.decodeToBuffer(jwk.dp).toString('hex')}`), dq: BigInt(`0x${base64url.decodeToBuffer(jwk.dq).toString('hex')}`), qi: BigInt(`0x${base64url.decodeToBuffer(jwk.qi).toString('hex')}`) }, 'pem', { label: 'RSA PRIVATE KEY' }) }, public (jwk) { const RSAPublicKey = asn1.get('RSAPublicKey') return RSAPublicKey.encode({ version: 0, n: BigInt(`0x${base64url.decodeToBuffer(jwk.n).toString('hex')}`), e: BigInt(`0x${base64url.decodeToBuffer(jwk.e).toString('hex')}`) }, 'pem', { label: 'RSA PUBLIC KEY' }) } }, EC: { private (jwk) { const ECPrivateKey = asn1.get('ECPrivateKey') return ECPrivateKey.encode({ version: 1, privateKey: base64url.decodeToBuffer(jwk.d), parameters: { type: 'namedCurve', value: jwk.crv }, publicKey: concatEcPublicKey(jwk.x, jwk.y) }, 'pem', { label: 'EC PRIVATE KEY' }) }, public (jwk) { const PublicKeyInfo = asn1.get('PublicKeyInfo') return PublicKeyInfo.encode({ algorithm: { algorithm: 'ecPublicKey', parameters: { type: 'namedCurve', value: jwk.crv } }, publicKey: concatEcPublicKey(jwk.x, jwk.y) }, 'pem', { label: 'PUBLIC KEY' }) } }, OKP: { private (jwk) { const OneAsymmetricKey = asn1.get('OneAsymmetricKey') const b64 = OneAsymmetricKey.encode({ version: 0, privateKey: { privateKey: base64url.decodeToBuffer(jwk.d) }, algorithm: { algorithm: jwk.crv } }, 'der') // TODO: WHYYY? https://github.com/indutny/asn1.js/issues/110 b64.write('04', 12, 1, 'hex') return formatPem(b64.toString('base64'), 'PRIVATE') }, public (jwk) { const PublicKeyInfo = asn1.get('PublicKeyInfo') return PublicKeyInfo.encode({ algorithm: { algorithm: jwk.crv }, publicKey: { unused: 0, data: base64url.decodeToBuffer(jwk.x) } }, 'pem', { label: 'PUBLIC KEY' }) } } } module.exports.jwkToPem = (jwk, { calculateMissingRSAPrimes = false } = {}) => { switch (jwk.kty) { case 'EC': if (!EC_CURVES.has(jwk.crv)) { throw new errors.JOSENotSupported(`unsupported EC key curve: ${jwk.crv}`) } break case 'OKP': if (!OKP_CURVES.has(jwk.crv)) { throw new errors.JOSENotSupported(`unsupported OKP key curve: ${jwk.crv}`) } break case 'RSA': break default: throw new errors.JOSENotSupported(`unsupported key type: ${jwk.kty}`) } if (jwk.d) { return jwkToPem[jwk.kty].private(jwk, { calculateMissingRSAPrimes }) } return jwkToPem[jwk.kty].public(jwk) } /***/ }), /***/ 20125: /***/ ((module) => { module.exports = alg => `sha${alg.substr(2, 3)}` /***/ }), /***/ 53141: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { /* global BigInt */ const { randomBytes } = __webpack_require__(33373) const base64url = __webpack_require__(73385) const errors = __webpack_require__(52973) const ZERO = BigInt(0) const ONE = BigInt(1) const TWO = BigInt(2) const toJWKParameter = (n) => { const hex = n.toString(16) return base64url.encodeBuffer(Buffer.from(hex.length % 2 ? `0${hex}` : hex, 'hex')) } const fromBuffer = buf => BigInt(`0x${buf.toString('hex')}`) const bitLength = n => n.toString(2).length const eGcdX = (a, b) => { let x = ZERO let y = ONE let u = ONE let v = ZERO while (a !== ZERO) { const q = b / a const r = b % a const m = x - (u * q) const n = y - (v * q) b = a a = r x = u y = v u = m v = n } return x } const gcd = (a, b) => { let shift = ZERO while (!((a | b) & ONE)) { a >>= ONE b >>= ONE shift++ } while (!(a & ONE)) { a >>= ONE } do { while (!(b & ONE)) { b >>= ONE } if (a > b) { const x = a a = b b = x } b -= a } while (b) return a << shift } const modPow = (a, b, n) => { a = toZn(a, n) let result = ONE let x = a while (b > 0) { var leastSignificantBit = b % TWO b = b / TWO if (leastSignificantBit === ONE) { result = result * x result = result % n } x = x * x x = x % n } return result } const randBetween = (min, max) => { const interval = max - min const bitLen = bitLength(interval) let rnd do { rnd = fromBuffer(randBits(bitLen)) } while (rnd > interval) return rnd + min } const randBits = (bitLength) => { const byteLength = Math.ceil(bitLength / 8) const rndBytes = randomBytes(byteLength) // Fill with 0's the extra bits rndBytes[0] = rndBytes[0] & (2 ** (bitLength % 8) - 1) return rndBytes } const toZn = (a, n) => { a = a % n return (a < 0) ? a + n : a } const odd = (n) => { let r = n while (r % TWO === ZERO) { r = r / TWO } return r } // not sold on these values const maxCountWhileNoY = 30 const maxCountWhileInot0 = 22 const getPrimeFactors = (e, d, n) => { const r = odd(e * d - ONE) let countWhileNoY = 0 let y do { countWhileNoY++ if (countWhileNoY === maxCountWhileNoY) { throw new errors.JWKImportFailed('failed to calculate missing primes') } let countWhileInot0 = 0 let i = modPow(randBetween(TWO, n), r, n) let o = ZERO while (i !== ONE) { countWhileInot0++ if (countWhileInot0 === maxCountWhileInot0) { throw new errors.JWKImportFailed('failed to calculate missing primes') } o = i i = (i * i) % n } if (o !== (n - ONE)) { y = o } } while (!y) const p = gcd(y - ONE, n) const q = n / p return p > q ? { p, q } : { p: q, q: p } } module.exports = (jwk) => { const e = fromBuffer(base64url.decodeToBuffer(jwk.e)) const d = fromBuffer(base64url.decodeToBuffer(jwk.d)) const n = fromBuffer(base64url.decodeToBuffer(jwk.n)) if (d >= n) { throw new errors.JWKInvalid('invalid RSA private exponent') } const { p, q } = getPrimeFactors(e, d, n) const dp = d % (p - ONE) const dq = d % (q - ONE) const qi = toZn(eGcdX(toZn(q, p), p), p) return { ...jwk, p: toJWKParameter(p), q: toJWKParameter(q), dp: toJWKParameter(dp), dq: toJWKParameter(dq), qi: toJWKParameter(qi) } } /***/ }), /***/ 32457: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { const { diffieHellman, KeyObject, sign, verify } = __webpack_require__(33373) const [major, minor] = process.version.substr(1).split('.').map(x => parseInt(x, 10)) module.exports = { oaepHashSupported: major > 12 || (major === 12 && minor >= 9), keyObjectSupported: !!KeyObject && major >= 12, edDSASupported: !!sign && !!verify, dsaEncodingSupported: major > 13 || (major === 13 && minor >= 2) || (major === 12 && minor >= 16), improvedDH: !!diffieHellman } /***/ }), /***/ 97305: /***/ ((module) => { const minute = 60 const hour = minute * 60 const day = hour * 24 const week = day * 7 const year = day * 365.25 const REGEX = /^(\d+|\d+\.\d+) ?(seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)$/i module.exports = (str) => { const matched = REGEX.exec(str) if (!matched) { throw new TypeError(`invalid time period format ("${str}")`) } const value = parseFloat(matched[1]) const unit = matched[2].toLowerCase() switch (unit) { case 'sec': case 'secs': case 'second': case 'seconds': case 's': return Math.round(value) case 'minute': case 'minutes': case 'min': case 'mins': case 'm': return Math.round(value * minute) case 'hour': case 'hours': case 'hr': case 'hrs': case 'h': return Math.round(value * hour) case 'day': case 'days': case 'd': return Math.round(value * day) case 'week': case 'weeks': case 'w': return Math.round(value * week) case 'year': case 'years': case 'yr': case 'yrs': case 'y': return Math.round(value * year) } } /***/ }), /***/ 80820: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { const { timingSafeEqual: TSE } = __webpack_require__(33373) const paddedBuffer = (input, length) => { if (input.length === length) { return input } const buffer = Buffer.alloc(length) input.copy(buffer) return buffer } const timingSafeEqual = (a, b) => { const length = Math.max(a.length, b.length) return TSE(paddedBuffer(a, length), paddedBuffer(b, length)) } module.exports = timingSafeEqual /***/ }), /***/ 4520: /***/ ((module) => { const MAX_INT32 = Math.pow(2, 32) module.exports = (value, buf = Buffer.allocUnsafe(8)) => { const high = Math.floor(value / MAX_INT32) const low = value % MAX_INT32 buf.writeUInt32BE(high, 0) buf.writeUInt32BE(low, 4) return buf } /***/ }), /***/ 530: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { const { JOSECritNotUnderstood, JWSInvalid } = __webpack_require__(52973) const DEFINED = new Set([ 'alg', 'jku', 'jwk', 'kid', 'x5u', 'x5c', 'x5t', 'x5t#S256', 'typ', 'cty', 'crit', 'enc', 'zip', 'epk', 'apu', 'apv', 'iv', 'tag', 'p2s', 'p2c' ]) module.exports = function validateCrit (Err, protectedHeader, unprotectedHeader, understood) { if (protectedHeader && 'crit' in protectedHeader) { if ( !Array.isArray(protectedHeader.crit) || protectedHeader.crit.length === 0 || protectedHeader.crit.some(s => typeof s !== 'string' || !s) ) { throw new Err('"crit" Header Parameter MUST be an array of non-empty strings when present') } const whitelisted = new Set(understood) const combined = { ...protectedHeader, ...unprotectedHeader } protectedHeader.crit.forEach((parameter) => { if (DEFINED.has(parameter)) { throw new Err(`The critical list contains a non-extension Header Parameter ${parameter}`) } if (!whitelisted.has(parameter)) { throw new JOSECritNotUnderstood(`critical "${parameter}" is not understood`) } if (parameter === 'b64') { if (!('b64' in protectedHeader)) { throw new JWSInvalid('"b64" critical parameter must be integrity protected') } if (typeof protectedHeader.b64 !== 'boolean') { throw new JWSInvalid('"b64" critical parameter must be a boolean') } } else if (!(parameter in combined)) { throw new Err(`critical parameter "${parameter}" is missing`) } }) } if (unprotectedHeader && 'crit' in unprotectedHeader) { throw new Err('"crit" Header Parameter MUST be integrity protected when present') } } /***/ }), /***/ 16425: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { module.exports = { JWE: __webpack_require__(72851), JWK: __webpack_require__(67894), JWKS: __webpack_require__(42896), JWS: __webpack_require__(36518), JWT: __webpack_require__(18138), errors: __webpack_require__(52973) } /***/ }), /***/ 49651: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { const { createCipheriv, createDecipheriv, getCiphers } = __webpack_require__(33373) const uint64be = __webpack_require__(4520) const timingSafeEqual = __webpack_require__(80820) const { KEYOBJECT } = __webpack_require__(15010) const { JWEInvalid, JWEDecryptionFailed } = __webpack_require__(52973) const checkInput = function (size, iv, tag) { if (iv.length !== 16) { throw new JWEInvalid('invalid iv') } if (arguments.length === 3) { if (tag.length !== size / 8) { throw new JWEInvalid('invalid tag') } } } const encrypt = (size, sign, { [KEYOBJECT]: keyObject }, cleartext, { iv, aad = Buffer.alloc(0) }) => { const key = keyObject.export() checkInput(size, iv) const keySize = size / 8 const encKey = key.slice(keySize) const cipher = createCipheriv(`aes-${size}-cbc`, encKey, iv) const ciphertext = Buffer.concat([cipher.update(cleartext), cipher.final()]) const macData = Buffer.concat([aad, iv, ciphertext, uint64be(aad.length * 8)]) const macKey = key.slice(0, keySize) const tag = sign({ [KEYOBJECT]: macKey }, macData).slice(0, keySize) return { ciphertext, tag } } const decrypt = (size, sign, { [KEYOBJECT]: keyObject }, ciphertext, { iv, tag = Buffer.alloc(0), aad = Buffer.alloc(0) }) => { checkInput(size, iv, tag) const keySize = size / 8 const key = keyObject.export() const encKey = key.slice(keySize) const macKey = key.slice(0, keySize) const macData = Buffer.concat([aad, iv, ciphertext, uint64be(aad.length * 8)]) const expectedTag = sign({ [KEYOBJECT]: macKey }, macData, tag).slice(0, keySize) const macCheckPassed = timingSafeEqual(tag, expectedTag) if (!macCheckPassed) { throw new JWEDecryptionFailed() } let cleartext try { const cipher = createDecipheriv(`aes-${size}-cbc`, encKey, iv) cleartext = Buffer.concat([cipher.update(ciphertext), cipher.final()]) } catch (err) {} if (!cleartext) { throw new JWEDecryptionFailed() } return cleartext } module.exports = (JWA, JWK) => { ['A128CBC-HS256', 'A192CBC-HS384', 'A256CBC-HS512'].forEach((jwaAlg) => { const size = parseInt(jwaAlg.substr(1, 3), 10) const sign = JWA.sign.get(`HS${size * 2}`) if (getCiphers().includes(`aes-${size}-cbc`)) { JWA.encrypt.set(jwaAlg, encrypt.bind(undefined, size, sign)) JWA.decrypt.set(jwaAlg, decrypt.bind(undefined, size, sign)) JWK.oct.encrypt[jwaAlg] = JWK.oct.decrypt[jwaAlg] = key => (key.use === 'enc' || key.use === undefined) && key.length / 2 === size } }) } /***/ }), /***/ 21239: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { const { createCipheriv, createDecipheriv, getCiphers } = __webpack_require__(33373) const { KEYOBJECT } = __webpack_require__(15010) const { JWEInvalid, JWEDecryptionFailed } = __webpack_require__(52973) const { asInput } = __webpack_require__(98921) const checkInput = function (size, iv, tag) { if (iv.length !== 12) { throw new JWEInvalid('invalid iv') } if (arguments.length === 3) { if (tag.length !== 16) { throw new JWEInvalid('invalid tag') } } } const encrypt = (size, { [KEYOBJECT]: keyObject }, cleartext, { iv, aad = Buffer.alloc(0) }) => { const key = asInput(keyObject, false) checkInput(size, iv) const cipher = createCipheriv(`aes-${size}-gcm`, key, iv, { authTagLength: 16 }) cipher.setAAD(aad) const ciphertext = Buffer.concat([cipher.update(cleartext), cipher.final()]) const tag = cipher.getAuthTag() return { ciphertext, tag } } const decrypt = (size, { [KEYOBJECT]: keyObject }, ciphertext, { iv, tag = Buffer.alloc(0), aad = Buffer.alloc(0) }) => { const key = asInput(keyObject, false) checkInput(size, iv, tag) try { const cipher = createDecipheriv(`aes-${size}-gcm`, key, iv, { authTagLength: 16 }) cipher.setAuthTag(tag) cipher.setAAD(aad) return Buffer.concat([cipher.update(ciphertext), cipher.final()]) } catch (err) { throw new JWEDecryptionFailed() } } module.exports = (JWA, JWK) => { ['A128GCM', 'A192GCM', 'A256GCM'].forEach((jwaAlg) => { const size = parseInt(jwaAlg.substr(1, 3), 10) if (getCiphers().includes(`aes-${size}-gcm`)) { JWA.encrypt.set(jwaAlg, encrypt.bind(undefined, size)) JWA.decrypt.set(jwaAlg, decrypt.bind(undefined, size)) JWK.oct.encrypt[jwaAlg] = JWK.oct.decrypt[jwaAlg] = key => (key.use === 'enc' || key.use === undefined) && key.length === size } }) } /***/ }), /***/ 37813: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { const generateIV = __webpack_require__(93137) const base64url = __webpack_require__(73385) module.exports = (JWA, JWK) => { ['A128GCMKW', 'A192GCMKW', 'A256GCMKW'].forEach((jwaAlg) => { const encAlg = jwaAlg.substr(0, 7) const size = parseInt(jwaAlg.substr(1, 3), 10) const encrypt = JWA.encrypt.get(encAlg) const decrypt = JWA.decrypt.get(encAlg) if (encrypt && decrypt) { JWA.keyManagementEncrypt.set(jwaAlg, (key, payload) => { const iv = generateIV(jwaAlg) const { ciphertext, tag } = encrypt(key, payload, { iv }) return { wrapped: ciphertext, header: { tag: base64url.encodeBuffer(tag), iv: base64url.encodeBuffer(iv) } } }) JWA.keyManagementDecrypt.set(jwaAlg, decrypt) JWK.oct.wrapKey[jwaAlg] = JWK.oct.unwrapKey[jwaAlg] = key => (key.use === 'enc' || key.use === undefined) && key.length === size } }) } /***/ }), /***/ 80477: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { const { createCipheriv, createDecipheriv, getCiphers } = __webpack_require__(33373) const { KEYOBJECT } = __webpack_require__(15010) const { asInput } = __webpack_require__(98921) const checkInput = (data) => { if (data !== undefined && data.length % 8 !== 0) { throw new Error('invalid data length') } } const wrapKey = (alg, { [KEYOBJECT]: keyObject }, payload) => { const key = asInput(keyObject, false) const cipher = createCipheriv(alg, key, Buffer.alloc(8, 'a6', 'hex')) return { wrapped: Buffer.concat([cipher.update(payload), cipher.final()]) } } const unwrapKey = (alg, { [KEYOBJECT]: keyObject }, payload) => { const key = asInput(keyObject, false) checkInput(payload) const cipher = createDecipheriv(alg, key, Buffer.alloc(8, 'a6', 'hex')) return Buffer.concat([cipher.update(payload), cipher.final()]) } module.exports = (JWA, JWK) => { ['A128KW', 'A192KW', 'A256KW'].forEach((jwaAlg) => { const size = parseInt(jwaAlg.substr(1, 3), 10) const alg = `aes${size}-wrap` if (getCiphers().includes(alg)) { JWA.keyManagementEncrypt.set(jwaAlg, wrapKey.bind(undefined, alg)) JWA.keyManagementDecrypt.set(jwaAlg, unwrapKey.bind(undefined, alg)) JWK.oct.wrapKey[jwaAlg] = JWK.oct.unwrapKey[jwaAlg] = key => (key.use === 'enc' || key.use === undefined) && key.length === size } }) } /***/ }), /***/ 94563: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { const { improvedDH } = __webpack_require__(32457) if (improvedDH) { const { diffieHellman } = __webpack_require__(33373) const { KeyObject } = __webpack_require__(98921) const importKey = __webpack_require__(13468) module.exports = ({ keyObject: privateKey }, publicKey) => { if (!(publicKey instanceof KeyObject)) { ({ keyObject: publicKey } = importKey(publicKey)) } return diffieHellman({ privateKey, publicKey }) } } else { const { createECDH, constants: { POINT_CONVERSION_UNCOMPRESSED } } = __webpack_require__(33373) const base64url = __webpack_require__(73385) const crvToCurve = (crv) => { switch (crv) { case 'P-256': return 'prime256v1' case 'P-384': return 'secp384r1' case 'P-521': return 'secp521r1' } } const UNCOMPRESSED = Buffer.alloc(1, POINT_CONVERSION_UNCOMPRESSED) const pubToBuffer = (x, y) => Buffer.concat([UNCOMPRESSED, base64url.decodeToBuffer(x), base64url.decodeToBuffer(y)]) module.exports = ({ crv, d }, { x, y }) => { const curve = crvToCurve(crv) const exchange = createECDH(curve) exchange.setPrivateKey(base64url.decodeToBuffer(d)) return exchange.computeSecret(pubToBuffer(x, y)) } } /***/ }), /***/ 81417: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { const { createHash } = __webpack_require__(33373) const ecdhComputeSecret = __webpack_require__(94563) const concat = (key, length, value) => { const iterations = Math.ceil(length / 32) let res for (let iter = 1; iter <= iterations; iter++) { const buf = Buffer.allocUnsafe(4 + key.length + value.length) buf.writeUInt32BE(iter, 0) key.copy(buf, 4) value.copy(buf, 4 + key.length) if (!res) { res = createHash('sha256').update(buf).digest() } else { res = Buffer.concat([res, createHash('sha256').update(buf).digest()]) } } return res.slice(0, length) } const uint32be = (value, buf = Buffer.allocUnsafe(4)) => { buf.writeUInt32BE(value) return buf } const lengthAndInput = input => Buffer.concat([uint32be(input.length), input]) module.exports = (alg, keyLen, privKey, pubKey, { apu = Buffer.alloc(0), apv = Buffer.alloc(0) } = {}, computeSecret = ecdhComputeSecret) => { const value = Buffer.concat([ lengthAndInput(Buffer.from(alg)), lengthAndInput(apu), lengthAndInput(apv), uint32be(keyLen) ]) const sharedSecret = computeSecret(privKey, pubKey) return concat(sharedSecret, keyLen / 8, value) } /***/ }), /***/ 52652: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { const { improvedDH } = __webpack_require__(32457) const { KEYLENGTHS } = __webpack_require__(15501) const { generateSync } = __webpack_require__(39377) const { name: secp256k1 } = __webpack_require__(2044) const derive = __webpack_require__(81417) const wrapKey = (key, payload, { enc }) => { const epk = generateSync(key.kty, key.crv) const derivedKey = derive(enc, KEYLENGTHS.get(enc), epk, key) return { wrapped: derivedKey, header: { epk: { kty: key.kty, crv: key.crv, x: epk.x, y: epk.y } } } } const unwrapKey = (key, payload, header) => { const { enc, epk } = header return derive(enc, KEYLENGTHS.get(enc), key, epk, header) } module.exports = (JWA, JWK) => { JWA.keyManagementEncrypt.set('ECDH-ES', wrapKey) JWA.keyManagementDecrypt.set('ECDH-ES', unwrapKey) JWK.EC.deriveKey['ECDH-ES'] = key => (key.use === 'enc' || key.use === undefined) && key.crv !== secp256k1 if (improvedDH) { JWK.OKP.deriveKey['ECDH-ES'] = key => (key.use === 'enc' || key.use === undefined) && key.keyObject.asymmetricKeyType.startsWith('x') } } /***/ }), /***/ 7668: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { const { improvedDH } = __webpack_require__(32457) const { KEYOBJECT } = __webpack_require__(15010) const { generateSync } = __webpack_require__(39377) const { name: secp256k1 } = __webpack_require__(2044) const { ECDH_DERIVE_LENGTHS } = __webpack_require__(15501) const derive = __webpack_require__(81417) const wrapKey = (wrap, derive, key, payload) => { const epk = generateSync(key.kty, key.crv) const derivedKey = derive(epk, key, payload) const result = wrap({ [KEYOBJECT]: derivedKey }, payload) result.header = result.header || {} Object.assign(result.header, { epk: { kty: key.kty, crv: key.crv, x: epk.x, y: epk.y } }) return result } const unwrapKey = (unwrap, derive, key, payload, header) => { const { epk } = header const derivedKey = derive(key, epk, header) return unwrap({ [KEYOBJECT]: derivedKey }, payload, header) } module.exports = (JWA, JWK) => { ['ECDH-ES+A128KW', 'ECDH-ES+A192KW', 'ECDH-ES+A256KW'].forEach((jwaAlg) => { const kw = jwaAlg.substr(-6) const kwWrap = JWA.keyManagementEncrypt.get(kw) const kwUnwrap = JWA.keyManagementDecrypt.get(kw) const keylen = parseInt(jwaAlg.substr(9, 3), 10) ECDH_DERIVE_LENGTHS.set(jwaAlg, keylen) if (kwWrap && kwUnwrap) { JWA.keyManagementEncrypt.set(jwaAlg, wrapKey.bind(undefined, kwWrap, derive.bind(undefined, jwaAlg, keylen))) JWA.keyManagementDecrypt.set(jwaAlg, unwrapKey.bind(undefined, kwUnwrap, derive.bind(undefined, jwaAlg, keylen))) JWK.EC.deriveKey[jwaAlg] = key => (key.use === 'enc' || key.use === undefined) && key.crv !== secp256k1 if (improvedDH) { JWK.OKP.deriveKey[jwaAlg] = key => (key.use === 'enc' || key.use === undefined) && key.keyObject.asymmetricKeyType.startsWith('x') } } }) } module.exports.wrapKey = wrapKey module.exports.unwrapKey = unwrapKey /***/ }), /***/ 77634: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { const { sign: signOneShot, verify: verifyOneShot, createSign, createVerify, getCurves } = __webpack_require__(33373) const { derToJose, joseToDer } = __webpack_require__(14451) const { KEYOBJECT } = __webpack_require__(15010) const resolveNodeAlg = __webpack_require__(20125) const { asInput } = __webpack_require__(98921) const { dsaEncodingSupported } = __webpack_require__(32457) const { name: secp256k1 } = __webpack_require__(2044) let sign, verify if (dsaEncodingSupported) { sign = (jwaAlg, nodeAlg, { [KEYOBJECT]: keyObject }, payload) => { if (typeof payload === 'string') { payload = Buffer.from(payload) } return signOneShot(nodeAlg, payload, { key: asInput(keyObject, false), dsaEncoding: 'ieee-p1363' }) } verify = (jwaAlg, nodeAlg, { [KEYOBJECT]: keyObject }, payload, signature) => { try { return verifyOneShot(nodeAlg, payload, { key: asInput(keyObject, true), dsaEncoding: 'ieee-p1363' }, signature) } catch (err) { return false } } } else { sign = (jwaAlg, nodeAlg, { [KEYOBJECT]: keyObject }, payload) => { return derToJose(createSign(nodeAlg).update(payload).sign(asInput(keyObject, false)), jwaAlg) } verify = (jwaAlg, nodeAlg, { [KEYOBJECT]: keyObject }, payload, signature) => { try { return createVerify(nodeAlg).update(payload).verify(asInput(keyObject, true), joseToDer(signature, jwaAlg)) } catch (err) { return false } } } const crvToAlg = (crv) => { switch (crv) { case 'P-256': return 'ES256' case secp256k1: return 'ES256K' case 'P-384': return 'ES384' case 'P-521': return 'ES512' } } module.exports = (JWA, JWK) => { const algs = [] if (getCurves().includes('prime256v1')) { algs.push('ES256') } if (getCurves().includes('secp256k1')) { algs.push('ES256K') } if (getCurves().includes('secp384r1')) { algs.push('ES384') } if (getCurves().includes('secp521r1')) { algs.push('ES512') } algs.forEach((jwaAlg) => { const nodeAlg = resolveNodeAlg(jwaAlg) JWA.sign.set(jwaAlg, sign.bind(undefined, jwaAlg, nodeAlg)) JWA.verify.set(jwaAlg, verify.bind(undefined, jwaAlg, nodeAlg)) JWK.EC.sign[jwaAlg] = key => key.private && JWK.EC.verify[jwaAlg](key) JWK.EC.verify[jwaAlg] = key => (key.use === 'sig' || key.use === undefined) && crvToAlg(key.crv) === jwaAlg }) } /***/ }), /***/ 18803: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { const { sign: signOneShot, verify: verifyOneShot } = __webpack_require__(33373) const { KEYOBJECT } = __webpack_require__(15010) const { edDSASupported } = __webpack_require__(32457) const sign = ({ [KEYOBJECT]: keyObject }, payload) => { if (typeof payload === 'string') { payload = Buffer.from(payload) } return signOneShot(undefined, payload, keyObject) } const verify = ({ [KEYOBJECT]: keyObject }, payload, signature) => { return verifyOneShot(undefined, payload, keyObject, signature) } module.exports = (JWA, JWK) => { if (edDSASupported) { JWA.sign.set('EdDSA', sign) JWA.verify.set('EdDSA', verify) JWK.OKP.sign.EdDSA = key => key.private && JWK.OKP.verify.EdDSA(key) JWK.OKP.verify.EdDSA = key => (key.use === 'sig' || key.use === undefined) && key.keyObject.asymmetricKeyType.startsWith('ed') } } /***/ }), /***/ 25866: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { const { createHmac } = __webpack_require__(33373) const { KEYOBJECT } = __webpack_require__(15010) const timingSafeEqual = __webpack_require__(80820) const resolveNodeAlg = __webpack_require__(20125) const { asInput } = __webpack_require__(98921) const sign = (jwaAlg, hmacAlg, { [KEYOBJECT]: keyObject }, payload) => { const hmac = createHmac(hmacAlg, asInput(keyObject, false)) hmac.update(payload) return hmac.digest() } const verify = (jwaAlg, hmacAlg, key, payload, signature) => { const expected = sign(jwaAlg, hmacAlg, key, payload) const actual = signature return timingSafeEqual(actual, expected) } module.exports = (JWA, JWK) => { ['HS256', 'HS384', 'HS512'].forEach((jwaAlg) => { const hmacAlg = resolveNodeAlg(jwaAlg) JWA.sign.set(jwaAlg, sign.bind(undefined, jwaAlg, hmacAlg)) JWA.verify.set(jwaAlg, verify.bind(undefined, jwaAlg, hmacAlg)) JWK.oct.sign[jwaAlg] = JWK.oct.verify[jwaAlg] = key => key.use === 'sig' || key.use === undefined }) } /***/ }), /***/ 50191: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { const { JWKKeySupport, JOSENotSupported } = __webpack_require__(52973) const { KEY_MANAGEMENT_ENCRYPT, KEY_MANAGEMENT_DECRYPT } = __webpack_require__(15010) const { JWA, JWK } = __webpack_require__(15501) // sign, verify __webpack_require__(25866)(JWA, JWK) __webpack_require__(77634)(JWA, JWK) __webpack_require__(18803)(JWA, JWK) __webpack_require__(35172)(JWA, JWK) __webpack_require__(16984)(JWA, JWK) __webpack_require__(72638)(JWA) // encrypt, decrypt __webpack_require__(49651)(JWA, JWK) __webpack_require__(21239)(JWA, JWK) // wrapKey, unwrapKey __webpack_require__(1029)(JWA, JWK) __webpack_require__(80477)(JWA, JWK) __webpack_require__(37813)(JWA, JWK) // deriveKey __webpack_require__(94515)(JWA, JWK) __webpack_require__(52652)(JWA, JWK) __webpack_require__(7668)(JWA, JWK) const check = (key, op, alg) => { const cache = `_${op}_${alg}` let label let keyOp if (op === 'keyManagementEncrypt') { label = 'key management (encryption)' keyOp = KEY_MANAGEMENT_ENCRYPT } else if (op === 'keyManagementDecrypt') { label = 'key management (decryption)' keyOp = KEY_MANAGEMENT_DECRYPT } if (cache in key) { if (key[cache]) { return } throw new JWKKeySupport(`the key does not support ${alg} ${label || op} algorithm`) } let value = true if (!JWA[op].has(alg)) { throw new JOSENotSupported(`unsupported ${label || op} alg: ${alg}`) } else if (!key.algorithms(keyOp).has(alg)) { value = false } Object.defineProperty(key, cache, { value, enumerable: false }) if (!value) { return check(key, op, alg) } } module.exports = { check, sign: (alg, key, payload) => { check(key, 'sign', alg) return JWA.sign.get(alg)(key, payload) }, verify: (alg, key, payload, signature) => { check(key, 'verify', alg) return JWA.verify.get(alg)(key, payload, signature) }, keyManagementEncrypt: (alg, key, payload, opts) => { check(key, 'keyManagementEncrypt', alg) return JWA.keyManagementEncrypt.get(alg)(key, payload, opts) }, keyManagementDecrypt: (alg, key, payload, opts) => { check(key, 'keyManagementDecrypt', alg) return JWA.keyManagementDecrypt.get(alg)(key, payload, opts) }, encrypt: (alg, key, cleartext, opts) => { check(key, 'encrypt', alg) return JWA.encrypt.get(alg)(key, cleartext, opts) }, decrypt: (alg, key, ciphertext, opts) => { check(key, 'decrypt', alg) return JWA.decrypt.get(alg)(key, ciphertext, opts) } } /***/ }), /***/ 72638: /***/ ((module) => { const sign = () => Buffer.from('') const verify = (key, payload, signature) => !signature.length module.exports = (JWA, JWK) => { JWA.sign.set('none', sign) JWA.verify.set('none', verify) } /***/ }), /***/ 94515: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { const { pbkdf2Sync: pbkdf2, randomBytes } = __webpack_require__(33373) const { KEYOBJECT } = __webpack_require__(15010) const base64url = __webpack_require__(73385) const SALT_LENGTH = 16 const NULL_BUFFER = Buffer.alloc(1, 0) const concatSalt = (alg, p2s) => { return Buffer.concat([ Buffer.from(alg, 'utf8'), NULL_BUFFER, p2s ]) } const wrapKey = (keylen, sha, concat, wrap, { [KEYOBJECT]: keyObject }, payload) => { // Note that if password-based encryption is used for multiple // recipients, it is expected that each recipient use different values // for the PBES2 parameters "p2s" and "p2c". // here we generate p2c between 2048 and 4096 and random p2s const p2c = Math.floor((Math.random() * 2049) + 2048) const p2s = randomBytes(SALT_LENGTH) const salt = concat(p2s) const derivedKey = pbkdf2(keyObject.export(), salt, p2c, keylen, sha) const result = wrap({ [KEYOBJECT]: derivedKey }, payload) result.header = result.header || {} Object.assign(result.header, { p2c, p2s: base64url.encodeBuffer(p2s) }) return result } const unwrapKey = (keylen, sha, concat, unwrap, { [KEYOBJECT]: keyObject }, payload, header) => { const { p2s, p2c } = header const salt = concat(p2s) const derivedKey = pbkdf2(keyObject.export(), salt, p2c, keylen, sha) return unwrap({ [KEYOBJECT]: derivedKey }, payload, header) } module.exports = (JWA, JWK) => { ['PBES2-HS256+A128KW', 'PBES2-HS384+A192KW', 'PBES2-HS512+A256KW'].forEach((jwaAlg) => { const kw = jwaAlg.substr(-6) const kwWrap = JWA.keyManagementEncrypt.get(kw) const kwUnwrap = JWA.keyManagementDecrypt.get(kw) const keylen = parseInt(jwaAlg.substr(13, 3), 10) / 8 const sha = `sha${jwaAlg.substr(8, 3)}` if (kwWrap && kwUnwrap) { JWA.keyManagementEncrypt.set(jwaAlg, wrapKey.bind(undefined, keylen, sha, concatSalt.bind(undefined, jwaAlg), kwWrap)) JWA.keyManagementDecrypt.set(jwaAlg, unwrapKey.bind(undefined, keylen, sha, concatSalt.bind(undefined, jwaAlg), kwUnwrap)) JWK.oct.deriveKey[jwaAlg] = key => key.use === 'enc' || key.use === undefined } }) } /***/ }), /***/ 1029: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { const { publicEncrypt, privateDecrypt, constants } = __webpack_require__(33373) const { oaepHashSupported } = __webpack_require__(32457) const { KEYOBJECT } = __webpack_require__(15010) const { asInput } = __webpack_require__(98921) const resolvePadding = (alg) => { switch (alg) { case 'RSA-OAEP': case 'RSA-OAEP-256': case 'RSA-OAEP-384': case 'RSA-OAEP-512': return constants.RSA_PKCS1_OAEP_PADDING case 'RSA1_5': return constants.RSA_PKCS1_PADDING } } const resolveOaepHash = (alg) => { switch (alg) { case 'RSA-OAEP': return 'sha1' case 'RSA-OAEP-256': return 'sha256' case 'RSA-OAEP-384': return 'sha384' case 'RSA-OAEP-512': return 'sha512' default: return undefined } } const wrapKey = (padding, oaepHash, { [KEYOBJECT]: keyObject }, payload) => { const key = asInput(keyObject, true) return { wrapped: publicEncrypt({ key, oaepHash, padding }, payload) } } const unwrapKey = (padding, oaepHash, { [KEYOBJECT]: keyObject }, payload) => { const key = asInput(keyObject, false) return privateDecrypt({ key, oaepHash, padding }, payload) } const LENGTHS = { RSA1_5: 0, 'RSA-OAEP': 592, 'RSA-OAEP-256': 784, 'RSA-OAEP-384': 1040, 'RSA-OAEP-512': 1296 } module.exports = (JWA, JWK) => { const algs = ['RSA-OAEP', 'RSA1_5'] if (oaepHashSupported) { algs.splice(1, 0, 'RSA-OAEP-256', 'RSA-OAEP-384', 'RSA-OAEP-512') } algs.forEach((jwaAlg) => { const padding = resolvePadding(jwaAlg) const oaepHash = resolveOaepHash(jwaAlg) JWA.keyManagementEncrypt.set(jwaAlg, wrapKey.bind(undefined, padding, oaepHash)) JWA.keyManagementDecrypt.set(jwaAlg, unwrapKey.bind(undefined, padding, oaepHash)) JWK.RSA.wrapKey[jwaAlg] = key => (key.use === 'enc' || key.use === undefined) && key.length >= LENGTHS[jwaAlg] JWK.RSA.unwrapKey[jwaAlg] = key => key.private && (key.use === 'enc' || key.use === undefined) && key.length >= LENGTHS[jwaAlg] }) } /***/ }), /***/ 16984: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { const { createSign, createVerify } = __webpack_require__(33373) const { KEYOBJECT } = __webpack_require__(15010) const resolveNodeAlg = __webpack_require__(20125) const { asInput } = __webpack_require__(98921) const sign = (nodeAlg, { [KEYOBJECT]: keyObject }, payload) => { return createSign(nodeAlg).update(payload).sign(asInput(keyObject, false)) } const verify = (nodeAlg, { [KEYOBJECT]: keyObject }, payload, signature) => { return createVerify(nodeAlg).update(payload).verify(asInput(keyObject, true), signature) } const LENGTHS = { RS256: 0, RS384: 624, RS512: 752 } module.exports = (JWA, JWK) => { ['RS256', 'RS384', 'RS512'].forEach((jwaAlg) => { const nodeAlg = resolveNodeAlg(jwaAlg) JWA.sign.set(jwaAlg, sign.bind(undefined, nodeAlg)) JWA.verify.set(jwaAlg, verify.bind(undefined, nodeAlg)) JWK.RSA.sign[jwaAlg] = key => key.private && JWK.RSA.verify[jwaAlg](key) JWK.RSA.verify[jwaAlg] = key => (key.use === 'sig' || key.use === undefined) && key.length >= LENGTHS[jwaAlg] }) } /***/ }), /***/ 35172: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { const { createSign, createVerify, constants } = __webpack_require__(33373) const { KEYOBJECT } = __webpack_require__(15010) const resolveNodeAlg = __webpack_require__(20125) const { asInput } = __webpack_require__(98921) const sign = (nodeAlg, { [KEYOBJECT]: keyObject }, payload) => { const key = asInput(keyObject, false) return createSign(nodeAlg).update(payload).sign({ key, padding: constants.RSA_PKCS1_PSS_PADDING, saltLength: constants.RSA_PSS_SALTLEN_DIGEST }) } const verify = (nodeAlg, { [KEYOBJECT]: keyObject }, payload, signature) => { const key = asInput(keyObject, true) return createVerify(nodeAlg).update(payload).verify({ key, padding: constants.RSA_PKCS1_PSS_PADDING, saltLength: constants.RSA_PSS_SALTLEN_DIGEST }, signature) } const LENGTHS = { PS256: 528, PS384: 784, PS512: 1040 } module.exports = (JWA, JWK) => { ['PS256', 'PS384', 'PS512'].forEach((jwaAlg) => { const nodeAlg = resolveNodeAlg(jwaAlg) JWA.sign.set(jwaAlg, sign.bind(undefined, nodeAlg)) JWA.verify.set(jwaAlg, verify.bind(undefined, nodeAlg)) JWK.RSA.sign[jwaAlg] = key => key.private && JWK.RSA.verify[jwaAlg](key) JWK.RSA.verify[jwaAlg] = key => (key.use === 'sig' || key.use === undefined) && key.length >= LENGTHS[jwaAlg] }) } /***/ }), /***/ 73607: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { const { inflateRawSync } = __webpack_require__(78761) const base64url = __webpack_require__(73385) const getKey = __webpack_require__(31308) const { KeyStore } = __webpack_require__(42896) const errors = __webpack_require__(52973) const { check, decrypt, keyManagementDecrypt } = __webpack_require__(50191) const JWK = __webpack_require__(67894) const { createSecretKey } = __webpack_require__(98921) const generateCEK = __webpack_require__(15242) const validateHeaders = __webpack_require__(46904) const { detect: resolveSerialization } = __webpack_require__(5348) const SINGLE_RECIPIENT = new Set(['compact', 'flattened']) const combineHeader = (prot = {}, unprotected = {}, header = {}) => { if (typeof prot === 'string') { prot = base64url.JSON.decode(prot) } const p2s = prot.p2s || unprotected.p2s || header.p2s const apu = prot.apu || unprotected.apu || header.apu const apv = prot.apv || unprotected.apv || header.apv const iv = prot.iv || unprotected.iv || header.iv const tag = prot.tag || unprotected.tag || header.tag return { ...prot, ...unprotected, ...header, ...(typeof p2s === 'string' ? { p2s: base64url.decodeToBuffer(p2s) } : undefined), ...(typeof apu === 'string' ? { apu: base64url.decodeToBuffer(apu) } : undefined), ...(typeof apv === 'string' ? { apv: base64url.decodeToBuffer(apv) } : undefined), ...(typeof iv === 'string' ? { iv: base64url.decodeToBuffer(iv) } : undefined), ...(typeof tag === 'string' ? { tag: base64url.decodeToBuffer(tag) } : undefined) } } /* * @public */ const jweDecrypt = (skipValidateHeaders, serialization, jwe, key, { crit = [], complete = false, algorithms } = {}) => { key = getKey(key, true) if (algorithms !== undefined && (!Array.isArray(algorithms) || algorithms.some(s => typeof s !== 'string' || !s))) { throw new TypeError('"algorithms" option must be an array of non-empty strings') } else if (algorithms) { algorithms = new Set(algorithms) } if (!Array.isArray(crit) || crit.some(s => typeof s !== 'string' || !s)) { throw new TypeError('"crit" option must be an array of non-empty strings') } if (!serialization) { serialization = resolveSerialization(jwe) } let alg, ciphertext, enc, encryptedKey, iv, opts, prot, tag, unprotected, cek, aad, header // treat general format with one recipient as flattened // skips iteration and avoids multi errors in this case if (serialization === 'general' && jwe.recipients.length === 1) { serialization = 'flattened' const { recipients, ...root } = jwe jwe = { ...root, ...recipients[0] } } if (SINGLE_RECIPIENT.has(serialization)) { if (serialization === 'compact') { // compact serialization format ([prot, encryptedKey, iv, ciphertext, tag] = jwe.split('.')) } else { // flattened serialization format ({ protected: prot, encrypted_key: encryptedKey, iv, ciphertext, tag, unprotected, aad, header } = jwe) } if (!skipValidateHeaders) { validateHeaders(prot, unprotected, [{ header }], true, crit) } opts = combineHeader(prot, unprotected, header) ;({ alg, enc } = opts) if (algorithms && !algorithms.has(alg === 'dir' ? enc : alg)) { throw new errors.JOSEAlgNotWhitelisted('alg not whitelisted') } if (key instanceof KeyStore) { const keystore = key let keys if (opts.alg === 'dir') { keys = keystore.all({ kid: opts.kid, alg: opts.enc, key_ops: ['decrypt'] }) } else { keys = keystore.all({ kid: opts.kid, alg: opts.alg, key_ops: ['unwrapKey'] }) } switch (keys.length) { case 0: throw new errors.JWKSNoMatchingKey() case 1: // treat the call as if a Key instance was passed in // skips iteration and avoids multi errors in this case key = keys[0] break default: { const errs = [] for (const key of keys) { try { return jweDecrypt(true, serialization, jwe, key, { crit, complete, algorithms: algorithms ? [...algorithms] : undefined }) } catch (err) { errs.push(err) continue } } const multi = new errors.JOSEMultiError(errs) if ([...multi].some(e => e instanceof errors.JWEDecryptionFailed)) { throw new errors.JWEDecryptionFailed() } throw multi } } } check(key, ...(alg === 'dir' ? ['decrypt', enc] : ['keyManagementDecrypt', alg])) try { if (alg === 'dir') { cek = JWK.asKey(key, { alg: enc, use: 'enc' }) } else if (alg === 'ECDH-ES') { const unwrapped = keyManagementDecrypt(alg, key, undefined, opts) cek = JWK.asKey(createSecretKey(unwrapped), { alg: enc, use: 'enc' }) } else { const unwrapped = keyManagementDecrypt(alg, key, base64url.decodeToBuffer(encryptedKey), opts) cek = JWK.asKey(createSecretKey(unwrapped), { alg: enc, use: 'enc' }) } } catch (err) { // To mitigate the attacks described in RFC 3218, the // recipient MUST NOT distinguish between format, padding, and length // errors of encrypted keys. It is strongly recommended, in the event // of receiving an improperly formatted key, that the recipient // substitute a randomly generated CEK and proceed to the next step, to // mitigate timing attacks. cek = generateCEK(enc) } let adata if (aad) { adata = Buffer.concat([ Buffer.from(prot || ''), Buffer.from('.'), Buffer.from(aad) ]) } else { adata = Buffer.from(prot || '') } try { iv = base64url.decodeToBuffer(iv) } catch (err) {} try { tag = base64url.decodeToBuffer(tag) } catch (err) {} let cleartext = decrypt(enc, cek, base64url.decodeToBuffer(ciphertext), { iv, tag, aad: adata }) if (opts.zip) { cleartext = inflateRawSync(cleartext) } if (complete) { const result = { cleartext, key, cek } if (aad) result.aad = aad if (header) result.header = header if (unprotected) result.unprotected = unprotected if (prot) result.protected = base64url.JSON.decode(prot) return result } return cleartext } validateHeaders(jwe.protected, jwe.unprotected, jwe.recipients.map(({ header }) => ({ header })), true, crit) // general serialization format const { recipients, ...root } = jwe const errs = [] for (const recipient of recipients) { try { return jweDecrypt(true, 'flattened', { ...root, ...recipient }, key, { crit, complete, algorithms: algorithms ? [...algorithms] : undefined }) } catch (err) { errs.push(err) continue } } const multi = new errors.JOSEMultiError(errs) if ([...multi].some(e => e instanceof errors.JWEDecryptionFailed)) { throw new errors.JWEDecryptionFailed() } else if ([...multi].every(e => e instanceof errors.JWKSNoMatchingKey)) { throw new errors.JWKSNoMatchingKey() } throw multi } module.exports = jweDecrypt.bind(undefined, false, undefined) /***/ }), /***/ 19094: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { const { deflateRawSync } = __webpack_require__(78761) const { KEYOBJECT } = __webpack_require__(15010) const generateIV = __webpack_require__(93137) const base64url = __webpack_require__(73385) const getKey = __webpack_require__(31308) const isObject = __webpack_require__(41805) const { createSecretKey } = __webpack_require__(98921) const deepClone = __webpack_require__(43653) const importKey = __webpack_require__(13468) const { JWEInvalid } = __webpack_require__(52973) const { check, keyManagementEncrypt, encrypt } = __webpack_require__(50191) const serializers = __webpack_require__(5348) const generateCEK = __webpack_require__(15242) const validateHeaders = __webpack_require__(46904) const PROCESS_RECIPIENT = Symbol('PROCESS_RECIPIENT') class Encrypt { // TODO: in v2.x swap unprotectedHeader and aad constructor (cleartext, protectedHeader, unprotectedHeader, aad) { if (!Buffer.isBuffer(cleartext) && typeof cleartext !== 'string') { throw new TypeError('cleartext argument must be a Buffer or a string') } cleartext = Buffer.from(cleartext) if (aad !== undefined && !Buffer.isBuffer(aad) && typeof aad !== 'string') { throw new TypeError('aad argument must be a Buffer or a string when provided') } aad = aad ? Buffer.from(aad) : undefined if (protectedHeader !== undefined && !isObject(protectedHeader)) { throw new TypeError('protectedHeader argument must be a plain object when provided') } if (unprotectedHeader !== undefined && !isObject(unprotectedHeader)) { throw new TypeError('unprotectedHeader argument must be a plain object when provided') } this._recipients = [] this._cleartext = cleartext this._aad = aad this._unprotected = unprotectedHeader ? deepClone(unprotectedHeader) : undefined this._protected = protectedHeader ? deepClone(protectedHeader) : undefined } /* * @public */ recipient (key, header) { key = getKey(key) if (header !== undefined && !isObject(header)) { throw new TypeError('header argument must be a plain object when provided') } this._recipients.push({ key, header: header ? deepClone(header) : undefined }) return this } /* * @private */ [PROCESS_RECIPIENT] (recipient) { const unprotectedHeader = this._unprotected const protectedHeader = this._protected const { length: recipientCount } = this._recipients const jweHeader = { ...protectedHeader, ...unprotectedHeader, ...recipient.header } const { key } = recipient const enc = jweHeader.enc let alg = jweHeader.alg if (key.use === 'sig') { throw new TypeError('a key with "use":"sig" is not usable for encryption') } if (alg === 'dir') { check(key, 'encrypt', enc) } else if (alg) { check(key, 'keyManagementEncrypt', alg) } else { alg = key.alg || [...key.algorithms('wrapKey')][0] || [...key.algorithms('deriveKey')][0] if (alg === 'ECDH-ES' && recipientCount !== 1) { alg = [...key.algorithms('deriveKey')][1] } if (!alg) { throw new JWEInvalid('could not resolve a usable "alg" for a recipient') } if (recipientCount === 1) { if (protectedHeader) { protectedHeader.alg = alg } else { this._protected = { alg } } } else { if (recipient.header) { recipient.header.alg = alg } else { recipient.header = { alg } } } } let wrapped let generatedHeader if (key.kty === 'oct' && alg === 'dir') { this._cek = importKey(key[KEYOBJECT], { use: 'enc', alg: enc }) } else { check(this._cek, 'encrypt', enc) ;({ wrapped, header: generatedHeader } = keyManagementEncrypt(alg, key, this._cek[KEYOBJECT].export(), { enc, alg })) if (alg === 'ECDH-ES') { this._cek = importKey(createSecretKey(wrapped), { use: 'enc', alg: enc }) } } if (alg === 'dir' || alg === 'ECDH-ES') { recipient.encrypted_key = '' } else { recipient.encrypted_key = base64url.encodeBuffer(wrapped) } if (generatedHeader) { recipient.generatedHeader = generatedHeader } } /* * @public */ encrypt (serialization) { const serializer = serializers[serialization] if (!serializer) { throw new TypeError('serialization must be one of "compact", "flattened", "general"') } if (!this._recipients.length) { throw new JWEInvalid('missing recipients') } serializer.validate(this._protected, this._unprotected, this._aad, this._recipients) let enc = validateHeaders(this._protected, this._unprotected, this._recipients, false, this._protected ? this._protected.crit : undefined) if (!enc) { enc = 'A128CBC-HS256' if (this._protected) { this._protected.enc = enc } else { this._protected = { enc } } } const final = {} this._cek = generateCEK(enc) for (const recipient of this._recipients) { this[PROCESS_RECIPIENT](recipient) } const iv = generateIV(enc) final.iv = base64url.encodeBuffer(iv) if (this._recipients.length === 1 && this._recipients[0].generatedHeader) { const [{ generatedHeader }] = this._recipients delete this._recipients[0].generatedHeader this._protected = { ...this._protected, ...generatedHeader } } if (this._protected) { final.protected = base64url.JSON.encode(this._protected) } final.unprotected = this._unprotected let aad if (this._aad) { final.aad = base64url.encode(this._aad) aad = Buffer.concat([ Buffer.from(final.protected || ''), Buffer.from('.'), Buffer.from(final.aad) ]) } else { aad = Buffer.from(final.protected || '') } let cleartext = this._cleartext if (this._protected && 'zip' in this._protected) { cleartext = deflateRawSync(cleartext) } const { ciphertext, tag } = encrypt(enc, this._cek, cleartext, { iv, aad }) final.tag = base64url.encodeBuffer(tag) final.ciphertext = base64url.encodeBuffer(ciphertext) return serializer(final, this._recipients) } } module.exports = Encrypt /***/ }), /***/ 15242: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { const { randomBytes } = __webpack_require__(33373) const { createSecretKey } = __webpack_require__(98921) const { KEYLENGTHS } = __webpack_require__(15501) const Key = __webpack_require__(50504) module.exports = (alg) => { const keyLength = KEYLENGTHS.get(alg) if (!keyLength) { return new Key({ type: 'secret' }) } return new Key(createSecretKey(randomBytes(keyLength / 8)), { use: 'enc', alg }) } /***/ }), /***/ 72851: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { const Encrypt = __webpack_require__(19094) const decrypt = __webpack_require__(73607) // TODO: in v2.x swap unprotectedHeader and aad const single = (serialization, cleartext, key, protectedHeader, unprotectedHeader, aad) => { return new Encrypt(cleartext, protectedHeader, unprotectedHeader, aad) .recipient(key) .encrypt(serialization) } module.exports.Encrypt = Encrypt module.exports.encrypt = single.bind(undefined, 'compact') module.exports.encrypt.flattened = single.bind(undefined, 'flattened') module.exports.encrypt.general = single.bind(undefined, 'general') module.exports.decrypt = decrypt /***/ }), /***/ 5348: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { const isObject = __webpack_require__(41805) let validateCrit = __webpack_require__(530) const { JWEInvalid } = __webpack_require__(52973) validateCrit = validateCrit.bind(undefined, JWEInvalid) const compactSerializer = (final, [recipient]) => { return `${final.protected}.${recipient.encrypted_key}.${final.iv}.${final.ciphertext}.${final.tag}` } compactSerializer.validate = (protectedHeader, unprotectedHeader, aad, { 0: { header }, length }) => { if (length !== 1 || aad || unprotectedHeader || header) { throw new JWEInvalid('JWE Compact Serialization doesn\'t support multiple recipients, JWE unprotected headers or AAD') } validateCrit(protectedHeader, unprotectedHeader, protectedHeader ? protectedHeader.crit : undefined) } const flattenedSerializer = (final, [recipient]) => { const { header, encrypted_key: encryptedKey } = recipient return { ...(final.protected ? { protected: final.protected } : undefined), ...(final.unprotected ? { unprotected: final.unprotected } : undefined), ...(header ? { header } : undefined), ...(encryptedKey ? { encrypted_key: encryptedKey } : undefined), ...(final.aad ? { aad: final.aad } : undefined), iv: final.iv, ciphertext: final.ciphertext, tag: final.tag } } flattenedSerializer.validate = (protectedHeader, unprotectedHeader, aad, { 0: { header }, length }) => { if (length !== 1) { throw new JWEInvalid('Flattened JWE JSON Serialization doesn\'t support multiple recipients') } validateCrit(protectedHeader, { ...unprotectedHeader, ...header }, protectedHeader ? protectedHeader.crit : undefined) } const generalSerializer = (final, recipients) => { const result = { ...(final.protected ? { protected: final.protected } : undefined), ...(final.unprotected ? { unprotected: final.unprotected } : undefined), recipients: recipients.map(({ header, encrypted_key: encryptedKey, generatedHeader }) => { if (!header && !encryptedKey && !generatedHeader) { return false } return { ...(header || generatedHeader ? { header: { ...header, ...generatedHeader } } : undefined), ...(encryptedKey ? { encrypted_key: encryptedKey } : undefined) } }).filter(Boolean), ...(final.aad ? { aad: final.aad } : undefined), iv: final.iv, ciphertext: final.ciphertext, tag: final.tag } if (!result.recipients.length) { delete result.recipients } return result } generalSerializer.validate = (protectedHeader, unprotectedHeader, aad, recipients) => { recipients.forEach(({ header }) => { validateCrit(protectedHeader, { ...header, ...unprotectedHeader }, protectedHeader ? protectedHeader.crit : undefined) }) } const isJSON = (input) => { return isObject(input) && typeof input.ciphertext === 'string' && typeof input.iv === 'string' && typeof input.tag === 'string' && (input.unprotected === undefined || isObject(input.unprotected)) && (input.protected === undefined || typeof input.protected === 'string') && (input.aad === undefined || typeof input.aad === 'string') } const isSingleRecipient = (input) => { return (input.encrypted_key === undefined || typeof input.encrypted_key === 'string') && (input.header === undefined || isObject(input.header)) } const isValidRecipient = (recipient) => { return isObject(recipient) && typeof recipient.encrypted_key === 'string' && (recipient.header === undefined || isObject(recipient.header)) } const isMultiRecipient = (input) => { if (Array.isArray(input.recipients) && input.recipients.every(isValidRecipient)) { return true } return false } const detect = (input) => { if (typeof input === 'string' && input.split('.').length === 5) { return 'compact' } if (isJSON(input)) { if (isMultiRecipient(input)) { return 'general' } if (isSingleRecipient(input)) { return 'flattened' } } throw new JWEInvalid('JWE malformed or invalid serialization') } module.exports = { compact: compactSerializer, flattened: flattenedSerializer, general: generalSerializer, detect } /***/ }), /***/ 46904: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { const isDisjoint = __webpack_require__(56149) const base64url = __webpack_require__(73385) let validateCrit = __webpack_require__(530) const { JWEInvalid, JOSENotSupported } = __webpack_require__(52973) validateCrit = validateCrit.bind(undefined, JWEInvalid) module.exports = (prot, unprotected, recipients, checkAlgorithms, crit) => { if (typeof prot === 'string') { try { prot = base64url.JSON.decode(prot) } catch (err) { throw new JWEInvalid('could not parse JWE protected header') } } let alg = [] const enc = new Set() if (!isDisjoint(prot, unprotected) || !recipients.every(({ header }) => { if (typeof header === 'object') { alg.push(header.alg) enc.add(header.enc) } const combined = { ...unprotected, ...header } validateCrit(prot, combined, crit) if ('zip' in combined) { throw new JWEInvalid('"zip" Header Parameter MUST be integrity protected') } else if (prot && 'zip' in prot && prot.zip !== 'DEF') { throw new JOSENotSupported('only "DEF" compression algorithm is supported') } return isDisjoint(header, prot) && isDisjoint(header, unprotected) })) { throw new JWEInvalid('JWE Shared Protected, JWE Shared Unprotected and JWE Per-Recipient Header Parameter names must be disjoint') } if (typeof prot === 'object') { alg.push(prot.alg) enc.add(prot.enc) } if (typeof unprotected === 'object') { alg.push(unprotected.alg) enc.add(unprotected.enc) } alg = alg.filter(Boolean) enc.delete(undefined) if (recipients.length !== 1) { if (alg.includes('dir') || alg.includes('ECDH-ES')) { throw new JWEInvalid('dir and ECDH-ES alg may only be used with a single recipient') } } if (checkAlgorithms) { if (alg.length !== recipients.length) { throw new JWEInvalid('missing Key Management algorithm') } if (enc.size === 0) { throw new JWEInvalid('missing Content Encryption algorithm') } else if (enc.size !== 1) { throw new JWEInvalid('there must only be one Content Encryption algorithm') } } else { if (enc.size > 1) { throw new JWEInvalid('there must only be one Content Encryption algorithm') } } return [...enc][0] } /***/ }), /***/ 39377: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { const errors = __webpack_require__(52973) const importKey = __webpack_require__(13468) const RSAKey = __webpack_require__(73242) const ECKey = __webpack_require__(53426) const OKPKey = __webpack_require__(24510) const OctKey = __webpack_require__(50504) const generate = async (kty, crvOrSize, params, generatePrivate = true) => { switch (kty) { case 'RSA': return importKey( await RSAKey.generate(crvOrSize, generatePrivate), params ) case 'EC': return importKey( await ECKey.generate(crvOrSize, generatePrivate), params ) case 'OKP': return importKey( await OKPKey.generate(crvOrSize, generatePrivate), params ) case 'oct': return importKey( await OctKey.generate(crvOrSize, generatePrivate), params ) default: throw new errors.JOSENotSupported(`unsupported key type: ${kty}`) } } const generateSync = (kty, crvOrSize, params, generatePrivate = true) => { switch (kty) { case 'RSA': return importKey(RSAKey.generateSync(crvOrSize, generatePrivate), params) case 'EC': return importKey(ECKey.generateSync(crvOrSize, generatePrivate), params) case 'OKP': return importKey(OKPKey.generateSync(crvOrSize, generatePrivate), params) case 'oct': return importKey(OctKey.generateSync(crvOrSize, generatePrivate), params) default: throw new errors.JOSENotSupported(`unsupported key type: ${kty}`) } } module.exports.generate = generate module.exports.generateSync = generateSync /***/ }), /***/ 13468: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { const { deprecate } = __webpack_require__(31669) const { createPublicKey, createPrivateKey, createSecretKey, KeyObject } = __webpack_require__(98921) const base64url = __webpack_require__(73385) const isObject = __webpack_require__(41805) const { jwkToPem } = __webpack_require__(69693) const errors = __webpack_require__(52973) const RSAKey = __webpack_require__(73242) const ECKey = __webpack_require__(53426) const OKPKey = __webpack_require__(24510) const OctKey = __webpack_require__(50504) const importable = new Set(['string', 'buffer', 'object']) const mergedParameters = (target = {}, source = {}) => { return { alg: source.alg, key_ops: source.key_ops, kid: source.kid, use: source.use, x5c: source.x5c, x5t: source.x5t, 'x5t#S256': source['x5t#S256'], ...target } } const openSSHpublicKey = /^[a-zA-Z0-9-]+ AAAA(?:[0-9A-Za-z+/])+(?:==|=)?(?: .*)?$/ const asKey = (key, parameters, { calculateMissingRSAPrimes = false } = {}) => { let privateKey, publicKey, secret if (!importable.has(typeof key)) { throw new TypeError('key argument must be a string, buffer or an object') } if (parameters !== undefined && !isObject(parameters)) { throw new TypeError('parameters argument must be a plain object when provided') } if (key instanceof KeyObject) { switch (key.type) { case 'private': privateKey = key break case 'public': publicKey = key break case 'secret': secret = key break } } else if (typeof key === 'object' && key && 'kty' in key && key.kty === 'oct') { // symmetric key try { secret = createSecretKey(base64url.decodeToBuffer(key.k)) } catch (err) { if (!('k' in key)) { secret = { type: 'secret' } } } parameters = mergedParameters(parameters, key) } else if (typeof key === 'object' && key && 'kty' in key) { // assume JWK formatted asymmetric key ({ calculateMissingRSAPrimes = false } = parameters || { calculateMissingRSAPrimes }) let pem try { pem = jwkToPem(key, { calculateMissingRSAPrimes }) } catch (err) { if (err instanceof errors.JOSEError) { throw err } } if (pem && key.d) { privateKey = createPrivateKey(pem) } else if (pem) { publicKey = createPublicKey(pem) } parameters = mergedParameters({}, key) } else if (key && (typeof key === 'object' || typeof key === 'string')) { // | | passed to crypto.createPrivateKey or crypto.createPublicKey or passed to crypto.createSecretKey try { privateKey = createPrivateKey(key) } catch (err) { if (err instanceof errors.JOSEError) { throw err } } try { publicKey = createPublicKey(key) if (key.startsWith('-----BEGIN CERTIFICATE-----') && (!parameters || !('x5c' in parameters))) { parameters = mergedParameters(parameters, { x5c: [key.replace(/(?:-----(?:BEGIN|END) CERTIFICATE-----|\s)/g, '')] }) } } catch (err) { if (err instanceof errors.JOSEError) { throw err } } try { // this is to filter out invalid PEM keys and certs, i'll rather have them fail import then // have them imported as symmetric "oct" keys if (!key.includes('-----BEGIN') && !openSSHpublicKey.test(key.toString('ascii').replace(/[\r\n]/g, ''))) { secret = createSecretKey(Buffer.isBuffer(key) ? key : Buffer.from(key)) } } catch (err) {} } const keyObject = privateKey || publicKey || secret if (privateKey || publicKey) { switch (keyObject.asymmetricKeyType) { case 'rsa': return new RSAKey(keyObject, parameters) case 'ec': return new ECKey(keyObject, parameters) case 'ed25519': case 'ed448': case 'x25519': case 'x448': return new OKPKey(keyObject, parameters) default: throw new errors.JOSENotSupported('only RSA, EC and OKP asymmetric keys are supported') } } else if (secret) { return new OctKey(keyObject, parameters) } throw new errors.JWKImportFailed('key import failed') } module.exports = asKey Object.defineProperty(asKey, 'deprecated', { value: deprecate((key, parameters) => { return asKey(key, parameters, { calculateMissingRSAPrimes: true }) }, 'JWK.importKey() is deprecated, use JWK.asKey() instead'), enumerable: false }) /***/ }), /***/ 67894: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { const Key = __webpack_require__(57841) const None = __webpack_require__(98012) const EmbeddedJWK = __webpack_require__(84902) const EmbeddedX5C = __webpack_require__(303) const importKey = __webpack_require__(13468) const generate = __webpack_require__(39377) module.exports = { ...generate, asKey: importKey, isKey: input => input instanceof Key, None, EmbeddedJWK, EmbeddedX5C } /* deprecated */ Object.defineProperty(module.exports, "importKey", ({ value: importKey.deprecated, enumerable: false })) /***/ }), /***/ 57841: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { const { strict: assert } = __webpack_require__(42357) const { inspect } = __webpack_require__(31669) const { EOL } = __webpack_require__(12087) const { keyObjectSupported } = __webpack_require__(32457) const { createPublicKey } = __webpack_require__(98921) const { keyObjectToJWK } = __webpack_require__(69693) const { THUMBPRINT_MATERIAL, PUBLIC_MEMBERS, PRIVATE_MEMBERS, JWK_MEMBERS, KEYOBJECT, USES_MAPPING, OPS, USES } = __webpack_require__(15010) const isObject = __webpack_require__(41805) const thumbprint = __webpack_require__(82253) const errors = __webpack_require__(52973) const privateApi = Symbol('privateApi') const { JWK } = __webpack_require__(15501) class Key { constructor (keyObject, { alg, use, kid, key_ops: ops, x5c, x5t, 'x5t#S256': x5t256 } = {}) { if (use !== undefined) { if (typeof use !== 'string' || !USES.has(use)) { throw new TypeError('`use` must be either "sig" or "enc" string when provided') } } if (alg !== undefined) { if (typeof alg !== 'string' || !alg) { throw new TypeError('`alg` must be a non-empty string when provided') } } if (kid !== undefined) { if (typeof kid !== 'string' || !kid) { throw new TypeError('`kid` must be a non-empty string when provided') } } if (ops !== undefined) { if (!Array.isArray(ops) || !ops.length || ops.some(o => typeof o !== 'string')) { throw new TypeError('`key_ops` must be a non-empty array of strings when provided') } ops = Array.from(new Set(ops)).filter(x => OPS.has(x)) } if (ops && use) { if ( (use === 'enc' && ops.some(x => USES_MAPPING.sig.has(x))) || (use === 'sig' && ops.some(x => USES_MAPPING.enc.has(x))) ) { throw new errors.JWKInvalid('inconsistent JWK "use" and "key_ops"') } } if (keyObjectSupported && x5c !== undefined) { if (!Array.isArray(x5c) || !x5c.length || x5c.some(c => typeof c !== 'string')) { throw new TypeError('`x5c` must be an array of one or more PKIX certificates when provided') } x5c.forEach((cert, i) => { let publicKey try { publicKey = createPublicKey({ key: `-----BEGIN CERTIFICATE-----${EOL}${(cert.match(/.{1,64}/g) || []).join(EOL)}${EOL}-----END CERTIFICATE-----`, format: 'pem' }) } catch (err) { throw new errors.JWKInvalid(`\`x5c\` member at index ${i} is not a valid base64-encoded DER PKIX certificate`) } if (i === 0) { try { assert.deepEqual( publicKey.export({ type: 'spki', format: 'der' }), (keyObject.type === 'public' ? keyObject : createPublicKey(keyObject)).export({ type: 'spki', format: 'der' }) ) } catch (err) { throw new errors.JWKInvalid('The key in the first `x5c` certificate MUST match the public key represented by the JWK') } } }) } Object.defineProperties(this, { [KEYOBJECT]: { value: isObject(keyObject) ? undefined : keyObject }, keyObject: { get () { if (!keyObjectSupported) { throw new errors.JOSENotSupported('KeyObject class is not supported in your Node.js runtime version') } return this[KEYOBJECT] } }, type: { value: keyObject.type }, private: { value: keyObject.type === 'private' }, public: { value: keyObject.type === 'public' }, secret: { value: keyObject.type === 'secret' }, alg: { value: alg, enumerable: alg !== undefined }, use: { value: use, enumerable: use !== undefined }, x5c: { enumerable: x5c !== undefined, ...(x5c ? { get () { return [...x5c] } } : { value: undefined }) }, key_ops: { enumerable: ops !== undefined, ...(ops ? { get () { return [...ops] } } : { value: undefined }) }, kid: { enumerable: true, ...(kid ? { value: kid } : { get () { Object.defineProperty(this, 'kid', { value: this.thumbprint, configurable: false }) return this.kid }, configurable: true }) }, ...(x5c ? { x5t: { enumerable: true, ...(x5t ? { value: x5t } : { get () { Object.defineProperty(this, 'x5t', { value: thumbprint.x5t(this.x5c[0]), configurable: false }) return this.x5t }, configurable: true }) } } : undefined), ...(x5c ? { 'x5t#S256': { enumerable: true, ...(x5t256 ? { value: x5t256 } : { get () { Object.defineProperty(this, 'x5t#S256', { value: thumbprint['x5t#S256'](this.x5c[0]), configurable: false }) return this['x5t#S256'] }, configurable: true }) } } : undefined), thumbprint: { get () { Object.defineProperty(this, 'thumbprint', { value: thumbprint.kid(this[THUMBPRINT_MATERIAL]()), configurable: false }) return this.thumbprint }, configurable: true } }) } toPEM (priv = false, encoding = {}) { if (this.secret) { throw new TypeError('symmetric keys cannot be exported as PEM') } if (priv && this.public === true) { throw new TypeError('public key cannot be exported as private') } const { type = priv ? 'pkcs8' : 'spki', cipher, passphrase } = encoding let keyObject = this[KEYOBJECT] if (!priv) { if (this.private) { keyObject = createPublicKey(keyObject) } if (cipher || passphrase) { throw new TypeError('cipher and passphrase can only be applied when exporting private keys') } } if (priv) { return keyObject.export({ format: 'pem', type, cipher, passphrase }) } return keyObject.export({ format: 'pem', type }) } toJWK (priv = false) { if (priv && this.public === true) { throw new TypeError('public key cannot be exported as private') } const components = [...this.constructor[priv ? PRIVATE_MEMBERS : PUBLIC_MEMBERS]] .map(k => [k, this[k]]) const result = {} Object.keys(components).forEach((key) => { const [k, v] = components[key] result[k] = v }) result.kty = this.kty result.kid = this.kid if (this.alg) { result.alg = this.alg } if (this.key_ops && this.key_ops.length) { result.key_ops = this.key_ops } if (this.use) { result.use = this.use } if (this.x5c) { result.x5c = this.x5c } if (this.x5t) { result.x5t = this.x5t } if (this['x5t#S256']) { result['x5t#S256'] = this['x5t#S256'] } return result } [JWK_MEMBERS] () { const props = this[KEYOBJECT].type === 'private' ? this.constructor[PRIVATE_MEMBERS] : this.constructor[PUBLIC_MEMBERS] Object.defineProperties(this, [...props].reduce((acc, component) => { acc[component] = { get () { const jwk = keyObjectToJWK(this[KEYOBJECT]) Object.defineProperties( this, Object.entries(jwk) .filter(([key]) => props.has(key)) .reduce((acc, [key, value]) => { acc[key] = { value, enumerable: this.constructor[PUBLIC_MEMBERS].has(key), configurable: false } return acc }, {}) ) return this[component] }, enumerable: this.constructor[PUBLIC_MEMBERS].has(component), configurable: true } return acc }, {})) } /* c8 ignore next 8 */ [inspect.custom] () { return `${this.constructor.name} ${inspect(this.toJWK(false), { depth: Infinity, colors: process.stdout.isTTY, compact: false, sorted: true })}` } /* c8 ignore next 3 */ [THUMBPRINT_MATERIAL] () { throw new Error(`"[THUMBPRINT_MATERIAL]()" is not implemented on ${this.constructor.name}`) } algorithms (operation, /* the rest is private API */ int, opts) { const { use = this.use, alg = this.alg, key_ops: ops = this.key_ops } = int === privateApi ? opts : {} if (alg) { return new Set(this.algorithms(operation, privateApi, { alg: null, use, key_ops: ops }).has(alg) ? [alg] : undefined) } if (typeof operation === 'symbol') { try { return this[operation]() } catch (err) { return new Set() } } if (operation && ops && !ops.includes(operation)) { return new Set() } switch (operation) { case 'decrypt': case 'deriveKey': case 'encrypt': case 'sign': case 'unwrapKey': case 'verify': case 'wrapKey': return new Set(Object.entries(JWK[this.kty][operation]).map(([alg, fn]) => fn(this) ? alg : undefined).filter(Boolean)) case undefined: return new Set([ ...this.algorithms('sign'), ...this.algorithms('verify'), ...this.algorithms('decrypt'), ...this.algorithms('encrypt'), ...this.algorithms('unwrapKey'), ...this.algorithms('wrapKey'), ...this.algorithms('deriveKey') ]) default: throw new TypeError('invalid key operation') } } /* c8 ignore next 3 */ static async generate () { throw new Error(`"static async generate()" is not implemented on ${this.name}`) } /* c8 ignore next 3 */ static generateSync () { throw new Error(`"static generateSync()" is not implemented on ${this.name}`) } /* c8 ignore next 3 */ static get [PUBLIC_MEMBERS] () { throw new Error(`"static get [PUBLIC_MEMBERS]()" is not implemented on ${this.name}`) } /* c8 ignore next 3 */ static get [PRIVATE_MEMBERS] () { throw new Error(`"static get [PRIVATE_MEMBERS]()" is not implemented on ${this.name}`) } } module.exports = Key /***/ }), /***/ 53426: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { const { generateKeyPairSync, generateKeyPair: async } = __webpack_require__(33373) const { promisify } = __webpack_require__(31669) const { THUMBPRINT_MATERIAL, JWK_MEMBERS, PUBLIC_MEMBERS, PRIVATE_MEMBERS, KEY_MANAGEMENT_DECRYPT, KEY_MANAGEMENT_ENCRYPT } = __webpack_require__(15010) const { EC_CURVES } = __webpack_require__(15501) const { keyObjectSupported } = __webpack_require__(32457) const { createPublicKey, createPrivateKey } = __webpack_require__(98921) const errors = __webpack_require__(52973) const { name: secp256k1 } = __webpack_require__(2044) const Key = __webpack_require__(57841) const generateKeyPair = promisify(async) const EC_PUBLIC = new Set(['crv', 'x', 'y']) Object.freeze(EC_PUBLIC) const EC_PRIVATE = new Set([...EC_PUBLIC, 'd']) Object.freeze(EC_PRIVATE) // Elliptic Curve Key Type class ECKey extends Key { constructor (...args) { super(...args) this[JWK_MEMBERS]() Object.defineProperty(this, 'kty', { value: 'EC', enumerable: true }) if (!EC_CURVES.has(this.crv)) { throw new errors.JOSENotSupported('unsupported EC key curve') } } static get [PUBLIC_MEMBERS] () { return EC_PUBLIC } static get [PRIVATE_MEMBERS] () { return EC_PRIVATE } // https://tc39.github.io/ecma262/#sec-ordinaryownpropertykeys no need for any special // JSON.stringify handling in V8 [THUMBPRINT_MATERIAL] () { return { crv: this.crv, kty: 'EC', x: this.x, y: this.y } } [KEY_MANAGEMENT_ENCRYPT] () { return this.algorithms('deriveKey') } [KEY_MANAGEMENT_DECRYPT] () { if (this.public) { return new Set() } return this.algorithms('deriveKey') } static async generate (crv = 'P-256', privat = true) { if (!EC_CURVES.has(crv)) { throw new errors.JOSENotSupported(`unsupported EC key curve: ${crv}`) } if (crv === secp256k1 && crv !== 'secp256k1') { crv = 'secp256k1' } let privateKey, publicKey if (keyObjectSupported) { ({ privateKey, publicKey } = await generateKeyPair('ec', { namedCurve: crv })) return privat ? privateKey : publicKey } ({ privateKey, publicKey } = await generateKeyPair('ec', { namedCurve: crv, publicKeyEncoding: { type: 'spki', format: 'pem' }, privateKeyEncoding: { type: 'pkcs8', format: 'pem' } })) if (privat) { return createPrivateKey(privateKey) } else { return createPublicKey(publicKey) } } static generateSync (crv = 'P-256', privat = true) { if (!EC_CURVES.has(crv)) { throw new errors.JOSENotSupported(`unsupported EC key curve: ${crv}`) } if (crv === secp256k1 && crv !== 'secp256k1') { crv = 'secp256k1' } let privateKey, publicKey if (keyObjectSupported) { ({ privateKey, publicKey } = generateKeyPairSync('ec', { namedCurve: crv })) return privat ? privateKey : publicKey } ({ privateKey, publicKey } = generateKeyPairSync('ec', { namedCurve: crv, publicKeyEncoding: { type: 'spki', format: 'pem' }, privateKeyEncoding: { type: 'pkcs8', format: 'pem' } })) if (privat) { return createPrivateKey(privateKey) } else { return createPublicKey(publicKey) } } } module.exports = ECKey /***/ }), /***/ 84902: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { const { inspect } = __webpack_require__(31669) const Key = __webpack_require__(57841) class EmbeddedJWK extends Key { constructor () { super({ type: 'embedded' }) Object.defineProperties(this, { kid: { value: undefined }, kty: { value: undefined }, thumbprint: { value: undefined }, toJWK: { value: undefined }, toPEM: { value: undefined } }) } /* c8 ignore next 3 */ [inspect.custom] () { return 'Embedded.JWK {}' } algorithms () { return new Set() } } module.exports = new EmbeddedJWK() /***/ }), /***/ 303: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { const { inspect } = __webpack_require__(31669) const Key = __webpack_require__(57841) class EmbeddedX5C extends Key { constructor () { super({ type: 'embedded' }) Object.defineProperties(this, { kid: { value: undefined }, kty: { value: undefined }, thumbprint: { value: undefined }, toJWK: { value: undefined }, toPEM: { value: undefined } }) } /* c8 ignore next 3 */ [inspect.custom] () { return 'Embedded.X5C {}' } algorithms () { return new Set() } } module.exports = new EmbeddedX5C() /***/ }), /***/ 98012: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { const { inspect } = __webpack_require__(31669) const Key = __webpack_require__(57841) class NoneKey extends Key { constructor () { super({ type: 'unsecured' }, { alg: 'none' }) Object.defineProperties(this, { kid: { value: undefined }, kty: { value: undefined }, thumbprint: { value: undefined }, toJWK: { value: undefined }, toPEM: { value: undefined } }) } /* c8 ignore next 3 */ [inspect.custom] () { return 'None {}' } algorithms (operation) { switch (operation) { case 'sign': case 'verify': case undefined: return new Set(['none']) default: return new Set() } } } module.exports = new NoneKey() /***/ }), /***/ 50504: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { const { randomBytes } = __webpack_require__(33373) const { createSecretKey } = __webpack_require__(98921) const base64url = __webpack_require__(73385) const { THUMBPRINT_MATERIAL, PUBLIC_MEMBERS, PRIVATE_MEMBERS, KEY_MANAGEMENT_DECRYPT, KEY_MANAGEMENT_ENCRYPT, KEYOBJECT } = __webpack_require__(15010) const Key = __webpack_require__(57841) const OCT_PUBLIC = new Set() Object.freeze(OCT_PUBLIC) const OCT_PRIVATE = new Set(['k']) Object.freeze(OCT_PRIVATE) // Octet sequence Key Type class OctKey extends Key { constructor (...args) { super(...args) Object.defineProperties(this, { kty: { value: 'oct', enumerable: true }, length: { value: this[KEYOBJECT] ? this[KEYOBJECT].symmetricKeySize * 8 : undefined }, k: { enumerable: false, get () { if (this[KEYOBJECT]) { Object.defineProperty(this, 'k', { value: base64url.encodeBuffer(this[KEYOBJECT].export()), configurable: false }) } else { Object.defineProperty(this, 'k', { value: undefined, configurable: false }) } return this.k }, configurable: true } }) } static get [PUBLIC_MEMBERS] () { return OCT_PUBLIC } static get [PRIVATE_MEMBERS] () { return OCT_PRIVATE } // https://tc39.github.io/ecma262/#sec-ordinaryownpropertykeys no need for any special // JSON.stringify handling in V8 [THUMBPRINT_MATERIAL] () { if (!this[KEYOBJECT]) { throw new TypeError('reference "oct" keys without "k" cannot have their thumbprint calculated') } return { k: this.k, kty: 'oct' } } [KEY_MANAGEMENT_ENCRYPT] () { return new Set([ ...this.algorithms('wrapKey'), ...this.algorithms('deriveKey') ]) } [KEY_MANAGEMENT_DECRYPT] () { return this[KEY_MANAGEMENT_ENCRYPT]() } algorithms (...args) { if (!this[KEYOBJECT]) { return new Set() } return Key.prototype.algorithms.call(this, ...args) } static async generate (...args) { return this.generateSync(...args) } static generateSync (len = 256, privat = true) { if (!privat) { throw new TypeError('"oct" keys cannot be generated as public') } if (!Number.isSafeInteger(len) || !len || len % 8 !== 0) { throw new TypeError('invalid bit length') } return createSecretKey(randomBytes(len / 8)) } } module.exports = OctKey /***/ }), /***/ 24510: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { const { generateKeyPairSync, generateKeyPair: async } = __webpack_require__(33373) const { promisify } = __webpack_require__(31669) const { THUMBPRINT_MATERIAL, JWK_MEMBERS, PUBLIC_MEMBERS, PRIVATE_MEMBERS, KEY_MANAGEMENT_DECRYPT, KEY_MANAGEMENT_ENCRYPT } = __webpack_require__(15010) const { OKP_CURVES } = __webpack_require__(15501) const { edDSASupported } = __webpack_require__(32457) const errors = __webpack_require__(52973) const Key = __webpack_require__(57841) const generateKeyPair = promisify(async) const OKP_PUBLIC = new Set(['crv', 'x']) Object.freeze(OKP_PUBLIC) const OKP_PRIVATE = new Set([...OKP_PUBLIC, 'd']) Object.freeze(OKP_PRIVATE) // Octet string key pairs Key Type class OKPKey extends Key { constructor (...args) { super(...args) this[JWK_MEMBERS]() Object.defineProperty(this, 'kty', { value: 'OKP', enumerable: true }) if (!OKP_CURVES.has(this.crv)) { throw new errors.JOSENotSupported('unsupported OKP key curve') } } static get [PUBLIC_MEMBERS] () { return OKP_PUBLIC } static get [PRIVATE_MEMBERS] () { return OKP_PRIVATE } // https://tc39.github.io/ecma262/#sec-ordinaryownpropertykeys no need for any special // JSON.stringify handling in V8 [THUMBPRINT_MATERIAL] () { return { crv: this.crv, kty: 'OKP', x: this.x } } [KEY_MANAGEMENT_ENCRYPT] () { return this.algorithms('deriveKey') } [KEY_MANAGEMENT_DECRYPT] () { if (this.public) { return new Set() } return this.algorithms('deriveKey') } static async generate (crv = 'Ed25519', privat = true) { if (!edDSASupported) { throw new errors.JOSENotSupported('OKP keys are not supported in your Node.js runtime version') } if (!OKP_CURVES.has(crv)) { throw new errors.JOSENotSupported(`unsupported OKP key curve: ${crv}`) } const { privateKey, publicKey } = await generateKeyPair(crv.toLowerCase()) return privat ? privateKey : publicKey } static generateSync (crv = 'Ed25519', privat = true) { if (!edDSASupported) { throw new errors.JOSENotSupported('OKP keys are not supported in your Node.js runtime version') } if (!OKP_CURVES.has(crv)) { throw new errors.JOSENotSupported(`unsupported OKP key curve: ${crv}`) } const { privateKey, publicKey } = generateKeyPairSync(crv.toLowerCase()) return privat ? privateKey : publicKey } } module.exports = OKPKey /***/ }), /***/ 73242: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { const { generateKeyPairSync, generateKeyPair: async } = __webpack_require__(33373) const { promisify } = __webpack_require__(31669) const { THUMBPRINT_MATERIAL, JWK_MEMBERS, PUBLIC_MEMBERS, PRIVATE_MEMBERS, KEY_MANAGEMENT_DECRYPT, KEY_MANAGEMENT_ENCRYPT } = __webpack_require__(15010) const { keyObjectSupported } = __webpack_require__(32457) const { createPublicKey, createPrivateKey } = __webpack_require__(98921) const Key = __webpack_require__(57841) const generateKeyPair = promisify(async) const RSA_PUBLIC = new Set(['e', 'n']) Object.freeze(RSA_PUBLIC) const RSA_PRIVATE = new Set([...RSA_PUBLIC, 'd', 'p', 'q', 'dp', 'dq', 'qi']) Object.freeze(RSA_PRIVATE) // RSA Key Type class RSAKey extends Key { constructor (...args) { super(...args) this[JWK_MEMBERS]() Object.defineProperties(this, { kty: { value: 'RSA', enumerable: true }, length: { get () { Object.defineProperty(this, 'length', { value: Buffer.byteLength(this.n, 'base64') * 8, configurable: false }) return this.length }, configurable: true } }) } static get [PUBLIC_MEMBERS] () { return RSA_PUBLIC } static get [PRIVATE_MEMBERS] () { return RSA_PRIVATE } // https://tc39.github.io/ecma262/#sec-ordinaryownpropertykeys no need for any special // JSON.stringify handling in V8 [THUMBPRINT_MATERIAL] () { return { e: this.e, kty: 'RSA', n: this.n } } [KEY_MANAGEMENT_ENCRYPT] () { return this.algorithms('wrapKey') } [KEY_MANAGEMENT_DECRYPT] () { return this.algorithms('unwrapKey') } static async generate (len = 2048, privat = true) { if (!Number.isSafeInteger(len) || len < 512 || len % 8 !== 0 || (('electron' in process.versions) && len % 128 !== 0)) { throw new TypeError('invalid bit length') } let privateKey, publicKey if (keyObjectSupported) { ({ privateKey, publicKey } = await generateKeyPair('rsa', { modulusLength: len })) return privat ? privateKey : publicKey } ({ privateKey, publicKey } = await generateKeyPair('rsa', { modulusLength: len, publicKeyEncoding: { type: 'spki', format: 'pem' }, privateKeyEncoding: { type: 'pkcs8', format: 'pem' } })) if (privat) { return createPrivateKey(privateKey) } else { return createPublicKey(publicKey) } } static generateSync (len = 2048, privat = true) { if (!Number.isSafeInteger(len) || len < 512 || len % 8 !== 0 || (('electron' in process.versions) && len % 128 !== 0)) { throw new TypeError('invalid bit length') } let privateKey, publicKey if (keyObjectSupported) { ({ privateKey, publicKey } = generateKeyPairSync('rsa', { modulusLength: len })) return privat ? privateKey : publicKey } ({ privateKey, publicKey } = generateKeyPairSync('rsa', { modulusLength: len, publicKeyEncoding: { type: 'spki', format: 'pem' }, privateKeyEncoding: { type: 'pkcs8', format: 'pem' } })) if (privat) { return createPrivateKey(privateKey) } else { return createPublicKey(publicKey) } } } module.exports = RSAKey /***/ }), /***/ 2044: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { const { deprecate } = __webpack_require__(31669) const deprecation = deprecate(() => {}, '"P-256K" EC curve name is deprecated') module.exports = { name: 'secp256k1', rename (value) { if (value !== 'secp256k1') { deprecation() } module.exports.name = value } } /***/ }), /***/ 82253: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { const { createHash } = __webpack_require__(33373) const base64url = __webpack_require__(73385) const x5t = (hash, cert) => base64url.encodeBuffer(createHash(hash).update(Buffer.from(cert, 'base64')).digest()) module.exports.kid = components => base64url.encodeBuffer(createHash('sha256').update(JSON.stringify(components)).digest()) module.exports.x5t = x5t.bind(undefined, 'sha1') module.exports["x5t#S256"] = x5t.bind(undefined, 'sha256') /***/ }), /***/ 42896: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { const KeyStore = __webpack_require__(24998) module.exports = KeyStore /***/ }), /***/ 24998: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { const { deprecate, inspect } = __webpack_require__(31669) const isObject = __webpack_require__(41805) const { generate, generateSync } = __webpack_require__(39377) const { USES_MAPPING } = __webpack_require__(15010) const { isKey, asKey: importKey } = __webpack_require__(67894) const keyscore = (key, { alg, use, ops }) => { let score = 0 if (alg && key.alg) { score++ } if (use && key.use) { score++ } if (ops && key.key_ops) { score++ } return score } class KeyStore { constructor (...keys) { while (keys.some(Array.isArray)) { keys = keys.flat ? keys.flat() : keys.reduce((acc, val) => { if (Array.isArray(val)) { return [...acc, ...val] } acc.push(val) return acc }, []) } if (keys.some(k => !isKey(k) || !k.kty)) { throw new TypeError('all keys must be instances of a key instantiated by JWK.asKey') } this._keys = new Set(keys) } all ({ alg, kid, thumbprint, use, kty, key_ops: ops, x5t, 'x5t#S256': x5t256, crv } = {}) { if (ops !== undefined && (!Array.isArray(ops) || !ops.length || ops.some(x => typeof x !== 'string'))) { throw new TypeError('`key_ops` must be a non-empty array of strings') } const search = { alg, use, ops } return [...this._keys] .filter((key) => { let candidate = true if (candidate && kid !== undefined && key.kid !== kid) { candidate = false } if (candidate && thumbprint !== undefined && key.thumbprint !== thumbprint) { candidate = false } if (candidate && x5t !== undefined && key.x5t !== x5t) { candidate = false } if (candidate && x5t256 !== undefined && key['x5t#S256'] !== x5t256) { candidate = false } if (candidate && kty !== undefined && key.kty !== kty) { candidate = false } if (candidate && crv !== undefined && (key.crv !== crv)) { candidate = false } if (alg !== undefined && !key.algorithms().has(alg)) { candidate = false } if (candidate && use !== undefined && (key.use !== undefined && key.use !== use)) { candidate = false } // TODO: if (candidate && ops !== undefined && (key.key_ops !== undefined || key.use !== undefined)) { let keyOps if (key.key_ops) { keyOps = new Set(key.key_ops) } else { keyOps = USES_MAPPING[key.use] } if (ops.some(x => !keyOps.has(x))) { candidate = false } } return candidate }) .sort((first, second) => keyscore(second, search) - keyscore(first, search)) } get (...args) { return this.all(...args)[0] } add (key) { if (!isKey(key) || !key.kty) { throw new TypeError('key must be an instance of a key instantiated by JWK.asKey') } this._keys.add(key) } remove (key) { if (!isKey(key)) { throw new TypeError('key must be an instance of a key instantiated by JWK.asKey') } this._keys.delete(key) } toJWKS (priv = false) { return { keys: [...this._keys.values()].map( key => key.toJWK(priv && (key.private || (key.secret && key.k))) ) } } async generate (...args) { this._keys.add(await generate(...args)) } generateSync (...args) { this._keys.add(generateSync(...args)) } get size () { return this._keys.size } /* c8 ignore next 8 */ [inspect.custom] () { return `${this.constructor.name} ${inspect(this.toJWKS(false), { depth: Infinity, colors: process.stdout.isTTY, compact: false, sorted: true })}` } * [Symbol.iterator] () { for (const key of this._keys) { yield key } } } function asKeyStore (jwks, { ignoreErrors = false, calculateMissingRSAPrimes = false } = {}) { if (!isObject(jwks) || !Array.isArray(jwks.keys) || jwks.keys.some(k => !isObject(k) || !('kty' in k))) { throw new TypeError('jwks must be a JSON Web Key Set formatted object') } const keys = jwks.keys.map((jwk) => { try { return importKey(jwk, { calculateMissingRSAPrimes }) } catch (err) { if (!ignoreErrors) { throw err } } }).filter(Boolean) return new KeyStore(...keys) } Object.defineProperty(KeyStore, 'fromJWKS', { value: deprecate(jwks => asKeyStore(jwks, { calculateMissingRSAPrimes: true }), 'JWKS.KeyStore.fromJWKS() is deprecated, use JWKS.asKeyStore() instead'), enumerable: false }) module.exports = { KeyStore, asKeyStore } /***/ }), /***/ 36518: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { const Sign = __webpack_require__(1728) const { verify } = __webpack_require__(39835) const single = (serialization, payload, key, protectedHeader, unprotectedHeader) => { return new Sign(payload) .recipient(key, protectedHeader, unprotectedHeader) .sign(serialization) } module.exports.Sign = Sign module.exports.sign = single.bind(undefined, 'compact') module.exports.sign.flattened = single.bind(undefined, 'flattened') module.exports.sign.general = single.bind(undefined, 'general') module.exports.verify = verify /***/ }), /***/ 28104: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { const isObject = __webpack_require__(41805) let validateCrit = __webpack_require__(530) const { JWSInvalid } = __webpack_require__(52973) validateCrit = validateCrit.bind(undefined, JWSInvalid) const compactSerializer = (payload, [recipient]) => { return `${recipient.protected}.${payload}.${recipient.signature}` } compactSerializer.validate = (jws, { 0: { unprotectedHeader, protectedHeader }, length }) => { if (length !== 1 || unprotectedHeader) { throw new JWSInvalid('JWS Compact Serialization doesn\'t support multiple recipients or JWS unprotected headers') } validateCrit(protectedHeader, unprotectedHeader, protectedHeader ? protectedHeader.crit : undefined) } const flattenedSerializer = (payload, [recipient]) => { const { header, signature, protected: prot } = recipient return { payload, ...prot ? { protected: prot } : undefined, ...header ? { header } : undefined, signature } } flattenedSerializer.validate = (jws, { 0: { unprotectedHeader, protectedHeader }, length }) => { if (length !== 1) { throw new JWSInvalid('Flattened JWS JSON Serialization doesn\'t support multiple recipients') } validateCrit(protectedHeader, unprotectedHeader, protectedHeader ? protectedHeader.crit : undefined) } const generalSerializer = (payload, recipients) => { return { payload, signatures: recipients.map(({ header, signature, protected: prot }) => { return { ...prot ? { protected: prot } : undefined, ...header ? { header } : undefined, signature } }) } } generalSerializer.validate = (jws, recipients) => { let validateB64 = false recipients.forEach(({ protectedHeader, unprotectedHeader }) => { if (protectedHeader && !validateB64 && 'b64' in protectedHeader) { validateB64 = true } validateCrit(protectedHeader, unprotectedHeader, protectedHeader ? protectedHeader.crit : undefined) }) if (validateB64) { const values = recipients.map(({ protectedHeader }) => protectedHeader && protectedHeader.b64) if (!values.every((actual, i, [expected]) => actual === expected)) { throw new JWSInvalid('the "b64" Header Parameter value MUST be the same for all recipients') } } } const isJSON = (input) => { return isObject(input) && (typeof input.payload === 'string' || Buffer.isBuffer(input.payload)) } const isValidRecipient = (recipient) => { return isObject(recipient) && typeof recipient.signature === 'string' && (recipient.header === undefined || isObject(recipient.header)) && (recipient.protected === undefined || typeof recipient.protected === 'string') } const isMultiRecipient = (input) => { if (Array.isArray(input.signatures) && input.signatures.every(isValidRecipient)) { return true } return false } const detect = (input) => { if (typeof input === 'string' && input.split('.').length === 3) { return 'compact' } if (isJSON(input)) { if (isMultiRecipient(input)) { return 'general' } if (isValidRecipient(input)) { return 'flattened' } } throw new JWSInvalid('JWS malformed or invalid serialization') } module.exports = { compact: compactSerializer, flattened: flattenedSerializer, general: generalSerializer, detect } /***/ }), /***/ 1728: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { const base64url = __webpack_require__(73385) const isDisjoint = __webpack_require__(56149) const isObject = __webpack_require__(41805) const deepClone = __webpack_require__(43653) const { JWSInvalid } = __webpack_require__(52973) const { sign } = __webpack_require__(50191) const getKey = __webpack_require__(31308) const serializers = __webpack_require__(28104) const PROCESS_RECIPIENT = Symbol('PROCESS_RECIPIENT') class Sign { constructor (payload) { if (typeof payload === 'string') { payload = base64url.encode(payload) } else if (Buffer.isBuffer(payload)) { payload = base64url.encodeBuffer(payload) this._binary = true } else if (isObject(payload)) { payload = base64url.JSON.encode(payload) } else { throw new TypeError('payload argument must be a Buffer, string or an object') } this._payload = payload this._recipients = [] } /* * @public */ recipient (key, protectedHeader, unprotectedHeader) { key = getKey(key) if (protectedHeader !== undefined && !isObject(protectedHeader)) { throw new TypeError('protectedHeader argument must be a plain object when provided') } if (unprotectedHeader !== undefined && !isObject(unprotectedHeader)) { throw new TypeError('unprotectedHeader argument must be a plain object when provided') } if (!isDisjoint(protectedHeader, unprotectedHeader)) { throw new JWSInvalid('JWS Protected and JWS Unprotected Header Parameter names must be disjoint') } this._recipients.push({ key, protectedHeader: protectedHeader ? deepClone(protectedHeader) : undefined, unprotectedHeader: unprotectedHeader ? deepClone(unprotectedHeader) : undefined }) return this } /* * @private */ [PROCESS_RECIPIENT] (recipient, first) { const { key, protectedHeader, unprotectedHeader } = recipient if (key.use === 'enc') { throw new TypeError('a key with "use":"enc" is not usable for signing') } const joseHeader = { protected: protectedHeader || {}, unprotected: unprotectedHeader || {} } let alg = joseHeader.protected.alg || joseHeader.unprotected.alg if (!alg) { alg = key.alg || [...key.algorithms('sign')][0] if (recipient.protectedHeader) { joseHeader.protected.alg = recipient.protectedHeader.alg = alg } else { joseHeader.protected = recipient.protectedHeader = { alg } } } if (!alg) { throw new JWSInvalid('could not resolve a usable "alg" for a recipient') } recipient.header = unprotectedHeader recipient.protected = Object.keys(joseHeader.protected).length ? base64url.JSON.encode(joseHeader.protected) : '' if (first && joseHeader.protected.crit && joseHeader.protected.crit.includes('b64') && joseHeader.protected.b64 === false) { if (this._binary) { this._payload = base64url.decodeToBuffer(this._payload) } else { this._payload = base64url.decode(this._payload) } } const data = Buffer.concat([ Buffer.from(recipient.protected || ''), Buffer.from('.'), Buffer.from(this._payload) ]) recipient.signature = base64url.encodeBuffer(sign(alg, key, data)) } /* * @public */ sign (serialization) { const serializer = serializers[serialization] if (!serializer) { throw new TypeError('serialization must be one of "compact", "flattened", "general"') } if (!this._recipients.length) { throw new JWSInvalid('missing recipients') } serializer.validate(this, this._recipients) this._recipients.forEach((recipient, i) => { this[PROCESS_RECIPIENT](recipient, i === 0) }) return serializer(this._payload, this._recipients) } } module.exports = Sign /***/ }), /***/ 39835: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { const { EOL } = __webpack_require__(12087) const base64url = __webpack_require__(73385) const isDisjoint = __webpack_require__(56149) const isObject = __webpack_require__(41805) let validateCrit = __webpack_require__(530) const getKey = __webpack_require__(31308) const { KeyStore } = __webpack_require__(42896) const errors = __webpack_require__(52973) const { check, verify } = __webpack_require__(50191) const JWK = __webpack_require__(67894) const { detect: resolveSerialization } = __webpack_require__(28104) validateCrit = validateCrit.bind(undefined, errors.JWSInvalid) const SINGLE_RECIPIENT = new Set(['compact', 'flattened', 'preparsed']) /* * @public */ const jwsVerify = (skipDisjointCheck, serialization, jws, key, { crit = [], complete = false, algorithms, parse = true, encoding = 'utf8' } = {}) => { key = getKey(key, true) if (algorithms !== undefined && (!Array.isArray(algorithms) || algorithms.some(s => typeof s !== 'string' || !s))) { throw new TypeError('"algorithms" option must be an array of non-empty strings') } else if (algorithms) { algorithms = new Set(algorithms) } if (!Array.isArray(crit) || crit.some(s => typeof s !== 'string' || !s)) { throw new TypeError('"crit" option must be an array of non-empty strings') } if (!serialization) { serialization = resolveSerialization(jws) } let prot // protected header let header // unprotected header let payload let signature let alg // treat general format with one recipient as flattened // skips iteration and avoids multi errors in this case if (serialization === 'general' && jws.signatures.length === 1) { serialization = 'flattened' const { signatures, ...root } = jws jws = { ...root, ...signatures[0] } } let decoded if (SINGLE_RECIPIENT.has(serialization)) { let parsedProt = {} switch (serialization) { case 'compact': // compact serialization format ([prot, payload, signature] = jws.split('.')) break case 'flattened': // flattened serialization format ({ protected: prot, payload, signature, header } = jws) break case 'preparsed': { // from the JWT module ({ decoded } = jws); ([prot, payload, signature] = jws.token.split('.')) break } } if (!header) { skipDisjointCheck = true } if (decoded) { parsedProt = decoded.header } else if (prot) { try { parsedProt = base64url.JSON.decode(prot) } catch (err) { throw new errors.JWSInvalid('could not parse JWS protected header') } } else { skipDisjointCheck = skipDisjointCheck || true } if (!skipDisjointCheck && !isDisjoint(parsedProt, header)) { throw new errors.JWSInvalid('JWS Protected and JWS Unprotected Header Parameter names must be disjoint') } const combinedHeader = { ...parsedProt, ...header } validateCrit(parsedProt, header, crit) alg = parsedProt.alg || (header && header.alg) if (!alg) { throw new errors.JWSInvalid('missing JWS signature algorithm') } else if (algorithms && !algorithms.has(alg)) { throw new errors.JOSEAlgNotWhitelisted('alg not whitelisted') } if (key instanceof KeyStore) { const keystore = key const keys = keystore.all({ kid: combinedHeader.kid, alg: combinedHeader.alg, key_ops: ['verify'] }) switch (keys.length) { case 0: throw new errors.JWKSNoMatchingKey() case 1: // treat the call as if a Key instance was passed in // skips iteration and avoids multi errors in this case key = keys[0] break default: { const errs = [] for (const key of keys) { try { return jwsVerify(true, serialization, jws, key, { crit, complete, encoding, parse, algorithms: algorithms ? [...algorithms] : undefined }) } catch (err) { errs.push(err) continue } } const multi = new errors.JOSEMultiError(errs) if ([...multi].some(e => e instanceof errors.JWSVerificationFailed)) { throw new errors.JWSVerificationFailed() } throw multi } } } if (key === JWK.EmbeddedJWK) { if (!isObject(combinedHeader.jwk)) { throw new errors.JWSInvalid('JWS Header Parameter "jwk" must be a JSON object') } key = JWK.asKey(combinedHeader.jwk) if (key.type !== 'public') { throw new errors.JWSInvalid('JWS Header Parameter "jwk" must be a public key') } } else if (key === JWK.EmbeddedX5C) { if (!Array.isArray(combinedHeader.x5c) || !combinedHeader.x5c.length || combinedHeader.x5c.some(c => typeof c !== 'string' || !c)) { throw new errors.JWSInvalid('JWS Header Parameter "x5c" must be a JSON array of certificate value strings') } key = JWK.asKey( `-----BEGIN CERTIFICATE-----${EOL}${(combinedHeader.x5c[0].match(/.{1,64}/g) || []).join(EOL)}${EOL}-----END CERTIFICATE-----`, { x5c: combinedHeader.x5c } ) } check(key, 'verify', alg) const toBeVerified = Buffer.concat([ Buffer.from(prot || ''), Buffer.from('.'), Buffer.isBuffer(payload) ? payload : Buffer.from(payload) ]) if (!verify(alg, key, toBeVerified, base64url.decodeToBuffer(signature))) { throw new errors.JWSVerificationFailed() } if (!combinedHeader.crit || !combinedHeader.crit.includes('b64') || combinedHeader.b64) { if (parse) { payload = decoded ? decoded.payload : base64url.JSON.decode.try(payload, encoding) } else { payload = base64url.decodeToBuffer(payload) } } if (complete) { const result = { payload, key } if (prot) result.protected = parsedProt if (header) result.header = header return result } return payload } // general serialization format const { signatures, ...root } = jws const errs = [] for (const recipient of signatures) { try { return jwsVerify(false, 'flattened', { ...root, ...recipient }, key, { crit, complete, encoding, parse, algorithms: algorithms ? [...algorithms] : undefined }) } catch (err) { errs.push(err) continue } } const multi = new errors.JOSEMultiError(errs) if ([...multi].some(e => e instanceof errors.JWSVerificationFailed)) { throw new errors.JWSVerificationFailed() } else if ([...multi].every(e => e instanceof errors.JWKSNoMatchingKey)) { throw new errors.JWKSNoMatchingKey() } throw multi } module.exports = { bare: jwsVerify, verify: jwsVerify.bind(undefined, false, undefined) } /***/ }), /***/ 6743: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { const base64url = __webpack_require__(73385) const errors = __webpack_require__(52973) module.exports = (token, { complete = false } = {}) => { if (typeof token !== 'string' || !token) { throw new TypeError('JWT must be a string') } const { 0: header, 1: payload, 2: signature, length } = token.split('.') if (length === 5) { throw new TypeError('JWTs must be decrypted first') } if (length !== 3) { throw new errors.JWTMalformed('JWTs must have three components') } try { const result = { header: base64url.JSON.decode(header), payload: base64url.JSON.decode(payload), signature } return complete ? result : result.payload } catch (err) { throw new errors.JWTMalformed('JWT is malformed') } } /***/ }), /***/ 18138: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { const decode = __webpack_require__(6743) const sign = __webpack_require__(86703) const verify = __webpack_require__(44856) const profiles = __webpack_require__(39547) module.exports = { decode, sign, verify, ...profiles } /***/ }), /***/ 39547: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { const verify = __webpack_require__(44856) module.exports = { IdToken: { verify: (token, key, options) => verify(token, key, { ...options, profile: 'id_token' }) }, LogoutToken: { verify: (token, key, options) => verify(token, key, { ...options, profile: 'logout_token' }) }, AccessToken: { verify: (token, key, options) => verify(token, key, { ...options, profile: 'at+JWT' }) } } /***/ }), /***/ 23951: /***/ ((module) => { const isNotString = val => typeof val !== 'string' || val.length === 0 module.exports.isNotString = isNotString module.exports.isString = function isString (Err, value, label, claim, required = false) { if (required && value === undefined) { throw new Err(`${label} is missing`, claim, 'missing') } if (value !== undefined && isNotString(value)) { throw new Err(`${label} must be a string`, claim, 'invalid') } } /***/ }), /***/ 86703: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { const isObject = __webpack_require__(41805) const secs = __webpack_require__(97305) const epoch = __webpack_require__(47396) const getKey = __webpack_require__(31308) const JWS = __webpack_require__(36518) const isString = __webpack_require__(23951).isString.bind(undefined, TypeError) const validateOptions = (options) => { if (typeof options.iat !== 'boolean') { throw new TypeError('options.iat must be a boolean') } if (typeof options.kid !== 'boolean') { throw new TypeError('options.kid must be a boolean') } isString(options.subject, 'options.subject') isString(options.issuer, 'options.issuer') if ( options.audience !== undefined && ( (typeof options.audience !== 'string' || !options.audience) && (!Array.isArray(options.audience) || options.audience.length === 0 || options.audience.some(a => !a || typeof a !== 'string')) ) ) { throw new TypeError('options.audience must be a string or an array of strings') } if (!isObject(options.header)) { throw new TypeError('options.header must be an object') } isString(options.algorithm, 'options.algorithm') isString(options.expiresIn, 'options.expiresIn') isString(options.notBefore, 'options.notBefore') isString(options.jti, 'options.jti') isString(options.nonce, 'options.nonce') if (options.now !== undefined && (!(options.now instanceof Date) || !options.now.getTime())) { throw new TypeError('options.now must be a valid Date object') } } module.exports = (payload, key, options = {}) => { if (!isObject(options)) { throw new TypeError('options must be an object') } const { algorithm, audience, expiresIn, header = {}, iat = true, issuer, jti, kid = true, nonce, notBefore, subject, now } = options validateOptions({ algorithm, audience, expiresIn, header, iat, issuer, jti, kid, nonce, notBefore, now, subject }) if (!isObject(payload)) { throw new TypeError('payload must be an object') } let unix if (expiresIn || notBefore || iat) { unix = epoch(now || new Date()) } payload = { ...payload, sub: subject || payload.sub, aud: audience || payload.aud, iss: issuer || payload.iss, jti: jti || payload.jti, iat: iat ? unix : payload.iat, nonce: nonce || payload.nonce, exp: expiresIn ? unix + secs(expiresIn) : payload.exp, nbf: notBefore ? unix + secs(notBefore) : payload.nbf } key = getKey(key) let includeKid if (typeof options.kid === 'boolean') { includeKid = kid } else { includeKid = !key.secret } return JWS.sign(JSON.stringify(payload), key, { ...header, alg: algorithm || header.alg, kid: includeKid ? key.kid : header.kid }) } /***/ }), /***/ 44856: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { const isObject = __webpack_require__(41805) const epoch = __webpack_require__(47396) const secs = __webpack_require__(97305) const getKey = __webpack_require__(31308) const { bare: verify } = __webpack_require__(39835) const { JWTClaimInvalid, JWTExpired } = __webpack_require__(52973) const { isString, isNotString } = __webpack_require__(23951) const decode = __webpack_require__(6743) const isPayloadString = isString.bind(undefined, JWTClaimInvalid) const isOptionString = isString.bind(undefined, TypeError) const IDTOKEN = 'id_token' const LOGOUTTOKEN = 'logout_token' const ATJWT = 'at+JWT' const isTimestamp = (value, label, required = false) => { if (required && value === undefined) { throw new JWTClaimInvalid(`"${label}" claim is missing`, label, 'missing') } if (value !== undefined && (typeof value !== 'number')) { throw new JWTClaimInvalid(`"${label}" claim must be a JSON numeric value`, label, 'invalid') } } const isStringOrArrayOfStrings = (value, label, required = false) => { if (required && value === undefined) { throw new JWTClaimInvalid(`"${label}" claim is missing`, label, 'missing') } if (value !== undefined && (isNotString(value) && isNotArrayOfStrings(value))) { throw new JWTClaimInvalid(`"${label}" claim must be a string or array of strings`, label, 'invalid') } } const isNotArrayOfStrings = val => !Array.isArray(val) || val.length === 0 || val.some(isNotString) const normalizeTyp = (value) => value.toLowerCase().replace(/^application\//, '') const validateOptions = ({ algorithms, audience, clockTolerance, complete = false, crit, ignoreExp = false, ignoreIat = false, ignoreNbf = false, issuer, jti, maxAuthAge, maxTokenAge, nonce, now = new Date(), profile, subject, typ }) => { isOptionString(profile, 'options.profile') if (typeof complete !== 'boolean') { throw new TypeError('options.complete must be a boolean') } if (typeof ignoreExp !== 'boolean') { throw new TypeError('options.ignoreExp must be a boolean') } if (typeof ignoreNbf !== 'boolean') { throw new TypeError('options.ignoreNbf must be a boolean') } if (typeof ignoreIat !== 'boolean') { throw new TypeError('options.ignoreIat must be a boolean') } isOptionString(maxTokenAge, 'options.maxTokenAge') isOptionString(subject, 'options.subject') isOptionString(maxAuthAge, 'options.maxAuthAge') isOptionString(jti, 'options.jti') isOptionString(clockTolerance, 'options.clockTolerance') isOptionString(typ, 'options.typ') if (issuer !== undefined && (isNotString(issuer) && isNotArrayOfStrings(issuer))) { throw new TypeError('options.issuer must be a string or an array of strings') } if (audience !== undefined && (isNotString(audience) && isNotArrayOfStrings(audience))) { throw new TypeError('options.audience must be a string or an array of strings') } if (algorithms !== undefined && isNotArrayOfStrings(algorithms)) { throw new TypeError('options.algorithms must be an array of strings') } isOptionString(nonce, 'options.nonce') if (!(now instanceof Date) || !now.getTime()) { throw new TypeError('options.now must be a valid Date object') } if (ignoreIat && maxTokenAge !== undefined) { throw new TypeError('options.ignoreIat and options.maxTokenAge cannot used together') } if (crit !== undefined && isNotArrayOfStrings(crit)) { throw new TypeError('options.crit must be an array of strings') } switch (profile) { case IDTOKEN: if (!issuer) { throw new TypeError('"issuer" option is required to validate an ID Token') } if (!audience) { throw new TypeError('"audience" option is required to validate an ID Token') } break case ATJWT: if (!issuer) { throw new TypeError('"issuer" option is required to validate a JWT Access Token') } if (!audience) { throw new TypeError('"audience" option is required to validate a JWT Access Token') } typ = ATJWT break case LOGOUTTOKEN: if (!issuer) { throw new TypeError('"issuer" option is required to validate a Logout Token') } if (!audience) { throw new TypeError('"audience" option is required to validate a Logout Token') } break case undefined: break default: throw new TypeError(`unsupported options.profile value "${profile}"`) } return { algorithms, audience, clockTolerance, complete, crit, ignoreExp, ignoreIat, ignoreNbf, issuer, jti, maxAuthAge, maxTokenAge, nonce, now, profile, subject, typ } } const validateTypes = ({ header, payload }, profile, options) => { isPayloadString(header.alg, '"alg" header parameter', 'alg', true) isTimestamp(payload.iat, 'iat', profile === IDTOKEN || profile === LOGOUTTOKEN || profile === ATJWT || !!options.maxTokenAge) isTimestamp(payload.exp, 'exp', profile === IDTOKEN || profile === ATJWT) isTimestamp(payload.auth_time, 'auth_time', !!options.maxAuthAge) isTimestamp(payload.nbf, 'nbf') isPayloadString(payload.jti, '"jti" claim', 'jti', profile === LOGOUTTOKEN || profile === ATJWT || !!options.jti) isPayloadString(payload.acr, '"acr" claim', 'acr') isPayloadString(payload.nonce, '"nonce" claim', 'nonce', !!options.nonce) isStringOrArrayOfStrings(payload.iss, 'iss', !!options.issuer) isPayloadString(payload.sub, '"sub" claim', 'sub', profile === IDTOKEN || profile === ATJWT || !!options.subject) isStringOrArrayOfStrings(payload.aud, 'aud', !!options.audience) isPayloadString(payload.azp, '"azp" claim', 'azp', profile === IDTOKEN && Array.isArray(payload.aud) && payload.aud.length > 1) isStringOrArrayOfStrings(payload.amr, 'amr') isPayloadString(header.typ, '"typ" header parameter', 'typ', !!options.typ) if (profile === ATJWT) { isPayloadString(payload.client_id, '"client_id" claim', 'client_id', true) } if (profile === LOGOUTTOKEN) { isPayloadString(payload.sid, '"sid" claim', 'sid') if (!('sid' in payload) && !('sub' in payload)) { throw new JWTClaimInvalid('either "sid" or "sub" (or both) claims must be present') } if ('nonce' in payload) { throw new JWTClaimInvalid('"nonce" claim is prohibited', 'nonce', 'prohibited') } if (!('events' in payload)) { throw new JWTClaimInvalid('"events" claim is missing', 'events', 'missing') } if (!isObject(payload.events)) { throw new JWTClaimInvalid('"events" claim must be an object', 'events', 'invalid') } if (!('http://schemas.openid.net/event/backchannel-logout' in payload.events)) { throw new JWTClaimInvalid('"http://schemas.openid.net/event/backchannel-logout" member is missing in the "events" claim', 'events', 'invalid') } if (!isObject(payload.events['http://schemas.openid.net/event/backchannel-logout'])) { throw new JWTClaimInvalid('"http://schemas.openid.net/event/backchannel-logout" member in the "events" claim must be an object', 'events', 'invalid') } } } const checkAudiencePresence = (audPayload, audOption, profile) => { if (typeof audPayload === 'string') { return audOption.includes(audPayload) } // Each principal intended to process the JWT MUST // identify itself with a value in the audience claim audPayload = new Set(audPayload) return audOption.some(Set.prototype.has.bind(audPayload)) } module.exports = (token, key, options = {}) => { if (!isObject(options)) { throw new TypeError('options must be an object') } const { algorithms, audience, clockTolerance, complete, crit, ignoreExp, ignoreIat, ignoreNbf, issuer, jti, maxAuthAge, maxTokenAge, nonce, now, profile, subject, typ } = options = validateOptions(options) const decoded = decode(token, { complete: true }) key = getKey(key, true) if (complete) { ({ key } = verify(true, 'preparsed', { decoded, token }, key, { crit, algorithms, complete: true })) decoded.key = key } else { verify(true, 'preparsed', { decoded, token }, key, { crit, algorithms }) } const unix = epoch(now) validateTypes(decoded, profile, options) if (issuer && (typeof decoded.payload.iss !== 'string' || !(typeof issuer === 'string' ? [issuer] : issuer).includes(decoded.payload.iss))) { throw new JWTClaimInvalid('unexpected "iss" claim value', 'iss', 'check_failed') } if (nonce && decoded.payload.nonce !== nonce) { throw new JWTClaimInvalid('unexpected "nonce" claim value', 'nonce', 'check_failed') } if (subject && decoded.payload.sub !== subject) { throw new JWTClaimInvalid('unexpected "sub" claim value', 'sub', 'check_failed') } if (jti && decoded.payload.jti !== jti) { throw new JWTClaimInvalid('unexpected "jti" claim value', 'jti', 'check_failed') } if (audience && !checkAudiencePresence(decoded.payload.aud, typeof audience === 'string' ? [audience] : audience, profile)) { throw new JWTClaimInvalid('unexpected "aud" claim value', 'aud', 'check_failed') } if (typ && normalizeTyp(decoded.header.typ) !== normalizeTyp(typ)) { throw new JWTClaimInvalid('unexpected "typ" JWT header value', 'typ', 'check_failed') } const tolerance = clockTolerance ? secs(clockTolerance) : 0 if (maxAuthAge) { const maxAuthAgeSeconds = secs(maxAuthAge) if (decoded.payload.auth_time + maxAuthAgeSeconds < unix - tolerance) { throw new JWTClaimInvalid('"auth_time" claim timestamp check failed (too much time has elapsed since the last End-User authentication)', 'auth_time', 'check_failed') } } if (!ignoreIat && !('exp' in decoded.payload) && 'iat' in decoded.payload && decoded.payload.iat > unix + tolerance) { throw new JWTClaimInvalid('"iat" claim timestamp check failed (it should be in the past)', 'iat', 'check_failed') } if (!ignoreNbf && 'nbf' in decoded.payload && decoded.payload.nbf > unix + tolerance) { throw new JWTClaimInvalid('"nbf" claim timestamp check failed', 'nbf', 'check_failed') } if (!ignoreExp && 'exp' in decoded.payload && decoded.payload.exp <= unix - tolerance) { throw new JWTExpired('"exp" claim timestamp check failed', 'exp', 'check_failed') } if (maxTokenAge) { const age = unix - decoded.payload.iat const max = secs(maxTokenAge) if (age - tolerance > max) { throw new JWTExpired('"iat" claim timestamp check failed (too far in the past)', 'iat', 'check_failed') } if (age < 0 - tolerance) { throw new JWTClaimInvalid('"iat" claim timestamp check failed (it should be in the past)', 'iat', 'check_failed') } } if (profile === IDTOKEN && Array.isArray(decoded.payload.aud) && decoded.payload.aud.length > 1 && decoded.payload.azp !== audience) { throw new JWTClaimInvalid('unexpected "azp" claim value', 'azp', 'check_failed') } return complete ? decoded : decoded.payload } /***/ }), /***/ 30760: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { const { getCurves } = __webpack_require__(33373) const { name: secp256k1 } = __webpack_require__(2044) const curves = new Set() if (getCurves().includes('prime256v1')) { curves.add('P-256') } if (getCurves().includes('secp256k1')) { curves.add(secp256k1) } if (getCurves().includes('secp384r1')) { curves.add('P-384') } if (getCurves().includes('secp521r1')) { curves.add('P-521') } module.exports = curves /***/ }), /***/ 87168: /***/ ((module) => { module.exports = new Map() /***/ }), /***/ 15501: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { const EC_CURVES = __webpack_require__(30760) const IVLENGTHS = __webpack_require__(19805) const JWA = __webpack_require__(72430) const JWK = __webpack_require__(95942) const KEYLENGTHS = __webpack_require__(54358) const OKP_CURVES = __webpack_require__(24720) const ECDH_DERIVE_LENGTHS = __webpack_require__(87168) module.exports = { EC_CURVES, ECDH_DERIVE_LENGTHS, IVLENGTHS, JWA, JWK, KEYLENGTHS, OKP_CURVES } /***/ }), /***/ 19805: /***/ ((module) => { module.exports = new Map([ ['A128CBC-HS256', 128], ['A128GCM', 96], ['A128GCMKW', 96], ['A192CBC-HS384', 128], ['A192GCM', 96], ['A192GCMKW', 96], ['A256CBC-HS512', 128], ['A256GCM', 96], ['A256GCMKW', 96] ]) /***/ }), /***/ 72430: /***/ ((module) => { module.exports = { sign: new Map(), verify: new Map(), keyManagementEncrypt: new Map(), keyManagementDecrypt: new Map(), encrypt: new Map(), decrypt: new Map() } /***/ }), /***/ 95942: /***/ ((module) => { module.exports = { oct: { decrypt: {}, deriveKey: {}, encrypt: {}, sign: {}, unwrapKey: {}, verify: {}, wrapKey: {} }, EC: { decrypt: {}, deriveKey: {}, encrypt: {}, sign: {}, unwrapKey: {}, verify: {}, wrapKey: {} }, RSA: { decrypt: {}, deriveKey: {}, encrypt: {}, sign: {}, unwrapKey: {}, verify: {}, wrapKey: {} }, OKP: { decrypt: {}, deriveKey: {}, encrypt: {}, sign: {}, unwrapKey: {}, verify: {}, wrapKey: {} } } /***/ }), /***/ 54358: /***/ ((module) => { module.exports = new Map([ ['A128CBC-HS256', 256], ['A128GCM', 128], ['A192CBC-HS384', 384], ['A192GCM', 192], ['A256CBC-HS512', 512], ['A256GCM', 256] ]) /***/ }), /***/ 24720: /***/ ((module) => { const curves = new Set(['Ed25519']) if (!('electron' in process.versions)) { curves.add('Ed448') curves.add('X25519') curves.add('X448') } module.exports = curves /***/ }), /***/ 21917: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; var yaml = __webpack_require__(40916); module.exports = yaml; /***/ }), /***/ 40916: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; var loader = __webpack_require__(45190); var dumper = __webpack_require__(73034); function deprecated(name) { return function () { throw new Error('Function ' + name + ' is deprecated and cannot be used.'); }; } module.exports.Type = __webpack_require__(30967); module.exports.Schema = __webpack_require__(66514); module.exports.FAILSAFE_SCHEMA = __webpack_require__(66037); module.exports.JSON_SCHEMA = __webpack_require__(1571); module.exports.CORE_SCHEMA = __webpack_require__(92183); module.exports.DEFAULT_SAFE_SCHEMA = __webpack_require__(48949); module.exports.DEFAULT_FULL_SCHEMA = __webpack_require__(56874); module.exports.load = loader.load; module.exports.loadAll = loader.loadAll; module.exports.safeLoad = loader.safeLoad; module.exports.safeLoadAll = loader.safeLoadAll; module.exports.dump = dumper.dump; module.exports.safeDump = dumper.safeDump; module.exports.YAMLException = __webpack_require__(65199); // Deprecated schema names from JS-YAML 2.0.x module.exports.MINIMAL_SCHEMA = __webpack_require__(66037); module.exports.SAFE_SCHEMA = __webpack_require__(48949); module.exports.DEFAULT_SCHEMA = __webpack_require__(56874); // Deprecated functions from JS-YAML 1.x.x module.exports.scan = deprecated('scan'); module.exports.parse = deprecated('parse'); module.exports.compose = deprecated('compose'); module.exports.addConstructor = deprecated('addConstructor'); /***/ }), /***/ 59136: /***/ ((module) => { "use strict"; function isNothing(subject) { return (typeof subject === 'undefined') || (subject === null); } function isObject(subject) { return (typeof subject === 'object') && (subject !== null); } function toArray(sequence) { if (Array.isArray(sequence)) return sequence; else if (isNothing(sequence)) return []; return [ sequence ]; } function extend(target, source) { var index, length, key, sourceKeys; if (source) { sourceKeys = Object.keys(source); for (index = 0, length = sourceKeys.length; index < length; index += 1) { key = sourceKeys[index]; target[key] = source[key]; } } return target; } function repeat(string, count) { var result = '', cycle; for (cycle = 0; cycle < count; cycle += 1) { result += string; } return result; } function isNegativeZero(number) { return (number === 0) && (Number.NEGATIVE_INFINITY === 1 / number); } module.exports.isNothing = isNothing; module.exports.isObject = isObject; module.exports.toArray = toArray; module.exports.repeat = repeat; module.exports.isNegativeZero = isNegativeZero; module.exports.extend = extend; /***/ }), /***/ 73034: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; /*eslint-disable no-use-before-define*/ var common = __webpack_require__(59136); var YAMLException = __webpack_require__(65199); var DEFAULT_FULL_SCHEMA = __webpack_require__(56874); var DEFAULT_SAFE_SCHEMA = __webpack_require__(48949); var _toString = Object.prototype.toString; var _hasOwnProperty = Object.prototype.hasOwnProperty; var CHAR_TAB = 0x09; /* Tab */ var CHAR_LINE_FEED = 0x0A; /* LF */ var CHAR_CARRIAGE_RETURN = 0x0D; /* CR */ var CHAR_SPACE = 0x20; /* Space */ var CHAR_EXCLAMATION = 0x21; /* ! */ var CHAR_DOUBLE_QUOTE = 0x22; /* " */ var CHAR_SHARP = 0x23; /* # */ var CHAR_PERCENT = 0x25; /* % */ var CHAR_AMPERSAND = 0x26; /* & */ var CHAR_SINGLE_QUOTE = 0x27; /* ' */ var CHAR_ASTERISK = 0x2A; /* * */ var CHAR_COMMA = 0x2C; /* , */ var CHAR_MINUS = 0x2D; /* - */ var CHAR_COLON = 0x3A; /* : */ var CHAR_EQUALS = 0x3D; /* = */ var CHAR_GREATER_THAN = 0x3E; /* > */ var CHAR_QUESTION = 0x3F; /* ? */ var CHAR_COMMERCIAL_AT = 0x40; /* @ */ var CHAR_LEFT_SQUARE_BRACKET = 0x5B; /* [ */ var CHAR_RIGHT_SQUARE_BRACKET = 0x5D; /* ] */ var CHAR_GRAVE_ACCENT = 0x60; /* ` */ var CHAR_LEFT_CURLY_BRACKET = 0x7B; /* { */ var CHAR_VERTICAL_LINE = 0x7C; /* | */ var CHAR_RIGHT_CURLY_BRACKET = 0x7D; /* } */ var ESCAPE_SEQUENCES = {}; ESCAPE_SEQUENCES[0x00] = '\\0'; ESCAPE_SEQUENCES[0x07] = '\\a'; ESCAPE_SEQUENCES[0x08] = '\\b'; ESCAPE_SEQUENCES[0x09] = '\\t'; ESCAPE_SEQUENCES[0x0A] = '\\n'; ESCAPE_SEQUENCES[0x0B] = '\\v'; ESCAPE_SEQUENCES[0x0C] = '\\f'; ESCAPE_SEQUENCES[0x0D] = '\\r'; ESCAPE_SEQUENCES[0x1B] = '\\e'; ESCAPE_SEQUENCES[0x22] = '\\"'; ESCAPE_SEQUENCES[0x5C] = '\\\\'; ESCAPE_SEQUENCES[0x85] = '\\N'; ESCAPE_SEQUENCES[0xA0] = '\\_'; ESCAPE_SEQUENCES[0x2028] = '\\L'; ESCAPE_SEQUENCES[0x2029] = '\\P'; var DEPRECATED_BOOLEANS_SYNTAX = [ 'y', 'Y', 'yes', 'Yes', 'YES', 'on', 'On', 'ON', 'n', 'N', 'no', 'No', 'NO', 'off', 'Off', 'OFF' ]; function compileStyleMap(schema, map) { var result, keys, index, length, tag, style, type; if (map === null) return {}; result = {}; keys = Object.keys(map); for (index = 0, length = keys.length; index < length; index += 1) { tag = keys[index]; style = String(map[tag]); if (tag.slice(0, 2) === '!!') { tag = 'tag:yaml.org,2002:' + tag.slice(2); } type = schema.compiledTypeMap['fallback'][tag]; if (type && _hasOwnProperty.call(type.styleAliases, style)) { style = type.styleAliases[style]; } result[tag] = style; } return result; } function encodeHex(character) { var string, handle, length; string = character.toString(16).toUpperCase(); if (character <= 0xFF) { handle = 'x'; length = 2; } else if (character <= 0xFFFF) { handle = 'u'; length = 4; } else if (character <= 0xFFFFFFFF) { handle = 'U'; length = 8; } else { throw new YAMLException('code point within a string may not be greater than 0xFFFFFFFF'); } return '\\' + handle + common.repeat('0', length - string.length) + string; } function State(options) { this.schema = options['schema'] || DEFAULT_FULL_SCHEMA; this.indent = Math.max(1, (options['indent'] || 2)); this.noArrayIndent = options['noArrayIndent'] || false; this.skipInvalid = options['skipInvalid'] || false; this.flowLevel = (common.isNothing(options['flowLevel']) ? -1 : options['flowLevel']); this.styleMap = compileStyleMap(this.schema, options['styles'] || null); this.sortKeys = options['sortKeys'] || false; this.lineWidth = options['lineWidth'] || 80; this.noRefs = options['noRefs'] || false; this.noCompatMode = options['noCompatMode'] || false; this.condenseFlow = options['condenseFlow'] || false; this.implicitTypes = this.schema.compiledImplicit; this.explicitTypes = this.schema.compiledExplicit; this.tag = null; this.result = ''; this.duplicates = []; this.usedDuplicates = null; } // Indents every line in a string. Empty lines (\n only) are not indented. function indentString(string, spaces) { var ind = common.repeat(' ', spaces), position = 0, next = -1, result = '', line, length = string.length; while (position < length) { next = string.indexOf('\n', position); if (next === -1) { line = string.slice(position); position = length; } else { line = string.slice(position, next + 1); position = next + 1; } if (line.length && line !== '\n') result += ind; result += line; } return result; } function generateNextLine(state, level) { return '\n' + common.repeat(' ', state.indent * level); } function testImplicitResolving(state, str) { var index, length, type; for (index = 0, length = state.implicitTypes.length; index < length; index += 1) { type = state.implicitTypes[index]; if (type.resolve(str)) { return true; } } return false; } // [33] s-white ::= s-space | s-tab function isWhitespace(c) { return c === CHAR_SPACE || c === CHAR_TAB; } // Returns true if the character can be printed without escaping. // From YAML 1.2: "any allowed characters known to be non-printable // should also be escaped. [However,] This isn’t mandatory" // Derived from nb-char - \t - #x85 - #xA0 - #x2028 - #x2029. function isPrintable(c) { return (0x00020 <= c && c <= 0x00007E) || ((0x000A1 <= c && c <= 0x00D7FF) && c !== 0x2028 && c !== 0x2029) || ((0x0E000 <= c && c <= 0x00FFFD) && c !== 0xFEFF /* BOM */) || (0x10000 <= c && c <= 0x10FFFF); } // [34] ns-char ::= nb-char - s-white // [27] nb-char ::= c-printable - b-char - c-byte-order-mark // [26] b-char ::= b-line-feed | b-carriage-return // [24] b-line-feed ::= #xA /* LF */ // [25] b-carriage-return ::= #xD /* CR */ // [3] c-byte-order-mark ::= #xFEFF function isNsChar(c) { return isPrintable(c) && !isWhitespace(c) // byte-order-mark && c !== 0xFEFF // b-char && c !== CHAR_CARRIAGE_RETURN && c !== CHAR_LINE_FEED; } // Simplified test for values allowed after the first character in plain style. function isPlainSafe(c, prev) { // Uses a subset of nb-char - c-flow-indicator - ":" - "#" // where nb-char ::= c-printable - b-char - c-byte-order-mark. return isPrintable(c) && c !== 0xFEFF // - c-flow-indicator && c !== CHAR_COMMA && c !== CHAR_LEFT_SQUARE_BRACKET && c !== CHAR_RIGHT_SQUARE_BRACKET && c !== CHAR_LEFT_CURLY_BRACKET && c !== CHAR_RIGHT_CURLY_BRACKET // - ":" - "#" // /* An ns-char preceding */ "#" && c !== CHAR_COLON && ((c !== CHAR_SHARP) || (prev && isNsChar(prev))); } // Simplified test for values allowed as the first character in plain style. function isPlainSafeFirst(c) { // Uses a subset of ns-char - c-indicator // where ns-char = nb-char - s-white. return isPrintable(c) && c !== 0xFEFF && !isWhitespace(c) // - s-white // - (c-indicator ::= // “-” | “?” | “:” | “,” | “[” | “]” | “{” | “}” && c !== CHAR_MINUS && c !== CHAR_QUESTION && c !== CHAR_COLON && c !== CHAR_COMMA && c !== CHAR_LEFT_SQUARE_BRACKET && c !== CHAR_RIGHT_SQUARE_BRACKET && c !== CHAR_LEFT_CURLY_BRACKET && c !== CHAR_RIGHT_CURLY_BRACKET // | “#” | “&” | “*” | “!” | “|” | “=” | “>” | “'” | “"” && c !== CHAR_SHARP && c !== CHAR_AMPERSAND && c !== CHAR_ASTERISK && c !== CHAR_EXCLAMATION && c !== CHAR_VERTICAL_LINE && c !== CHAR_EQUALS && c !== CHAR_GREATER_THAN && c !== CHAR_SINGLE_QUOTE && c !== CHAR_DOUBLE_QUOTE // | “%” | “@” | “`”) && c !== CHAR_PERCENT && c !== CHAR_COMMERCIAL_AT && c !== CHAR_GRAVE_ACCENT; } // Determines whether block indentation indicator is required. function needIndentIndicator(string) { var leadingSpaceRe = /^\n* /; return leadingSpaceRe.test(string); } var STYLE_PLAIN = 1, STYLE_SINGLE = 2, STYLE_LITERAL = 3, STYLE_FOLDED = 4, STYLE_DOUBLE = 5; // Determines which scalar styles are possible and returns the preferred style. // lineWidth = -1 => no limit. // Pre-conditions: str.length > 0. // Post-conditions: // STYLE_PLAIN or STYLE_SINGLE => no \n are in the string. // STYLE_LITERAL => no lines are suitable for folding (or lineWidth is -1). // STYLE_FOLDED => a line > lineWidth and can be folded (and lineWidth != -1). function chooseScalarStyle(string, singleLineOnly, indentPerLevel, lineWidth, testAmbiguousType) { var i; var char, prev_char; var hasLineBreak = false; var hasFoldableLine = false; // only checked if shouldTrackWidth var shouldTrackWidth = lineWidth !== -1; var previousLineBreak = -1; // count the first line correctly var plain = isPlainSafeFirst(string.charCodeAt(0)) && !isWhitespace(string.charCodeAt(string.length - 1)); if (singleLineOnly) { // Case: no block styles. // Check for disallowed characters to rule out plain and single. for (i = 0; i < string.length; i++) { char = string.charCodeAt(i); if (!isPrintable(char)) { return STYLE_DOUBLE; } prev_char = i > 0 ? string.charCodeAt(i - 1) : null; plain = plain && isPlainSafe(char, prev_char); } } else { // Case: block styles permitted. for (i = 0; i < string.length; i++) { char = string.charCodeAt(i); if (char === CHAR_LINE_FEED) { hasLineBreak = true; // Check if any line can be folded. if (shouldTrackWidth) { hasFoldableLine = hasFoldableLine || // Foldable line = too long, and not more-indented. (i - previousLineBreak - 1 > lineWidth && string[previousLineBreak + 1] !== ' '); previousLineBreak = i; } } else if (!isPrintable(char)) { return STYLE_DOUBLE; } prev_char = i > 0 ? string.charCodeAt(i - 1) : null; plain = plain && isPlainSafe(char, prev_char); } // in case the end is missing a \n hasFoldableLine = hasFoldableLine || (shouldTrackWidth && (i - previousLineBreak - 1 > lineWidth && string[previousLineBreak + 1] !== ' ')); } // Although every style can represent \n without escaping, prefer block styles // for multiline, since they're more readable and they don't add empty lines. // Also prefer folding a super-long line. if (!hasLineBreak && !hasFoldableLine) { // Strings interpretable as another type have to be quoted; // e.g. the string 'true' vs. the boolean true. return plain && !testAmbiguousType(string) ? STYLE_PLAIN : STYLE_SINGLE; } // Edge case: block indentation indicator can only have one digit. if (indentPerLevel > 9 && needIndentIndicator(string)) { return STYLE_DOUBLE; } // At this point we know block styles are valid. // Prefer literal style unless we want to fold. return hasFoldableLine ? STYLE_FOLDED : STYLE_LITERAL; } // Note: line breaking/folding is implemented for only the folded style. // NB. We drop the last trailing newline (if any) of a returned block scalar // since the dumper adds its own newline. This always works: // • No ending newline => unaffected; already using strip "-" chomping. // • Ending newline => removed then restored. // Importantly, this keeps the "+" chomp indicator from gaining an extra line. function writeScalar(state, string, level, iskey) { state.dump = (function () { if (string.length === 0) { return "''"; } if (!state.noCompatMode && DEPRECATED_BOOLEANS_SYNTAX.indexOf(string) !== -1) { return "'" + string + "'"; } var indent = state.indent * Math.max(1, level); // no 0-indent scalars // As indentation gets deeper, let the width decrease monotonically // to the lower bound min(state.lineWidth, 40). // Note that this implies // state.lineWidth ≤ 40 + state.indent: width is fixed at the lower bound. // state.lineWidth > 40 + state.indent: width decreases until the lower bound. // This behaves better than a constant minimum width which disallows narrower options, // or an indent threshold which causes the width to suddenly increase. var lineWidth = state.lineWidth === -1 ? -1 : Math.max(Math.min(state.lineWidth, 40), state.lineWidth - indent); // Without knowing if keys are implicit/explicit, assume implicit for safety. var singleLineOnly = iskey // No block styles in flow mode. || (state.flowLevel > -1 && level >= state.flowLevel); function testAmbiguity(string) { return testImplicitResolving(state, string); } switch (chooseScalarStyle(string, singleLineOnly, state.indent, lineWidth, testAmbiguity)) { case STYLE_PLAIN: return string; case STYLE_SINGLE: return "'" + string.replace(/'/g, "''") + "'"; case STYLE_LITERAL: return '|' + blockHeader(string, state.indent) + dropEndingNewline(indentString(string, indent)); case STYLE_FOLDED: return '>' + blockHeader(string, state.indent) + dropEndingNewline(indentString(foldString(string, lineWidth), indent)); case STYLE_DOUBLE: return '"' + escapeString(string, lineWidth) + '"'; default: throw new YAMLException('impossible error: invalid scalar style'); } }()); } // Pre-conditions: string is valid for a block scalar, 1 <= indentPerLevel <= 9. function blockHeader(string, indentPerLevel) { var indentIndicator = needIndentIndicator(string) ? String(indentPerLevel) : ''; // note the special case: the string '\n' counts as a "trailing" empty line. var clip = string[string.length - 1] === '\n'; var keep = clip && (string[string.length - 2] === '\n' || string === '\n'); var chomp = keep ? '+' : (clip ? '' : '-'); return indentIndicator + chomp + '\n'; } // (See the note for writeScalar.) function dropEndingNewline(string) { return string[string.length - 1] === '\n' ? string.slice(0, -1) : string; } // Note: a long line without a suitable break point will exceed the width limit. // Pre-conditions: every char in str isPrintable, str.length > 0, width > 0. function foldString(string, width) { // In folded style, $k$ consecutive newlines output as $k+1$ newlines— // unless they're before or after a more-indented line, or at the very // beginning or end, in which case $k$ maps to $k$. // Therefore, parse each chunk as newline(s) followed by a content line. var lineRe = /(\n+)([^\n]*)/g; // first line (possibly an empty line) var result = (function () { var nextLF = string.indexOf('\n'); nextLF = nextLF !== -1 ? nextLF : string.length; lineRe.lastIndex = nextLF; return foldLine(string.slice(0, nextLF), width); }()); // If we haven't reached the first content line yet, don't add an extra \n. var prevMoreIndented = string[0] === '\n' || string[0] === ' '; var moreIndented; // rest of the lines var match; while ((match = lineRe.exec(string))) { var prefix = match[1], line = match[2]; moreIndented = (line[0] === ' '); result += prefix + (!prevMoreIndented && !moreIndented && line !== '' ? '\n' : '') + foldLine(line, width); prevMoreIndented = moreIndented; } return result; } // Greedy line breaking. // Picks the longest line under the limit each time, // otherwise settles for the shortest line over the limit. // NB. More-indented lines *cannot* be folded, as that would add an extra \n. function foldLine(line, width) { if (line === '' || line[0] === ' ') return line; // Since a more-indented line adds a \n, breaks can't be followed by a space. var breakRe = / [^ ]/g; // note: the match index will always be <= length-2. var match; // start is an inclusive index. end, curr, and next are exclusive. var start = 0, end, curr = 0, next = 0; var result = ''; // Invariants: 0 <= start <= length-1. // 0 <= curr <= next <= max(0, length-2). curr - start <= width. // Inside the loop: // A match implies length >= 2, so curr and next are <= length-2. while ((match = breakRe.exec(line))) { next = match.index; // maintain invariant: curr - start <= width if (next - start > width) { end = (curr > start) ? curr : next; // derive end <= length-2 result += '\n' + line.slice(start, end); // skip the space that was output as \n start = end + 1; // derive start <= length-1 } curr = next; } // By the invariants, start <= length-1, so there is something left over. // It is either the whole string or a part starting from non-whitespace. result += '\n'; // Insert a break if the remainder is too long and there is a break available. if (line.length - start > width && curr > start) { result += line.slice(start, curr) + '\n' + line.slice(curr + 1); } else { result += line.slice(start); } return result.slice(1); // drop extra \n joiner } // Escapes a double-quoted string. function escapeString(string) { var result = ''; var char, nextChar; var escapeSeq; for (var i = 0; i < string.length; i++) { char = string.charCodeAt(i); // Check for surrogate pairs (reference Unicode 3.0 section "3.7 Surrogates"). if (char >= 0xD800 && char <= 0xDBFF/* high surrogate */) { nextChar = string.charCodeAt(i + 1); if (nextChar >= 0xDC00 && nextChar <= 0xDFFF/* low surrogate */) { // Combine the surrogate pair and store it escaped. result += encodeHex((char - 0xD800) * 0x400 + nextChar - 0xDC00 + 0x10000); // Advance index one extra since we already used that char here. i++; continue; } } escapeSeq = ESCAPE_SEQUENCES[char]; result += !escapeSeq && isPrintable(char) ? string[i] : escapeSeq || encodeHex(char); } return result; } function writeFlowSequence(state, level, object) { var _result = '', _tag = state.tag, index, length; for (index = 0, length = object.length; index < length; index += 1) { // Write only valid elements. if (writeNode(state, level, object[index], false, false)) { if (index !== 0) _result += ',' + (!state.condenseFlow ? ' ' : ''); _result += state.dump; } } state.tag = _tag; state.dump = '[' + _result + ']'; } function writeBlockSequence(state, level, object, compact) { var _result = '', _tag = state.tag, index, length; for (index = 0, length = object.length; index < length; index += 1) { // Write only valid elements. if (writeNode(state, level + 1, object[index], true, true)) { if (!compact || index !== 0) { _result += generateNextLine(state, level); } if (state.dump && CHAR_LINE_FEED === state.dump.charCodeAt(0)) { _result += '-'; } else { _result += '- '; } _result += state.dump; } } state.tag = _tag; state.dump = _result || '[]'; // Empty sequence if no valid values. } function writeFlowMapping(state, level, object) { var _result = '', _tag = state.tag, objectKeyList = Object.keys(object), index, length, objectKey, objectValue, pairBuffer; for (index = 0, length = objectKeyList.length; index < length; index += 1) { pairBuffer = ''; if (index !== 0) pairBuffer += ', '; if (state.condenseFlow) pairBuffer += '"'; objectKey = objectKeyList[index]; objectValue = object[objectKey]; if (!writeNode(state, level, objectKey, false, false)) { continue; // Skip this pair because of invalid key; } if (state.dump.length > 1024) pairBuffer += '? '; pairBuffer += state.dump + (state.condenseFlow ? '"' : '') + ':' + (state.condenseFlow ? '' : ' '); if (!writeNode(state, level, objectValue, false, false)) { continue; // Skip this pair because of invalid value. } pairBuffer += state.dump; // Both key and value are valid. _result += pairBuffer; } state.tag = _tag; state.dump = '{' + _result + '}'; } function writeBlockMapping(state, level, object, compact) { var _result = '', _tag = state.tag, objectKeyList = Object.keys(object), index, length, objectKey, objectValue, explicitPair, pairBuffer; // Allow sorting keys so that the output file is deterministic if (state.sortKeys === true) { // Default sorting objectKeyList.sort(); } else if (typeof state.sortKeys === 'function') { // Custom sort function objectKeyList.sort(state.sortKeys); } else if (state.sortKeys) { // Something is wrong throw new YAMLException('sortKeys must be a boolean or a function'); } for (index = 0, length = objectKeyList.length; index < length; index += 1) { pairBuffer = ''; if (!compact || index !== 0) { pairBuffer += generateNextLine(state, level); } objectKey = objectKeyList[index]; objectValue = object[objectKey]; if (!writeNode(state, level + 1, objectKey, true, true, true)) { continue; // Skip this pair because of invalid key. } explicitPair = (state.tag !== null && state.tag !== '?') || (state.dump && state.dump.length > 1024); if (explicitPair) { if (state.dump && CHAR_LINE_FEED === state.dump.charCodeAt(0)) { pairBuffer += '?'; } else { pairBuffer += '? '; } } pairBuffer += state.dump; if (explicitPair) { pairBuffer += generateNextLine(state, level); } if (!writeNode(state, level + 1, objectValue, true, explicitPair)) { continue; // Skip this pair because of invalid value. } if (state.dump && CHAR_LINE_FEED === state.dump.charCodeAt(0)) { pairBuffer += ':'; } else { pairBuffer += ': '; } pairBuffer += state.dump; // Both key and value are valid. _result += pairBuffer; } state.tag = _tag; state.dump = _result || '{}'; // Empty mapping if no valid pairs. } function detectType(state, object, explicit) { var _result, typeList, index, length, type, style; typeList = explicit ? state.explicitTypes : state.implicitTypes; for (index = 0, length = typeList.length; index < length; index += 1) { type = typeList[index]; if ((type.instanceOf || type.predicate) && (!type.instanceOf || ((typeof object === 'object') && (object instanceof type.instanceOf))) && (!type.predicate || type.predicate(object))) { state.tag = explicit ? type.tag : '?'; if (type.represent) { style = state.styleMap[type.tag] || type.defaultStyle; if (_toString.call(type.represent) === '[object Function]') { _result = type.represent(object, style); } else if (_hasOwnProperty.call(type.represent, style)) { _result = type.represent[style](object, style); } else { throw new YAMLException('!<' + type.tag + '> tag resolver accepts not "' + style + '" style'); } state.dump = _result; } return true; } } return false; } // Serializes `object` and writes it to global `result`. // Returns true on success, or false on invalid object. // function writeNode(state, level, object, block, compact, iskey) { state.tag = null; state.dump = object; if (!detectType(state, object, false)) { detectType(state, object, true); } var type = _toString.call(state.dump); if (block) { block = (state.flowLevel < 0 || state.flowLevel > level); } var objectOrArray = type === '[object Object]' || type === '[object Array]', duplicateIndex, duplicate; if (objectOrArray) { duplicateIndex = state.duplicates.indexOf(object); duplicate = duplicateIndex !== -1; } if ((state.tag !== null && state.tag !== '?') || duplicate || (state.indent !== 2 && level > 0)) { compact = false; } if (duplicate && state.usedDuplicates[duplicateIndex]) { state.dump = '*ref_' + duplicateIndex; } else { if (objectOrArray && duplicate && !state.usedDuplicates[duplicateIndex]) { state.usedDuplicates[duplicateIndex] = true; } if (type === '[object Object]') { if (block && (Object.keys(state.dump).length !== 0)) { writeBlockMapping(state, level, state.dump, compact); if (duplicate) { state.dump = '&ref_' + duplicateIndex + state.dump; } } else { writeFlowMapping(state, level, state.dump); if (duplicate) { state.dump = '&ref_' + duplicateIndex + ' ' + state.dump; } } } else if (type === '[object Array]') { var arrayLevel = (state.noArrayIndent && (level > 0)) ? level - 1 : level; if (block && (state.dump.length !== 0)) { writeBlockSequence(state, arrayLevel, state.dump, compact); if (duplicate) { state.dump = '&ref_' + duplicateIndex + state.dump; } } else { writeFlowSequence(state, arrayLevel, state.dump); if (duplicate) { state.dump = '&ref_' + duplicateIndex + ' ' + state.dump; } } } else if (type === '[object String]') { if (state.tag !== '?') { writeScalar(state, state.dump, level, iskey); } } else { if (state.skipInvalid) return false; throw new YAMLException('unacceptable kind of an object to dump ' + type); } if (state.tag !== null && state.tag !== '?') { state.dump = '!<' + state.tag + '> ' + state.dump; } } return true; } function getDuplicateReferences(object, state) { var objects = [], duplicatesIndexes = [], index, length; inspectNode(object, objects, duplicatesIndexes); for (index = 0, length = duplicatesIndexes.length; index < length; index += 1) { state.duplicates.push(objects[duplicatesIndexes[index]]); } state.usedDuplicates = new Array(length); } function inspectNode(object, objects, duplicatesIndexes) { var objectKeyList, index, length; if (object !== null && typeof object === 'object') { index = objects.indexOf(object); if (index !== -1) { if (duplicatesIndexes.indexOf(index) === -1) { duplicatesIndexes.push(index); } } else { objects.push(object); if (Array.isArray(object)) { for (index = 0, length = object.length; index < length; index += 1) { inspectNode(object[index], objects, duplicatesIndexes); } } else { objectKeyList = Object.keys(object); for (index = 0, length = objectKeyList.length; index < length; index += 1) { inspectNode(object[objectKeyList[index]], objects, duplicatesIndexes); } } } } } function dump(input, options) { options = options || {}; var state = new State(options); if (!state.noRefs) getDuplicateReferences(input, state); if (writeNode(state, 0, input, true, true)) return state.dump + '\n'; return ''; } function safeDump(input, options) { return dump(input, common.extend({ schema: DEFAULT_SAFE_SCHEMA }, options)); } module.exports.dump = dump; module.exports.safeDump = safeDump; /***/ }), /***/ 65199: /***/ ((module) => { "use strict"; // YAML error class. http://stackoverflow.com/questions/8458984 // function YAMLException(reason, mark) { // Super constructor Error.call(this); this.name = 'YAMLException'; this.reason = reason; this.mark = mark; this.message = (this.reason || '(unknown reason)') + (this.mark ? ' ' + this.mark.toString() : ''); // Include stack trace in error object if (Error.captureStackTrace) { // Chrome and NodeJS Error.captureStackTrace(this, this.constructor); } else { // FF, IE 10+ and Safari 6+. Fallback for others this.stack = (new Error()).stack || ''; } } // Inherit from Error YAMLException.prototype = Object.create(Error.prototype); YAMLException.prototype.constructor = YAMLException; YAMLException.prototype.toString = function toString(compact) { var result = this.name + ': '; result += this.reason || '(unknown reason)'; if (!compact && this.mark) { result += ' ' + this.mark.toString(); } return result; }; module.exports = YAMLException; /***/ }), /***/ 45190: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; /*eslint-disable max-len,no-use-before-define*/ var common = __webpack_require__(59136); var YAMLException = __webpack_require__(65199); var Mark = __webpack_require__(55426); var DEFAULT_SAFE_SCHEMA = __webpack_require__(48949); var DEFAULT_FULL_SCHEMA = __webpack_require__(56874); var _hasOwnProperty = Object.prototype.hasOwnProperty; var CONTEXT_FLOW_IN = 1; var CONTEXT_FLOW_OUT = 2; var CONTEXT_BLOCK_IN = 3; var CONTEXT_BLOCK_OUT = 4; var CHOMPING_CLIP = 1; var CHOMPING_STRIP = 2; var CHOMPING_KEEP = 3; var PATTERN_NON_PRINTABLE = /[\x00-\x08\x0B\x0C\x0E-\x1F\x7F-\x84\x86-\x9F\uFFFE\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/; var PATTERN_NON_ASCII_LINE_BREAKS = /[\x85\u2028\u2029]/; var PATTERN_FLOW_INDICATORS = /[,\[\]\{\}]/; var PATTERN_TAG_HANDLE = /^(?:!|!!|![a-z\-]+!)$/i; var PATTERN_TAG_URI = /^(?:!|[^,\[\]\{\}])(?:%[0-9a-f]{2}|[0-9a-z\-#;\/\?:@&=\+\$,_\.!~\*'\(\)\[\]])*$/i; function _class(obj) { return Object.prototype.toString.call(obj); } function is_EOL(c) { return (c === 0x0A/* LF */) || (c === 0x0D/* CR */); } function is_WHITE_SPACE(c) { return (c === 0x09/* Tab */) || (c === 0x20/* Space */); } function is_WS_OR_EOL(c) { return (c === 0x09/* Tab */) || (c === 0x20/* Space */) || (c === 0x0A/* LF */) || (c === 0x0D/* CR */); } function is_FLOW_INDICATOR(c) { return c === 0x2C/* , */ || c === 0x5B/* [ */ || c === 0x5D/* ] */ || c === 0x7B/* { */ || c === 0x7D/* } */; } function fromHexCode(c) { var lc; if ((0x30/* 0 */ <= c) && (c <= 0x39/* 9 */)) { return c - 0x30; } /*eslint-disable no-bitwise*/ lc = c | 0x20; if ((0x61/* a */ <= lc) && (lc <= 0x66/* f */)) { return lc - 0x61 + 10; } return -1; } function escapedHexLen(c) { if (c === 0x78/* x */) { return 2; } if (c === 0x75/* u */) { return 4; } if (c === 0x55/* U */) { return 8; } return 0; } function fromDecimalCode(c) { if ((0x30/* 0 */ <= c) && (c <= 0x39/* 9 */)) { return c - 0x30; } return -1; } function simpleEscapeSequence(c) { /* eslint-disable indent */ return (c === 0x30/* 0 */) ? '\x00' : (c === 0x61/* a */) ? '\x07' : (c === 0x62/* b */) ? '\x08' : (c === 0x74/* t */) ? '\x09' : (c === 0x09/* Tab */) ? '\x09' : (c === 0x6E/* n */) ? '\x0A' : (c === 0x76/* v */) ? '\x0B' : (c === 0x66/* f */) ? '\x0C' : (c === 0x72/* r */) ? '\x0D' : (c === 0x65/* e */) ? '\x1B' : (c === 0x20/* Space */) ? ' ' : (c === 0x22/* " */) ? '\x22' : (c === 0x2F/* / */) ? '/' : (c === 0x5C/* \ */) ? '\x5C' : (c === 0x4E/* N */) ? '\x85' : (c === 0x5F/* _ */) ? '\xA0' : (c === 0x4C/* L */) ? '\u2028' : (c === 0x50/* P */) ? '\u2029' : ''; } function charFromCodepoint(c) { if (c <= 0xFFFF) { return String.fromCharCode(c); } // Encode UTF-16 surrogate pair // https://en.wikipedia.org/wiki/UTF-16#Code_points_U.2B010000_to_U.2B10FFFF return String.fromCharCode( ((c - 0x010000) >> 10) + 0xD800, ((c - 0x010000) & 0x03FF) + 0xDC00 ); } var simpleEscapeCheck = new Array(256); // integer, for fast access var simpleEscapeMap = new Array(256); for (var i = 0; i < 256; i++) { simpleEscapeCheck[i] = simpleEscapeSequence(i) ? 1 : 0; simpleEscapeMap[i] = simpleEscapeSequence(i); } function State(input, options) { this.input = input; this.filename = options['filename'] || null; this.schema = options['schema'] || DEFAULT_FULL_SCHEMA; this.onWarning = options['onWarning'] || null; this.legacy = options['legacy'] || false; this.json = options['json'] || false; this.listener = options['listener'] || null; this.implicitTypes = this.schema.compiledImplicit; this.typeMap = this.schema.compiledTypeMap; this.length = input.length; this.position = 0; this.line = 0; this.lineStart = 0; this.lineIndent = 0; this.documents = []; /* this.version; this.checkLineBreaks; this.tagMap; this.anchorMap; this.tag; this.anchor; this.kind; this.result;*/ } function generateError(state, message) { return new YAMLException( message, new Mark(state.filename, state.input, state.position, state.line, (state.position - state.lineStart))); } function throwError(state, message) { throw generateError(state, message); } function throwWarning(state, message) { if (state.onWarning) { state.onWarning.call(null, generateError(state, message)); } } var directiveHandlers = { YAML: function handleYamlDirective(state, name, args) { var match, major, minor; if (state.version !== null) { throwError(state, 'duplication of %YAML directive'); } if (args.length !== 1) { throwError(state, 'YAML directive accepts exactly one argument'); } match = /^([0-9]+)\.([0-9]+)$/.exec(args[0]); if (match === null) { throwError(state, 'ill-formed argument of the YAML directive'); } major = parseInt(match[1], 10); minor = parseInt(match[2], 10); if (major !== 1) { throwError(state, 'unacceptable YAML version of the document'); } state.version = args[0]; state.checkLineBreaks = (minor < 2); if (minor !== 1 && minor !== 2) { throwWarning(state, 'unsupported YAML version of the document'); } }, TAG: function handleTagDirective(state, name, args) { var handle, prefix; if (args.length !== 2) { throwError(state, 'TAG directive accepts exactly two arguments'); } handle = args[0]; prefix = args[1]; if (!PATTERN_TAG_HANDLE.test(handle)) { throwError(state, 'ill-formed tag handle (first argument) of the TAG directive'); } if (_hasOwnProperty.call(state.tagMap, handle)) { throwError(state, 'there is a previously declared suffix for "' + handle + '" tag handle'); } if (!PATTERN_TAG_URI.test(prefix)) { throwError(state, 'ill-formed tag prefix (second argument) of the TAG directive'); } state.tagMap[handle] = prefix; } }; function captureSegment(state, start, end, checkJson) { var _position, _length, _character, _result; if (start < end) { _result = state.input.slice(start, end); if (checkJson) { for (_position = 0, _length = _result.length; _position < _length; _position += 1) { _character = _result.charCodeAt(_position); if (!(_character === 0x09 || (0x20 <= _character && _character <= 0x10FFFF))) { throwError(state, 'expected valid JSON character'); } } } else if (PATTERN_NON_PRINTABLE.test(_result)) { throwError(state, 'the stream contains non-printable characters'); } state.result += _result; } } function mergeMappings(state, destination, source, overridableKeys) { var sourceKeys, key, index, quantity; if (!common.isObject(source)) { throwError(state, 'cannot merge mappings; the provided source object is unacceptable'); } sourceKeys = Object.keys(source); for (index = 0, quantity = sourceKeys.length; index < quantity; index += 1) { key = sourceKeys[index]; if (!_hasOwnProperty.call(destination, key)) { destination[key] = source[key]; overridableKeys[key] = true; } } } function storeMappingPair(state, _result, overridableKeys, keyTag, keyNode, valueNode, startLine, startPos) { var index, quantity; // The output is a plain object here, so keys can only be strings. // We need to convert keyNode to a string, but doing so can hang the process // (deeply nested arrays that explode exponentially using aliases). if (Array.isArray(keyNode)) { keyNode = Array.prototype.slice.call(keyNode); for (index = 0, quantity = keyNode.length; index < quantity; index += 1) { if (Array.isArray(keyNode[index])) { throwError(state, 'nested arrays are not supported inside keys'); } if (typeof keyNode === 'object' && _class(keyNode[index]) === '[object Object]') { keyNode[index] = '[object Object]'; } } } // Avoid code execution in load() via toString property // (still use its own toString for arrays, timestamps, // and whatever user schema extensions happen to have @@toStringTag) if (typeof keyNode === 'object' && _class(keyNode) === '[object Object]') { keyNode = '[object Object]'; } keyNode = String(keyNode); if (_result === null) { _result = {}; } if (keyTag === 'tag:yaml.org,2002:merge') { if (Array.isArray(valueNode)) { for (index = 0, quantity = valueNode.length; index < quantity; index += 1) { mergeMappings(state, _result, valueNode[index], overridableKeys); } } else { mergeMappings(state, _result, valueNode, overridableKeys); } } else { if (!state.json && !_hasOwnProperty.call(overridableKeys, keyNode) && _hasOwnProperty.call(_result, keyNode)) { state.line = startLine || state.line; state.position = startPos || state.position; throwError(state, 'duplicated mapping key'); } _result[keyNode] = valueNode; delete overridableKeys[keyNode]; } return _result; } function readLineBreak(state) { var ch; ch = state.input.charCodeAt(state.position); if (ch === 0x0A/* LF */) { state.position++; } else if (ch === 0x0D/* CR */) { state.position++; if (state.input.charCodeAt(state.position) === 0x0A/* LF */) { state.position++; } } else { throwError(state, 'a line break is expected'); } state.line += 1; state.lineStart = state.position; } function skipSeparationSpace(state, allowComments, checkIndent) { var lineBreaks = 0, ch = state.input.charCodeAt(state.position); while (ch !== 0) { while (is_WHITE_SPACE(ch)) { ch = state.input.charCodeAt(++state.position); } if (allowComments && ch === 0x23/* # */) { do { ch = state.input.charCodeAt(++state.position); } while (ch !== 0x0A/* LF */ && ch !== 0x0D/* CR */ && ch !== 0); } if (is_EOL(ch)) { readLineBreak(state); ch = state.input.charCodeAt(state.position); lineBreaks++; state.lineIndent = 0; while (ch === 0x20/* Space */) { state.lineIndent++; ch = state.input.charCodeAt(++state.position); } } else { break; } } if (checkIndent !== -1 && lineBreaks !== 0 && state.lineIndent < checkIndent) { throwWarning(state, 'deficient indentation'); } return lineBreaks; } function testDocumentSeparator(state) { var _position = state.position, ch; ch = state.input.charCodeAt(_position); // Condition state.position === state.lineStart is tested // in parent on each call, for efficiency. No needs to test here again. if ((ch === 0x2D/* - */ || ch === 0x2E/* . */) && ch === state.input.charCodeAt(_position + 1) && ch === state.input.charCodeAt(_position + 2)) { _position += 3; ch = state.input.charCodeAt(_position); if (ch === 0 || is_WS_OR_EOL(ch)) { return true; } } return false; } function writeFoldedLines(state, count) { if (count === 1) { state.result += ' '; } else if (count > 1) { state.result += common.repeat('\n', count - 1); } } function readPlainScalar(state, nodeIndent, withinFlowCollection) { var preceding, following, captureStart, captureEnd, hasPendingContent, _line, _lineStart, _lineIndent, _kind = state.kind, _result = state.result, ch; ch = state.input.charCodeAt(state.position); if (is_WS_OR_EOL(ch) || is_FLOW_INDICATOR(ch) || ch === 0x23/* # */ || ch === 0x26/* & */ || ch === 0x2A/* * */ || ch === 0x21/* ! */ || ch === 0x7C/* | */ || ch === 0x3E/* > */ || ch === 0x27/* ' */ || ch === 0x22/* " */ || ch === 0x25/* % */ || ch === 0x40/* @ */ || ch === 0x60/* ` */) { return false; } if (ch === 0x3F/* ? */ || ch === 0x2D/* - */) { following = state.input.charCodeAt(state.position + 1); if (is_WS_OR_EOL(following) || withinFlowCollection && is_FLOW_INDICATOR(following)) { return false; } } state.kind = 'scalar'; state.result = ''; captureStart = captureEnd = state.position; hasPendingContent = false; while (ch !== 0) { if (ch === 0x3A/* : */) { following = state.input.charCodeAt(state.position + 1); if (is_WS_OR_EOL(following) || withinFlowCollection && is_FLOW_INDICATOR(following)) { break; } } else if (ch === 0x23/* # */) { preceding = state.input.charCodeAt(state.position - 1); if (is_WS_OR_EOL(preceding)) { break; } } else if ((state.position === state.lineStart && testDocumentSeparator(state)) || withinFlowCollection && is_FLOW_INDICATOR(ch)) { break; } else if (is_EOL(ch)) { _line = state.line; _lineStart = state.lineStart; _lineIndent = state.lineIndent; skipSeparationSpace(state, false, -1); if (state.lineIndent >= nodeIndent) { hasPendingContent = true; ch = state.input.charCodeAt(state.position); continue; } else { state.position = captureEnd; state.line = _line; state.lineStart = _lineStart; state.lineIndent = _lineIndent; break; } } if (hasPendingContent) { captureSegment(state, captureStart, captureEnd, false); writeFoldedLines(state, state.line - _line); captureStart = captureEnd = state.position; hasPendingContent = false; } if (!is_WHITE_SPACE(ch)) { captureEnd = state.position + 1; } ch = state.input.charCodeAt(++state.position); } captureSegment(state, captureStart, captureEnd, false); if (state.result) { return true; } state.kind = _kind; state.result = _result; return false; } function readSingleQuotedScalar(state, nodeIndent) { var ch, captureStart, captureEnd; ch = state.input.charCodeAt(state.position); if (ch !== 0x27/* ' */) { return false; } state.kind = 'scalar'; state.result = ''; state.position++; captureStart = captureEnd = state.position; while ((ch = state.input.charCodeAt(state.position)) !== 0) { if (ch === 0x27/* ' */) { captureSegment(state, captureStart, state.position, true); ch = state.input.charCodeAt(++state.position); if (ch === 0x27/* ' */) { captureStart = state.position; state.position++; captureEnd = state.position; } else { return true; } } else if (is_EOL(ch)) { captureSegment(state, captureStart, captureEnd, true); writeFoldedLines(state, skipSeparationSpace(state, false, nodeIndent)); captureStart = captureEnd = state.position; } else if (state.position === state.lineStart && testDocumentSeparator(state)) { throwError(state, 'unexpected end of the document within a single quoted scalar'); } else { state.position++; captureEnd = state.position; } } throwError(state, 'unexpected end of the stream within a single quoted scalar'); } function readDoubleQuotedScalar(state, nodeIndent) { var captureStart, captureEnd, hexLength, hexResult, tmp, ch; ch = state.input.charCodeAt(state.position); if (ch !== 0x22/* " */) { return false; } state.kind = 'scalar'; state.result = ''; state.position++; captureStart = captureEnd = state.position; while ((ch = state.input.charCodeAt(state.position)) !== 0) { if (ch === 0x22/* " */) { captureSegment(state, captureStart, state.position, true); state.position++; return true; } else if (ch === 0x5C/* \ */) { captureSegment(state, captureStart, state.position, true); ch = state.input.charCodeAt(++state.position); if (is_EOL(ch)) { skipSeparationSpace(state, false, nodeIndent); // TODO: rework to inline fn with no type cast? } else if (ch < 256 && simpleEscapeCheck[ch]) { state.result += simpleEscapeMap[ch]; state.position++; } else if ((tmp = escapedHexLen(ch)) > 0) { hexLength = tmp; hexResult = 0; for (; hexLength > 0; hexLength--) { ch = state.input.charCodeAt(++state.position); if ((tmp = fromHexCode(ch)) >= 0) { hexResult = (hexResult << 4) + tmp; } else { throwError(state, 'expected hexadecimal character'); } } state.result += charFromCodepoint(hexResult); state.position++; } else { throwError(state, 'unknown escape sequence'); } captureStart = captureEnd = state.position; } else if (is_EOL(ch)) { captureSegment(state, captureStart, captureEnd, true); writeFoldedLines(state, skipSeparationSpace(state, false, nodeIndent)); captureStart = captureEnd = state.position; } else if (state.position === state.lineStart && testDocumentSeparator(state)) { throwError(state, 'unexpected end of the document within a double quoted scalar'); } else { state.position++; captureEnd = state.position; } } throwError(state, 'unexpected end of the stream within a double quoted scalar'); } function readFlowCollection(state, nodeIndent) { var readNext = true, _line, _tag = state.tag, _result, _anchor = state.anchor, following, terminator, isPair, isExplicitPair, isMapping, overridableKeys = {}, keyNode, keyTag, valueNode, ch; ch = state.input.charCodeAt(state.position); if (ch === 0x5B/* [ */) { terminator = 0x5D;/* ] */ isMapping = false; _result = []; } else if (ch === 0x7B/* { */) { terminator = 0x7D;/* } */ isMapping = true; _result = {}; } else { return false; } if (state.anchor !== null) { state.anchorMap[state.anchor] = _result; } ch = state.input.charCodeAt(++state.position); while (ch !== 0) { skipSeparationSpace(state, true, nodeIndent); ch = state.input.charCodeAt(state.position); if (ch === terminator) { state.position++; state.tag = _tag; state.anchor = _anchor; state.kind = isMapping ? 'mapping' : 'sequence'; state.result = _result; return true; } else if (!readNext) { throwError(state, 'missed comma between flow collection entries'); } keyTag = keyNode = valueNode = null; isPair = isExplicitPair = false; if (ch === 0x3F/* ? */) { following = state.input.charCodeAt(state.position + 1); if (is_WS_OR_EOL(following)) { isPair = isExplicitPair = true; state.position++; skipSeparationSpace(state, true, nodeIndent); } } _line = state.line; composeNode(state, nodeIndent, CONTEXT_FLOW_IN, false, true); keyTag = state.tag; keyNode = state.result; skipSeparationSpace(state, true, nodeIndent); ch = state.input.charCodeAt(state.position); if ((isExplicitPair || state.line === _line) && ch === 0x3A/* : */) { isPair = true; ch = state.input.charCodeAt(++state.position); skipSeparationSpace(state, true, nodeIndent); composeNode(state, nodeIndent, CONTEXT_FLOW_IN, false, true); valueNode = state.result; } if (isMapping) { storeMappingPair(state, _result, overridableKeys, keyTag, keyNode, valueNode); } else if (isPair) { _result.push(storeMappingPair(state, null, overridableKeys, keyTag, keyNode, valueNode)); } else { _result.push(keyNode); } skipSeparationSpace(state, true, nodeIndent); ch = state.input.charCodeAt(state.position); if (ch === 0x2C/* , */) { readNext = true; ch = state.input.charCodeAt(++state.position); } else { readNext = false; } } throwError(state, 'unexpected end of the stream within a flow collection'); } function readBlockScalar(state, nodeIndent) { var captureStart, folding, chomping = CHOMPING_CLIP, didReadContent = false, detectedIndent = false, textIndent = nodeIndent, emptyLines = 0, atMoreIndented = false, tmp, ch; ch = state.input.charCodeAt(state.position); if (ch === 0x7C/* | */) { folding = false; } else if (ch === 0x3E/* > */) { folding = true; } else { return false; } state.kind = 'scalar'; state.result = ''; while (ch !== 0) { ch = state.input.charCodeAt(++state.position); if (ch === 0x2B/* + */ || ch === 0x2D/* - */) { if (CHOMPING_CLIP === chomping) { chomping = (ch === 0x2B/* + */) ? CHOMPING_KEEP : CHOMPING_STRIP; } else { throwError(state, 'repeat of a chomping mode identifier'); } } else if ((tmp = fromDecimalCode(ch)) >= 0) { if (tmp === 0) { throwError(state, 'bad explicit indentation width of a block scalar; it cannot be less than one'); } else if (!detectedIndent) { textIndent = nodeIndent + tmp - 1; detectedIndent = true; } else { throwError(state, 'repeat of an indentation width identifier'); } } else { break; } } if (is_WHITE_SPACE(ch)) { do { ch = state.input.charCodeAt(++state.position); } while (is_WHITE_SPACE(ch)); if (ch === 0x23/* # */) { do { ch = state.input.charCodeAt(++state.position); } while (!is_EOL(ch) && (ch !== 0)); } } while (ch !== 0) { readLineBreak(state); state.lineIndent = 0; ch = state.input.charCodeAt(state.position); while ((!detectedIndent || state.lineIndent < textIndent) && (ch === 0x20/* Space */)) { state.lineIndent++; ch = state.input.charCodeAt(++state.position); } if (!detectedIndent && state.lineIndent > textIndent) { textIndent = state.lineIndent; } if (is_EOL(ch)) { emptyLines++; continue; } // End of the scalar. if (state.lineIndent < textIndent) { // Perform the chomping. if (chomping === CHOMPING_KEEP) { state.result += common.repeat('\n', didReadContent ? 1 + emptyLines : emptyLines); } else if (chomping === CHOMPING_CLIP) { if (didReadContent) { // i.e. only if the scalar is not empty. state.result += '\n'; } } // Break this `while` cycle and go to the funciton's epilogue. break; } // Folded style: use fancy rules to handle line breaks. if (folding) { // Lines starting with white space characters (more-indented lines) are not folded. if (is_WHITE_SPACE(ch)) { atMoreIndented = true; // except for the first content line (cf. Example 8.1) state.result += common.repeat('\n', didReadContent ? 1 + emptyLines : emptyLines); // End of more-indented block. } else if (atMoreIndented) { atMoreIndented = false; state.result += common.repeat('\n', emptyLines + 1); // Just one line break - perceive as the same line. } else if (emptyLines === 0) { if (didReadContent) { // i.e. only if we have already read some scalar content. state.result += ' '; } // Several line breaks - perceive as different lines. } else { state.result += common.repeat('\n', emptyLines); } // Literal style: just add exact number of line breaks between content lines. } else { // Keep all line breaks except the header line break. state.result += common.repeat('\n', didReadContent ? 1 + emptyLines : emptyLines); } didReadContent = true; detectedIndent = true; emptyLines = 0; captureStart = state.position; while (!is_EOL(ch) && (ch !== 0)) { ch = state.input.charCodeAt(++state.position); } captureSegment(state, captureStart, state.position, false); } return true; } function readBlockSequence(state, nodeIndent) { var _line, _tag = state.tag, _anchor = state.anchor, _result = [], following, detected = false, ch; if (state.anchor !== null) { state.anchorMap[state.anchor] = _result; } ch = state.input.charCodeAt(state.position); while (ch !== 0) { if (ch !== 0x2D/* - */) { break; } following = state.input.charCodeAt(state.position + 1); if (!is_WS_OR_EOL(following)) { break; } detected = true; state.position++; if (skipSeparationSpace(state, true, -1)) { if (state.lineIndent <= nodeIndent) { _result.push(null); ch = state.input.charCodeAt(state.position); continue; } } _line = state.line; composeNode(state, nodeIndent, CONTEXT_BLOCK_IN, false, true); _result.push(state.result); skipSeparationSpace(state, true, -1); ch = state.input.charCodeAt(state.position); if ((state.line === _line || state.lineIndent > nodeIndent) && (ch !== 0)) { throwError(state, 'bad indentation of a sequence entry'); } else if (state.lineIndent < nodeIndent) { break; } } if (detected) { state.tag = _tag; state.anchor = _anchor; state.kind = 'sequence'; state.result = _result; return true; } return false; } function readBlockMapping(state, nodeIndent, flowIndent) { var following, allowCompact, _line, _pos, _tag = state.tag, _anchor = state.anchor, _result = {}, overridableKeys = {}, keyTag = null, keyNode = null, valueNode = null, atExplicitKey = false, detected = false, ch; if (state.anchor !== null) { state.anchorMap[state.anchor] = _result; } ch = state.input.charCodeAt(state.position); while (ch !== 0) { following = state.input.charCodeAt(state.position + 1); _line = state.line; // Save the current line. _pos = state.position; // // Explicit notation case. There are two separate blocks: // first for the key (denoted by "?") and second for the value (denoted by ":") // if ((ch === 0x3F/* ? */ || ch === 0x3A/* : */) && is_WS_OR_EOL(following)) { if (ch === 0x3F/* ? */) { if (atExplicitKey) { storeMappingPair(state, _result, overridableKeys, keyTag, keyNode, null); keyTag = keyNode = valueNode = null; } detected = true; atExplicitKey = true; allowCompact = true; } else if (atExplicitKey) { // i.e. 0x3A/* : */ === character after the explicit key. atExplicitKey = false; allowCompact = true; } else { throwError(state, 'incomplete explicit mapping pair; a key node is missed; or followed by a non-tabulated empty line'); } state.position += 1; ch = following; // // Implicit notation case. Flow-style node as the key first, then ":", and the value. // } else if (composeNode(state, flowIndent, CONTEXT_FLOW_OUT, false, true)) { if (state.line === _line) { ch = state.input.charCodeAt(state.position); while (is_WHITE_SPACE(ch)) { ch = state.input.charCodeAt(++state.position); } if (ch === 0x3A/* : */) { ch = state.input.charCodeAt(++state.position); if (!is_WS_OR_EOL(ch)) { throwError(state, 'a whitespace character is expected after the key-value separator within a block mapping'); } if (atExplicitKey) { storeMappingPair(state, _result, overridableKeys, keyTag, keyNode, null); keyTag = keyNode = valueNode = null; } detected = true; atExplicitKey = false; allowCompact = false; keyTag = state.tag; keyNode = state.result; } else if (detected) { throwError(state, 'can not read an implicit mapping pair; a colon is missed'); } else { state.tag = _tag; state.anchor = _anchor; return true; // Keep the result of `composeNode`. } } else if (detected) { throwError(state, 'can not read a block mapping entry; a multiline key may not be an implicit key'); } else { state.tag = _tag; state.anchor = _anchor; return true; // Keep the result of `composeNode`. } } else { break; // Reading is done. Go to the epilogue. } // // Common reading code for both explicit and implicit notations. // if (state.line === _line || state.lineIndent > nodeIndent) { if (composeNode(state, nodeIndent, CONTEXT_BLOCK_OUT, true, allowCompact)) { if (atExplicitKey) { keyNode = state.result; } else { valueNode = state.result; } } if (!atExplicitKey) { storeMappingPair(state, _result, overridableKeys, keyTag, keyNode, valueNode, _line, _pos); keyTag = keyNode = valueNode = null; } skipSeparationSpace(state, true, -1); ch = state.input.charCodeAt(state.position); } if (state.lineIndent > nodeIndent && (ch !== 0)) { throwError(state, 'bad indentation of a mapping entry'); } else if (state.lineIndent < nodeIndent) { break; } } // // Epilogue. // // Special case: last mapping's node contains only the key in explicit notation. if (atExplicitKey) { storeMappingPair(state, _result, overridableKeys, keyTag, keyNode, null); } // Expose the resulting mapping. if (detected) { state.tag = _tag; state.anchor = _anchor; state.kind = 'mapping'; state.result = _result; } return detected; } function readTagProperty(state) { var _position, isVerbatim = false, isNamed = false, tagHandle, tagName, ch; ch = state.input.charCodeAt(state.position); if (ch !== 0x21/* ! */) return false; if (state.tag !== null) { throwError(state, 'duplication of a tag property'); } ch = state.input.charCodeAt(++state.position); if (ch === 0x3C/* < */) { isVerbatim = true; ch = state.input.charCodeAt(++state.position); } else if (ch === 0x21/* ! */) { isNamed = true; tagHandle = '!!'; ch = state.input.charCodeAt(++state.position); } else { tagHandle = '!'; } _position = state.position; if (isVerbatim) { do { ch = state.input.charCodeAt(++state.position); } while (ch !== 0 && ch !== 0x3E/* > */); if (state.position < state.length) { tagName = state.input.slice(_position, state.position); ch = state.input.charCodeAt(++state.position); } else { throwError(state, 'unexpected end of the stream within a verbatim tag'); } } else { while (ch !== 0 && !is_WS_OR_EOL(ch)) { if (ch === 0x21/* ! */) { if (!isNamed) { tagHandle = state.input.slice(_position - 1, state.position + 1); if (!PATTERN_TAG_HANDLE.test(tagHandle)) { throwError(state, 'named tag handle cannot contain such characters'); } isNamed = true; _position = state.position + 1; } else { throwError(state, 'tag suffix cannot contain exclamation marks'); } } ch = state.input.charCodeAt(++state.position); } tagName = state.input.slice(_position, state.position); if (PATTERN_FLOW_INDICATORS.test(tagName)) { throwError(state, 'tag suffix cannot contain flow indicator characters'); } } if (tagName && !PATTERN_TAG_URI.test(tagName)) { throwError(state, 'tag name cannot contain such characters: ' + tagName); } if (isVerbatim) { state.tag = tagName; } else if (_hasOwnProperty.call(state.tagMap, tagHandle)) { state.tag = state.tagMap[tagHandle] + tagName; } else if (tagHandle === '!') { state.tag = '!' + tagName; } else if (tagHandle === '!!') { state.tag = 'tag:yaml.org,2002:' + tagName; } else { throwError(state, 'undeclared tag handle "' + tagHandle + '"'); } return true; } function readAnchorProperty(state) { var _position, ch; ch = state.input.charCodeAt(state.position); if (ch !== 0x26/* & */) return false; if (state.anchor !== null) { throwError(state, 'duplication of an anchor property'); } ch = state.input.charCodeAt(++state.position); _position = state.position; while (ch !== 0 && !is_WS_OR_EOL(ch) && !is_FLOW_INDICATOR(ch)) { ch = state.input.charCodeAt(++state.position); } if (state.position === _position) { throwError(state, 'name of an anchor node must contain at least one character'); } state.anchor = state.input.slice(_position, state.position); return true; } function readAlias(state) { var _position, alias, ch; ch = state.input.charCodeAt(state.position); if (ch !== 0x2A/* * */) return false; ch = state.input.charCodeAt(++state.position); _position = state.position; while (ch !== 0 && !is_WS_OR_EOL(ch) && !is_FLOW_INDICATOR(ch)) { ch = state.input.charCodeAt(++state.position); } if (state.position === _position) { throwError(state, 'name of an alias node must contain at least one character'); } alias = state.input.slice(_position, state.position); if (!_hasOwnProperty.call(state.anchorMap, alias)) { throwError(state, 'unidentified alias "' + alias + '"'); } state.result = state.anchorMap[alias]; skipSeparationSpace(state, true, -1); return true; } function composeNode(state, parentIndent, nodeContext, allowToSeek, allowCompact) { var allowBlockStyles, allowBlockScalars, allowBlockCollections, indentStatus = 1, // 1: this>parent, 0: this=parent, -1: this parentIndent) { indentStatus = 1; } else if (state.lineIndent === parentIndent) { indentStatus = 0; } else if (state.lineIndent < parentIndent) { indentStatus = -1; } } } if (indentStatus === 1) { while (readTagProperty(state) || readAnchorProperty(state)) { if (skipSeparationSpace(state, true, -1)) { atNewLine = true; allowBlockCollections = allowBlockStyles; if (state.lineIndent > parentIndent) { indentStatus = 1; } else if (state.lineIndent === parentIndent) { indentStatus = 0; } else if (state.lineIndent < parentIndent) { indentStatus = -1; } } else { allowBlockCollections = false; } } } if (allowBlockCollections) { allowBlockCollections = atNewLine || allowCompact; } if (indentStatus === 1 || CONTEXT_BLOCK_OUT === nodeContext) { if (CONTEXT_FLOW_IN === nodeContext || CONTEXT_FLOW_OUT === nodeContext) { flowIndent = parentIndent; } else { flowIndent = parentIndent + 1; } blockIndent = state.position - state.lineStart; if (indentStatus === 1) { if (allowBlockCollections && (readBlockSequence(state, blockIndent) || readBlockMapping(state, blockIndent, flowIndent)) || readFlowCollection(state, flowIndent)) { hasContent = true; } else { if ((allowBlockScalars && readBlockScalar(state, flowIndent)) || readSingleQuotedScalar(state, flowIndent) || readDoubleQuotedScalar(state, flowIndent)) { hasContent = true; } else if (readAlias(state)) { hasContent = true; if (state.tag !== null || state.anchor !== null) { throwError(state, 'alias node should not have any properties'); } } else if (readPlainScalar(state, flowIndent, CONTEXT_FLOW_IN === nodeContext)) { hasContent = true; if (state.tag === null) { state.tag = '?'; } } if (state.anchor !== null) { state.anchorMap[state.anchor] = state.result; } } } else if (indentStatus === 0) { // Special case: block sequences are allowed to have same indentation level as the parent. // http://www.yaml.org/spec/1.2/spec.html#id2799784 hasContent = allowBlockCollections && readBlockSequence(state, blockIndent); } } if (state.tag !== null && state.tag !== '!') { if (state.tag === '?') { // Implicit resolving is not allowed for non-scalar types, and '?' // non-specific tag is only automatically assigned to plain scalars. // // We only need to check kind conformity in case user explicitly assigns '?' // tag, for example like this: "! [0]" // if (state.result !== null && state.kind !== 'scalar') { throwError(state, 'unacceptable node kind for ! tag; it should be "scalar", not "' + state.kind + '"'); } for (typeIndex = 0, typeQuantity = state.implicitTypes.length; typeIndex < typeQuantity; typeIndex += 1) { type = state.implicitTypes[typeIndex]; if (type.resolve(state.result)) { // `state.result` updated in resolver if matched state.result = type.construct(state.result); state.tag = type.tag; if (state.anchor !== null) { state.anchorMap[state.anchor] = state.result; } break; } } } else if (_hasOwnProperty.call(state.typeMap[state.kind || 'fallback'], state.tag)) { type = state.typeMap[state.kind || 'fallback'][state.tag]; if (state.result !== null && type.kind !== state.kind) { throwError(state, 'unacceptable node kind for !<' + state.tag + '> tag; it should be "' + type.kind + '", not "' + state.kind + '"'); } if (!type.resolve(state.result)) { // `state.result` updated in resolver if matched throwError(state, 'cannot resolve a node with !<' + state.tag + '> explicit tag'); } else { state.result = type.construct(state.result); if (state.anchor !== null) { state.anchorMap[state.anchor] = state.result; } } } else { throwError(state, 'unknown tag !<' + state.tag + '>'); } } if (state.listener !== null) { state.listener('close', state); } return state.tag !== null || state.anchor !== null || hasContent; } function readDocument(state) { var documentStart = state.position, _position, directiveName, directiveArgs, hasDirectives = false, ch; state.version = null; state.checkLineBreaks = state.legacy; state.tagMap = {}; state.anchorMap = {}; while ((ch = state.input.charCodeAt(state.position)) !== 0) { skipSeparationSpace(state, true, -1); ch = state.input.charCodeAt(state.position); if (state.lineIndent > 0 || ch !== 0x25/* % */) { break; } hasDirectives = true; ch = state.input.charCodeAt(++state.position); _position = state.position; while (ch !== 0 && !is_WS_OR_EOL(ch)) { ch = state.input.charCodeAt(++state.position); } directiveName = state.input.slice(_position, state.position); directiveArgs = []; if (directiveName.length < 1) { throwError(state, 'directive name must not be less than one character in length'); } while (ch !== 0) { while (is_WHITE_SPACE(ch)) { ch = state.input.charCodeAt(++state.position); } if (ch === 0x23/* # */) { do { ch = state.input.charCodeAt(++state.position); } while (ch !== 0 && !is_EOL(ch)); break; } if (is_EOL(ch)) break; _position = state.position; while (ch !== 0 && !is_WS_OR_EOL(ch)) { ch = state.input.charCodeAt(++state.position); } directiveArgs.push(state.input.slice(_position, state.position)); } if (ch !== 0) readLineBreak(state); if (_hasOwnProperty.call(directiveHandlers, directiveName)) { directiveHandlers[directiveName](state, directiveName, directiveArgs); } else { throwWarning(state, 'unknown document directive "' + directiveName + '"'); } } skipSeparationSpace(state, true, -1); if (state.lineIndent === 0 && state.input.charCodeAt(state.position) === 0x2D/* - */ && state.input.charCodeAt(state.position + 1) === 0x2D/* - */ && state.input.charCodeAt(state.position + 2) === 0x2D/* - */) { state.position += 3; skipSeparationSpace(state, true, -1); } else if (hasDirectives) { throwError(state, 'directives end mark is expected'); } composeNode(state, state.lineIndent - 1, CONTEXT_BLOCK_OUT, false, true); skipSeparationSpace(state, true, -1); if (state.checkLineBreaks && PATTERN_NON_ASCII_LINE_BREAKS.test(state.input.slice(documentStart, state.position))) { throwWarning(state, 'non-ASCII line breaks are interpreted as content'); } state.documents.push(state.result); if (state.position === state.lineStart && testDocumentSeparator(state)) { if (state.input.charCodeAt(state.position) === 0x2E/* . */) { state.position += 3; skipSeparationSpace(state, true, -1); } return; } if (state.position < (state.length - 1)) { throwError(state, 'end of the stream or a document separator is expected'); } else { return; } } function loadDocuments(input, options) { input = String(input); options = options || {}; if (input.length !== 0) { // Add tailing `\n` if not exists if (input.charCodeAt(input.length - 1) !== 0x0A/* LF */ && input.charCodeAt(input.length - 1) !== 0x0D/* CR */) { input += '\n'; } // Strip BOM if (input.charCodeAt(0) === 0xFEFF) { input = input.slice(1); } } var state = new State(input, options); var nullpos = input.indexOf('\0'); if (nullpos !== -1) { state.position = nullpos; throwError(state, 'null byte is not allowed in input'); } // Use 0 as string terminator. That significantly simplifies bounds check. state.input += '\0'; while (state.input.charCodeAt(state.position) === 0x20/* Space */) { state.lineIndent += 1; state.position += 1; } while (state.position < (state.length - 1)) { readDocument(state); } return state.documents; } function loadAll(input, iterator, options) { if (iterator !== null && typeof iterator === 'object' && typeof options === 'undefined') { options = iterator; iterator = null; } var documents = loadDocuments(input, options); if (typeof iterator !== 'function') { return documents; } for (var index = 0, length = documents.length; index < length; index += 1) { iterator(documents[index]); } } function load(input, options) { var documents = loadDocuments(input, options); if (documents.length === 0) { /*eslint-disable no-undefined*/ return undefined; } else if (documents.length === 1) { return documents[0]; } throw new YAMLException('expected a single document in the stream, but found more'); } function safeLoadAll(input, iterator, options) { if (typeof iterator === 'object' && iterator !== null && typeof options === 'undefined') { options = iterator; iterator = null; } return loadAll(input, iterator, common.extend({ schema: DEFAULT_SAFE_SCHEMA }, options)); } function safeLoad(input, options) { return load(input, common.extend({ schema: DEFAULT_SAFE_SCHEMA }, options)); } module.exports.loadAll = loadAll; module.exports.load = load; module.exports.safeLoadAll = safeLoadAll; module.exports.safeLoad = safeLoad; /***/ }), /***/ 55426: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; var common = __webpack_require__(59136); function Mark(name, buffer, position, line, column) { this.name = name; this.buffer = buffer; this.position = position; this.line = line; this.column = column; } Mark.prototype.getSnippet = function getSnippet(indent, maxLength) { var head, start, tail, end, snippet; if (!this.buffer) return null; indent = indent || 4; maxLength = maxLength || 75; head = ''; start = this.position; while (start > 0 && '\x00\r\n\x85\u2028\u2029'.indexOf(this.buffer.charAt(start - 1)) === -1) { start -= 1; if (this.position - start > (maxLength / 2 - 1)) { head = ' ... '; start += 5; break; } } tail = ''; end = this.position; while (end < this.buffer.length && '\x00\r\n\x85\u2028\u2029'.indexOf(this.buffer.charAt(end)) === -1) { end += 1; if (end - this.position > (maxLength / 2 - 1)) { tail = ' ... '; end -= 5; break; } } snippet = this.buffer.slice(start, end); return common.repeat(' ', indent) + head + snippet + tail + '\n' + common.repeat(' ', indent + this.position - start + head.length) + '^'; }; Mark.prototype.toString = function toString(compact) { var snippet, where = ''; if (this.name) { where += 'in "' + this.name + '" '; } where += 'at line ' + (this.line + 1) + ', column ' + (this.column + 1); if (!compact) { snippet = this.getSnippet(); if (snippet) { where += ':\n' + snippet; } } return where; }; module.exports = Mark; /***/ }), /***/ 66514: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; /*eslint-disable max-len*/ var common = __webpack_require__(59136); var YAMLException = __webpack_require__(65199); var Type = __webpack_require__(30967); function compileList(schema, name, result) { var exclude = []; schema.include.forEach(function (includedSchema) { result = compileList(includedSchema, name, result); }); schema[name].forEach(function (currentType) { result.forEach(function (previousType, previousIndex) { if (previousType.tag === currentType.tag && previousType.kind === currentType.kind) { exclude.push(previousIndex); } }); result.push(currentType); }); return result.filter(function (type, index) { return exclude.indexOf(index) === -1; }); } function compileMap(/* lists... */) { var result = { scalar: {}, sequence: {}, mapping: {}, fallback: {} }, index, length; function collectType(type) { result[type.kind][type.tag] = result['fallback'][type.tag] = type; } for (index = 0, length = arguments.length; index < length; index += 1) { arguments[index].forEach(collectType); } return result; } function Schema(definition) { this.include = definition.include || []; this.implicit = definition.implicit || []; this.explicit = definition.explicit || []; this.implicit.forEach(function (type) { if (type.loadKind && type.loadKind !== 'scalar') { throw new YAMLException('There is a non-scalar type in the implicit list of a schema. Implicit resolving of such types is not supported.'); } }); this.compiledImplicit = compileList(this, 'implicit', []); this.compiledExplicit = compileList(this, 'explicit', []); this.compiledTypeMap = compileMap(this.compiledImplicit, this.compiledExplicit); } Schema.DEFAULT = null; Schema.create = function createSchema() { var schemas, types; switch (arguments.length) { case 1: schemas = Schema.DEFAULT; types = arguments[0]; break; case 2: schemas = arguments[0]; types = arguments[1]; break; default: throw new YAMLException('Wrong number of arguments for Schema.create function'); } schemas = common.toArray(schemas); types = common.toArray(types); if (!schemas.every(function (schema) { return schema instanceof Schema; })) { throw new YAMLException('Specified list of super schemas (or a single Schema object) contains a non-Schema object.'); } if (!types.every(function (type) { return type instanceof Type; })) { throw new YAMLException('Specified list of YAML types (or a single Type object) contains a non-Type object.'); } return new Schema({ include: schemas, explicit: types }); }; module.exports = Schema; /***/ }), /***/ 92183: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; // Standard YAML's Core schema. // http://www.yaml.org/spec/1.2/spec.html#id2804923 // // NOTE: JS-YAML does not support schema-specific tag resolution restrictions. // So, Core schema has no distinctions from JSON schema is JS-YAML. var Schema = __webpack_require__(66514); module.exports = new Schema({ include: [ __webpack_require__(1571) ] }); /***/ }), /***/ 56874: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; // JS-YAML's default schema for `load` function. // It is not described in the YAML specification. // // This schema is based on JS-YAML's default safe schema and includes // JavaScript-specific types: !!js/undefined, !!js/regexp and !!js/function. // // Also this schema is used as default base schema at `Schema.create` function. var Schema = __webpack_require__(66514); module.exports = Schema.DEFAULT = new Schema({ include: [ __webpack_require__(48949) ], explicit: [ __webpack_require__(25914), __webpack_require__(69242), __webpack_require__(27278) ] }); /***/ }), /***/ 48949: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; // JS-YAML's default schema for `safeLoad` function. // It is not described in the YAML specification. // // This schema is based on standard YAML's Core schema and includes most of // extra types described at YAML tag repository. (http://yaml.org/type/) var Schema = __webpack_require__(66514); module.exports = new Schema({ include: [ __webpack_require__(92183) ], implicit: [ __webpack_require__(83714), __webpack_require__(81393) ], explicit: [ __webpack_require__(32551), __webpack_require__(96668), __webpack_require__(76039), __webpack_require__(69237) ] }); /***/ }), /***/ 66037: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; // Standard YAML's Failsafe schema. // http://www.yaml.org/spec/1.2/spec.html#id2802346 var Schema = __webpack_require__(66514); module.exports = new Schema({ explicit: [ __webpack_require__(52672), __webpack_require__(5490), __webpack_require__(31173) ] }); /***/ }), /***/ 1571: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; // Standard YAML's JSON schema. // http://www.yaml.org/spec/1.2/spec.html#id2803231 // // NOTE: JS-YAML does not support schema-specific tag resolution restrictions. // So, this schema is not such strict as defined in the YAML specification. // It allows numbers in binary notaion, use `Null` and `NULL` as `null`, etc. var Schema = __webpack_require__(66514); module.exports = new Schema({ include: [ __webpack_require__(66037) ], implicit: [ __webpack_require__(22671), __webpack_require__(94675), __webpack_require__(89963), __webpack_require__(15564) ] }); /***/ }), /***/ 30967: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; var YAMLException = __webpack_require__(65199); var TYPE_CONSTRUCTOR_OPTIONS = [ 'kind', 'resolve', 'construct', 'instanceOf', 'predicate', 'represent', 'defaultStyle', 'styleAliases' ]; var YAML_NODE_KINDS = [ 'scalar', 'sequence', 'mapping' ]; function compileStyleAliases(map) { var result = {}; if (map !== null) { Object.keys(map).forEach(function (style) { map[style].forEach(function (alias) { result[String(alias)] = style; }); }); } return result; } function Type(tag, options) { options = options || {}; Object.keys(options).forEach(function (name) { if (TYPE_CONSTRUCTOR_OPTIONS.indexOf(name) === -1) { throw new YAMLException('Unknown option "' + name + '" is met in definition of "' + tag + '" YAML type.'); } }); // TODO: Add tag format check. this.tag = tag; this.kind = options['kind'] || null; this.resolve = options['resolve'] || function () { return true; }; this.construct = options['construct'] || function (data) { return data; }; this.instanceOf = options['instanceOf'] || null; this.predicate = options['predicate'] || null; this.represent = options['represent'] || null; this.defaultStyle = options['defaultStyle'] || null; this.styleAliases = compileStyleAliases(options['styleAliases'] || null); if (YAML_NODE_KINDS.indexOf(this.kind) === -1) { throw new YAMLException('Unknown kind "' + this.kind + '" is specified for "' + tag + '" YAML type.'); } } module.exports = Type; /***/ }), /***/ 32551: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; /*eslint-disable no-bitwise*/ var NodeBuffer; try { // A trick for browserified version, to not include `Buffer` shim var _require = require; NodeBuffer = _require('buffer').Buffer; } catch (__) {} var Type = __webpack_require__(30967); // [ 64, 65, 66 ] -> [ padding, CR, LF ] var BASE64_MAP = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=\n\r'; function resolveYamlBinary(data) { if (data === null) return false; var code, idx, bitlen = 0, max = data.length, map = BASE64_MAP; // Convert one by one. for (idx = 0; idx < max; idx++) { code = map.indexOf(data.charAt(idx)); // Skip CR/LF if (code > 64) continue; // Fail on illegal characters if (code < 0) return false; bitlen += 6; } // If there are any bits left, source was corrupted return (bitlen % 8) === 0; } function constructYamlBinary(data) { var idx, tailbits, input = data.replace(/[\r\n=]/g, ''), // remove CR/LF & padding to simplify scan max = input.length, map = BASE64_MAP, bits = 0, result = []; // Collect by 6*4 bits (3 bytes) for (idx = 0; idx < max; idx++) { if ((idx % 4 === 0) && idx) { result.push((bits >> 16) & 0xFF); result.push((bits >> 8) & 0xFF); result.push(bits & 0xFF); } bits = (bits << 6) | map.indexOf(input.charAt(idx)); } // Dump tail tailbits = (max % 4) * 6; if (tailbits === 0) { result.push((bits >> 16) & 0xFF); result.push((bits >> 8) & 0xFF); result.push(bits & 0xFF); } else if (tailbits === 18) { result.push((bits >> 10) & 0xFF); result.push((bits >> 2) & 0xFF); } else if (tailbits === 12) { result.push((bits >> 4) & 0xFF); } // Wrap into Buffer for NodeJS and leave Array for browser if (NodeBuffer) { // Support node 6.+ Buffer API when available return NodeBuffer.from ? NodeBuffer.from(result) : new NodeBuffer(result); } return result; } function representYamlBinary(object /*, style*/) { var result = '', bits = 0, idx, tail, max = object.length, map = BASE64_MAP; // Convert every three bytes to 4 ASCII characters. for (idx = 0; idx < max; idx++) { if ((idx % 3 === 0) && idx) { result += map[(bits >> 18) & 0x3F]; result += map[(bits >> 12) & 0x3F]; result += map[(bits >> 6) & 0x3F]; result += map[bits & 0x3F]; } bits = (bits << 8) + object[idx]; } // Dump tail tail = max % 3; if (tail === 0) { result += map[(bits >> 18) & 0x3F]; result += map[(bits >> 12) & 0x3F]; result += map[(bits >> 6) & 0x3F]; result += map[bits & 0x3F]; } else if (tail === 2) { result += map[(bits >> 10) & 0x3F]; result += map[(bits >> 4) & 0x3F]; result += map[(bits << 2) & 0x3F]; result += map[64]; } else if (tail === 1) { result += map[(bits >> 2) & 0x3F]; result += map[(bits << 4) & 0x3F]; result += map[64]; result += map[64]; } return result; } function isBinary(object) { return NodeBuffer && NodeBuffer.isBuffer(object); } module.exports = new Type('tag:yaml.org,2002:binary', { kind: 'scalar', resolve: resolveYamlBinary, construct: constructYamlBinary, predicate: isBinary, represent: representYamlBinary }); /***/ }), /***/ 94675: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; var Type = __webpack_require__(30967); function resolveYamlBoolean(data) { if (data === null) return false; var max = data.length; return (max === 4 && (data === 'true' || data === 'True' || data === 'TRUE')) || (max === 5 && (data === 'false' || data === 'False' || data === 'FALSE')); } function constructYamlBoolean(data) { return data === 'true' || data === 'True' || data === 'TRUE'; } function isBoolean(object) { return Object.prototype.toString.call(object) === '[object Boolean]'; } module.exports = new Type('tag:yaml.org,2002:bool', { kind: 'scalar', resolve: resolveYamlBoolean, construct: constructYamlBoolean, predicate: isBoolean, represent: { lowercase: function (object) { return object ? 'true' : 'false'; }, uppercase: function (object) { return object ? 'TRUE' : 'FALSE'; }, camelcase: function (object) { return object ? 'True' : 'False'; } }, defaultStyle: 'lowercase' }); /***/ }), /***/ 15564: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; var common = __webpack_require__(59136); var Type = __webpack_require__(30967); var YAML_FLOAT_PATTERN = new RegExp( // 2.5e4, 2.5 and integers '^(?:[-+]?(?:0|[1-9][0-9_]*)(?:\\.[0-9_]*)?(?:[eE][-+]?[0-9]+)?' + // .2e4, .2 // special case, seems not from spec '|\\.[0-9_]+(?:[eE][-+]?[0-9]+)?' + // 20:59 '|[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+\\.[0-9_]*' + // .inf '|[-+]?\\.(?:inf|Inf|INF)' + // .nan '|\\.(?:nan|NaN|NAN))$'); function resolveYamlFloat(data) { if (data === null) return false; if (!YAML_FLOAT_PATTERN.test(data) || // Quick hack to not allow integers end with `_` // Probably should update regexp & check speed data[data.length - 1] === '_') { return false; } return true; } function constructYamlFloat(data) { var value, sign, base, digits; value = data.replace(/_/g, '').toLowerCase(); sign = value[0] === '-' ? -1 : 1; digits = []; if ('+-'.indexOf(value[0]) >= 0) { value = value.slice(1); } if (value === '.inf') { return (sign === 1) ? Number.POSITIVE_INFINITY : Number.NEGATIVE_INFINITY; } else if (value === '.nan') { return NaN; } else if (value.indexOf(':') >= 0) { value.split(':').forEach(function (v) { digits.unshift(parseFloat(v, 10)); }); value = 0.0; base = 1; digits.forEach(function (d) { value += d * base; base *= 60; }); return sign * value; } return sign * parseFloat(value, 10); } var SCIENTIFIC_WITHOUT_DOT = /^[-+]?[0-9]+e/; function representYamlFloat(object, style) { var res; if (isNaN(object)) { switch (style) { case 'lowercase': return '.nan'; case 'uppercase': return '.NAN'; case 'camelcase': return '.NaN'; } } else if (Number.POSITIVE_INFINITY === object) { switch (style) { case 'lowercase': return '.inf'; case 'uppercase': return '.INF'; case 'camelcase': return '.Inf'; } } else if (Number.NEGATIVE_INFINITY === object) { switch (style) { case 'lowercase': return '-.inf'; case 'uppercase': return '-.INF'; case 'camelcase': return '-.Inf'; } } else if (common.isNegativeZero(object)) { return '-0.0'; } res = object.toString(10); // JS stringifier can build scientific format without dots: 5e-100, // while YAML requres dot: 5.e-100. Fix it with simple hack return SCIENTIFIC_WITHOUT_DOT.test(res) ? res.replace('e', '.e') : res; } function isFloat(object) { return (Object.prototype.toString.call(object) === '[object Number]') && (object % 1 !== 0 || common.isNegativeZero(object)); } module.exports = new Type('tag:yaml.org,2002:float', { kind: 'scalar', resolve: resolveYamlFloat, construct: constructYamlFloat, predicate: isFloat, represent: representYamlFloat, defaultStyle: 'lowercase' }); /***/ }), /***/ 89963: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; var common = __webpack_require__(59136); var Type = __webpack_require__(30967); function isHexCode(c) { return ((0x30/* 0 */ <= c) && (c <= 0x39/* 9 */)) || ((0x41/* A */ <= c) && (c <= 0x46/* F */)) || ((0x61/* a */ <= c) && (c <= 0x66/* f */)); } function isOctCode(c) { return ((0x30/* 0 */ <= c) && (c <= 0x37/* 7 */)); } function isDecCode(c) { return ((0x30/* 0 */ <= c) && (c <= 0x39/* 9 */)); } function resolveYamlInteger(data) { if (data === null) return false; var max = data.length, index = 0, hasDigits = false, ch; if (!max) return false; ch = data[index]; // sign if (ch === '-' || ch === '+') { ch = data[++index]; } if (ch === '0') { // 0 if (index + 1 === max) return true; ch = data[++index]; // base 2, base 8, base 16 if (ch === 'b') { // base 2 index++; for (; index < max; index++) { ch = data[index]; if (ch === '_') continue; if (ch !== '0' && ch !== '1') return false; hasDigits = true; } return hasDigits && ch !== '_'; } if (ch === 'x') { // base 16 index++; for (; index < max; index++) { ch = data[index]; if (ch === '_') continue; if (!isHexCode(data.charCodeAt(index))) return false; hasDigits = true; } return hasDigits && ch !== '_'; } // base 8 for (; index < max; index++) { ch = data[index]; if (ch === '_') continue; if (!isOctCode(data.charCodeAt(index))) return false; hasDigits = true; } return hasDigits && ch !== '_'; } // base 10 (except 0) or base 60 // value should not start with `_`; if (ch === '_') return false; for (; index < max; index++) { ch = data[index]; if (ch === '_') continue; if (ch === ':') break; if (!isDecCode(data.charCodeAt(index))) { return false; } hasDigits = true; } // Should have digits and should not end with `_` if (!hasDigits || ch === '_') return false; // if !base60 - done; if (ch !== ':') return true; // base60 almost not used, no needs to optimize return /^(:[0-5]?[0-9])+$/.test(data.slice(index)); } function constructYamlInteger(data) { var value = data, sign = 1, ch, base, digits = []; if (value.indexOf('_') !== -1) { value = value.replace(/_/g, ''); } ch = value[0]; if (ch === '-' || ch === '+') { if (ch === '-') sign = -1; value = value.slice(1); ch = value[0]; } if (value === '0') return 0; if (ch === '0') { if (value[1] === 'b') return sign * parseInt(value.slice(2), 2); if (value[1] === 'x') return sign * parseInt(value, 16); return sign * parseInt(value, 8); } if (value.indexOf(':') !== -1) { value.split(':').forEach(function (v) { digits.unshift(parseInt(v, 10)); }); value = 0; base = 1; digits.forEach(function (d) { value += (d * base); base *= 60; }); return sign * value; } return sign * parseInt(value, 10); } function isInteger(object) { return (Object.prototype.toString.call(object)) === '[object Number]' && (object % 1 === 0 && !common.isNegativeZero(object)); } module.exports = new Type('tag:yaml.org,2002:int', { kind: 'scalar', resolve: resolveYamlInteger, construct: constructYamlInteger, predicate: isInteger, represent: { binary: function (obj) { return obj >= 0 ? '0b' + obj.toString(2) : '-0b' + obj.toString(2).slice(1); }, octal: function (obj) { return obj >= 0 ? '0' + obj.toString(8) : '-0' + obj.toString(8).slice(1); }, decimal: function (obj) { return obj.toString(10); }, /* eslint-disable max-len */ hexadecimal: function (obj) { return obj >= 0 ? '0x' + obj.toString(16).toUpperCase() : '-0x' + obj.toString(16).toUpperCase().slice(1); } }, defaultStyle: 'decimal', styleAliases: { binary: [ 2, 'bin' ], octal: [ 8, 'oct' ], decimal: [ 10, 'dec' ], hexadecimal: [ 16, 'hex' ] } }); /***/ }), /***/ 27278: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; var esprima; // Browserified version does not have esprima // // 1. For node.js just require module as deps // 2. For browser try to require mudule via external AMD system. // If not found - try to fallback to window.esprima. If not // found too - then fail to parse. // try { // workaround to exclude package from browserify list. var _require = require; esprima = _require('esprima'); } catch (_) { /* eslint-disable no-redeclare */ /* global window */ if (typeof window !== 'undefined') esprima = window.esprima; } var Type = __webpack_require__(30967); function resolveJavascriptFunction(data) { if (data === null) return false; try { var source = '(' + data + ')', ast = esprima.parse(source, { range: true }); if (ast.type !== 'Program' || ast.body.length !== 1 || ast.body[0].type !== 'ExpressionStatement' || (ast.body[0].expression.type !== 'ArrowFunctionExpression' && ast.body[0].expression.type !== 'FunctionExpression')) { return false; } return true; } catch (err) { return false; } } function constructJavascriptFunction(data) { /*jslint evil:true*/ var source = '(' + data + ')', ast = esprima.parse(source, { range: true }), params = [], body; if (ast.type !== 'Program' || ast.body.length !== 1 || ast.body[0].type !== 'ExpressionStatement' || (ast.body[0].expression.type !== 'ArrowFunctionExpression' && ast.body[0].expression.type !== 'FunctionExpression')) { throw new Error('Failed to resolve function'); } ast.body[0].expression.params.forEach(function (param) { params.push(param.name); }); body = ast.body[0].expression.body.range; // Esprima's ranges include the first '{' and the last '}' characters on // function expressions. So cut them out. if (ast.body[0].expression.body.type === 'BlockStatement') { /*eslint-disable no-new-func*/ return new Function(params, source.slice(body[0] + 1, body[1] - 1)); } // ES6 arrow functions can omit the BlockStatement. In that case, just return // the body. /*eslint-disable no-new-func*/ return new Function(params, 'return ' + source.slice(body[0], body[1])); } function representJavascriptFunction(object /*, style*/) { return object.toString(); } function isFunction(object) { return Object.prototype.toString.call(object) === '[object Function]'; } module.exports = new Type('tag:yaml.org,2002:js/function', { kind: 'scalar', resolve: resolveJavascriptFunction, construct: constructJavascriptFunction, predicate: isFunction, represent: representJavascriptFunction }); /***/ }), /***/ 69242: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; var Type = __webpack_require__(30967); function resolveJavascriptRegExp(data) { if (data === null) return false; if (data.length === 0) return false; var regexp = data, tail = /\/([gim]*)$/.exec(data), modifiers = ''; // if regexp starts with '/' it can have modifiers and must be properly closed // `/foo/gim` - modifiers tail can be maximum 3 chars if (regexp[0] === '/') { if (tail) modifiers = tail[1]; if (modifiers.length > 3) return false; // if expression starts with /, is should be properly terminated if (regexp[regexp.length - modifiers.length - 1] !== '/') return false; } return true; } function constructJavascriptRegExp(data) { var regexp = data, tail = /\/([gim]*)$/.exec(data), modifiers = ''; // `/foo/gim` - tail can be maximum 4 chars if (regexp[0] === '/') { if (tail) modifiers = tail[1]; regexp = regexp.slice(1, regexp.length - modifiers.length - 1); } return new RegExp(regexp, modifiers); } function representJavascriptRegExp(object /*, style*/) { var result = '/' + object.source + '/'; if (object.global) result += 'g'; if (object.multiline) result += 'm'; if (object.ignoreCase) result += 'i'; return result; } function isRegExp(object) { return Object.prototype.toString.call(object) === '[object RegExp]'; } module.exports = new Type('tag:yaml.org,2002:js/regexp', { kind: 'scalar', resolve: resolveJavascriptRegExp, construct: constructJavascriptRegExp, predicate: isRegExp, represent: representJavascriptRegExp }); /***/ }), /***/ 25914: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; var Type = __webpack_require__(30967); function resolveJavascriptUndefined() { return true; } function constructJavascriptUndefined() { /*eslint-disable no-undefined*/ return undefined; } function representJavascriptUndefined() { return ''; } function isUndefined(object) { return typeof object === 'undefined'; } module.exports = new Type('tag:yaml.org,2002:js/undefined', { kind: 'scalar', resolve: resolveJavascriptUndefined, construct: constructJavascriptUndefined, predicate: isUndefined, represent: representJavascriptUndefined }); /***/ }), /***/ 31173: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; var Type = __webpack_require__(30967); module.exports = new Type('tag:yaml.org,2002:map', { kind: 'mapping', construct: function (data) { return data !== null ? data : {}; } }); /***/ }), /***/ 81393: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; var Type = __webpack_require__(30967); function resolveYamlMerge(data) { return data === '<<' || data === null; } module.exports = new Type('tag:yaml.org,2002:merge', { kind: 'scalar', resolve: resolveYamlMerge }); /***/ }), /***/ 22671: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; var Type = __webpack_require__(30967); function resolveYamlNull(data) { if (data === null) return true; var max = data.length; return (max === 1 && data === '~') || (max === 4 && (data === 'null' || data === 'Null' || data === 'NULL')); } function constructYamlNull() { return null; } function isNull(object) { return object === null; } module.exports = new Type('tag:yaml.org,2002:null', { kind: 'scalar', resolve: resolveYamlNull, construct: constructYamlNull, predicate: isNull, represent: { canonical: function () { return '~'; }, lowercase: function () { return 'null'; }, uppercase: function () { return 'NULL'; }, camelcase: function () { return 'Null'; } }, defaultStyle: 'lowercase' }); /***/ }), /***/ 96668: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; var Type = __webpack_require__(30967); var _hasOwnProperty = Object.prototype.hasOwnProperty; var _toString = Object.prototype.toString; function resolveYamlOmap(data) { if (data === null) return true; var objectKeys = [], index, length, pair, pairKey, pairHasKey, object = data; for (index = 0, length = object.length; index < length; index += 1) { pair = object[index]; pairHasKey = false; if (_toString.call(pair) !== '[object Object]') return false; for (pairKey in pair) { if (_hasOwnProperty.call(pair, pairKey)) { if (!pairHasKey) pairHasKey = true; else return false; } } if (!pairHasKey) return false; if (objectKeys.indexOf(pairKey) === -1) objectKeys.push(pairKey); else return false; } return true; } function constructYamlOmap(data) { return data !== null ? data : []; } module.exports = new Type('tag:yaml.org,2002:omap', { kind: 'sequence', resolve: resolveYamlOmap, construct: constructYamlOmap }); /***/ }), /***/ 76039: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; var Type = __webpack_require__(30967); var _toString = Object.prototype.toString; function resolveYamlPairs(data) { if (data === null) return true; var index, length, pair, keys, result, object = data; result = new Array(object.length); for (index = 0, length = object.length; index < length; index += 1) { pair = object[index]; if (_toString.call(pair) !== '[object Object]') return false; keys = Object.keys(pair); if (keys.length !== 1) return false; result[index] = [ keys[0], pair[keys[0]] ]; } return true; } function constructYamlPairs(data) { if (data === null) return []; var index, length, pair, keys, result, object = data; result = new Array(object.length); for (index = 0, length = object.length; index < length; index += 1) { pair = object[index]; keys = Object.keys(pair); result[index] = [ keys[0], pair[keys[0]] ]; } return result; } module.exports = new Type('tag:yaml.org,2002:pairs', { kind: 'sequence', resolve: resolveYamlPairs, construct: constructYamlPairs }); /***/ }), /***/ 5490: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; var Type = __webpack_require__(30967); module.exports = new Type('tag:yaml.org,2002:seq', { kind: 'sequence', construct: function (data) { return data !== null ? data : []; } }); /***/ }), /***/ 69237: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; var Type = __webpack_require__(30967); var _hasOwnProperty = Object.prototype.hasOwnProperty; function resolveYamlSet(data) { if (data === null) return true; var key, object = data; for (key in object) { if (_hasOwnProperty.call(object, key)) { if (object[key] !== null) return false; } } return true; } function constructYamlSet(data) { return data !== null ? data : {}; } module.exports = new Type('tag:yaml.org,2002:set', { kind: 'mapping', resolve: resolveYamlSet, construct: constructYamlSet }); /***/ }), /***/ 52672: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; var Type = __webpack_require__(30967); module.exports = new Type('tag:yaml.org,2002:str', { kind: 'scalar', construct: function (data) { return data !== null ? data : ''; } }); /***/ }), /***/ 83714: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; var Type = __webpack_require__(30967); var YAML_DATE_REGEXP = new RegExp( '^([0-9][0-9][0-9][0-9])' + // [1] year '-([0-9][0-9])' + // [2] month '-([0-9][0-9])$'); // [3] day var YAML_TIMESTAMP_REGEXP = new RegExp( '^([0-9][0-9][0-9][0-9])' + // [1] year '-([0-9][0-9]?)' + // [2] month '-([0-9][0-9]?)' + // [3] day '(?:[Tt]|[ \\t]+)' + // ... '([0-9][0-9]?)' + // [4] hour ':([0-9][0-9])' + // [5] minute ':([0-9][0-9])' + // [6] second '(?:\\.([0-9]*))?' + // [7] fraction '(?:[ \\t]*(Z|([-+])([0-9][0-9]?)' + // [8] tz [9] tz_sign [10] tz_hour '(?::([0-9][0-9]))?))?$'); // [11] tz_minute function resolveYamlTimestamp(data) { if (data === null) return false; if (YAML_DATE_REGEXP.exec(data) !== null) return true; if (YAML_TIMESTAMP_REGEXP.exec(data) !== null) return true; return false; } function constructYamlTimestamp(data) { var match, year, month, day, hour, minute, second, fraction = 0, delta = null, tz_hour, tz_minute, date; match = YAML_DATE_REGEXP.exec(data); if (match === null) match = YAML_TIMESTAMP_REGEXP.exec(data); if (match === null) throw new Error('Date resolve error'); // match: [1] year [2] month [3] day year = +(match[1]); month = +(match[2]) - 1; // JS month starts with 0 day = +(match[3]); if (!match[4]) { // no hour return new Date(Date.UTC(year, month, day)); } // match: [4] hour [5] minute [6] second [7] fraction hour = +(match[4]); minute = +(match[5]); second = +(match[6]); if (match[7]) { fraction = match[7].slice(0, 3); while (fraction.length < 3) { // milli-seconds fraction += '0'; } fraction = +fraction; } // match: [8] tz [9] tz_sign [10] tz_hour [11] tz_minute if (match[9]) { tz_hour = +(match[10]); tz_minute = +(match[11] || 0); delta = (tz_hour * 60 + tz_minute) * 60000; // delta in mili-seconds if (match[9] === '-') delta = -delta; } date = new Date(Date.UTC(year, month, day, hour, minute, second, fraction)); if (delta) date.setTime(date.getTime() - delta); return date; } function representYamlTimestamp(object /*, style*/) { return object.toISOString(); } module.exports = new Type('tag:yaml.org,2002:timestamp', { kind: 'scalar', resolve: resolveYamlTimestamp, construct: constructYamlTimestamp, instanceOf: Date, represent: representYamlTimestamp }); /***/ }), /***/ 85587: /***/ (function(module, exports) { (function(){ // Copyright (c) 2005 Tom Wu // All Rights Reserved. // See "LICENSE" for details. // Basic JavaScript BN library - subset useful for RSA encryption. // Bits per digit var dbits; // JavaScript engine analysis var canary = 0xdeadbeefcafe; var j_lm = ((canary&0xffffff)==0xefcafe); // (public) Constructor function BigInteger(a,b,c) { if(a != null) if("number" == typeof a) this.fromNumber(a,b,c); else if(b == null && "string" != typeof a) this.fromString(a,256); else this.fromString(a,b); } // return new, unset BigInteger function nbi() { return new BigInteger(null); } // am: Compute w_j += (x*this_i), propagate carries, // c is initial carry, returns final carry. // c < 3*dvalue, x < 2*dvalue, this_i < dvalue // We need to select the fastest one that works in this environment. // am1: use a single mult and divide to get the high bits, // max digit bits should be 26 because // max internal value = 2*dvalue^2-2*dvalue (< 2^53) function am1(i,x,w,j,c,n) { while(--n >= 0) { var v = x*this[i++]+w[j]+c; c = Math.floor(v/0x4000000); w[j++] = v&0x3ffffff; } return c; } // am2 avoids a big mult-and-extract completely. // Max digit bits should be <= 30 because we do bitwise ops // on values up to 2*hdvalue^2-hdvalue-1 (< 2^31) function am2(i,x,w,j,c,n) { var xl = x&0x7fff, xh = x>>15; while(--n >= 0) { var l = this[i]&0x7fff; var h = this[i++]>>15; var m = xh*l+h*xl; l = xl*l+((m&0x7fff)<<15)+w[j]+(c&0x3fffffff); c = (l>>>30)+(m>>>15)+xh*h+(c>>>30); w[j++] = l&0x3fffffff; } return c; } // Alternately, set max digit bits to 28 since some // browsers slow down when dealing with 32-bit numbers. function am3(i,x,w,j,c,n) { var xl = x&0x3fff, xh = x>>14; while(--n >= 0) { var l = this[i]&0x3fff; var h = this[i++]>>14; var m = xh*l+h*xl; l = xl*l+((m&0x3fff)<<14)+w[j]+c; c = (l>>28)+(m>>14)+xh*h; w[j++] = l&0xfffffff; } return c; } var inBrowser = typeof navigator !== "undefined"; if(inBrowser && j_lm && (navigator.appName == "Microsoft Internet Explorer")) { BigInteger.prototype.am = am2; dbits = 30; } else if(inBrowser && j_lm && (navigator.appName != "Netscape")) { BigInteger.prototype.am = am1; dbits = 26; } else { // Mozilla/Netscape seems to prefer am3 BigInteger.prototype.am = am3; dbits = 28; } BigInteger.prototype.DB = dbits; BigInteger.prototype.DM = ((1<= 0; --i) r[i] = this[i]; r.t = this.t; r.s = this.s; } // (protected) set from integer value x, -DV <= x < DV function bnpFromInt(x) { this.t = 1; this.s = (x<0)?-1:0; if(x > 0) this[0] = x; else if(x < -1) this[0] = x+this.DV; else this.t = 0; } // return bigint initialized to value function nbv(i) { var r = nbi(); r.fromInt(i); return r; } // (protected) set from string and radix function bnpFromString(s,b) { var k; if(b == 16) k = 4; else if(b == 8) k = 3; else if(b == 256) k = 8; // byte array else if(b == 2) k = 1; else if(b == 32) k = 5; else if(b == 4) k = 2; else { this.fromRadix(s,b); return; } this.t = 0; this.s = 0; var i = s.length, mi = false, sh = 0; while(--i >= 0) { var x = (k==8)?s[i]&0xff:intAt(s,i); if(x < 0) { if(s.charAt(i) == "-") mi = true; continue; } mi = false; if(sh == 0) this[this.t++] = x; else if(sh+k > this.DB) { this[this.t-1] |= (x&((1<<(this.DB-sh))-1))<>(this.DB-sh)); } else this[this.t-1] |= x<= this.DB) sh -= this.DB; } if(k == 8 && (s[0]&0x80) != 0) { this.s = -1; if(sh > 0) this[this.t-1] |= ((1<<(this.DB-sh))-1)< 0 && this[this.t-1] == c) --this.t; } // (public) return string representation in given radix function bnToString(b) { if(this.s < 0) return "-"+this.negate().toString(b); var k; if(b == 16) k = 4; else if(b == 8) k = 3; else if(b == 2) k = 1; else if(b == 32) k = 5; else if(b == 4) k = 2; else return this.toRadix(b); var km = (1< 0) { if(p < this.DB && (d = this[i]>>p) > 0) { m = true; r = int2char(d); } while(i >= 0) { if(p < k) { d = (this[i]&((1<>(p+=this.DB-k); } else { d = (this[i]>>(p-=k))&km; if(p <= 0) { p += this.DB; --i; } } if(d > 0) m = true; if(m) r += int2char(d); } } return m?r:"0"; } // (public) -this function bnNegate() { var r = nbi(); BigInteger.ZERO.subTo(this,r); return r; } // (public) |this| function bnAbs() { return (this.s<0)?this.negate():this; } // (public) return + if this > a, - if this < a, 0 if equal function bnCompareTo(a) { var r = this.s-a.s; if(r != 0) return r; var i = this.t; r = i-a.t; if(r != 0) return (this.s<0)?-r:r; while(--i >= 0) if((r=this[i]-a[i]) != 0) return r; return 0; } // returns bit length of the integer x function nbits(x) { var r = 1, t; if((t=x>>>16) != 0) { x = t; r += 16; } if((t=x>>8) != 0) { x = t; r += 8; } if((t=x>>4) != 0) { x = t; r += 4; } if((t=x>>2) != 0) { x = t; r += 2; } if((t=x>>1) != 0) { x = t; r += 1; } return r; } // (public) return the number of bits in "this" function bnBitLength() { if(this.t <= 0) return 0; return this.DB*(this.t-1)+nbits(this[this.t-1]^(this.s&this.DM)); } // (protected) r = this << n*DB function bnpDLShiftTo(n,r) { var i; for(i = this.t-1; i >= 0; --i) r[i+n] = this[i]; for(i = n-1; i >= 0; --i) r[i] = 0; r.t = this.t+n; r.s = this.s; } // (protected) r = this >> n*DB function bnpDRShiftTo(n,r) { for(var i = n; i < this.t; ++i) r[i-n] = this[i]; r.t = Math.max(this.t-n,0); r.s = this.s; } // (protected) r = this << n function bnpLShiftTo(n,r) { var bs = n%this.DB; var cbs = this.DB-bs; var bm = (1<= 0; --i) { r[i+ds+1] = (this[i]>>cbs)|c; c = (this[i]&bm)<= 0; --i) r[i] = 0; r[ds] = c; r.t = this.t+ds+1; r.s = this.s; r.clamp(); } // (protected) r = this >> n function bnpRShiftTo(n,r) { r.s = this.s; var ds = Math.floor(n/this.DB); if(ds >= this.t) { r.t = 0; return; } var bs = n%this.DB; var cbs = this.DB-bs; var bm = (1<>bs; for(var i = ds+1; i < this.t; ++i) { r[i-ds-1] |= (this[i]&bm)<>bs; } if(bs > 0) r[this.t-ds-1] |= (this.s&bm)<>= this.DB; } if(a.t < this.t) { c -= a.s; while(i < this.t) { c += this[i]; r[i++] = c&this.DM; c >>= this.DB; } c += this.s; } else { c += this.s; while(i < a.t) { c -= a[i]; r[i++] = c&this.DM; c >>= this.DB; } c -= a.s; } r.s = (c<0)?-1:0; if(c < -1) r[i++] = this.DV+c; else if(c > 0) r[i++] = c; r.t = i; r.clamp(); } // (protected) r = this * a, r != this,a (HAC 14.12) // "this" should be the larger one if appropriate. function bnpMultiplyTo(a,r) { var x = this.abs(), y = a.abs(); var i = x.t; r.t = i+y.t; while(--i >= 0) r[i] = 0; for(i = 0; i < y.t; ++i) r[i+x.t] = x.am(0,y[i],r,i,0,x.t); r.s = 0; r.clamp(); if(this.s != a.s) BigInteger.ZERO.subTo(r,r); } // (protected) r = this^2, r != this (HAC 14.16) function bnpSquareTo(r) { var x = this.abs(); var i = r.t = 2*x.t; while(--i >= 0) r[i] = 0; for(i = 0; i < x.t-1; ++i) { var c = x.am(i,x[i],r,2*i,0,1); if((r[i+x.t]+=x.am(i+1,2*x[i],r,2*i+1,c,x.t-i-1)) >= x.DV) { r[i+x.t] -= x.DV; r[i+x.t+1] = 1; } } if(r.t > 0) r[r.t-1] += x.am(i,x[i],r,2*i,0,1); r.s = 0; r.clamp(); } // (protected) divide this by m, quotient and remainder to q, r (HAC 14.20) // r != q, this != m. q or r may be null. function bnpDivRemTo(m,q,r) { var pm = m.abs(); if(pm.t <= 0) return; var pt = this.abs(); if(pt.t < pm.t) { if(q != null) q.fromInt(0); if(r != null) this.copyTo(r); return; } if(r == null) r = nbi(); var y = nbi(), ts = this.s, ms = m.s; var nsh = this.DB-nbits(pm[pm.t-1]); // normalize modulus if(nsh > 0) { pm.lShiftTo(nsh,y); pt.lShiftTo(nsh,r); } else { pm.copyTo(y); pt.copyTo(r); } var ys = y.t; var y0 = y[ys-1]; if(y0 == 0) return; var yt = y0*(1<1)?y[ys-2]>>this.F2:0); var d1 = this.FV/yt, d2 = (1<= 0) { r[r.t++] = 1; r.subTo(t,r); } BigInteger.ONE.dlShiftTo(ys,t); t.subTo(y,y); // "negative" y so we can replace sub with am later while(y.t < ys) y[y.t++] = 0; while(--j >= 0) { // Estimate quotient digit var qd = (r[--i]==y0)?this.DM:Math.floor(r[i]*d1+(r[i-1]+e)*d2); if((r[i]+=y.am(0,qd,r,j,0,ys)) < qd) { // Try it out y.dlShiftTo(j,t); r.subTo(t,r); while(r[i] < --qd) r.subTo(t,r); } } if(q != null) { r.drShiftTo(ys,q); if(ts != ms) BigInteger.ZERO.subTo(q,q); } r.t = ys; r.clamp(); if(nsh > 0) r.rShiftTo(nsh,r); // Denormalize remainder if(ts < 0) BigInteger.ZERO.subTo(r,r); } // (public) this mod a function bnMod(a) { var r = nbi(); this.abs().divRemTo(a,null,r); if(this.s < 0 && r.compareTo(BigInteger.ZERO) > 0) a.subTo(r,r); return r; } // Modular reduction using "classic" algorithm function Classic(m) { this.m = m; } function cConvert(x) { if(x.s < 0 || x.compareTo(this.m) >= 0) return x.mod(this.m); else return x; } function cRevert(x) { return x; } function cReduce(x) { x.divRemTo(this.m,null,x); } function cMulTo(x,y,r) { x.multiplyTo(y,r); this.reduce(r); } function cSqrTo(x,r) { x.squareTo(r); this.reduce(r); } Classic.prototype.convert = cConvert; Classic.prototype.revert = cRevert; Classic.prototype.reduce = cReduce; Classic.prototype.mulTo = cMulTo; Classic.prototype.sqrTo = cSqrTo; // (protected) return "-1/this % 2^DB"; useful for Mont. reduction // justification: // xy == 1 (mod m) // xy = 1+km // xy(2-xy) = (1+km)(1-km) // x[y(2-xy)] = 1-k^2m^2 // x[y(2-xy)] == 1 (mod m^2) // if y is 1/x mod m, then y(2-xy) is 1/x mod m^2 // should reduce x and y(2-xy) by m^2 at each step to keep size bounded. // JS multiply "overflows" differently from C/C++, so care is needed here. function bnpInvDigit() { if(this.t < 1) return 0; var x = this[0]; if((x&1) == 0) return 0; var y = x&3; // y == 1/x mod 2^2 y = (y*(2-(x&0xf)*y))&0xf; // y == 1/x mod 2^4 y = (y*(2-(x&0xff)*y))&0xff; // y == 1/x mod 2^8 y = (y*(2-(((x&0xffff)*y)&0xffff)))&0xffff; // y == 1/x mod 2^16 // last step - calculate inverse mod DV directly; // assumes 16 < DB <= 32 and assumes ability to handle 48-bit ints y = (y*(2-x*y%this.DV))%this.DV; // y == 1/x mod 2^dbits // we really want the negative inverse, and -DV < y < DV return (y>0)?this.DV-y:-y; } // Montgomery reduction function Montgomery(m) { this.m = m; this.mp = m.invDigit(); this.mpl = this.mp&0x7fff; this.mph = this.mp>>15; this.um = (1<<(m.DB-15))-1; this.mt2 = 2*m.t; } // xR mod m function montConvert(x) { var r = nbi(); x.abs().dlShiftTo(this.m.t,r); r.divRemTo(this.m,null,r); if(x.s < 0 && r.compareTo(BigInteger.ZERO) > 0) this.m.subTo(r,r); return r; } // x/R mod m function montRevert(x) { var r = nbi(); x.copyTo(r); this.reduce(r); return r; } // x = x/R mod m (HAC 14.32) function montReduce(x) { while(x.t <= this.mt2) // pad x so am has enough room later x[x.t++] = 0; for(var i = 0; i < this.m.t; ++i) { // faster way of calculating u0 = x[i]*mp mod DV var j = x[i]&0x7fff; var u0 = (j*this.mpl+(((j*this.mph+(x[i]>>15)*this.mpl)&this.um)<<15))&x.DM; // use am to combine the multiply-shift-add into one call j = i+this.m.t; x[j] += this.m.am(0,u0,x,i,0,this.m.t); // propagate carry while(x[j] >= x.DV) { x[j] -= x.DV; x[++j]++; } } x.clamp(); x.drShiftTo(this.m.t,x); if(x.compareTo(this.m) >= 0) x.subTo(this.m,x); } // r = "x^2/R mod m"; x != r function montSqrTo(x,r) { x.squareTo(r); this.reduce(r); } // r = "xy/R mod m"; x,y != r function montMulTo(x,y,r) { x.multiplyTo(y,r); this.reduce(r); } Montgomery.prototype.convert = montConvert; Montgomery.prototype.revert = montRevert; Montgomery.prototype.reduce = montReduce; Montgomery.prototype.mulTo = montMulTo; Montgomery.prototype.sqrTo = montSqrTo; // (protected) true iff this is even function bnpIsEven() { return ((this.t>0)?(this[0]&1):this.s) == 0; } // (protected) this^e, e < 2^32, doing sqr and mul with "r" (HAC 14.79) function bnpExp(e,z) { if(e > 0xffffffff || e < 1) return BigInteger.ONE; var r = nbi(), r2 = nbi(), g = z.convert(this), i = nbits(e)-1; g.copyTo(r); while(--i >= 0) { z.sqrTo(r,r2); if((e&(1< 0) z.mulTo(r2,g,r); else { var t = r; r = r2; r2 = t; } } return z.revert(r); } // (public) this^e % m, 0 <= e < 2^32 function bnModPowInt(e,m) { var z; if(e < 256 || m.isEven()) z = new Classic(m); else z = new Montgomery(m); return this.exp(e,z); } // protected BigInteger.prototype.copyTo = bnpCopyTo; BigInteger.prototype.fromInt = bnpFromInt; BigInteger.prototype.fromString = bnpFromString; BigInteger.prototype.clamp = bnpClamp; BigInteger.prototype.dlShiftTo = bnpDLShiftTo; BigInteger.prototype.drShiftTo = bnpDRShiftTo; BigInteger.prototype.lShiftTo = bnpLShiftTo; BigInteger.prototype.rShiftTo = bnpRShiftTo; BigInteger.prototype.subTo = bnpSubTo; BigInteger.prototype.multiplyTo = bnpMultiplyTo; BigInteger.prototype.squareTo = bnpSquareTo; BigInteger.prototype.divRemTo = bnpDivRemTo; BigInteger.prototype.invDigit = bnpInvDigit; BigInteger.prototype.isEven = bnpIsEven; BigInteger.prototype.exp = bnpExp; // public BigInteger.prototype.toString = bnToString; BigInteger.prototype.negate = bnNegate; BigInteger.prototype.abs = bnAbs; BigInteger.prototype.compareTo = bnCompareTo; BigInteger.prototype.bitLength = bnBitLength; BigInteger.prototype.mod = bnMod; BigInteger.prototype.modPowInt = bnModPowInt; // "constants" BigInteger.ZERO = nbv(0); BigInteger.ONE = nbv(1); // Copyright (c) 2005-2009 Tom Wu // All Rights Reserved. // See "LICENSE" for details. // Extended JavaScript BN functions, required for RSA private ops. // Version 1.1: new BigInteger("0", 10) returns "proper" zero // Version 1.2: square() API, isProbablePrime fix // (public) function bnClone() { var r = nbi(); this.copyTo(r); return r; } // (public) return value as integer function bnIntValue() { if(this.s < 0) { if(this.t == 1) return this[0]-this.DV; else if(this.t == 0) return -1; } else if(this.t == 1) return this[0]; else if(this.t == 0) return 0; // assumes 16 < DB < 32 return ((this[1]&((1<<(32-this.DB))-1))<>24; } // (public) return value as short (assumes DB>=16) function bnShortValue() { return (this.t==0)?this.s:(this[0]<<16)>>16; } // (protected) return x s.t. r^x < DV function bnpChunkSize(r) { return Math.floor(Math.LN2*this.DB/Math.log(r)); } // (public) 0 if this == 0, 1 if this > 0 function bnSigNum() { if(this.s < 0) return -1; else if(this.t <= 0 || (this.t == 1 && this[0] <= 0)) return 0; else return 1; } // (protected) convert to radix string function bnpToRadix(b) { if(b == null) b = 10; if(this.signum() == 0 || b < 2 || b > 36) return "0"; var cs = this.chunkSize(b); var a = Math.pow(b,cs); var d = nbv(a), y = nbi(), z = nbi(), r = ""; this.divRemTo(d,y,z); while(y.signum() > 0) { r = (a+z.intValue()).toString(b).substr(1) + r; y.divRemTo(d,y,z); } return z.intValue().toString(b) + r; } // (protected) convert from radix string function bnpFromRadix(s,b) { this.fromInt(0); if(b == null) b = 10; var cs = this.chunkSize(b); var d = Math.pow(b,cs), mi = false, j = 0, w = 0; for(var i = 0; i < s.length; ++i) { var x = intAt(s,i); if(x < 0) { if(s.charAt(i) == "-" && this.signum() == 0) mi = true; continue; } w = b*w+x; if(++j >= cs) { this.dMultiply(d); this.dAddOffset(w,0); j = 0; w = 0; } } if(j > 0) { this.dMultiply(Math.pow(b,j)); this.dAddOffset(w,0); } if(mi) BigInteger.ZERO.subTo(this,this); } // (protected) alternate constructor function bnpFromNumber(a,b,c) { if("number" == typeof b) { // new BigInteger(int,int,RNG) if(a < 2) this.fromInt(1); else { this.fromNumber(a,c); if(!this.testBit(a-1)) // force MSB set this.bitwiseTo(BigInteger.ONE.shiftLeft(a-1),op_or,this); if(this.isEven()) this.dAddOffset(1,0); // force odd while(!this.isProbablePrime(b)) { this.dAddOffset(2,0); if(this.bitLength() > a) this.subTo(BigInteger.ONE.shiftLeft(a-1),this); } } } else { // new BigInteger(int,RNG) var x = new Array(), t = a&7; x.length = (a>>3)+1; b.nextBytes(x); if(t > 0) x[0] &= ((1< 0) { if(p < this.DB && (d = this[i]>>p) != (this.s&this.DM)>>p) r[k++] = d|(this.s<<(this.DB-p)); while(i >= 0) { if(p < 8) { d = (this[i]&((1<>(p+=this.DB-8); } else { d = (this[i]>>(p-=8))&0xff; if(p <= 0) { p += this.DB; --i; } } if((d&0x80) != 0) d |= -256; if(k == 0 && (this.s&0x80) != (d&0x80)) ++k; if(k > 0 || d != this.s) r[k++] = d; } } return r; } function bnEquals(a) { return(this.compareTo(a)==0); } function bnMin(a) { return(this.compareTo(a)<0)?this:a; } function bnMax(a) { return(this.compareTo(a)>0)?this:a; } // (protected) r = this op a (bitwise) function bnpBitwiseTo(a,op,r) { var i, f, m = Math.min(a.t,this.t); for(i = 0; i < m; ++i) r[i] = op(this[i],a[i]); if(a.t < this.t) { f = a.s&this.DM; for(i = m; i < this.t; ++i) r[i] = op(this[i],f); r.t = this.t; } else { f = this.s&this.DM; for(i = m; i < a.t; ++i) r[i] = op(f,a[i]); r.t = a.t; } r.s = op(this.s,a.s); r.clamp(); } // (public) this & a function op_and(x,y) { return x&y; } function bnAnd(a) { var r = nbi(); this.bitwiseTo(a,op_and,r); return r; } // (public) this | a function op_or(x,y) { return x|y; } function bnOr(a) { var r = nbi(); this.bitwiseTo(a,op_or,r); return r; } // (public) this ^ a function op_xor(x,y) { return x^y; } function bnXor(a) { var r = nbi(); this.bitwiseTo(a,op_xor,r); return r; } // (public) this & ~a function op_andnot(x,y) { return x&~y; } function bnAndNot(a) { var r = nbi(); this.bitwiseTo(a,op_andnot,r); return r; } // (public) ~this function bnNot() { var r = nbi(); for(var i = 0; i < this.t; ++i) r[i] = this.DM&~this[i]; r.t = this.t; r.s = ~this.s; return r; } // (public) this << n function bnShiftLeft(n) { var r = nbi(); if(n < 0) this.rShiftTo(-n,r); else this.lShiftTo(n,r); return r; } // (public) this >> n function bnShiftRight(n) { var r = nbi(); if(n < 0) this.lShiftTo(-n,r); else this.rShiftTo(n,r); return r; } // return index of lowest 1-bit in x, x < 2^31 function lbit(x) { if(x == 0) return -1; var r = 0; if((x&0xffff) == 0) { x >>= 16; r += 16; } if((x&0xff) == 0) { x >>= 8; r += 8; } if((x&0xf) == 0) { x >>= 4; r += 4; } if((x&3) == 0) { x >>= 2; r += 2; } if((x&1) == 0) ++r; return r; } // (public) returns index of lowest 1-bit (or -1 if none) function bnGetLowestSetBit() { for(var i = 0; i < this.t; ++i) if(this[i] != 0) return i*this.DB+lbit(this[i]); if(this.s < 0) return this.t*this.DB; return -1; } // return number of 1 bits in x function cbit(x) { var r = 0; while(x != 0) { x &= x-1; ++r; } return r; } // (public) return number of set bits function bnBitCount() { var r = 0, x = this.s&this.DM; for(var i = 0; i < this.t; ++i) r += cbit(this[i]^x); return r; } // (public) true iff nth bit is set function bnTestBit(n) { var j = Math.floor(n/this.DB); if(j >= this.t) return(this.s!=0); return((this[j]&(1<<(n%this.DB)))!=0); } // (protected) this op (1<>= this.DB; } if(a.t < this.t) { c += a.s; while(i < this.t) { c += this[i]; r[i++] = c&this.DM; c >>= this.DB; } c += this.s; } else { c += this.s; while(i < a.t) { c += a[i]; r[i++] = c&this.DM; c >>= this.DB; } c += a.s; } r.s = (c<0)?-1:0; if(c > 0) r[i++] = c; else if(c < -1) r[i++] = this.DV+c; r.t = i; r.clamp(); } // (public) this + a function bnAdd(a) { var r = nbi(); this.addTo(a,r); return r; } // (public) this - a function bnSubtract(a) { var r = nbi(); this.subTo(a,r); return r; } // (public) this * a function bnMultiply(a) { var r = nbi(); this.multiplyTo(a,r); return r; } // (public) this^2 function bnSquare() { var r = nbi(); this.squareTo(r); return r; } // (public) this / a function bnDivide(a) { var r = nbi(); this.divRemTo(a,r,null); return r; } // (public) this % a function bnRemainder(a) { var r = nbi(); this.divRemTo(a,null,r); return r; } // (public) [this/a,this%a] function bnDivideAndRemainder(a) { var q = nbi(), r = nbi(); this.divRemTo(a,q,r); return new Array(q,r); } // (protected) this *= n, this >= 0, 1 < n < DV function bnpDMultiply(n) { this[this.t] = this.am(0,n-1,this,0,0,this.t); ++this.t; this.clamp(); } // (protected) this += n << w words, this >= 0 function bnpDAddOffset(n,w) { if(n == 0) return; while(this.t <= w) this[this.t++] = 0; this[w] += n; while(this[w] >= this.DV) { this[w] -= this.DV; if(++w >= this.t) this[this.t++] = 0; ++this[w]; } } // A "null" reducer function NullExp() {} function nNop(x) { return x; } function nMulTo(x,y,r) { x.multiplyTo(y,r); } function nSqrTo(x,r) { x.squareTo(r); } NullExp.prototype.convert = nNop; NullExp.prototype.revert = nNop; NullExp.prototype.mulTo = nMulTo; NullExp.prototype.sqrTo = nSqrTo; // (public) this^e function bnPow(e) { return this.exp(e,new NullExp()); } // (protected) r = lower n words of "this * a", a.t <= n // "this" should be the larger one if appropriate. function bnpMultiplyLowerTo(a,n,r) { var i = Math.min(this.t+a.t,n); r.s = 0; // assumes a,this >= 0 r.t = i; while(i > 0) r[--i] = 0; var j; for(j = r.t-this.t; i < j; ++i) r[i+this.t] = this.am(0,a[i],r,i,0,this.t); for(j = Math.min(a.t,n); i < j; ++i) this.am(0,a[i],r,i,0,n-i); r.clamp(); } // (protected) r = "this * a" without lower n words, n > 0 // "this" should be the larger one if appropriate. function bnpMultiplyUpperTo(a,n,r) { --n; var i = r.t = this.t+a.t-n; r.s = 0; // assumes a,this >= 0 while(--i >= 0) r[i] = 0; for(i = Math.max(n-this.t,0); i < a.t; ++i) r[this.t+i-n] = this.am(n-i,a[i],r,0,0,this.t+i-n); r.clamp(); r.drShiftTo(1,r); } // Barrett modular reduction function Barrett(m) { // setup Barrett this.r2 = nbi(); this.q3 = nbi(); BigInteger.ONE.dlShiftTo(2*m.t,this.r2); this.mu = this.r2.divide(m); this.m = m; } function barrettConvert(x) { if(x.s < 0 || x.t > 2*this.m.t) return x.mod(this.m); else if(x.compareTo(this.m) < 0) return x; else { var r = nbi(); x.copyTo(r); this.reduce(r); return r; } } function barrettRevert(x) { return x; } // x = x mod m (HAC 14.42) function barrettReduce(x) { x.drShiftTo(this.m.t-1,this.r2); if(x.t > this.m.t+1) { x.t = this.m.t+1; x.clamp(); } this.mu.multiplyUpperTo(this.r2,this.m.t+1,this.q3); this.m.multiplyLowerTo(this.q3,this.m.t+1,this.r2); while(x.compareTo(this.r2) < 0) x.dAddOffset(1,this.m.t+1); x.subTo(this.r2,x); while(x.compareTo(this.m) >= 0) x.subTo(this.m,x); } // r = x^2 mod m; x != r function barrettSqrTo(x,r) { x.squareTo(r); this.reduce(r); } // r = x*y mod m; x,y != r function barrettMulTo(x,y,r) { x.multiplyTo(y,r); this.reduce(r); } Barrett.prototype.convert = barrettConvert; Barrett.prototype.revert = barrettRevert; Barrett.prototype.reduce = barrettReduce; Barrett.prototype.mulTo = barrettMulTo; Barrett.prototype.sqrTo = barrettSqrTo; // (public) this^e % m (HAC 14.85) function bnModPow(e,m) { var i = e.bitLength(), k, r = nbv(1), z; if(i <= 0) return r; else if(i < 18) k = 1; else if(i < 48) k = 3; else if(i < 144) k = 4; else if(i < 768) k = 5; else k = 6; if(i < 8) z = new Classic(m); else if(m.isEven()) z = new Barrett(m); else z = new Montgomery(m); // precomputation var g = new Array(), n = 3, k1 = k-1, km = (1< 1) { var g2 = nbi(); z.sqrTo(g[1],g2); while(n <= km) { g[n] = nbi(); z.mulTo(g2,g[n-2],g[n]); n += 2; } } var j = e.t-1, w, is1 = true, r2 = nbi(), t; i = nbits(e[j])-1; while(j >= 0) { if(i >= k1) w = (e[j]>>(i-k1))&km; else { w = (e[j]&((1<<(i+1))-1))<<(k1-i); if(j > 0) w |= e[j-1]>>(this.DB+i-k1); } n = k; while((w&1) == 0) { w >>= 1; --n; } if((i -= n) < 0) { i += this.DB; --j; } if(is1) { // ret == 1, don't bother squaring or multiplying it g[w].copyTo(r); is1 = false; } else { while(n > 1) { z.sqrTo(r,r2); z.sqrTo(r2,r); n -= 2; } if(n > 0) z.sqrTo(r,r2); else { t = r; r = r2; r2 = t; } z.mulTo(r2,g[w],r); } while(j >= 0 && (e[j]&(1< 0) { x.rShiftTo(g,x); y.rShiftTo(g,y); } while(x.signum() > 0) { if((i = x.getLowestSetBit()) > 0) x.rShiftTo(i,x); if((i = y.getLowestSetBit()) > 0) y.rShiftTo(i,y); if(x.compareTo(y) >= 0) { x.subTo(y,x); x.rShiftTo(1,x); } else { y.subTo(x,y); y.rShiftTo(1,y); } } if(g > 0) y.lShiftTo(g,y); return y; } // (protected) this % n, n < 2^26 function bnpModInt(n) { if(n <= 0) return 0; var d = this.DV%n, r = (this.s<0)?n-1:0; if(this.t > 0) if(d == 0) r = this[0]%n; else for(var i = this.t-1; i >= 0; --i) r = (d*r+this[i])%n; return r; } // (public) 1/this % m (HAC 14.61) function bnModInverse(m) { var ac = m.isEven(); if((this.isEven() && ac) || m.signum() == 0) return BigInteger.ZERO; var u = m.clone(), v = this.clone(); var a = nbv(1), b = nbv(0), c = nbv(0), d = nbv(1); while(u.signum() != 0) { while(u.isEven()) { u.rShiftTo(1,u); if(ac) { if(!a.isEven() || !b.isEven()) { a.addTo(this,a); b.subTo(m,b); } a.rShiftTo(1,a); } else if(!b.isEven()) b.subTo(m,b); b.rShiftTo(1,b); } while(v.isEven()) { v.rShiftTo(1,v); if(ac) { if(!c.isEven() || !d.isEven()) { c.addTo(this,c); d.subTo(m,d); } c.rShiftTo(1,c); } else if(!d.isEven()) d.subTo(m,d); d.rShiftTo(1,d); } if(u.compareTo(v) >= 0) { u.subTo(v,u); if(ac) a.subTo(c,a); b.subTo(d,b); } else { v.subTo(u,v); if(ac) c.subTo(a,c); d.subTo(b,d); } } if(v.compareTo(BigInteger.ONE) != 0) return BigInteger.ZERO; if(d.compareTo(m) >= 0) return d.subtract(m); if(d.signum() < 0) d.addTo(m,d); else return d; if(d.signum() < 0) return d.add(m); else return d; } 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]; var lplim = (1<<26)/lowprimes[lowprimes.length-1]; // (public) test primality with certainty >= 1-.5^t function bnIsProbablePrime(t) { var i, x = this.abs(); if(x.t == 1 && x[0] <= lowprimes[lowprimes.length-1]) { for(i = 0; i < lowprimes.length; ++i) if(x[0] == lowprimes[i]) return true; return false; } if(x.isEven()) return false; i = 1; while(i < lowprimes.length) { var m = lowprimes[i], j = i+1; while(j < lowprimes.length && m < lplim) m *= lowprimes[j++]; m = x.modInt(m); while(i < j) if(m%lowprimes[i++] == 0) return false; } return x.millerRabin(t); } // (protected) true if probably prime (HAC 4.24, Miller-Rabin) function bnpMillerRabin(t) { var n1 = this.subtract(BigInteger.ONE); var k = n1.getLowestSetBit(); if(k <= 0) return false; var r = n1.shiftRight(k); t = (t+1)>>1; if(t > lowprimes.length) t = lowprimes.length; var a = nbi(); for(var i = 0; i < t; ++i) { //Pick bases at random, instead of starting at 2 a.fromInt(lowprimes[Math.floor(Math.random()*lowprimes.length)]); var y = a.modPow(r,this); if(y.compareTo(BigInteger.ONE) != 0 && y.compareTo(n1) != 0) { var j = 1; while(j++ < k && y.compareTo(n1) != 0) { y = y.modPowInt(2,this); if(y.compareTo(BigInteger.ONE) == 0) return false; } if(y.compareTo(n1) != 0) return false; } } return true; } // protected BigInteger.prototype.chunkSize = bnpChunkSize; BigInteger.prototype.toRadix = bnpToRadix; BigInteger.prototype.fromRadix = bnpFromRadix; BigInteger.prototype.fromNumber = bnpFromNumber; BigInteger.prototype.bitwiseTo = bnpBitwiseTo; BigInteger.prototype.changeBit = bnpChangeBit; BigInteger.prototype.addTo = bnpAddTo; BigInteger.prototype.dMultiply = bnpDMultiply; BigInteger.prototype.dAddOffset = bnpDAddOffset; BigInteger.prototype.multiplyLowerTo = bnpMultiplyLowerTo; BigInteger.prototype.multiplyUpperTo = bnpMultiplyUpperTo; BigInteger.prototype.modInt = bnpModInt; BigInteger.prototype.millerRabin = bnpMillerRabin; // public BigInteger.prototype.clone = bnClone; BigInteger.prototype.intValue = bnIntValue; BigInteger.prototype.byteValue = bnByteValue; BigInteger.prototype.shortValue = bnShortValue; BigInteger.prototype.signum = bnSigNum; BigInteger.prototype.toByteArray = bnToByteArray; BigInteger.prototype.equals = bnEquals; BigInteger.prototype.min = bnMin; BigInteger.prototype.max = bnMax; BigInteger.prototype.and = bnAnd; BigInteger.prototype.or = bnOr; BigInteger.prototype.xor = bnXor; BigInteger.prototype.andNot = bnAndNot; BigInteger.prototype.not = bnNot; BigInteger.prototype.shiftLeft = bnShiftLeft; BigInteger.prototype.shiftRight = bnShiftRight; BigInteger.prototype.getLowestSetBit = bnGetLowestSetBit; BigInteger.prototype.bitCount = bnBitCount; BigInteger.prototype.testBit = bnTestBit; BigInteger.prototype.setBit = bnSetBit; BigInteger.prototype.clearBit = bnClearBit; BigInteger.prototype.flipBit = bnFlipBit; BigInteger.prototype.add = bnAdd; BigInteger.prototype.subtract = bnSubtract; BigInteger.prototype.multiply = bnMultiply; BigInteger.prototype.divide = bnDivide; BigInteger.prototype.remainder = bnRemainder; BigInteger.prototype.divideAndRemainder = bnDivideAndRemainder; BigInteger.prototype.modPow = bnModPow; BigInteger.prototype.modInverse = bnModInverse; BigInteger.prototype.pow = bnPow; BigInteger.prototype.gcd = bnGCD; BigInteger.prototype.isProbablePrime = bnIsProbablePrime; // JSBN-specific extension BigInteger.prototype.square = bnSquare; // Expose the Barrett function BigInteger.prototype.Barrett = Barrett // BigInteger interfaces not implemented in jsbn: // BigInteger(int signum, byte[] magnitude) // double doubleValue() // float floatValue() // int hashCode() // long longValue() // static BigInteger valueOf(long val) // Random number generator - requires a PRNG backend, e.g. prng4.js // For best results, put code like // // in your main HTML document. var rng_state; var rng_pool; var rng_pptr; // Mix in a 32-bit integer into the pool function rng_seed_int(x) { rng_pool[rng_pptr++] ^= x & 255; rng_pool[rng_pptr++] ^= (x >> 8) & 255; rng_pool[rng_pptr++] ^= (x >> 16) & 255; rng_pool[rng_pptr++] ^= (x >> 24) & 255; if(rng_pptr >= rng_psize) rng_pptr -= rng_psize; } // Mix in the current time (w/milliseconds) into the pool function rng_seed_time() { rng_seed_int(new Date().getTime()); } // Initialize the pool with junk if needed. if(rng_pool == null) { rng_pool = new Array(); rng_pptr = 0; var t; if(typeof window !== "undefined" && window.crypto) { if (window.crypto.getRandomValues) { // Use webcrypto if available var ua = new Uint8Array(32); window.crypto.getRandomValues(ua); for(t = 0; t < 32; ++t) rng_pool[rng_pptr++] = ua[t]; } else if(navigator.appName == "Netscape" && navigator.appVersion < "5") { // Extract entropy (256 bits) from NS4 RNG if available var z = window.crypto.random(32); for(t = 0; t < z.length; ++t) rng_pool[rng_pptr++] = z.charCodeAt(t) & 255; } } while(rng_pptr < rng_psize) { // extract some randomness from Math.random() t = Math.floor(65536 * Math.random()); rng_pool[rng_pptr++] = t >>> 8; rng_pool[rng_pptr++] = t & 255; } rng_pptr = 0; rng_seed_time(); //rng_seed_int(window.screenX); //rng_seed_int(window.screenY); } function rng_get_byte() { if(rng_state == null) { rng_seed_time(); rng_state = prng_newstate(); rng_state.init(rng_pool); for(rng_pptr = 0; rng_pptr < rng_pool.length; ++rng_pptr) rng_pool[rng_pptr] = 0; rng_pptr = 0; //rng_pool = null; } // TODO: allow reseeding after first request return rng_state.next(); } function rng_get_bytes(ba) { var i; for(i = 0; i < ba.length; ++i) ba[i] = rng_get_byte(); } function SecureRandom() {} SecureRandom.prototype.nextBytes = rng_get_bytes; // prng4.js - uses Arcfour as a PRNG function Arcfour() { this.i = 0; this.j = 0; this.S = new Array(); } // Initialize arcfour context from key, an array of ints, each from [0..255] function ARC4init(key) { var i, j, t; for(i = 0; i < 256; ++i) this.S[i] = i; j = 0; for(i = 0; i < 256; ++i) { j = (j + this.S[i] + key[i % key.length]) & 255; t = this.S[i]; this.S[i] = this.S[j]; this.S[j] = t; } this.i = 0; this.j = 0; } function ARC4next() { var t; this.i = (this.i + 1) & 255; this.j = (this.j + this.S[this.i]) & 255; t = this.S[this.i]; this.S[this.i] = this.S[this.j]; this.S[this.j] = t; return this.S[(t + this.S[this.i]) & 255]; } Arcfour.prototype.init = ARC4init; Arcfour.prototype.next = ARC4next; // Plug in your RNG constructor here function prng_newstate() { return new Arcfour(); } // Pool size must be a multiple of 4 and greater than 32. // An array of bytes the size of the pool will be passed to init() var rng_psize = 256; BigInteger.SecureRandom = SecureRandom; BigInteger.BigInteger = BigInteger; if (true) { exports = module.exports = BigInteger; } else {} }).call(this); /***/ }), /***/ 22820: /***/ ((__unused_webpack_module, exports) => { //TODO: handle reviver/dehydrate function like normal //and handle indentation, like normal. //if anyone needs this... please send pull request. exports.stringify = function stringify (o) { if('undefined' == typeof o) return o if(o && Buffer.isBuffer(o)) return JSON.stringify(':base64:' + o.toString('base64')) if(o && o.toJSON) o = o.toJSON() if(o && 'object' === typeof o) { var s = '' var array = Array.isArray(o) s = array ? '[' : '{' var first = true for(var k in o) { var ignore = 'function' == typeof o[k] || (!array && 'undefined' === typeof o[k]) if(Object.hasOwnProperty.call(o, k) && !ignore) { if(!first) s += ',' first = false if (array) { if(o[k] == undefined) s += 'null' else s += stringify(o[k]) } else if (o[k] !== void(0)) { s += stringify(k) + ':' + stringify(o[k]) } } } s += array ? ']' : '}' return s } else if ('string' === typeof o) { return JSON.stringify(/^:/.test(o) ? ':' + o : o) } else if ('undefined' === typeof o) { return 'null'; } else return JSON.stringify(o) } exports.parse = function (s) { return JSON.parse(s, function (key, value) { if('string' === typeof value) { if(/^:base64:/.test(value)) return new Buffer(value.substring(8), 'base64') else return /^:/.test(value) ? value.substring(1) : value } return value }) } /***/ }), /***/ 52533: /***/ ((module) => { "use strict"; var traverse = module.exports = function (schema, opts, cb) { // Legacy support for v0.3.1 and earlier. if (typeof opts == 'function') { cb = opts; opts = {}; } cb = opts.cb || cb; var pre = (typeof cb == 'function') ? cb : cb.pre || function() {}; var post = cb.post || function() {}; _traverse(opts, pre, post, schema, '', schema); }; traverse.keywords = { additionalItems: true, items: true, contains: true, additionalProperties: true, propertyNames: true, not: true }; traverse.arrayKeywords = { items: true, allOf: true, anyOf: true, oneOf: true }; traverse.propsKeywords = { definitions: true, properties: true, patternProperties: true, dependencies: true }; traverse.skipKeywords = { default: true, enum: true, const: true, required: true, maximum: true, minimum: true, exclusiveMaximum: true, exclusiveMinimum: true, multipleOf: true, maxLength: true, minLength: true, pattern: true, format: true, maxItems: true, minItems: true, uniqueItems: true, maxProperties: true, minProperties: true }; function _traverse(opts, pre, post, schema, jsonPtr, rootSchema, parentJsonPtr, parentKeyword, parentSchema, keyIndex) { if (schema && typeof schema == 'object' && !Array.isArray(schema)) { pre(schema, jsonPtr, rootSchema, parentJsonPtr, parentKeyword, parentSchema, keyIndex); for (var key in schema) { var sch = schema[key]; if (Array.isArray(sch)) { if (key in traverse.arrayKeywords) { for (var i=0; i schema.maxItems){ addError("There must be a maximum of " + schema.maxItems + " in the array"); } }else if(schema.properties || schema.additionalProperties){ errors.concat(checkObj(value, schema.properties, path, schema.additionalProperties)); } if(schema.pattern && typeof value == 'string' && !value.match(schema.pattern)){ addError("does not match the regex pattern " + schema.pattern); } if(schema.maxLength && typeof value == 'string' && value.length > schema.maxLength){ addError("may only be " + schema.maxLength + " characters long"); } if(schema.minLength && typeof value == 'string' && value.length < schema.minLength){ addError("must be at least " + schema.minLength + " characters long"); } if(typeof schema.minimum !== 'undefined' && typeof value == typeof schema.minimum && schema.minimum > value){ addError("must have a minimum value of " + schema.minimum); } if(typeof schema.maximum !== 'undefined' && typeof value == typeof schema.maximum && schema.maximum < value){ addError("must have a maximum value of " + schema.maximum); } if(schema['enum']){ var enumer = schema['enum']; l = enumer.length; var found; for(var j = 0; j < l; j++){ if(enumer[j]===value){ found=1; break; } } if(!found){ addError("does not have a value in the enumeration " + enumer.join(", ")); } } if(typeof schema.maxDecimal == 'number' && (value.toString().match(new RegExp("\\.[0-9]{" + (schema.maxDecimal + 1) + ",}")))){ addError("may only have " + schema.maxDecimal + " digits of decimal places"); } } } return null; } // validate an object against a schema function checkObj(instance,objTypeDef,path,additionalProp){ if(typeof objTypeDef =='object'){ if(typeof instance != 'object' || instance instanceof Array){ errors.push({property:path,message:"an object is required"}); } for(var i in objTypeDef){ if(objTypeDef.hasOwnProperty(i) && i != '__proto__' && i != 'constructor'){ var value = instance.hasOwnProperty(i) ? instance[i] : undefined; // skip _not_ specified properties if (value === undefined && options.existingOnly) continue; var propDef = objTypeDef[i]; // set default if(value === undefined && propDef["default"]){ value = instance[i] = propDef["default"]; } if(options.coerce && i in instance){ value = instance[i] = options.coerce(value, propDef); } checkProp(value,propDef,path,i); } } } for(i in instance){ if(instance.hasOwnProperty(i) && !(i.charAt(0) == '_' && i.charAt(1) == '_') && objTypeDef && !objTypeDef[i] && additionalProp===false){ if (options.filter) { delete instance[i]; continue; } else { errors.push({property:path,message:"The property " + i + " is not defined in the schema and the schema does not allow additional properties"}); } } var requires = objTypeDef && objTypeDef[i] && objTypeDef[i].requires; if(requires && !(requires in instance)){ errors.push({property:path,message:"the presence of the property " + i + " requires that " + requires + " also be present"}); } value = instance[i]; if(additionalProp && (!(objTypeDef && typeof objTypeDef == 'object') || !(i in objTypeDef))){ if(options.coerce){ value = instance[i] = options.coerce(value, additionalProp); } checkProp(value,additionalProp,path,i); } if(!_changing && value && value.$schema){ errors = errors.concat(checkProp(value,value.$schema,path,i)); } } return errors; } if(schema){ checkProp(instance,schema,'',_changing || ''); } if(!_changing && instance && instance.$schema){ checkProp(instance,instance.$schema,'',''); } return {valid:!errors.length,errors:errors}; }; exports.mustBeValid = function(result){ // summary: // This checks to ensure that the result is valid and will throw an appropriate error message if it is not // result: the result returned from checkPropertyChange or validate if(!result.valid){ throw new TypeError(result.errors.map(function(error){return "for property " + error.property + ': ' + error.message;}).join(", \n")); } } return exports; })); /***/ }), /***/ 81676: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { var util = __webpack_require__(31669), TransformStream = __webpack_require__(92413).Transform; module.exports = function (options) { return new JSONStream(options); }; var JSONStream = module.exports.JSONStream = function (options) { options = options || {}; TransformStream.call(this, options); this._writableState.objectMode = false; this._readableState.objectMode = true; this._async = options.async || false; }; util.inherits(JSONStream, TransformStream); JSONStream.prototype._transform = function (data, encoding, callback) { if (!Buffer.isBuffer(data)) data = new Buffer(data); if (this._buffer) { data = Buffer.concat([this._buffer, data]); } var ptr = 0, start = 0; while (++ptr <= data.length) { if (data[ptr] === 10 || ptr === data.length) { var line; try { line = JSON.parse(data.slice(start, ptr)); } catch (ex) { } if (line) { this.push(line); line = null; } if (data[ptr] === 10) start = ++ptr; } } this._buffer = data.slice(start); return this._async ? void setImmediate(callback) : void callback(); }; /***/ }), /***/ 57073: /***/ ((module, exports) => { exports = module.exports = stringify exports.getSerialize = serializer function stringify(obj, replacer, spaces, cycleReplacer) { return JSON.stringify(obj, serializer(replacer, cycleReplacer), spaces) } function serializer(replacer, cycleReplacer) { var stack = [], keys = [] if (cycleReplacer == null) cycleReplacer = function(key, value) { if (stack[0] === value) return "[Circular ~]" return "[Circular ~." + keys.slice(0, stack.indexOf(value)).join(".") + "]" } return function(key, value) { if (stack.length > 0) { var thisPos = stack.indexOf(this) ~thisPos ? stack.splice(thisPos + 1) : stack.push(this) ~thisPos ? keys.splice(thisPos, Infinity, key) : keys.push(key) if (~stack.indexOf(value)) value = cycleReplacer.call(this, key, value) } else stack.push(value) return replacer == null ? value : replacer.call(this, key, value) } } /***/ }), /***/ 63269: /***/ (function(module, exports, __webpack_require__) { (function (global, factory) { true ? factory(exports) : 0; }(this, function (exports) { 'use strict'; function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function (obj) { return typeof obj; }; } else { _typeof = function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); } function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); } function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); } function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); } function isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } } function _construct(Parent, args, Class) { if (isNativeReflectConstruct()) { _construct = Reflect.construct; } else { _construct = function _construct(Parent, args, Class) { var a = [null]; a.push.apply(a, args); var Constructor = Function.bind.apply(Parent, a); var instance = new Constructor(); if (Class) _setPrototypeOf(instance, Class.prototype); return instance; }; } return _construct.apply(null, arguments); } function _isNativeFunction(fn) { return Function.toString.call(fn).indexOf("[native code]") !== -1; } function _wrapNativeSuper(Class) { var _cache = typeof Map === "function" ? new Map() : undefined; _wrapNativeSuper = function _wrapNativeSuper(Class) { if (Class === null || !_isNativeFunction(Class)) return Class; if (typeof Class !== "function") { throw new TypeError("Super expression must either be null or a function"); } if (typeof _cache !== "undefined") { if (_cache.has(Class)) return _cache.get(Class); _cache.set(Class, Wrapper); } function Wrapper() { return _construct(Class, arguments, _getPrototypeOf(this).constructor); } Wrapper.prototype = Object.create(Class.prototype, { constructor: { value: Wrapper, enumerable: false, writable: true, configurable: true } }); return _setPrototypeOf(Wrapper, Class); }; return _wrapNativeSuper(Class); } function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; } function _possibleConstructorReturn(self, call) { if (call && (typeof call === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); } /* eslint-disable no-eval */ var globalEval = eval; // eslint-disable-next-line import/no-commonjs var supportsNodeVM = true && Boolean(module.exports) && !(typeof navigator !== 'undefined' && navigator.product === 'ReactNative'); var allowedResultTypes = ['value', 'path', 'pointer', 'parent', 'parentProperty', 'all']; var hasOwnProp = Object.prototype.hasOwnProperty; /** * Copy items out of one array into another. * @param {Array} source Array with items to copy * @param {Array} target Array to which to copy * @param {Function} conditionCb Callback passed the current item; will move * item if evaluates to `true` * @returns {undefined} */ var moveToAnotherArray = function moveToAnotherArray(source, target, conditionCb) { var il = source.length; for (var i = 0; i < il; i++) { var item = source[i]; if (conditionCb(item)) { target.push(source.splice(i--, 1)[0]); } } }; var vm = supportsNodeVM ? __webpack_require__(92184) : { /** * @param {string} expr Expression to evaluate * @param {Object} context Object whose items will be added to evaluation * @returns {*} Result of evaluated code */ runInNewContext: function runInNewContext(expr, context) { var keys = Object.keys(context); var funcs = []; moveToAnotherArray(keys, funcs, function (key) { return typeof context[key] === 'function'; }); var code = funcs.reduce(function (s, func) { var fString = context[func].toString(); if (!/function/.exec(fString)) { fString = 'function ' + fString; } return 'var ' + func + '=' + fString + ';' + s; }, '') + keys.reduce(function (s, vr) { return 'var ' + vr + '=' + JSON.stringify(context[vr]).replace( // http://www.thespanner.co.uk/2011/07/25/the-json-specification-is-now-wrong/ /\u2028|\u2029/g, function (m) { return "\\u202" + (m === "\u2028" ? '8' : '9'); }) + ';' + s; }, expr); return globalEval(code); } }; /** * Copies array and then pushes item into it. * @param {Array} arr Array to copy and into which to push * @param {*} item Array item to add (to end) * @returns {Array} Copy of the original array */ function push(arr, item) { arr = arr.slice(); arr.push(item); return arr; } /** * Copies array and then unshifts item into it. * @param {*} item Array item to add (to beginning) * @param {Array} arr Array to copy and into which to unshift * @returns {Array} Copy of the original array */ function unshift(item, arr) { arr = arr.slice(); arr.unshift(item); return arr; } /** * Caught when JSONPath is used without `new` but rethrown if with `new` * @extends Error */ var NewError = /*#__PURE__*/ function (_Error) { _inherits(NewError, _Error); /** * @param {*} value The evaluated scalar value */ function NewError(value) { var _this; _classCallCheck(this, NewError); _this = _possibleConstructorReturn(this, _getPrototypeOf(NewError).call(this, 'JSONPath should not be called with "new" (it prevents return of (unwrapped) scalar values)')); _this.avoidNew = true; _this.value = value; _this.name = 'NewError'; return _this; } return NewError; }(_wrapNativeSuper(Error)); /** * @param {Object} [opts] If present, must be an object * @param {string} expr JSON path to evaluate * @param {JSON} obj JSON object to evaluate against * @param {Function} callback Passed 3 arguments: 1) desired payload per `resultType`, * 2) `"value"|"property"`, 3) Full returned object with all payloads * @param {Function} otherTypeCallback If `@other()` is at the end of one's query, this * will be invoked with the value of the item, its path, its parent, and its parent's * property name, and it should return a boolean indicating whether the supplied value * belongs to the "other" type or not (or it may handle transformations and return `false`). * @returns {JSONPath} * @class */ function JSONPath(opts, expr, obj, callback, otherTypeCallback) { // eslint-disable-next-line no-restricted-syntax if (!(this instanceof JSONPath)) { try { return new JSONPath(opts, expr, obj, callback, otherTypeCallback); } catch (e) { if (!e.avoidNew) { throw e; } return e.value; } } if (typeof opts === 'string') { otherTypeCallback = callback; callback = obj; obj = expr; expr = opts; opts = {}; } opts = opts || {}; var objArgs = hasOwnProp.call(opts, 'json') && hasOwnProp.call(opts, 'path'); this.json = opts.json || obj; this.path = opts.path || expr; this.resultType = opts.resultType && opts.resultType.toLowerCase() || 'value'; this.flatten = opts.flatten || false; this.wrap = hasOwnProp.call(opts, 'wrap') ? opts.wrap : true; this.sandbox = opts.sandbox || {}; this.preventEval = opts.preventEval || false; this.parent = opts.parent || null; this.parentProperty = opts.parentProperty || null; this.callback = opts.callback || callback || null; this.otherTypeCallback = opts.otherTypeCallback || otherTypeCallback || function () { throw new Error('You must supply an otherTypeCallback callback option with the @other() operator.'); }; if (opts.autostart !== false) { var ret = this.evaluate({ path: objArgs ? opts.path : expr, json: objArgs ? opts.json : obj }); if (!ret || _typeof(ret) !== 'object') { throw new NewError(ret); } return ret; } } // PUBLIC METHODS JSONPath.prototype.evaluate = function (expr, json, callback, otherTypeCallback) { var that = this; var currParent = this.parent, currParentProperty = this.parentProperty; var flatten = this.flatten, wrap = this.wrap; this.currResultType = this.resultType; this.currPreventEval = this.preventEval; this.currSandbox = this.sandbox; callback = callback || this.callback; this.currOtherTypeCallback = otherTypeCallback || this.otherTypeCallback; json = json || this.json; expr = expr || this.path; if (expr && _typeof(expr) === 'object') { if (!expr.path) { throw new Error('You must supply a "path" property when providing an object argument to JSONPath.evaluate().'); } json = hasOwnProp.call(expr, 'json') ? expr.json : json; flatten = hasOwnProp.call(expr, 'flatten') ? expr.flatten : flatten; this.currResultType = hasOwnProp.call(expr, 'resultType') ? expr.resultType : this.currResultType; this.currSandbox = hasOwnProp.call(expr, 'sandbox') ? expr.sandbox : this.currSandbox; wrap = hasOwnProp.call(expr, 'wrap') ? expr.wrap : wrap; this.currPreventEval = hasOwnProp.call(expr, 'preventEval') ? expr.preventEval : this.currPreventEval; callback = hasOwnProp.call(expr, 'callback') ? expr.callback : callback; this.currOtherTypeCallback = hasOwnProp.call(expr, 'otherTypeCallback') ? expr.otherTypeCallback : this.currOtherTypeCallback; currParent = hasOwnProp.call(expr, 'parent') ? expr.parent : currParent; currParentProperty = hasOwnProp.call(expr, 'parentProperty') ? expr.parentProperty : currParentProperty; expr = expr.path; } currParent = currParent || null; currParentProperty = currParentProperty || null; if (Array.isArray(expr)) { expr = JSONPath.toPathString(expr); } if (!expr || !json || !allowedResultTypes.includes(this.currResultType)) { return undefined; } this._obj = json; var exprList = JSONPath.toPathArray(expr); if (exprList[0] === '$' && exprList.length > 1) { exprList.shift(); } this._hasParentSelector = null; var result = this._trace(exprList, json, ['$'], currParent, currParentProperty, callback).filter(function (ea) { return ea && !ea.isParentSelector; }); if (!result.length) { return wrap ? [] : undefined; } if (result.length === 1 && !wrap && !Array.isArray(result[0].value)) { return this._getPreferredOutput(result[0]); } return result.reduce(function (rslt, ea) { var valOrPath = that._getPreferredOutput(ea); if (flatten && Array.isArray(valOrPath)) { rslt = rslt.concat(valOrPath); } else { rslt.push(valOrPath); } return rslt; }, []); }; // PRIVATE METHODS JSONPath.prototype._getPreferredOutput = function (ea) { var resultType = this.currResultType; switch (resultType) { default: throw new TypeError('Unknown result type'); case 'all': ea.pointer = JSONPath.toPointer(ea.path); ea.path = typeof ea.path === 'string' ? ea.path : JSONPath.toPathString(ea.path); return ea; case 'value': case 'parent': case 'parentProperty': return ea[resultType]; case 'path': return JSONPath.toPathString(ea[resultType]); case 'pointer': return JSONPath.toPointer(ea.path); } }; JSONPath.prototype._handleCallback = function (fullRetObj, callback, type) { if (callback) { var preferredOutput = this._getPreferredOutput(fullRetObj); fullRetObj.path = typeof fullRetObj.path === 'string' ? fullRetObj.path : JSONPath.toPathString(fullRetObj.path); // eslint-disable-next-line callback-return callback(preferredOutput, type, fullRetObj); } }; JSONPath.prototype._trace = function (expr, val, path, parent, parentPropName, callback, literalPriority) { // No expr to follow? return path and value as the result of this trace branch var retObj; var that = this; if (!expr.length) { retObj = { path: path, value: val, parent: parent, parentProperty: parentPropName }; this._handleCallback(retObj, callback, 'value'); return retObj; } var loc = expr[0], x = expr.slice(1); // We need to gather the return value of recursive trace calls in order to // do the parent sel computation. var ret = []; function addRet(elems) { if (Array.isArray(elems)) { // This was causing excessive stack size in Node (with or without Babel) against our performance test: `ret.push(...elems);` elems.forEach(function (t) { ret.push(t); }); } else { ret.push(elems); } } if ((typeof loc !== 'string' || literalPriority) && val && hasOwnProp.call(val, loc)) { // simple case--directly follow property addRet(this._trace(x, val[loc], push(path, loc), val, loc, callback)); } else if (loc === '*') { // all child properties // eslint-disable-next-line no-shadow this._walk(loc, x, val, path, parent, parentPropName, callback, function (m, l, x, v, p, par, pr, cb) { addRet(that._trace(unshift(m, x), v, p, par, pr, cb, true)); }); } else if (loc === '..') { // all descendent parent properties addRet(this._trace(x, val, path, parent, parentPropName, callback)); // Check remaining expression with val's immediate children // eslint-disable-next-line no-shadow this._walk(loc, x, val, path, parent, parentPropName, callback, function (m, l, x, v, p, par, pr, cb) { // We don't join m and x here because we only want parents, not scalar values if (_typeof(v[m]) === 'object') { // Keep going with recursive descent on val's object children addRet(that._trace(unshift(l, x), v[m], push(p, m), v, m, cb)); } }); // The parent sel computation is handled in the frame above using the // ancestor object of val } else if (loc === '^') { // This is not a final endpoint, so we do not invoke the callback here this._hasParentSelector = true; return path.length ? { path: path.slice(0, -1), expr: x, isParentSelector: true } : []; } else if (loc === '~') { // property name retObj = { path: push(path, loc), value: parentPropName, parent: parent, parentProperty: null }; this._handleCallback(retObj, callback, 'property'); return retObj; } else if (loc === '$') { // root only addRet(this._trace(x, val, path, null, null, callback)); } else if (/^(-?\d*):(-?\d*):?(\d*)$/.test(loc)) { // [start:end:step] Python slice syntax addRet(this._slice(loc, x, val, path, parent, parentPropName, callback)); } else if (loc.indexOf('?(') === 0) { // [?(expr)] (filtering) if (this.currPreventEval) { throw new Error('Eval [?(expr)] prevented in JSONPath expression.'); } // eslint-disable-next-line no-shadow this._walk(loc, x, val, path, parent, parentPropName, callback, function (m, l, x, v, p, par, pr, cb) { if (that._eval(l.replace(/^\?\((.*?)\)$/, '$1'), v[m], m, p, par, pr)) { addRet(that._trace(unshift(m, x), v, p, par, pr, cb)); } }); } else if (loc[0] === '(') { // [(expr)] (dynamic property/index) if (this.currPreventEval) { throw new Error('Eval [(expr)] prevented in JSONPath expression.'); } // 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 addRet(this._trace(unshift(this._eval(loc, val, path[path.length - 1], path.slice(0, -1), parent, parentPropName), x), val, path, parent, parentPropName, callback)); } else if (loc[0] === '@') { // value type: @boolean(), etc. var addType = false; var valueType = loc.slice(1, -2); switch (valueType) { default: throw new TypeError('Unknown value type ' + valueType); case 'scalar': if (!val || !['object', 'function'].includes(_typeof(val))) { addType = true; } break; case 'boolean': case 'string': case 'undefined': case 'function': if (_typeof(val) === valueType) { // eslint-disable-line valid-typeof addType = true; } break; case 'number': if (_typeof(val) === valueType && isFinite(val)) { // eslint-disable-line valid-typeof addType = true; } break; case 'nonFinite': if (typeof val === 'number' && !isFinite(val)) { addType = true; } break; case 'object': if (val && _typeof(val) === valueType) { // eslint-disable-line valid-typeof addType = true; } break; case 'array': if (Array.isArray(val)) { addType = true; } break; case 'other': addType = this.currOtherTypeCallback(val, path, parent, parentPropName); break; case 'integer': if (val === Number(val) && isFinite(val) && !(val % 1)) { addType = true; } break; case 'null': if (val === null) { addType = true; } break; } if (addType) { retObj = { path: path, value: val, parent: parent, parentProperty: parentPropName }; this._handleCallback(retObj, callback, 'value'); return retObj; } } else if (loc[0] === '`' && val && hasOwnProp.call(val, loc.slice(1))) { // `-escaped property var locProp = loc.slice(1); addRet(this._trace(x, val[locProp], push(path, locProp), val, locProp, callback, true)); } else if (loc.includes(',')) { // [name1,name2,...] var parts = loc.split(','); var _iteratorNormalCompletion = true; var _didIteratorError = false; var _iteratorError = undefined; try { for (var _iterator = parts[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) { var part = _step.value; addRet(this._trace(unshift(part, x), val, path, parent, parentPropName, callback)); } } catch (err) { _didIteratorError = true; _iteratorError = err; } finally { try { if (!_iteratorNormalCompletion && _iterator["return"] != null) { _iterator["return"](); } } finally { if (_didIteratorError) { throw _iteratorError; } } } } else if (!literalPriority && val && hasOwnProp.call(val, loc)) { // simple case--directly follow property addRet(this._trace(x, val[loc], push(path, loc), val, loc, callback, true)); } // We check the resulting values for parent selections. For parent // selections we discard the value object and continue the trace with the // current val object if (this._hasParentSelector) { // eslint-disable-next-line unicorn/no-for-loop for (var t = 0; t < ret.length; t++) { var rett = ret[t]; if (rett.isParentSelector) { var tmp = that._trace(rett.expr, val, rett.path, parent, parentPropName, callback); if (Array.isArray(tmp)) { ret[t] = tmp[0]; var tl = tmp.length; for (var tt = 1; tt < tl; tt++) { t++; ret.splice(t, 0, tmp[tt]); } } else { ret[t] = tmp; } } } } return ret; }; JSONPath.prototype._walk = function (loc, expr, val, path, parent, parentPropName, callback, f) { if (Array.isArray(val)) { var n = val.length; for (var i = 0; i < n; i++) { f(i, loc, expr, val, path, parent, parentPropName, callback); } } else if (_typeof(val) === 'object') { for (var m in val) { if (hasOwnProp.call(val, m)) { f(m, loc, expr, val, path, parent, parentPropName, callback); } } } }; JSONPath.prototype._slice = function (loc, expr, val, path, parent, parentPropName, callback) { if (!Array.isArray(val)) { return undefined; } var len = val.length, parts = loc.split(':'), step = parts[2] && parseInt(parts[2]) || 1; var start = parts[0] && parseInt(parts[0]) || 0, end = parts[1] && parseInt(parts[1]) || len; start = start < 0 ? Math.max(0, start + len) : Math.min(len, start); end = end < 0 ? Math.max(0, end + len) : Math.min(len, end); var ret = []; for (var i = start; i < end; i += step) { var tmp = this._trace(unshift(i, expr), val, path, parent, parentPropName, callback); if (Array.isArray(tmp)) { // This was causing excessive stack size in Node (with or without Babel) against our performance test: `ret.push(...tmp);` tmp.forEach(function (t) { ret.push(t); }); } else { ret.push(tmp); } } return ret; }; JSONPath.prototype._eval = function (code, _v, _vname, path, parent, parentPropName) { if (!this._obj || !_v) { return false; } if (code.includes('@parentProperty')) { this.currSandbox._$_parentProperty = parentPropName; code = code.replace(/@parentProperty/g, '_$_parentProperty'); } if (code.includes('@parent')) { this.currSandbox._$_parent = parent; code = code.replace(/@parent/g, '_$_parent'); } if (code.includes('@property')) { this.currSandbox._$_property = _vname; code = code.replace(/@property/g, '_$_property'); } if (code.includes('@path')) { this.currSandbox._$_path = JSONPath.toPathString(path.concat([_vname])); code = code.replace(/@path/g, '_$_path'); } if (code.match(/@([.\s)[])/)) { this.currSandbox._$_v = _v; code = code.replace(/@([.\s)[])/g, '_$_v$1'); } try { return vm.runInNewContext(code, this.currSandbox); } catch (e) { // eslint-disable-next-line no-console console.log(e); throw new Error('jsonPath: ' + e.message + ': ' + code); } }; // PUBLIC CLASS PROPERTIES AND METHODS // Could store the cache object itself JSONPath.cache = {}; /** * @param {string[]} pathArr Array to convert * @returns {string} The path string */ JSONPath.toPathString = function (pathArr) { var x = pathArr, n = x.length; var p = '$'; for (var i = 1; i < n; i++) { if (!/^(~|\^|@.*?\(\))$/.test(x[i])) { p += /^[0-9*]+$/.test(x[i]) ? '[' + x[i] + ']' : "['" + x[i] + "']"; } } return p; }; /** * @param {string} pointer JSON Path * @returns {string} JSON Pointer */ JSONPath.toPointer = function (pointer) { var x = pointer, n = x.length; var p = ''; for (var i = 1; i < n; i++) { if (!/^(~|\^|@.*?\(\))$/.test(x[i])) { p += '/' + x[i].toString().replace(/~/g, '~0').replace(/\//g, '~1'); } } return p; }; /** * @param {string} expr Expression to convert * @returns {string[]} */ JSONPath.toPathArray = function (expr) { var cache = JSONPath.cache; if (cache[expr]) { return cache[expr].concat(); } var subx = []; var normalized = expr // Properties .replace(/@(?:null|boolean|number|string|integer|undefined|nonFinite|scalar|array|object|function|other)\(\)/g, ';$&;') // Parenthetical evaluations (filtering and otherwise), directly // within brackets or single quotes .replace(/[['](\??\(.*?\))[\]']/g, function ($0, $1) { return '[#' + (subx.push($1) - 1) + ']'; }) // Escape periods and tildes within properties .replace(/\['([^'\]]*)'\]/g, function ($0, prop) { return "['" + prop.replace(/\./g, '%@%').replace(/~/g, '%%@@%%') + "']"; }) // Properties operator .replace(/~/g, ';~;') // Split by property boundaries .replace(/'?\.'?(?![^[]*\])|\['?/g, ';') // Reinsert periods within properties .replace(/%@%/g, '.') // Reinsert tildes within properties .replace(/%%@@%%/g, '~') // Parent .replace(/(?:;)?(\^+)(?:;)?/g, function ($0, ups) { return ';' + ups.split('').join(';') + ';'; }) // Descendents .replace(/;;;|;;/g, ';..;') // Remove trailing .replace(/;$|'?\]|'$/g, ''); var exprList = normalized.split(';').map(function (exp) { var match = exp.match(/#(\d+)/); return !match || !match[1] ? exp : subx[match[1]]; }); cache[expr] = exprList; return cache[expr]; }; exports.JSONPath = JSONPath; Object.defineProperty(exports, '__esModule', { value: true }); })); /***/ }), /***/ 6287: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { /* * lib/jsprim.js: utilities for primitive JavaScript types */ var mod_assert = __webpack_require__(66631); var mod_util = __webpack_require__(31669); var mod_extsprintf = __webpack_require__(87264); var mod_verror = __webpack_require__(81692); var mod_jsonschema = __webpack_require__(21328); /* * Public interface */ exports.deepCopy = deepCopy; exports.deepEqual = deepEqual; exports.isEmpty = isEmpty; exports.hasKey = hasKey; exports.forEachKey = forEachKey; exports.pluck = pluck; exports.flattenObject = flattenObject; exports.flattenIter = flattenIter; exports.validateJsonObject = validateJsonObjectJS; exports.validateJsonObjectJS = validateJsonObjectJS; exports.randElt = randElt; exports.extraProperties = extraProperties; exports.mergeObjects = mergeObjects; exports.startsWith = startsWith; exports.endsWith = endsWith; exports.parseInteger = parseInteger; exports.iso8601 = iso8601; exports.rfc1123 = rfc1123; exports.parseDateTime = parseDateTime; exports.hrtimediff = hrtimeDiff; exports.hrtimeDiff = hrtimeDiff; exports.hrtimeAccum = hrtimeAccum; exports.hrtimeAdd = hrtimeAdd; exports.hrtimeNanosec = hrtimeNanosec; exports.hrtimeMicrosec = hrtimeMicrosec; exports.hrtimeMillisec = hrtimeMillisec; /* * Deep copy an acyclic *basic* Javascript object. This only handles basic * scalars (strings, numbers, booleans) and arbitrarily deep arrays and objects * containing these. This does *not* handle instances of other classes. */ function deepCopy(obj) { var ret, key; var marker = '__deepCopy'; if (obj && obj[marker]) throw (new Error('attempted deep copy of cyclic object')); if (obj && obj.constructor == Object) { ret = {}; obj[marker] = true; for (key in obj) { if (key == marker) continue; ret[key] = deepCopy(obj[key]); } delete (obj[marker]); return (ret); } if (obj && obj.constructor == Array) { ret = []; obj[marker] = true; for (key = 0; key < obj.length; key++) ret.push(deepCopy(obj[key])); delete (obj[marker]); return (ret); } /* * It must be a primitive type -- just return it. */ return (obj); } function deepEqual(obj1, obj2) { if (typeof (obj1) != typeof (obj2)) return (false); if (obj1 === null || obj2 === null || typeof (obj1) != 'object') return (obj1 === obj2); if (obj1.constructor != obj2.constructor) return (false); var k; for (k in obj1) { if (!obj2.hasOwnProperty(k)) return (false); if (!deepEqual(obj1[k], obj2[k])) return (false); } for (k in obj2) { if (!obj1.hasOwnProperty(k)) return (false); } return (true); } function isEmpty(obj) { var key; for (key in obj) return (false); return (true); } function hasKey(obj, key) { mod_assert.equal(typeof (key), 'string'); return (Object.prototype.hasOwnProperty.call(obj, key)); } function forEachKey(obj, callback) { for (var key in obj) { if (hasKey(obj, key)) { callback(key, obj[key]); } } } function pluck(obj, key) { mod_assert.equal(typeof (key), 'string'); return (pluckv(obj, key)); } function pluckv(obj, key) { if (obj === null || typeof (obj) !== 'object') return (undefined); if (obj.hasOwnProperty(key)) return (obj[key]); var i = key.indexOf('.'); if (i == -1) return (undefined); var key1 = key.substr(0, i); if (!obj.hasOwnProperty(key1)) return (undefined); return (pluckv(obj[key1], key.substr(i + 1))); } /* * Invoke callback(row) for each entry in the array that would be returned by * flattenObject(data, depth). This is just like flattenObject(data, * depth).forEach(callback), except that the intermediate array is never * created. */ function flattenIter(data, depth, callback) { doFlattenIter(data, depth, [], callback); } function doFlattenIter(data, depth, accum, callback) { var each; var key; if (depth === 0) { each = accum.slice(0); each.push(data); callback(each); return; } mod_assert.ok(data !== null); mod_assert.equal(typeof (data), 'object'); mod_assert.equal(typeof (depth), 'number'); mod_assert.ok(depth >= 0); for (key in data) { each = accum.slice(0); each.push(key); doFlattenIter(data[key], depth - 1, each, callback); } } function flattenObject(data, depth) { if (depth === 0) return ([ data ]); mod_assert.ok(data !== null); mod_assert.equal(typeof (data), 'object'); mod_assert.equal(typeof (depth), 'number'); mod_assert.ok(depth >= 0); var rv = []; var key; for (key in data) { flattenObject(data[key], depth - 1).forEach(function (p) { rv.push([ key ].concat(p)); }); } return (rv); } function startsWith(str, prefix) { return (str.substr(0, prefix.length) == prefix); } function endsWith(str, suffix) { return (str.substr( str.length - suffix.length, suffix.length) == suffix); } function iso8601(d) { if (typeof (d) == 'number') d = new Date(d); mod_assert.ok(d.constructor === Date); return (mod_extsprintf.sprintf('%4d-%02d-%02dT%02d:%02d:%02d.%03dZ', d.getUTCFullYear(), d.getUTCMonth() + 1, d.getUTCDate(), d.getUTCHours(), d.getUTCMinutes(), d.getUTCSeconds(), d.getUTCMilliseconds())); } var RFC1123_MONTHS = [ 'Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec']; var RFC1123_DAYS = [ 'Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat']; function rfc1123(date) { return (mod_extsprintf.sprintf('%s, %02d %s %04d %02d:%02d:%02d GMT', RFC1123_DAYS[date.getUTCDay()], date.getUTCDate(), RFC1123_MONTHS[date.getUTCMonth()], date.getUTCFullYear(), date.getUTCHours(), date.getUTCMinutes(), date.getUTCSeconds())); } /* * Parses a date expressed as a string, as either a number of milliseconds since * the epoch or any string format that Date accepts, giving preference to the * former where these two sets overlap (e.g., small numbers). */ function parseDateTime(str) { /* * This is irritatingly implicit, but significantly more concise than * alternatives. The "+str" will convert a string containing only a * number directly to a Number, or NaN for other strings. Thus, if the * conversion succeeds, we use it (this is the milliseconds-since-epoch * case). Otherwise, we pass the string directly to the Date * constructor to parse. */ var numeric = +str; if (!isNaN(numeric)) { return (new Date(numeric)); } else { return (new Date(str)); } } /* * Number.*_SAFE_INTEGER isn't present before node v0.12, so we hardcode * the ES6 definitions here, while allowing for them to someday be higher. */ var MAX_SAFE_INTEGER = Number.MAX_SAFE_INTEGER || 9007199254740991; var MIN_SAFE_INTEGER = Number.MIN_SAFE_INTEGER || -9007199254740991; /* * Default options for parseInteger(). */ var PI_DEFAULTS = { base: 10, allowSign: true, allowPrefix: false, allowTrailing: false, allowImprecise: false, trimWhitespace: false, leadingZeroIsOctal: false }; var CP_0 = 0x30; var CP_9 = 0x39; var CP_A = 0x41; var CP_B = 0x42; var CP_O = 0x4f; var CP_T = 0x54; var CP_X = 0x58; var CP_Z = 0x5a; var CP_a = 0x61; var CP_b = 0x62; var CP_o = 0x6f; var CP_t = 0x74; var CP_x = 0x78; var CP_z = 0x7a; var PI_CONV_DEC = 0x30; var PI_CONV_UC = 0x37; var PI_CONV_LC = 0x57; /* * A stricter version of parseInt() that provides options for changing what * is an acceptable string (for example, disallowing trailing characters). */ function parseInteger(str, uopts) { mod_assert.string(str, 'str'); mod_assert.optionalObject(uopts, 'options'); var baseOverride = false; var options = PI_DEFAULTS; if (uopts) { baseOverride = hasKey(uopts, 'base'); options = mergeObjects(options, uopts); mod_assert.number(options.base, 'options.base'); mod_assert.ok(options.base >= 2, 'options.base >= 2'); mod_assert.ok(options.base <= 36, 'options.base <= 36'); mod_assert.bool(options.allowSign, 'options.allowSign'); mod_assert.bool(options.allowPrefix, 'options.allowPrefix'); mod_assert.bool(options.allowTrailing, 'options.allowTrailing'); mod_assert.bool(options.allowImprecise, 'options.allowImprecise'); mod_assert.bool(options.trimWhitespace, 'options.trimWhitespace'); mod_assert.bool(options.leadingZeroIsOctal, 'options.leadingZeroIsOctal'); if (options.leadingZeroIsOctal) { mod_assert.ok(!baseOverride, '"base" and "leadingZeroIsOctal" are ' + 'mutually exclusive'); } } var c; var pbase = -1; var base = options.base; var start; var mult = 1; var value = 0; var idx = 0; var len = str.length; /* Trim any whitespace on the left side. */ if (options.trimWhitespace) { while (idx < len && isSpace(str.charCodeAt(idx))) { ++idx; } } /* Check the number for a leading sign. */ if (options.allowSign) { if (str[idx] === '-') { idx += 1; mult = -1; } else if (str[idx] === '+') { idx += 1; } } /* Parse the base-indicating prefix if there is one. */ if (str[idx] === '0') { if (options.allowPrefix) { pbase = prefixToBase(str.charCodeAt(idx + 1)); if (pbase !== -1 && (!baseOverride || pbase === base)) { base = pbase; idx += 2; } } if (pbase === -1 && options.leadingZeroIsOctal) { base = 8; } } /* Parse the actual digits. */ for (start = idx; idx < len; ++idx) { c = translateDigit(str.charCodeAt(idx)); if (c !== -1 && c < base) { value *= base; value += c; } else { break; } } /* If we didn't parse any digits, we have an invalid number. */ if (start === idx) { return (new Error('invalid number: ' + JSON.stringify(str))); } /* Trim any whitespace on the right side. */ if (options.trimWhitespace) { while (idx < len && isSpace(str.charCodeAt(idx))) { ++idx; } } /* Check for trailing characters. */ if (idx < len && !options.allowTrailing) { return (new Error('trailing characters after number: ' + JSON.stringify(str.slice(idx)))); } /* If our value is 0, we return now, to avoid returning -0. */ if (value === 0) { return (0); } /* Calculate our final value. */ var result = value * mult; /* * If the string represents a value that cannot be precisely represented * by JavaScript, then we want to check that: * * - We never increased the value past MAX_SAFE_INTEGER * - We don't make the result negative and below MIN_SAFE_INTEGER * * Because we only ever increment the value during parsing, there's no * chance of moving past MAX_SAFE_INTEGER and then dropping below it * again, losing precision in the process. This means that we only need * to do our checks here, at the end. */ if (!options.allowImprecise && (value > MAX_SAFE_INTEGER || result < MIN_SAFE_INTEGER)) { return (new Error('number is outside of the supported range: ' + JSON.stringify(str.slice(start, idx)))); } return (result); } /* * Interpret a character code as a base-36 digit. */ function translateDigit(d) { if (d >= CP_0 && d <= CP_9) { /* '0' to '9' -> 0 to 9 */ return (d - PI_CONV_DEC); } else if (d >= CP_A && d <= CP_Z) { /* 'A' - 'Z' -> 10 to 35 */ return (d - PI_CONV_UC); } else if (d >= CP_a && d <= CP_z) { /* 'a' - 'z' -> 10 to 35 */ return (d - PI_CONV_LC); } else { /* Invalid character code */ return (-1); } } /* * Test if a value matches the ECMAScript definition of trimmable whitespace. */ function isSpace(c) { return (c === 0x20) || (c >= 0x0009 && c <= 0x000d) || (c === 0x00a0) || (c === 0x1680) || (c === 0x180e) || (c >= 0x2000 && c <= 0x200a) || (c === 0x2028) || (c === 0x2029) || (c === 0x202f) || (c === 0x205f) || (c === 0x3000) || (c === 0xfeff); } /* * Determine which base a character indicates (e.g., 'x' indicates hex). */ function prefixToBase(c) { if (c === CP_b || c === CP_B) { /* 0b/0B (binary) */ return (2); } else if (c === CP_o || c === CP_O) { /* 0o/0O (octal) */ return (8); } else if (c === CP_t || c === CP_T) { /* 0t/0T (decimal) */ return (10); } else if (c === CP_x || c === CP_X) { /* 0x/0X (hexadecimal) */ return (16); } else { /* Not a meaningful character */ return (-1); } } function validateJsonObjectJS(schema, input) { var report = mod_jsonschema.validate(input, schema); if (report.errors.length === 0) return (null); /* Currently, we only do anything useful with the first error. */ var error = report.errors[0]; /* The failed property is given by a URI with an irrelevant prefix. */ var propname = error['property']; var reason = error['message'].toLowerCase(); var i, j; /* * There's at least one case where the property error message is * confusing at best. We work around this here. */ if ((i = reason.indexOf('the property ')) != -1 && (j = reason.indexOf(' is not defined in the schema and the ' + 'schema does not allow additional properties')) != -1) { i += 'the property '.length; if (propname === '') propname = reason.substr(i, j - i); else propname = propname + '.' + reason.substr(i, j - i); reason = 'unsupported property'; } var rv = new mod_verror.VError('property "%s": %s', propname, reason); rv.jsv_details = error; return (rv); } function randElt(arr) { mod_assert.ok(Array.isArray(arr) && arr.length > 0, 'randElt argument must be a non-empty array'); return (arr[Math.floor(Math.random() * arr.length)]); } function assertHrtime(a) { mod_assert.ok(a[0] >= 0 && a[1] >= 0, 'negative numbers not allowed in hrtimes'); mod_assert.ok(a[1] < 1e9, 'nanoseconds column overflow'); } /* * Compute the time elapsed between hrtime readings A and B, where A is later * than B. hrtime readings come from Node's process.hrtime(). There is no * defined way to represent negative deltas, so it's illegal to diff B from A * where the time denoted by B is later than the time denoted by A. If this * becomes valuable, we can define a representation and extend the * implementation to support it. */ function hrtimeDiff(a, b) { assertHrtime(a); assertHrtime(b); mod_assert.ok(a[0] > b[0] || (a[0] == b[0] && a[1] >= b[1]), 'negative differences not allowed'); var rv = [ a[0] - b[0], 0 ]; if (a[1] >= b[1]) { rv[1] = a[1] - b[1]; } else { rv[0]--; rv[1] = 1e9 - (b[1] - a[1]); } return (rv); } /* * Convert a hrtime reading from the array format returned by Node's * process.hrtime() into a scalar number of nanoseconds. */ function hrtimeNanosec(a) { assertHrtime(a); return (Math.floor(a[0] * 1e9 + a[1])); } /* * Convert a hrtime reading from the array format returned by Node's * process.hrtime() into a scalar number of microseconds. */ function hrtimeMicrosec(a) { assertHrtime(a); return (Math.floor(a[0] * 1e6 + a[1] / 1e3)); } /* * Convert a hrtime reading from the array format returned by Node's * process.hrtime() into a scalar number of milliseconds. */ function hrtimeMillisec(a) { assertHrtime(a); return (Math.floor(a[0] * 1e3 + a[1] / 1e6)); } /* * Add two hrtime readings A and B, overwriting A with the result of the * addition. This function is useful for accumulating several hrtime intervals * into a counter. Returns A. */ function hrtimeAccum(a, b) { assertHrtime(a); assertHrtime(b); /* * Accumulate the nanosecond component. */ a[1] += b[1]; if (a[1] >= 1e9) { /* * The nanosecond component overflowed, so carry to the seconds * field. */ a[0]++; a[1] -= 1e9; } /* * Accumulate the seconds component. */ a[0] += b[0]; return (a); } /* * Add two hrtime readings A and B, returning the result as a new hrtime array. * Does not modify either input argument. */ function hrtimeAdd(a, b) { assertHrtime(a); var rv = [ a[0], a[1] ]; return (hrtimeAccum(rv, b)); } /* * Check an object for unexpected properties. Accepts the object to check, and * an array of allowed property names (strings). Returns an array of key names * that were found on the object, but did not appear in the list of allowed * properties. If no properties were found, the returned array will be of * zero length. */ function extraProperties(obj, allowed) { mod_assert.ok(typeof (obj) === 'object' && obj !== null, 'obj argument must be a non-null object'); mod_assert.ok(Array.isArray(allowed), 'allowed argument must be an array of strings'); for (var i = 0; i < allowed.length; i++) { mod_assert.ok(typeof (allowed[i]) === 'string', 'allowed argument must be an array of strings'); } return (Object.keys(obj).filter(function (key) { return (allowed.indexOf(key) === -1); })); } /* * Given three sets of properties "provided" (may be undefined), "overrides" * (required), and "defaults" (may be undefined), construct an object containing * the union of these sets with "overrides" overriding "provided", and * "provided" overriding "defaults". None of the input objects are modified. */ function mergeObjects(provided, overrides, defaults) { var rv, k; rv = {}; if (defaults) { for (k in defaults) rv[k] = defaults[k]; } if (provided) { for (k in provided) rv[k] = provided[k]; } if (overrides) { for (k in overrides) rv[k] = overrides[k]; } return (rv); } /***/ }), /***/ 51531: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; const EventEmitter = __webpack_require__(28614); const JSONB = __webpack_require__(22820); const loadStore = opts => { const adapters = { redis: '@keyv/redis', mongodb: '@keyv/mongo', mongo: '@keyv/mongo', sqlite: '@keyv/sqlite', postgresql: '@keyv/postgres', postgres: '@keyv/postgres', mysql: '@keyv/mysql' }; if (opts.adapter || opts.uri) { const adapter = opts.adapter || /^[^:]*/.exec(opts.uri)[0]; return new (require(adapters[adapter]))(opts); } return new Map(); }; class Keyv extends EventEmitter { constructor(uri, opts) { super(); this.opts = Object.assign( { namespace: 'keyv', serialize: JSONB.stringify, deserialize: JSONB.parse }, (typeof uri === 'string') ? { uri } : uri, opts ); if (!this.opts.store) { const adapterOpts = Object.assign({}, this.opts); this.opts.store = loadStore(adapterOpts); } if (typeof this.opts.store.on === 'function') { this.opts.store.on('error', err => this.emit('error', err)); } this.opts.store.namespace = this.opts.namespace; } _getKeyPrefix(key) { return `${this.opts.namespace}:${key}`; } get(key) { key = this._getKeyPrefix(key); const store = this.opts.store; return Promise.resolve() .then(() => store.get(key)) .then(data => { data = (typeof data === 'string') ? this.opts.deserialize(data) : data; if (data === undefined) { return undefined; } if (typeof data.expires === 'number' && Date.now() > data.expires) { this.delete(key); return undefined; } return data.value; }); } set(key, value, ttl) { key = this._getKeyPrefix(key); if (typeof ttl === 'undefined') { ttl = this.opts.ttl; } if (ttl === 0) { ttl = undefined; } const store = this.opts.store; return Promise.resolve() .then(() => { const expires = (typeof ttl === 'number') ? (Date.now() + ttl) : null; value = { value, expires }; return store.set(key, this.opts.serialize(value), ttl); }) .then(() => true); } delete(key) { key = this._getKeyPrefix(key); const store = this.opts.store; return Promise.resolve() .then(() => store.delete(key)); } clear() { const store = this.opts.store; return Promise.resolve() .then(() => store.clear()); } } module.exports = Keyv; /***/ }), /***/ 44793: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; /** * Fetches a bearer token via comamnd */ // for API compatability /* eslint no-sync: 0 */ const spawnSync = __webpack_require__(63129).spawnSync function getProperty (propertyName, object) { // remove leading . if (propertyName.match(/^\./)) { propertyName = propertyName.replace(/^\./, '') } const parts = propertyName.split('.') const length = parts.length let property = object || this for (let i = 0; i < length; i++) { property = property[parts[i]] } return property } module.exports = { refresh: function (config) { return new Promise((resolve, reject) => { const cmd = config['cmd-path'] const args = config['cmd-args'].split(' ') const cmdEnv = config['cmd-env'] let output if (process.platform === 'win32') { output = spawnSync(cmd, args, { env: Object.assign({}, process.env, cmdEnv), windowsHide: true, shell: true }) } else { output = spawnSync(cmd, args, { env: Object.assign({}, process.env, cmdEnv), windowsHide: true }) } let result try { result = JSON.parse(output.stdout.toString('utf8')) } catch (err) { return reject(new Error('Failed to run cmd.')) } const token = getProperty(config['token-key'].replace(/[{}]+/g, ''), result) return resolve(token) }) } } /***/ }), /***/ 54562: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; /** * Refreshes a OpenID token. */ const Issuer = __webpack_require__(53140).Issuer module.exports = { refresh: function (config) { return new Promise((resolve, reject) => { Issuer.discover(config['idp-issuer-url']) .then(function (ourIssuer) { const client = new ourIssuer.Client({ client_id: config['client-id'], client_secret: config['client-secret'] }) return client.refresh(config['refresh-token']) }) .then(tokenSet => { return resolve(tokenSet.id_token) }) .catch(reject) }) } } /***/ }), /***/ 78412: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { function __ncc_wildcard$0 (arg) { if (arg === "cmd") return __webpack_require__(44793); else if (arg === "openid") return __webpack_require__(54562); } 'use strict' const { convertKubeconfig } = __webpack_require__(91899) const deprecate = __webpack_require__(18883)('kubernetes-client') const JSONStream = __webpack_require__(81676) const pump = __webpack_require__(18341) const qs = __webpack_require__(22760) const request = __webpack_require__(48699) const urljoin = __webpack_require__(12821) const WebSocket = __webpack_require__(8120) /** * Refresh whatever authentication {type} is. * @param {String} type - type of authentication * @param {Object} config - auth provider config * @returns {Promise} with request friendly auth object */ function refreshAuth (type, config) { return new Promise((resolve, reject) => { const provider = __ncc_wildcard$0(type) provider.refresh(config) .then(result => { const auth = { bearer: result } return resolve(auth) }) .catch(err => reject(err)) }) } const execChannels = [ 'stdin', 'stdout', 'stderr', 'error', 'resize' ] /** * Determine whether a failed Kubernetes API response is asking for an upgrade * @param {object} body - response body object from Kubernetes * @property {string} status - request status * @property {number} code - previous request's response code * @property {message} message - previous request response message * @returns {boolean} Upgrade the request */ function isUpgradeRequired (body) { return body.status === 'Failure' && body.code === 400 && body.message === 'Upgrade request required' } /** * Upgrade a request into a Websocket transaction & process the result * @param {ApiRequestOptions} options - Options object * @param {callback} cb - The callback that handles the response */ function upgradeRequest (options, cb) { const queryParams = qs.stringify(options.qs, { indices: false }) const wsUrl = urljoin(options.baseUrl, options.uri, `?${queryParams}`) const protocol = 'base64.channel.k8s.io' // Passing authorization header options.headers = { ...options.headers, authorization: `Bearer ${options.auth.bearer}` } const ws = new WebSocket(wsUrl, protocol, options) const messages = [] ws.on('message', (msg) => { const channel = execChannels[msg.slice(0, 1)] const message = Buffer.from(msg.slice(1), 'base64').toString('ascii') messages.push({ channel, message }) }) ws.on('error', (err) => { err.messages = messages cb(err, messages) }) ws.on('close', (code, reason) => cb(null, { messages, body: messages.map(({ message }) => message).join(''), code, reason })) return ws } class Request { /** * Internal representation of HTTP request object. * * @param {object} options - Options object * @param {string} options.url - Kubernetes API URL * @param {object} options.auth - request library auth object * @param {string} options.ca - Certificate authority * @param {string} options.cert - Client certificate * @param {string} options.key - Client key * @param {boolean} options.insecureSkipTlsVerify - Skip the validity check * on the server's certificate. */ constructor (options) { this.requestOptions = options.request || {} let convertedOptions if (!options.kubeconfig) { deprecate('Request() without a .kubeconfig option, see ' + 'https://github.com/godaddy/kubernetes-client/blob/master/merging-with-kubernetes.md') convertedOptions = options } else { convertedOptions = convertKubeconfig(options.kubeconfig) } this.requestOptions.qsStringifyOptions = { indices: false } this.requestOptions.baseUrl = convertedOptions.url this.requestOptions.ca = convertedOptions.ca this.requestOptions.cert = convertedOptions.cert this.requestOptions.key = convertedOptions.key if ('insecureSkipTlsVerify' in convertedOptions) { this.requestOptions.strictSSL = !convertedOptions.insecureSkipTlsVerify } if ('timeout' in convertedOptions) { this.requestOptions.timeout = convertedOptions.timeout } this.authProvider = { type: null } if (convertedOptions.auth) { this.requestOptions.auth = convertedOptions.auth if (convertedOptions.auth.provider) { this.requestOptions.auth = convertedOptions.auth.request this.authProvider = convertedOptions.auth.provider } } } _request (options, cb) { const auth = this.authProvider return request(options, (err, res, body) => { if (err) return cb(err) if (body && isUpgradeRequired(body)) { return upgradeRequest(options, cb) } // Refresh auth if 401 or 403 if ((res.statusCode === 401 || res.statusCode === 403) && auth.type) { return refreshAuth(auth.type, auth.config) .then(newAuth => { this.requestOptions.auth = newAuth options.auth = newAuth return request(options, (err, res, body) => { if (err) return cb(err) return cb(null, { statusCode: res.statusCode, body }) }) }) .catch(err => cb(err)) } return cb(null, { statusCode: res.statusCode, body: body }) }) } async getLogByteStream (options) { return this.http(Object.assign({ stream: true }, options)) } async getWatchObjectStream (options) { const jsonStream = new JSONStream() const stream = this.http(Object.assign({ stream: true }, options)) pump(stream, jsonStream) return jsonStream } /** * @param {object} options - Options object * @param {Stream} options.stdin - optional stdin Readable stream * @param {Stream} options.stdout - optional stdout Writeable stream * @param {Stream} options.stderr - optional stdout Writeable stream * @returns {Promise} Promise resolving to a Kubernetes V1 Status object and a WebSocket */ async getWebSocket (options) { throw new Error('Request.getWebSocket not implemented') } /** * @typedef {object} ApiRequestOptions * @property {object} body - Request body * @property {object} headers - Headers object * @property {string} path - version-less path * @property {object} qs - {@link https://www.npmjs.com/package/request#requestoptions-callback| * request query parameter} */ /** * Invoke a REST request against the Kubernetes API server * @param {string} method - HTTP method, passed directly to `request` * @param {ApiRequestOptions} options - Options object * @param {callback} cb - The callback that handles the response * @returns {Stream} If cb is falsy, return a stream */ http (options) { const uri = options.pathname const requestOptions = Object.assign({ method: options.method, uri, body: options.body, json: 'json' in options ? Boolean(options.json) : true, qs: options.parameters || options.qs, headers: options.headers }, this.requestOptions) if (options.noAuth) { delete requestOptions.auth } if (options.stream) return request(requestOptions) return new Promise((resolve, reject) => { this._request(requestOptions, (err, res) => { if (err) return reject(err) if (res.statusCode < 200 || res.statusCode > 299) { const error = new Error(res.body.message || res.body) // .code is backwards compatible with pre-5.0.0 code. error.code = res.statusCode error.statusCode = res.statusCode return reject(error) } resolve(res) }) }) } } module.exports = Request /***/ }), /***/ 91899: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; /* eslint no-process-env: 0 no-sync:0 */ const deprecate = __webpack_require__(18883)('kubernetes-client') const fs = __webpack_require__(35747) const path = __webpack_require__(85622) const yaml = __webpack_require__(21917) const merge = __webpack_require__(56323) const root = process.env.KUBERNETES_CLIENT_SERVICEACCOUNT_ROOT || '/var/run/secrets/kubernetes.io/serviceaccount/' const caPath = path.join(root, 'ca.crt') const tokenPath = path.join(root, 'token') const namespacePath = path.join(root, 'namespace') function convertKubeconfig (kubeconfig) { const context = kubeconfig.getCurrentContext() const cluster = kubeconfig.getCurrentCluster() const user = kubeconfig.getCurrentUser() const namespace = context.namespace let ca let insecureSkipTlsVerify = false if (cluster) { if (cluster.caFile) { ca = fs.readFileSync(path.normalize(cluster.caFile)) } else if (cluster.caData) { ca = Buffer.from(cluster.caData, 'base64').toString() } insecureSkipTlsVerify = cluster.skipTLSVerify } let cert let key let auth = {} if (user) { if (user.certFile) { cert = fs.readFileSync(path.normalize(user.certFile)) } else if (user.certData) { cert = Buffer.from(user.certData, 'base64').toString() } if (user.keyFile) { key = fs.readFileSync(path.normalize(user.keyFile)) } else if (user.keyData) { key = Buffer.from(user.keyData, 'base64').toString() } if (user.token) { auth.bearer = user.token } if (user.authProvider) { const config = user.authProvider.config // if we can't determine the type, just fail later (or don't refresh). let type = null let token = null if (config['cmd-path']) { type = 'cmd' token = config['access-token'] } else if (config['idp-issuer-url']) { type = 'openid' token = config['id-token'] } // If we have just an access-token, allow that... will expire later though. if (config['access-token'] && !type) { token = config['access-token'] } auth = { request: { bearer: token }, provider: { config, type } } } if (user.exec) { const env = {} if (user.exec.env) { user.exec.env.forEach(variable => { env[variable.name] = variable.value }) } let args = '' if (user.exec.args) { args = user.exec.args.join(' ') } auth = { provider: { type: 'cmd', config: { 'cmd-args': args, 'cmd-path': user.exec.command, 'token-key': 'status.token', 'cmd-env': env } } } } if (user.username) auth.user = user.username if (user.password) auth.pass = user.password } return { url: cluster.server, auth: Object.keys(auth).length ? auth : null, ca, insecureSkipTlsVerify, namespace, cert, key } } module.exports.convertKubeconfig = convertKubeconfig function defaultConfigPaths () { if (process.env.KUBECONFIG) { // From https://kubernetes.io/docs/tasks/access-application-cluster/configure-access-multiple-clusters/#set-the-kubeconfig-environment-variable // KUBECONFIG can support multiple config files. const delimiter = process.platform === 'win32' ? ';' : ':' return process.env.KUBECONFIG.split(delimiter) } const homeDir = process.env[(process.platform === 'win32') ? 'USERPROFILE' : 'HOME'] return [path.join(homeDir, '.kube', 'config')] } /** * Returns with in cluster config * Based on: https://github.com/kubernetes/client-go/blob/124670e99da15091e13916f0ad4b2b2df2a39cd5/rest/config.go#L274 * and http://kubernetes.io/docs/user-guide/accessing-the-cluster/#accessing-the-api-from-a-pod * * @function getInCluster * @returns {Object} { url, cert, auth, namespace } */ function getInCluster () { const host = process.env.KUBERNETES_SERVICE_HOST const port = process.env.KUBERNETES_SERVICE_PORT if (!host || !port) { throw new TypeError( 'Unable to load in-cluster configuration, KUBERNETES_SERVICE_HOST' + ' and KUBERNETES_SERVICE_PORT must be defined') } const ca = fs.readFileSync(caPath, 'utf8') const bearer = fs.readFileSync(tokenPath, 'utf8') const namespace = fs.readFileSync(namespacePath, 'utf8') return { url: `https://${host}:${port}`, ca, auth: { bearer }, namespace } } module.exports.getInCluster = deprecate.function( getInCluster, 'getInCluster see https://github.com/godaddy/kubernetes-client/blob/master/merging-with-kubernetes.md#request-kubeconfig-') // // Accept a manually specified current-context to take precedence over // `current-context` // /* eslint-disable complexity, max-statements */ function fromKubeconfig (kubeconfig, current) { if (!kubeconfig) kubeconfig = loadKubeconfig() // if kubeconfig is provided as a path to the yaml file, // or array of paths to the yaml files, // automatically load it. if (typeof kubeconfig === 'string' || Array.isArray(kubeconfig)) { kubeconfig = loadKubeconfig(kubeconfig) } current = current || kubeconfig['current-context'] const context = kubeconfig.contexts .find(item => item.name === current).context const cluster = kubeconfig.clusters .find(item => item.name === context.cluster).cluster const userConfig = kubeconfig.users .find(user => user.name === context.user) const user = userConfig ? userConfig.user : null const namespace = context.namespace let ca let insecureSkipTlsVerify = false if (cluster) { if (cluster['certificate-authority']) { ca = fs.readFileSync(path.normalize(cluster['certificate-authority'])) } else if (cluster['certificate-authority-data']) { ca = Buffer.from(cluster['certificate-authority-data'], 'base64').toString() } if (cluster['insecure-skip-tls-verify']) { insecureSkipTlsVerify = cluster['insecure-skip-tls-verify'] } } let cert let key let auth = {} if (user) { if (user['client-certificate']) { cert = fs.readFileSync(path.normalize(user['client-certificate'])) } else if (user['client-certificate-data']) { cert = Buffer.from(user['client-certificate-data'], 'base64').toString() } if (user['client-key']) { key = fs.readFileSync(path.normalize(user['client-key'])) } else if (user['client-key-data']) { key = Buffer.from(user['client-key-data'], 'base64').toString() } if (user.token) { auth.bearer = user.token } if (user['auth-provider']) { const config = user['auth-provider'].config // if we can't determine the type, just fail later (or don't refresh). let type = null let token = null if (config['cmd-path']) { type = 'cmd' token = config['access-token'] } else if (config['idp-issuer-url']) { type = 'openid' token = config['id-token'] } // If we have just an access-token, allow that... will expire later though. if (config['access-token'] && !type) { token = config['access-token'] } auth = { request: { bearer: token }, provider: { config, type } } } if (user.exec) { const env = {} if (user.exec.env) { user.exec.env.forEach(variable => { env[variable.name] = variable.value }) } let args = '' if (user.exec.args) { args = user.exec.args.join(' ') } auth = { provider: { type: 'cmd', config: { 'cmd-args': args, 'cmd-path': user.exec.command, 'token-key': 'status.token', 'cmd-env': env } } } } if (user.username) auth.user = user.username if (user.password) auth.pass = user.password } return { url: cluster.server, namespace, auth: Object.keys(auth).length ? auth : null, ca, insecureSkipTlsVerify, key, cert } } /* eslint-enable complexity, max-statements */ module.exports.fromKubeconfig = deprecate.function( fromKubeconfig, 'fromKubeconfig see https://github.com/godaddy/kubernetes-client/blob/master/merging-with-kubernetes.md#request-kubeconfig-') function mapCertificates (cfgPath, config) { const configDir = path.dirname(cfgPath) if (config.clusters) { config.clusters.filter(cluster => cluster.cluster['certificate-authority']).forEach(cluster => { cluster.cluster['certificate-authority'] = path.resolve(configDir, cluster.cluster['certificate-authority']) }) } if (config.users) { config.users.filter(user => user.user['client-certificate']).forEach(user => { user.user['client-certificate'] = path.resolve(configDir, user.user['client-certificate']) }) config.users.filter(user => user.user['client-key']).forEach(user => { user.user['client-key'] = path.resolve(configDir, user.user['client-key']) }) } return config } function loadKubeconfig (cfgPath) { let cfgPaths if (!cfgPath) { cfgPaths = defaultConfigPaths() } else if (Array.isArray(cfgPath)) { cfgPaths = cfgPath } else { cfgPaths = [cfgPath] } const configs = cfgPaths.map(cfgPath => { const config = yaml.safeLoad(fs.readFileSync(cfgPath)) return mapCertificates(cfgPath, config) }) return merge.all(configs) } module.exports.loadKubeconfig = deprecate.function( loadKubeconfig, 'loadKubeconfig see https://github.com/godaddy/kubernetes-client/blob/master/merging-with-kubernetes.md#request-kubeconfig-') /***/ }), /***/ 67002: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { const Request = __webpack_require__(78412) Request.config = __webpack_require__(91899) module.exports = Request /***/ }), /***/ 74790: /***/ ((module) => { "use strict"; // We support the full names and all the abbbreviated aliases: // http://kubernetes.io/docs/user-guide/kubectl-overview/ // and anything else we think is useful. const resourceAliases = { clusterroles: [], clusterrolebindings: [], componentstatuses: ['cs'], configmaps: ['cm'], cronjobs: [], customresourcedefinitions: ['crd'], daemonsets: ['ds'], deployments: ['deploy'], events: ['ev'], endpoints: ['ep'], horizontalpodautoscalers: ['hpa'], ingresses: ['ing'], jobs: [], limitranges: ['limits'], namespaces: ['ns'], nodes: ['no'], persistentvolumes: ['pv'], persistentvolumeclaims: ['pvc'], // Deprecated name of statefulsets in kubernetes 1.4 petsets: [], pods: ['po'], replicationcontrollers: ['rc'], replicasets: ['rs'], resourcequotas: ['quota'], roles: [], rolebindings: [], // Deprecated name of cronjobs in kubernetes 1.4 scheduledjobs: [], secrets: [], serviceaccounts: [], services: ['svc'], statefulsets: [], // Deprecated name of customresourcedefinition in kubernetes 1.7 thirdpartyresources: [] } const esPlurals = { componentstatuses: true, ingresses: true } const excludeFromAliasing = { apis: true, status: true } module.exports = function (resourceType) { let aliases = [resourceType] if (resourceAliases[resourceType]) { aliases = aliases.concat(resourceAliases[resourceType]) } // // NOTE(sbw): try to catch things that shouldn't have singular aliases. This // fails on some relatively common resources, like "status". // if ((resourceType.slice(-1) !== 's') || (resourceType in excludeFromAliasing)) { return aliases } const trimLength = esPlurals[resourceType] ? 2 : 1 const single = resourceType.substr(0, resourceType.length - trimLength) aliases.push(single) return aliases } /***/ }), /***/ 8428: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { const k8s = __webpack_require__(89679) module.exports = k8s.KubeConfig /***/ }), /***/ 98862: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { const deprecate = __webpack_require__(18883)('kubernetes-client') module.exports = { Client: __webpack_require__(10760).Client, Client1_13: __webpack_require__(10760).Client1_13, alias: __webpack_require__(74790), config: __webpack_require__(91899), KubeConfig: __webpack_require__(8428) } deprecate.property( module.exports, 'config', 'require(\'kubernetes-client\').config,' + ' use require(\'kubernetes-client/backends/request\').config.') /***/ }), /***/ 10760: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; /* eslint-disable no-sync */ /** * @file Convert a Swagger specification into a kubernetes-client API client. * * Represent Swagger a Path Item Object [1] with chains of objects: * * /api/v1/namespaces -> api.v1.namespaces * * Associate operations on a Path Item Object with functions: * * GET /api/v1/namespaces -> api.v1.namespaces.get() * * Represent Path Templating [2] with function calls: * * /api/v1/namespaces/{namespace}/pods -> api.v1.namespaces(namespace).pods * * Iterate over a Paths Object [3] to generate whole API client. * * [1]: https://swagger.io/specification/#pathItemObject * [2]: https://swagger.io/specification/#pathTemplating * [3]: https://swagger.io/specification/#pathsObject */ const Component = __webpack_require__(96789).Component const deprecate = __webpack_require__(18883)('kubernetes-client') const fs = __webpack_require__(35747) const KubeConfig = __webpack_require__(8428) const path = __webpack_require__(85622) const zlib = __webpack_require__(78761) const getAliases = __webpack_require__(74790) const Request = __webpack_require__(67002) class Root extends Component { _getSpec (pathname) { return this.backend.http({ method: 'GET', pathname }) .then(res => { return res.body }) } /** * Load swagger.json from kube-apiserver. * @returns {Promise} Promise */ loadSpec () { return this._getSpec('/openapi/v2') .catch(() => { return this._getSpec('/swagger.json') }) .then(res => { this._addSpec(res) return this }) .catch(err => { throw new Error(`Failed to get /openapi/v2 and /swagger.json: ${err.message}`) }) } _getLogByteStream (options) { return this.backend.getLogByteStream(Object.assign({ method: 'GET', pathItemObject: this.pathItemObject, pathname: this.getPath(), pathnameParameters: this.getPathnameParameters() }, options)) } async _getWatchObjectStream (options) { return this.backend.getWatchObjectStream(Object.assign({ method: 'GET', pathItemObject: this.pathItemObject, pathname: this.getPath(), pathnameParameters: this.getPathnameParameters() }, options)) } _addEndpoint (endpoint) { const component = super._addEndpoint(endpoint) if (!component) return component // // Deprecate stream API. // if (endpoint.pathItem.get) { const action = endpoint.pathItem.get['x-kubernetes-action'] if (action === 'watch' || action === 'watchlist') { component.getStream = deprecate.function( component.getStream, '.getStream use .getObjectStream, see ' + 'https://github.com/godaddy/kubernetes-client/blob/master/merging-with-kubernetes.md') component.getObjectStream = component._getWatchObjectStream } else if (endpoint.name === '/api/v1/namespaces/{namespace}/pods/{name}/log') { component.getStream = deprecate.function( component.getStream, '.getStream use .getByteStream, see ' + 'https://github.com/godaddy/kubernetes-client/blob/master/merging-with-kubernetes.md') component.getByteStream = component._getLogByteStream } else { component.getStream = deprecate.function( component.getStream, '.getStream see https://github.com/godaddy/kubernetes-client/blob/master/merging-with-kubernetes.md') } } } addCustomResourceDefinition (manifest) { const group = manifest.spec.group const name = manifest.spec.names.plural const namespace = manifest.spec.scope === 'Cluster' ? '' : '/namespaces/{namespace}' const addSpec = (version) => { const spec = { paths: {} } // // Make just enough of Swagger spec to generate some useful endpoints. // const templatePath = `/apis/${group}/${version}${namespace}/${name}/{name}` spec.paths[templatePath] = ['delete', 'get', 'patch', 'put'].reduce((acc, method) => { acc[method] = { operationId: `${method}Template${name}` } return acc }, {}) const resourcePath = `/apis/${group}/${version}${namespace}/${name}` spec.paths[resourcePath] = ['get', 'post'].reduce((acc, method) => { acc[method] = { operationId: `${method}${name}` } return acc }, {}) // // Namespaced CRDs get a cluster-level GET endpoint. // Similar to GET /api/v1/pods. // if (manifest.spec.scope === 'Namespaced') { const clusterPath = `/apis/${group}/${version}/${name}` spec.paths[clusterPath] = { get: { operationId: `getCluster${name}` } } } const watchPaths = { watchCluster: `/apis/${group}/${version}/watch/${name}`, watchNamespace: `/apis/${group}/${version}/watch${namespace}/${name}`, watchResource: `/apis/${group}/${version}/watch${namespace}/${name}/{name}` } Object.keys(watchPaths).forEach(operationId => { const watchPath = watchPaths[operationId] spec.paths[watchPath] = { get: { 'x-kubernetes-action': 'watch', operationId: `operationId${name}` } } }) // Add status endpoint - see https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.11/#customresourcesubresourcestatus-v1beta1-apiextensions-k8s-io if (manifest.spec.subresources && manifest.spec.subresources.status) { const statusPath = `/apis/${group}/${version}${namespace}/${name}/{name}/status` spec.paths[statusPath] = ['get', 'put'].reduce((acc, method) => { acc[method] = { operationId: `${method}Template${name}` } return acc }, {}) } // Add scale endpoints - see https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.11/#customresourcesubresourcescale-v1beta1-apiextensions-k8s-io if (manifest.spec.subresources && manifest.spec.subresources.scale) { const statusPath = `/apis/${group}/${version}${namespace}/${name}/{name}/scale` spec.paths[statusPath] = ['get', 'put'].reduce((acc, method) => { acc[method] = { operationId: `${method}Template${name}` } return acc }, {}) } this._addSpec(spec) } if (manifest.spec.version) { addSpec(manifest.spec.version) } else { const versions = manifest.spec.versions || [] versions.forEach(version => addSpec(version.name)) } } } class Client { constructor (options) { options = options || {} if (options.config) { deprecate('Client({ config }), see ' + 'https://github.com/godaddy/kubernetes-client/blob/master/merging-with-kubernetes.md') } let backend = options.backend if (!backend) { if (options.config) { backend = new Request(options.config) } else { const kubeconfig = new KubeConfig() kubeconfig.loadFromDefault() backend = new Request({ kubeconfig }) } } let spec = options.spec if (!spec && options.version) { const swaggerPath = path.join( __dirname, 'specs', `swagger-${options.version}.json.gz`) spec = JSON.parse(zlib.gunzipSync(fs.readFileSync(swaggerPath))) } const root = new Root({ splits: [], backend, getNames: options.getNames || getAliases }) if (spec) root._addSpec(spec) return root } } // eslint-disable-next-line camelcase class Client1_13 extends Client { constructor (options) { super(Object.assign({}, options, { version: '1.13' })) } } module.exports = { Client, Client1_13 } /***/ }), /***/ 8120: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; const WebSocket = __webpack_require__(30418); WebSocket.createWebSocketStream = __webpack_require__(61997); WebSocket.Server = __webpack_require__(89535); WebSocket.Receiver = __webpack_require__(1937); WebSocket.Sender = __webpack_require__(7748); module.exports = WebSocket; /***/ }), /***/ 20034: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; const { EMPTY_BUFFER } = __webpack_require__(94122); /** * Merges an array of buffers into a new buffer. * * @param {Buffer[]} list The array of buffers to concat * @param {Number} totalLength The total length of buffers in the list * @return {Buffer} The resulting buffer * @public */ function concat(list, totalLength) { if (list.length === 0) return EMPTY_BUFFER; if (list.length === 1) return list[0]; const target = Buffer.allocUnsafe(totalLength); let offset = 0; for (let i = 0; i < list.length; i++) { const buf = list[i]; target.set(buf, offset); offset += buf.length; } if (offset < totalLength) return target.slice(0, offset); return target; } /** * Masks a buffer using the given mask. * * @param {Buffer} source The buffer to mask * @param {Buffer} mask The mask to use * @param {Buffer} output The buffer where to store the result * @param {Number} offset The offset at which to start writing * @param {Number} length The number of bytes to mask. * @public */ function _mask(source, mask, output, offset, length) { for (let i = 0; i < length; i++) { output[offset + i] = source[i] ^ mask[i & 3]; } } /** * Unmasks a buffer using the given mask. * * @param {Buffer} buffer The buffer to unmask * @param {Buffer} mask The mask to use * @public */ function _unmask(buffer, mask) { // Required until https://github.com/nodejs/node/issues/9006 is resolved. const length = buffer.length; for (let i = 0; i < length; i++) { buffer[i] ^= mask[i & 3]; } } /** * Converts a buffer to an `ArrayBuffer`. * * @param {Buffer} buf The buffer to convert * @return {ArrayBuffer} Converted buffer * @public */ function toArrayBuffer(buf) { if (buf.byteLength === buf.buffer.byteLength) { return buf.buffer; } return buf.buffer.slice(buf.byteOffset, buf.byteOffset + buf.byteLength); } /** * Converts `data` to a `Buffer`. * * @param {*} data The data to convert * @return {Buffer} The buffer * @throws {TypeError} * @public */ function toBuffer(data) { toBuffer.readOnly = true; if (Buffer.isBuffer(data)) return data; let buf; if (data instanceof ArrayBuffer) { buf = Buffer.from(data); } else if (ArrayBuffer.isView(data)) { buf = Buffer.from(data.buffer, data.byteOffset, data.byteLength); } else { buf = Buffer.from(data); toBuffer.readOnly = false; } return buf; } try { const bufferUtil = __webpack_require__(71269); const bu = bufferUtil.BufferUtil || bufferUtil; module.exports = { concat, mask(source, mask, output, offset, length) { if (length < 48) _mask(source, mask, output, offset, length); else bu.mask(source, mask, output, offset, length); }, toArrayBuffer, toBuffer, unmask(buffer, mask) { if (buffer.length < 32) _unmask(buffer, mask); else bu.unmask(buffer, mask); } }; } catch (e) /* istanbul ignore next */ { module.exports = { concat, mask: _mask, toArrayBuffer, toBuffer, unmask: _unmask }; } /***/ }), /***/ 94122: /***/ ((module) => { "use strict"; module.exports = { BINARY_TYPES: ['nodebuffer', 'arraybuffer', 'fragments'], GUID: '258EAFA5-E914-47DA-95CA-C5AB0DC85B11', kStatusCode: Symbol('status-code'), kWebSocket: Symbol('websocket'), EMPTY_BUFFER: Buffer.alloc(0), NOOP: () => {} }; /***/ }), /***/ 63406: /***/ ((module) => { "use strict"; /** * Class representing an event. * * @private */ class Event { /** * Create a new `Event`. * * @param {String} type The name of the event * @param {Object} target A reference to the target to which the event was * dispatched */ constructor(type, target) { this.target = target; this.type = type; } } /** * Class representing a message event. * * @extends Event * @private */ class MessageEvent extends Event { /** * Create a new `MessageEvent`. * * @param {(String|Buffer|ArrayBuffer|Buffer[])} data The received data * @param {WebSocket} target A reference to the target to which the event was * dispatched */ constructor(data, target) { super('message', target); this.data = data; } } /** * Class representing a close event. * * @extends Event * @private */ class CloseEvent extends Event { /** * Create a new `CloseEvent`. * * @param {Number} code The status code explaining why the connection is being * closed * @param {String} reason A human-readable string explaining why the * connection is closing * @param {WebSocket} target A reference to the target to which the event was * dispatched */ constructor(code, reason, target) { super('close', target); this.wasClean = target._closeFrameReceived && target._closeFrameSent; this.reason = reason; this.code = code; } } /** * Class representing an open event. * * @extends Event * @private */ class OpenEvent extends Event { /** * Create a new `OpenEvent`. * * @param {WebSocket} target A reference to the target to which the event was * dispatched */ constructor(target) { super('open', target); } } /** * Class representing an error event. * * @extends Event * @private */ class ErrorEvent extends Event { /** * Create a new `ErrorEvent`. * * @param {Object} error The error that generated this event * @param {WebSocket} target A reference to the target to which the event was * dispatched */ constructor(error, target) { super('error', target); this.message = error.message; this.error = error; } } /** * This provides methods for emulating the `EventTarget` interface. It's not * meant to be used directly. * * @mixin */ const EventTarget = { /** * Register an event listener. * * @param {String} type A string representing the event type to listen for * @param {Function} listener The listener to add * @param {Object} [options] An options object specifies characteristics about * the event listener * @param {Boolean} [options.once=false] A `Boolean`` indicating that the * listener should be invoked at most once after being added. If `true`, * the listener would be automatically removed when invoked. * @public */ addEventListener(type, listener, options) { if (typeof listener !== 'function') return; function onMessage(data) { listener.call(this, new MessageEvent(data, this)); } function onClose(code, message) { listener.call(this, new CloseEvent(code, message, this)); } function onError(error) { listener.call(this, new ErrorEvent(error, this)); } function onOpen() { listener.call(this, new OpenEvent(this)); } const method = options && options.once ? 'once' : 'on'; if (type === 'message') { onMessage._listener = listener; this[method](type, onMessage); } else if (type === 'close') { onClose._listener = listener; this[method](type, onClose); } else if (type === 'error') { onError._listener = listener; this[method](type, onError); } else if (type === 'open') { onOpen._listener = listener; this[method](type, onOpen); } else { this[method](type, listener); } }, /** * Remove an event listener. * * @param {String} type A string representing the event type to remove * @param {Function} listener The listener to remove * @public */ removeEventListener(type, listener) { const listeners = this.listeners(type); for (let i = 0; i < listeners.length; i++) { if (listeners[i] === listener || listeners[i]._listener === listener) { this.removeListener(type, listeners[i]); } } } }; module.exports = EventTarget; /***/ }), /***/ 97821: /***/ ((module) => { "use strict"; // // Allowed token characters: // // '!', '#', '$', '%', '&', ''', '*', '+', '-', // '.', 0-9, A-Z, '^', '_', '`', a-z, '|', '~' // // tokenChars[32] === 0 // ' ' // tokenChars[33] === 1 // '!' // tokenChars[34] === 0 // '"' // ... // // prettier-ignore const tokenChars = [ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // 0 - 15 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // 16 - 31 0, 1, 0, 1, 1, 1, 1, 1, 0, 0, 1, 1, 0, 1, 1, 0, // 32 - 47 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, // 48 - 63 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 64 - 79 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 1, 1, // 80 - 95 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 96 - 111 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 0, 1, 0 // 112 - 127 ]; /** * Adds an offer to the map of extension offers or a parameter to the map of * parameters. * * @param {Object} dest The map of extension offers or parameters * @param {String} name The extension or parameter name * @param {(Object|Boolean|String)} elem The extension parameters or the * parameter value * @private */ function push(dest, name, elem) { if (dest[name] === undefined) dest[name] = [elem]; else dest[name].push(elem); } /** * Parses the `Sec-WebSocket-Extensions` header into an object. * * @param {String} header The field value of the header * @return {Object} The parsed object * @public */ function parse(header) { const offers = Object.create(null); if (header === undefined || header === '') return offers; let params = Object.create(null); let mustUnescape = false; let isEscaping = false; let inQuotes = false; let extensionName; let paramName; let start = -1; let end = -1; let i = 0; for (; i < header.length; i++) { const code = header.charCodeAt(i); if (extensionName === undefined) { if (end === -1 && tokenChars[code] === 1) { if (start === -1) start = i; } else if (code === 0x20 /* ' ' */ || code === 0x09 /* '\t' */) { if (end === -1 && start !== -1) end = i; } else if (code === 0x3b /* ';' */ || code === 0x2c /* ',' */) { if (start === -1) { throw new SyntaxError(`Unexpected character at index ${i}`); } if (end === -1) end = i; const name = header.slice(start, end); if (code === 0x2c) { push(offers, name, params); params = Object.create(null); } else { extensionName = name; } start = end = -1; } else { throw new SyntaxError(`Unexpected character at index ${i}`); } } else if (paramName === undefined) { if (end === -1 && tokenChars[code] === 1) { if (start === -1) start = i; } else if (code === 0x20 || code === 0x09) { if (end === -1 && start !== -1) end = i; } else if (code === 0x3b || code === 0x2c) { if (start === -1) { throw new SyntaxError(`Unexpected character at index ${i}`); } if (end === -1) end = i; push(params, header.slice(start, end), true); if (code === 0x2c) { push(offers, extensionName, params); params = Object.create(null); extensionName = undefined; } start = end = -1; } else if (code === 0x3d /* '=' */ && start !== -1 && end === -1) { paramName = header.slice(start, i); start = end = -1; } else { throw new SyntaxError(`Unexpected character at index ${i}`); } } else { // // The value of a quoted-string after unescaping must conform to the // token ABNF, so only token characters are valid. // Ref: https://tools.ietf.org/html/rfc6455#section-9.1 // if (isEscaping) { if (tokenChars[code] !== 1) { throw new SyntaxError(`Unexpected character at index ${i}`); } if (start === -1) start = i; else if (!mustUnescape) mustUnescape = true; isEscaping = false; } else if (inQuotes) { if (tokenChars[code] === 1) { if (start === -1) start = i; } else if (code === 0x22 /* '"' */ && start !== -1) { inQuotes = false; end = i; } else if (code === 0x5c /* '\' */) { isEscaping = true; } else { throw new SyntaxError(`Unexpected character at index ${i}`); } } else if (code === 0x22 && header.charCodeAt(i - 1) === 0x3d) { inQuotes = true; } else if (end === -1 && tokenChars[code] === 1) { if (start === -1) start = i; } else if (start !== -1 && (code === 0x20 || code === 0x09)) { if (end === -1) end = i; } else if (code === 0x3b || code === 0x2c) { if (start === -1) { throw new SyntaxError(`Unexpected character at index ${i}`); } if (end === -1) end = i; let value = header.slice(start, end); if (mustUnescape) { value = value.replace(/\\/g, ''); mustUnescape = false; } push(params, paramName, value); if (code === 0x2c) { push(offers, extensionName, params); params = Object.create(null); extensionName = undefined; } paramName = undefined; start = end = -1; } else { throw new SyntaxError(`Unexpected character at index ${i}`); } } } if (start === -1 || inQuotes) { throw new SyntaxError('Unexpected end of input'); } if (end === -1) end = i; const token = header.slice(start, end); if (extensionName === undefined) { push(offers, token, params); } else { if (paramName === undefined) { push(params, token, true); } else if (mustUnescape) { push(params, paramName, token.replace(/\\/g, '')); } else { push(params, paramName, token); } push(offers, extensionName, params); } return offers; } /** * Builds the `Sec-WebSocket-Extensions` header field value. * * @param {Object} extensions The map of extensions and parameters to format * @return {String} A string representing the given object * @public */ function format(extensions) { return Object.keys(extensions) .map((extension) => { let configurations = extensions[extension]; if (!Array.isArray(configurations)) configurations = [configurations]; return configurations .map((params) => { return [extension] .concat( Object.keys(params).map((k) => { let values = params[k]; if (!Array.isArray(values)) values = [values]; return values .map((v) => (v === true ? k : `${k}=${v}`)) .join('; '); }) ) .join('; '); }) .join(', '); }) .join(', '); } module.exports = { format, parse }; /***/ }), /***/ 78602: /***/ ((module) => { "use strict"; const kDone = Symbol('kDone'); const kRun = Symbol('kRun'); /** * A very simple job queue with adjustable concurrency. Adapted from * https://github.com/STRML/async-limiter */ class Limiter { /** * Creates a new `Limiter`. * * @param {Number} [concurrency=Infinity] The maximum number of jobs allowed * to run concurrently */ constructor(concurrency) { this[kDone] = () => { this.pending--; this[kRun](); }; this.concurrency = concurrency || Infinity; this.jobs = []; this.pending = 0; } /** * Adds a job to the queue. * * @param {Function} job The job to run * @public */ add(job) { this.jobs.push(job); this[kRun](); } /** * Removes a job from the queue and runs it if possible. * * @private */ [kRun]() { if (this.pending === this.concurrency) return; if (this.jobs.length) { const job = this.jobs.shift(); this.pending++; job(this[kDone]); } } } module.exports = Limiter; /***/ }), /***/ 99604: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; const zlib = __webpack_require__(78761); const bufferUtil = __webpack_require__(20034); const Limiter = __webpack_require__(78602); const { kStatusCode, NOOP } = __webpack_require__(94122); const TRAILER = Buffer.from([0x00, 0x00, 0xff, 0xff]); const kPerMessageDeflate = Symbol('permessage-deflate'); const kTotalLength = Symbol('total-length'); const kCallback = Symbol('callback'); const kBuffers = Symbol('buffers'); const kError = Symbol('error'); // // We limit zlib concurrency, which prevents severe memory fragmentation // as documented in https://github.com/nodejs/node/issues/8871#issuecomment-250915913 // and https://github.com/websockets/ws/issues/1202 // // Intentionally global; it's the global thread pool that's an issue. // let zlibLimiter; /** * permessage-deflate implementation. */ class PerMessageDeflate { /** * Creates a PerMessageDeflate instance. * * @param {Object} [options] Configuration options * @param {Boolean} [options.serverNoContextTakeover=false] Request/accept * disabling of server context takeover * @param {Boolean} [options.clientNoContextTakeover=false] Advertise/ * acknowledge disabling of client context takeover * @param {(Boolean|Number)} [options.serverMaxWindowBits] Request/confirm the * use of a custom server window size * @param {(Boolean|Number)} [options.clientMaxWindowBits] Advertise support * for, or request, a custom client window size * @param {Object} [options.zlibDeflateOptions] Options to pass to zlib on * deflate * @param {Object} [options.zlibInflateOptions] Options to pass to zlib on * inflate * @param {Number} [options.threshold=1024] Size (in bytes) below which * messages should not be compressed * @param {Number} [options.concurrencyLimit=10] The number of concurrent * calls to zlib * @param {Boolean} [isServer=false] Create the instance in either server or * client mode * @param {Number} [maxPayload=0] The maximum allowed message length */ constructor(options, isServer, maxPayload) { this._maxPayload = maxPayload | 0; this._options = options || {}; this._threshold = this._options.threshold !== undefined ? this._options.threshold : 1024; this._isServer = !!isServer; this._deflate = null; this._inflate = null; this.params = null; if (!zlibLimiter) { const concurrency = this._options.concurrencyLimit !== undefined ? this._options.concurrencyLimit : 10; zlibLimiter = new Limiter(concurrency); } } /** * @type {String} */ static get extensionName() { return 'permessage-deflate'; } /** * Create an extension negotiation offer. * * @return {Object} Extension parameters * @public */ offer() { const params = {}; if (this._options.serverNoContextTakeover) { params.server_no_context_takeover = true; } if (this._options.clientNoContextTakeover) { params.client_no_context_takeover = true; } if (this._options.serverMaxWindowBits) { params.server_max_window_bits = this._options.serverMaxWindowBits; } if (this._options.clientMaxWindowBits) { params.client_max_window_bits = this._options.clientMaxWindowBits; } else if (this._options.clientMaxWindowBits == null) { params.client_max_window_bits = true; } return params; } /** * Accept an extension negotiation offer/response. * * @param {Array} configurations The extension negotiation offers/reponse * @return {Object} Accepted configuration * @public */ accept(configurations) { configurations = this.normalizeParams(configurations); this.params = this._isServer ? this.acceptAsServer(configurations) : this.acceptAsClient(configurations); return this.params; } /** * Releases all resources used by the extension. * * @public */ cleanup() { if (this._inflate) { this._inflate.close(); this._inflate = null; } if (this._deflate) { const callback = this._deflate[kCallback]; this._deflate.close(); this._deflate = null; if (callback) { callback( new Error( 'The deflate stream was closed while data was being processed' ) ); } } } /** * Accept an extension negotiation offer. * * @param {Array} offers The extension negotiation offers * @return {Object} Accepted configuration * @private */ acceptAsServer(offers) { const opts = this._options; const accepted = offers.find((params) => { if ( (opts.serverNoContextTakeover === false && params.server_no_context_takeover) || (params.server_max_window_bits && (opts.serverMaxWindowBits === false || (typeof opts.serverMaxWindowBits === 'number' && opts.serverMaxWindowBits > params.server_max_window_bits))) || (typeof opts.clientMaxWindowBits === 'number' && !params.client_max_window_bits) ) { return false; } return true; }); if (!accepted) { throw new Error('None of the extension offers can be accepted'); } if (opts.serverNoContextTakeover) { accepted.server_no_context_takeover = true; } if (opts.clientNoContextTakeover) { accepted.client_no_context_takeover = true; } if (typeof opts.serverMaxWindowBits === 'number') { accepted.server_max_window_bits = opts.serverMaxWindowBits; } if (typeof opts.clientMaxWindowBits === 'number') { accepted.client_max_window_bits = opts.clientMaxWindowBits; } else if ( accepted.client_max_window_bits === true || opts.clientMaxWindowBits === false ) { delete accepted.client_max_window_bits; } return accepted; } /** * Accept the extension negotiation response. * * @param {Array} response The extension negotiation response * @return {Object} Accepted configuration * @private */ acceptAsClient(response) { const params = response[0]; if ( this._options.clientNoContextTakeover === false && params.client_no_context_takeover ) { throw new Error('Unexpected parameter "client_no_context_takeover"'); } if (!params.client_max_window_bits) { if (typeof this._options.clientMaxWindowBits === 'number') { params.client_max_window_bits = this._options.clientMaxWindowBits; } } else if ( this._options.clientMaxWindowBits === false || (typeof this._options.clientMaxWindowBits === 'number' && params.client_max_window_bits > this._options.clientMaxWindowBits) ) { throw new Error( 'Unexpected or invalid parameter "client_max_window_bits"' ); } return params; } /** * Normalize parameters. * * @param {Array} configurations The extension negotiation offers/reponse * @return {Array} The offers/response with normalized parameters * @private */ normalizeParams(configurations) { configurations.forEach((params) => { Object.keys(params).forEach((key) => { let value = params[key]; if (value.length > 1) { throw new Error(`Parameter "${key}" must have only a single value`); } value = value[0]; if (key === 'client_max_window_bits') { if (value !== true) { const num = +value; if (!Number.isInteger(num) || num < 8 || num > 15) { throw new TypeError( `Invalid value for parameter "${key}": ${value}` ); } value = num; } else if (!this._isServer) { throw new TypeError( `Invalid value for parameter "${key}": ${value}` ); } } else if (key === 'server_max_window_bits') { const num = +value; if (!Number.isInteger(num) || num < 8 || num > 15) { throw new TypeError( `Invalid value for parameter "${key}": ${value}` ); } value = num; } else if ( key === 'client_no_context_takeover' || key === 'server_no_context_takeover' ) { if (value !== true) { throw new TypeError( `Invalid value for parameter "${key}": ${value}` ); } } else { throw new Error(`Unknown parameter "${key}"`); } params[key] = value; }); }); return configurations; } /** * Decompress data. Concurrency limited. * * @param {Buffer} data Compressed data * @param {Boolean} fin Specifies whether or not this is the last fragment * @param {Function} callback Callback * @public */ decompress(data, fin, callback) { zlibLimiter.add((done) => { this._decompress(data, fin, (err, result) => { done(); callback(err, result); }); }); } /** * Compress data. Concurrency limited. * * @param {Buffer} data Data to compress * @param {Boolean} fin Specifies whether or not this is the last fragment * @param {Function} callback Callback * @public */ compress(data, fin, callback) { zlibLimiter.add((done) => { this._compress(data, fin, (err, result) => { done(); callback(err, result); }); }); } /** * Decompress data. * * @param {Buffer} data Compressed data * @param {Boolean} fin Specifies whether or not this is the last fragment * @param {Function} callback Callback * @private */ _decompress(data, fin, callback) { const endpoint = this._isServer ? 'client' : 'server'; if (!this._inflate) { const key = `${endpoint}_max_window_bits`; const windowBits = typeof this.params[key] !== 'number' ? zlib.Z_DEFAULT_WINDOWBITS : this.params[key]; this._inflate = zlib.createInflateRaw({ ...this._options.zlibInflateOptions, windowBits }); this._inflate[kPerMessageDeflate] = this; this._inflate[kTotalLength] = 0; this._inflate[kBuffers] = []; this._inflate.on('error', inflateOnError); this._inflate.on('data', inflateOnData); } this._inflate[kCallback] = callback; this._inflate.write(data); if (fin) this._inflate.write(TRAILER); this._inflate.flush(() => { const err = this._inflate[kError]; if (err) { this._inflate.close(); this._inflate = null; callback(err); return; } const data = bufferUtil.concat( this._inflate[kBuffers], this._inflate[kTotalLength] ); if (this._inflate._readableState.endEmitted) { this._inflate.close(); this._inflate = null; } else { this._inflate[kTotalLength] = 0; this._inflate[kBuffers] = []; if (fin && this.params[`${endpoint}_no_context_takeover`]) { this._inflate.reset(); } } callback(null, data); }); } /** * Compress data. * * @param {Buffer} data Data to compress * @param {Boolean} fin Specifies whether or not this is the last fragment * @param {Function} callback Callback * @private */ _compress(data, fin, callback) { const endpoint = this._isServer ? 'server' : 'client'; if (!this._deflate) { const key = `${endpoint}_max_window_bits`; const windowBits = typeof this.params[key] !== 'number' ? zlib.Z_DEFAULT_WINDOWBITS : this.params[key]; this._deflate = zlib.createDeflateRaw({ ...this._options.zlibDeflateOptions, windowBits }); this._deflate[kTotalLength] = 0; this._deflate[kBuffers] = []; // // An `'error'` event is emitted, only on Node.js < 10.0.0, if the // `zlib.DeflateRaw` instance is closed while data is being processed. // This can happen if `PerMessageDeflate#cleanup()` is called at the wrong // time due to an abnormal WebSocket closure. // this._deflate.on('error', NOOP); this._deflate.on('data', deflateOnData); } this._deflate[kCallback] = callback; this._deflate.write(data); this._deflate.flush(zlib.Z_SYNC_FLUSH, () => { if (!this._deflate) { // // The deflate stream was closed while data was being processed. // return; } let data = bufferUtil.concat( this._deflate[kBuffers], this._deflate[kTotalLength] ); if (fin) data = data.slice(0, data.length - 4); // // Ensure that the callback will not be called again in // `PerMessageDeflate#cleanup()`. // this._deflate[kCallback] = null; this._deflate[kTotalLength] = 0; this._deflate[kBuffers] = []; if (fin && this.params[`${endpoint}_no_context_takeover`]) { this._deflate.reset(); } callback(null, data); }); } } module.exports = PerMessageDeflate; /** * The listener of the `zlib.DeflateRaw` stream `'data'` event. * * @param {Buffer} chunk A chunk of data * @private */ function deflateOnData(chunk) { this[kBuffers].push(chunk); this[kTotalLength] += chunk.length; } /** * The listener of the `zlib.InflateRaw` stream `'data'` event. * * @param {Buffer} chunk A chunk of data * @private */ function inflateOnData(chunk) { this[kTotalLength] += chunk.length; if ( this[kPerMessageDeflate]._maxPayload < 1 || this[kTotalLength] <= this[kPerMessageDeflate]._maxPayload ) { this[kBuffers].push(chunk); return; } this[kError] = new RangeError('Max payload size exceeded'); this[kError].code = 'WS_ERR_UNSUPPORTED_MESSAGE_LENGTH'; this[kError][kStatusCode] = 1009; this.removeListener('data', inflateOnData); this.reset(); } /** * The listener of the `zlib.InflateRaw` stream `'error'` event. * * @param {Error} err The emitted error * @private */ function inflateOnError(err) { // // There is no need to call `Zlib#close()` as the handle is automatically // closed when an error is emitted. // this[kPerMessageDeflate]._inflate = null; err[kStatusCode] = 1007; this[kCallback](err); } /***/ }), /***/ 1937: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; const { Writable } = __webpack_require__(92413); const PerMessageDeflate = __webpack_require__(99604); const { BINARY_TYPES, EMPTY_BUFFER, kStatusCode, kWebSocket } = __webpack_require__(94122); const { concat, toArrayBuffer, unmask } = __webpack_require__(20034); const { isValidStatusCode, isValidUTF8 } = __webpack_require__(28541); const GET_INFO = 0; const GET_PAYLOAD_LENGTH_16 = 1; const GET_PAYLOAD_LENGTH_64 = 2; const GET_MASK = 3; const GET_DATA = 4; const INFLATING = 5; /** * HyBi Receiver implementation. * * @extends Writable */ class Receiver extends Writable { /** * Creates a Receiver instance. * * @param {String} [binaryType=nodebuffer] The type for binary data * @param {Object} [extensions] An object containing the negotiated extensions * @param {Boolean} [isServer=false] Specifies whether to operate in client or * server mode * @param {Number} [maxPayload=0] The maximum allowed message length */ constructor(binaryType, extensions, isServer, maxPayload) { super(); this._binaryType = binaryType || BINARY_TYPES[0]; this[kWebSocket] = undefined; this._extensions = extensions || {}; this._isServer = !!isServer; this._maxPayload = maxPayload | 0; this._bufferedBytes = 0; this._buffers = []; this._compressed = false; this._payloadLength = 0; this._mask = undefined; this._fragmented = 0; this._masked = false; this._fin = false; this._opcode = 0; this._totalPayloadLength = 0; this._messageLength = 0; this._fragments = []; this._state = GET_INFO; this._loop = false; } /** * Implements `Writable.prototype._write()`. * * @param {Buffer} chunk The chunk of data to write * @param {String} encoding The character encoding of `chunk` * @param {Function} cb Callback * @private */ _write(chunk, encoding, cb) { if (this._opcode === 0x08 && this._state == GET_INFO) return cb(); this._bufferedBytes += chunk.length; this._buffers.push(chunk); this.startLoop(cb); } /** * Consumes `n` bytes from the buffered data. * * @param {Number} n The number of bytes to consume * @return {Buffer} The consumed bytes * @private */ consume(n) { this._bufferedBytes -= n; if (n === this._buffers[0].length) return this._buffers.shift(); if (n < this._buffers[0].length) { const buf = this._buffers[0]; this._buffers[0] = buf.slice(n); return buf.slice(0, n); } const dst = Buffer.allocUnsafe(n); do { const buf = this._buffers[0]; const offset = dst.length - n; if (n >= buf.length) { dst.set(this._buffers.shift(), offset); } else { dst.set(new Uint8Array(buf.buffer, buf.byteOffset, n), offset); this._buffers[0] = buf.slice(n); } n -= buf.length; } while (n > 0); return dst; } /** * Starts the parsing loop. * * @param {Function} cb Callback * @private */ startLoop(cb) { let err; this._loop = true; do { switch (this._state) { case GET_INFO: err = this.getInfo(); break; case GET_PAYLOAD_LENGTH_16: err = this.getPayloadLength16(); break; case GET_PAYLOAD_LENGTH_64: err = this.getPayloadLength64(); break; case GET_MASK: this.getMask(); break; case GET_DATA: err = this.getData(cb); break; default: // `INFLATING` this._loop = false; return; } } while (this._loop); cb(err); } /** * Reads the first two bytes of a frame. * * @return {(RangeError|undefined)} A possible error * @private */ getInfo() { if (this._bufferedBytes < 2) { this._loop = false; return; } const buf = this.consume(2); if ((buf[0] & 0x30) !== 0x00) { this._loop = false; return error( RangeError, 'RSV2 and RSV3 must be clear', true, 1002, 'WS_ERR_UNEXPECTED_RSV_2_3' ); } const compressed = (buf[0] & 0x40) === 0x40; if (compressed && !this._extensions[PerMessageDeflate.extensionName]) { this._loop = false; return error( RangeError, 'RSV1 must be clear', true, 1002, 'WS_ERR_UNEXPECTED_RSV_1' ); } this._fin = (buf[0] & 0x80) === 0x80; this._opcode = buf[0] & 0x0f; this._payloadLength = buf[1] & 0x7f; if (this._opcode === 0x00) { if (compressed) { this._loop = false; return error( RangeError, 'RSV1 must be clear', true, 1002, 'WS_ERR_UNEXPECTED_RSV_1' ); } if (!this._fragmented) { this._loop = false; return error( RangeError, 'invalid opcode 0', true, 1002, 'WS_ERR_INVALID_OPCODE' ); } this._opcode = this._fragmented; } else if (this._opcode === 0x01 || this._opcode === 0x02) { if (this._fragmented) { this._loop = false; return error( RangeError, `invalid opcode ${this._opcode}`, true, 1002, 'WS_ERR_INVALID_OPCODE' ); } this._compressed = compressed; } else if (this._opcode > 0x07 && this._opcode < 0x0b) { if (!this._fin) { this._loop = false; return error( RangeError, 'FIN must be set', true, 1002, 'WS_ERR_EXPECTED_FIN' ); } if (compressed) { this._loop = false; return error( RangeError, 'RSV1 must be clear', true, 1002, 'WS_ERR_UNEXPECTED_RSV_1' ); } if (this._payloadLength > 0x7d) { this._loop = false; return error( RangeError, `invalid payload length ${this._payloadLength}`, true, 1002, 'WS_ERR_INVALID_CONTROL_PAYLOAD_LENGTH' ); } } else { this._loop = false; return error( RangeError, `invalid opcode ${this._opcode}`, true, 1002, 'WS_ERR_INVALID_OPCODE' ); } if (!this._fin && !this._fragmented) this._fragmented = this._opcode; this._masked = (buf[1] & 0x80) === 0x80; if (this._isServer) { if (!this._masked) { this._loop = false; return error( RangeError, 'MASK must be set', true, 1002, 'WS_ERR_EXPECTED_MASK' ); } } else if (this._masked) { this._loop = false; return error( RangeError, 'MASK must be clear', true, 1002, 'WS_ERR_UNEXPECTED_MASK' ); } if (this._payloadLength === 126) this._state = GET_PAYLOAD_LENGTH_16; else if (this._payloadLength === 127) this._state = GET_PAYLOAD_LENGTH_64; else return this.haveLength(); } /** * Gets extended payload length (7+16). * * @return {(RangeError|undefined)} A possible error * @private */ getPayloadLength16() { if (this._bufferedBytes < 2) { this._loop = false; return; } this._payloadLength = this.consume(2).readUInt16BE(0); return this.haveLength(); } /** * Gets extended payload length (7+64). * * @return {(RangeError|undefined)} A possible error * @private */ getPayloadLength64() { if (this._bufferedBytes < 8) { this._loop = false; return; } const buf = this.consume(8); const num = buf.readUInt32BE(0); // // The maximum safe integer in JavaScript is 2^53 - 1. An error is returned // if payload length is greater than this number. // if (num > Math.pow(2, 53 - 32) - 1) { this._loop = false; return error( RangeError, 'Unsupported WebSocket frame: payload length > 2^53 - 1', false, 1009, 'WS_ERR_UNSUPPORTED_DATA_PAYLOAD_LENGTH' ); } this._payloadLength = num * Math.pow(2, 32) + buf.readUInt32BE(4); return this.haveLength(); } /** * Payload length has been read. * * @return {(RangeError|undefined)} A possible error * @private */ haveLength() { if (this._payloadLength && this._opcode < 0x08) { this._totalPayloadLength += this._payloadLength; if (this._totalPayloadLength > this._maxPayload && this._maxPayload > 0) { this._loop = false; return error( RangeError, 'Max payload size exceeded', false, 1009, 'WS_ERR_UNSUPPORTED_MESSAGE_LENGTH' ); } } if (this._masked) this._state = GET_MASK; else this._state = GET_DATA; } /** * Reads mask bytes. * * @private */ getMask() { if (this._bufferedBytes < 4) { this._loop = false; return; } this._mask = this.consume(4); this._state = GET_DATA; } /** * Reads data bytes. * * @param {Function} cb Callback * @return {(Error|RangeError|undefined)} A possible error * @private */ getData(cb) { let data = EMPTY_BUFFER; if (this._payloadLength) { if (this._bufferedBytes < this._payloadLength) { this._loop = false; return; } data = this.consume(this._payloadLength); if (this._masked) unmask(data, this._mask); } if (this._opcode > 0x07) return this.controlMessage(data); if (this._compressed) { this._state = INFLATING; this.decompress(data, cb); return; } if (data.length) { // // This message is not compressed so its lenght is the sum of the payload // length of all fragments. // this._messageLength = this._totalPayloadLength; this._fragments.push(data); } return this.dataMessage(); } /** * Decompresses data. * * @param {Buffer} data Compressed data * @param {Function} cb Callback * @private */ decompress(data, cb) { const perMessageDeflate = this._extensions[PerMessageDeflate.extensionName]; perMessageDeflate.decompress(data, this._fin, (err, buf) => { if (err) return cb(err); if (buf.length) { this._messageLength += buf.length; if (this._messageLength > this._maxPayload && this._maxPayload > 0) { return cb( error( RangeError, 'Max payload size exceeded', false, 1009, 'WS_ERR_UNSUPPORTED_MESSAGE_LENGTH' ) ); } this._fragments.push(buf); } const er = this.dataMessage(); if (er) return cb(er); this.startLoop(cb); }); } /** * Handles a data message. * * @return {(Error|undefined)} A possible error * @private */ dataMessage() { if (this._fin) { const messageLength = this._messageLength; const fragments = this._fragments; this._totalPayloadLength = 0; this._messageLength = 0; this._fragmented = 0; this._fragments = []; if (this._opcode === 2) { let data; if (this._binaryType === 'nodebuffer') { data = concat(fragments, messageLength); } else if (this._binaryType === 'arraybuffer') { data = toArrayBuffer(concat(fragments, messageLength)); } else { data = fragments; } this.emit('message', data); } else { const buf = concat(fragments, messageLength); if (!isValidUTF8(buf)) { this._loop = false; return error( Error, 'invalid UTF-8 sequence', true, 1007, 'WS_ERR_INVALID_UTF8' ); } this.emit('message', buf.toString()); } } this._state = GET_INFO; } /** * Handles a control message. * * @param {Buffer} data Data to handle * @return {(Error|RangeError|undefined)} A possible error * @private */ controlMessage(data) { if (this._opcode === 0x08) { this._loop = false; if (data.length === 0) { this.emit('conclude', 1005, ''); this.end(); } else if (data.length === 1) { return error( RangeError, 'invalid payload length 1', true, 1002, 'WS_ERR_INVALID_CONTROL_PAYLOAD_LENGTH' ); } else { const code = data.readUInt16BE(0); if (!isValidStatusCode(code)) { return error( RangeError, `invalid status code ${code}`, true, 1002, 'WS_ERR_INVALID_CLOSE_CODE' ); } const buf = data.slice(2); if (!isValidUTF8(buf)) { return error( Error, 'invalid UTF-8 sequence', true, 1007, 'WS_ERR_INVALID_UTF8' ); } this.emit('conclude', code, buf.toString()); this.end(); } } else if (this._opcode === 0x09) { this.emit('ping', data); } else { this.emit('pong', data); } this._state = GET_INFO; } } module.exports = Receiver; /** * Builds an error object. * * @param {function(new:Error|RangeError)} ErrorCtor The error constructor * @param {String} message The error message * @param {Boolean} prefix Specifies whether or not to add a default prefix to * `message` * @param {Number} statusCode The status code * @param {String} errorCode The exposed error code * @return {(Error|RangeError)} The error * @private */ function error(ErrorCtor, message, prefix, statusCode, errorCode) { const err = new ErrorCtor( prefix ? `Invalid WebSocket frame: ${message}` : message ); Error.captureStackTrace(err, error); err.code = errorCode; err[kStatusCode] = statusCode; return err; } /***/ }), /***/ 7748: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; /* eslint no-unused-vars: ["error", { "varsIgnorePattern": "^net|tls$" }] */ const net = __webpack_require__(11631); const tls = __webpack_require__(4016); const { randomFillSync } = __webpack_require__(33373); const PerMessageDeflate = __webpack_require__(99604); const { EMPTY_BUFFER } = __webpack_require__(94122); const { isValidStatusCode } = __webpack_require__(28541); const { mask: applyMask, toBuffer } = __webpack_require__(20034); const mask = Buffer.alloc(4); /** * HyBi Sender implementation. */ class Sender { /** * Creates a Sender instance. * * @param {(net.Socket|tls.Socket)} socket The connection socket * @param {Object} [extensions] An object containing the negotiated extensions */ constructor(socket, extensions) { this._extensions = extensions || {}; this._socket = socket; this._firstFragment = true; this._compress = false; this._bufferedBytes = 0; this._deflating = false; this._queue = []; } /** * Frames a piece of data according to the HyBi WebSocket protocol. * * @param {Buffer} data The data to frame * @param {Object} options Options object * @param {Number} options.opcode The opcode * @param {Boolean} [options.readOnly=false] Specifies whether `data` can be * modified * @param {Boolean} [options.fin=false] Specifies whether or not to set the * FIN bit * @param {Boolean} [options.mask=false] Specifies whether or not to mask * `data` * @param {Boolean} [options.rsv1=false] Specifies whether or not to set the * RSV1 bit * @return {Buffer[]} The framed data as a list of `Buffer` instances * @public */ static frame(data, options) { const merge = options.mask && options.readOnly; let offset = options.mask ? 6 : 2; let payloadLength = data.length; if (data.length >= 65536) { offset += 8; payloadLength = 127; } else if (data.length > 125) { offset += 2; payloadLength = 126; } const target = Buffer.allocUnsafe(merge ? data.length + offset : offset); target[0] = options.fin ? options.opcode | 0x80 : options.opcode; if (options.rsv1) target[0] |= 0x40; target[1] = payloadLength; if (payloadLength === 126) { target.writeUInt16BE(data.length, 2); } else if (payloadLength === 127) { target.writeUInt32BE(0, 2); target.writeUInt32BE(data.length, 6); } if (!options.mask) return [target, data]; randomFillSync(mask, 0, 4); target[1] |= 0x80; target[offset - 4] = mask[0]; target[offset - 3] = mask[1]; target[offset - 2] = mask[2]; target[offset - 1] = mask[3]; if (merge) { applyMask(data, mask, target, offset, data.length); return [target]; } applyMask(data, mask, data, 0, data.length); return [target, data]; } /** * Sends a close message to the other peer. * * @param {Number} [code] The status code component of the body * @param {String} [data] The message component of the body * @param {Boolean} [mask=false] Specifies whether or not to mask the message * @param {Function} [cb] Callback * @public */ close(code, data, mask, cb) { let buf; if (code === undefined) { buf = EMPTY_BUFFER; } else if (typeof code !== 'number' || !isValidStatusCode(code)) { throw new TypeError('First argument must be a valid error code number'); } else if (data === undefined || data === '') { buf = Buffer.allocUnsafe(2); buf.writeUInt16BE(code, 0); } else { const length = Buffer.byteLength(data); if (length > 123) { throw new RangeError('The message must not be greater than 123 bytes'); } buf = Buffer.allocUnsafe(2 + length); buf.writeUInt16BE(code, 0); buf.write(data, 2); } if (this._deflating) { this.enqueue([this.doClose, buf, mask, cb]); } else { this.doClose(buf, mask, cb); } } /** * Frames and sends a close message. * * @param {Buffer} data The message to send * @param {Boolean} [mask=false] Specifies whether or not to mask `data` * @param {Function} [cb] Callback * @private */ doClose(data, mask, cb) { this.sendFrame( Sender.frame(data, { fin: true, rsv1: false, opcode: 0x08, mask, readOnly: false }), cb ); } /** * Sends a ping message to the other peer. * * @param {*} data The message to send * @param {Boolean} [mask=false] Specifies whether or not to mask `data` * @param {Function} [cb] Callback * @public */ ping(data, mask, cb) { const buf = toBuffer(data); if (buf.length > 125) { throw new RangeError('The data size must not be greater than 125 bytes'); } if (this._deflating) { this.enqueue([this.doPing, buf, mask, toBuffer.readOnly, cb]); } else { this.doPing(buf, mask, toBuffer.readOnly, cb); } } /** * Frames and sends a ping message. * * @param {Buffer} data The message to send * @param {Boolean} [mask=false] Specifies whether or not to mask `data` * @param {Boolean} [readOnly=false] Specifies whether `data` can be modified * @param {Function} [cb] Callback * @private */ doPing(data, mask, readOnly, cb) { this.sendFrame( Sender.frame(data, { fin: true, rsv1: false, opcode: 0x09, mask, readOnly }), cb ); } /** * Sends a pong message to the other peer. * * @param {*} data The message to send * @param {Boolean} [mask=false] Specifies whether or not to mask `data` * @param {Function} [cb] Callback * @public */ pong(data, mask, cb) { const buf = toBuffer(data); if (buf.length > 125) { throw new RangeError('The data size must not be greater than 125 bytes'); } if (this._deflating) { this.enqueue([this.doPong, buf, mask, toBuffer.readOnly, cb]); } else { this.doPong(buf, mask, toBuffer.readOnly, cb); } } /** * Frames and sends a pong message. * * @param {Buffer} data The message to send * @param {Boolean} [mask=false] Specifies whether or not to mask `data` * @param {Boolean} [readOnly=false] Specifies whether `data` can be modified * @param {Function} [cb] Callback * @private */ doPong(data, mask, readOnly, cb) { this.sendFrame( Sender.frame(data, { fin: true, rsv1: false, opcode: 0x0a, mask, readOnly }), cb ); } /** * Sends a data message to the other peer. * * @param {*} data The message to send * @param {Object} options Options object * @param {Boolean} [options.compress=false] Specifies whether or not to * compress `data` * @param {Boolean} [options.binary=false] Specifies whether `data` is binary * or text * @param {Boolean} [options.fin=false] Specifies whether the fragment is the * last one * @param {Boolean} [options.mask=false] Specifies whether or not to mask * `data` * @param {Function} [cb] Callback * @public */ send(data, options, cb) { const buf = toBuffer(data); const perMessageDeflate = this._extensions[PerMessageDeflate.extensionName]; let opcode = options.binary ? 2 : 1; let rsv1 = options.compress; if (this._firstFragment) { this._firstFragment = false; if (rsv1 && perMessageDeflate) { rsv1 = buf.length >= perMessageDeflate._threshold; } this._compress = rsv1; } else { rsv1 = false; opcode = 0; } if (options.fin) this._firstFragment = true; if (perMessageDeflate) { const opts = { fin: options.fin, rsv1, opcode, mask: options.mask, readOnly: toBuffer.readOnly }; if (this._deflating) { this.enqueue([this.dispatch, buf, this._compress, opts, cb]); } else { this.dispatch(buf, this._compress, opts, cb); } } else { this.sendFrame( Sender.frame(buf, { fin: options.fin, rsv1: false, opcode, mask: options.mask, readOnly: toBuffer.readOnly }), cb ); } } /** * Dispatches a data message. * * @param {Buffer} data The message to send * @param {Boolean} [compress=false] Specifies whether or not to compress * `data` * @param {Object} options Options object * @param {Number} options.opcode The opcode * @param {Boolean} [options.readOnly=false] Specifies whether `data` can be * modified * @param {Boolean} [options.fin=false] Specifies whether or not to set the * FIN bit * @param {Boolean} [options.mask=false] Specifies whether or not to mask * `data` * @param {Boolean} [options.rsv1=false] Specifies whether or not to set the * RSV1 bit * @param {Function} [cb] Callback * @private */ dispatch(data, compress, options, cb) { if (!compress) { this.sendFrame(Sender.frame(data, options), cb); return; } const perMessageDeflate = this._extensions[PerMessageDeflate.extensionName]; this._bufferedBytes += data.length; this._deflating = true; perMessageDeflate.compress(data, options.fin, (_, buf) => { if (this._socket.destroyed) { const err = new Error( 'The socket was closed while data was being compressed' ); if (typeof cb === 'function') cb(err); for (let i = 0; i < this._queue.length; i++) { const callback = this._queue[i][4]; if (typeof callback === 'function') callback(err); } return; } this._bufferedBytes -= data.length; this._deflating = false; options.readOnly = false; this.sendFrame(Sender.frame(buf, options), cb); this.dequeue(); }); } /** * Executes queued send operations. * * @private */ dequeue() { while (!this._deflating && this._queue.length) { const params = this._queue.shift(); this._bufferedBytes -= params[1].length; Reflect.apply(params[0], this, params.slice(1)); } } /** * Enqueues a send operation. * * @param {Array} params Send operation parameters. * @private */ enqueue(params) { this._bufferedBytes += params[1].length; this._queue.push(params); } /** * Sends a frame. * * @param {Buffer[]} list The frame to send * @param {Function} [cb] Callback * @private */ sendFrame(list, cb) { if (list.length === 2) { this._socket.cork(); this._socket.write(list[0]); this._socket.write(list[1], cb); this._socket.uncork(); } else { this._socket.write(list[0], cb); } } } module.exports = Sender; /***/ }), /***/ 61997: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; const { Duplex } = __webpack_require__(92413); /** * Emits the `'close'` event on a stream. * * @param {Duplex} stream The stream. * @private */ function emitClose(stream) { stream.emit('close'); } /** * The listener of the `'end'` event. * * @private */ function duplexOnEnd() { if (!this.destroyed && this._writableState.finished) { this.destroy(); } } /** * The listener of the `'error'` event. * * @param {Error} err The error * @private */ function duplexOnError(err) { this.removeListener('error', duplexOnError); this.destroy(); if (this.listenerCount('error') === 0) { // Do not suppress the throwing behavior. this.emit('error', err); } } /** * Wraps a `WebSocket` in a duplex stream. * * @param {WebSocket} ws The `WebSocket` to wrap * @param {Object} [options] The options for the `Duplex` constructor * @return {Duplex} The duplex stream * @public */ function createWebSocketStream(ws, options) { let resumeOnReceiverDrain = true; let terminateOnDestroy = true; function receiverOnDrain() { if (resumeOnReceiverDrain) ws._socket.resume(); } if (ws.readyState === ws.CONNECTING) { ws.once('open', function open() { ws._receiver.removeAllListeners('drain'); ws._receiver.on('drain', receiverOnDrain); }); } else { ws._receiver.removeAllListeners('drain'); ws._receiver.on('drain', receiverOnDrain); } const duplex = new Duplex({ ...options, autoDestroy: false, emitClose: false, objectMode: false, writableObjectMode: false }); ws.on('message', function message(msg) { if (!duplex.push(msg)) { resumeOnReceiverDrain = false; ws._socket.pause(); } }); ws.once('error', function error(err) { if (duplex.destroyed) return; // Prevent `ws.terminate()` from being called by `duplex._destroy()`. // // - If the `'error'` event is emitted before the `'open'` event, then // `ws.terminate()` is a noop as no socket is assigned. // - Otherwise, the error is re-emitted by the listener of the `'error'` // event of the `Receiver` object. The listener already closes the // connection by calling `ws.close()`. This allows a close frame to be // sent to the other peer. If `ws.terminate()` is called right after this, // then the close frame might not be sent. terminateOnDestroy = false; duplex.destroy(err); }); ws.once('close', function close() { if (duplex.destroyed) return; duplex.push(null); }); duplex._destroy = function (err, callback) { if (ws.readyState === ws.CLOSED) { callback(err); process.nextTick(emitClose, duplex); return; } let called = false; ws.once('error', function error(err) { called = true; callback(err); }); ws.once('close', function close() { if (!called) callback(err); process.nextTick(emitClose, duplex); }); if (terminateOnDestroy) ws.terminate(); }; duplex._final = function (callback) { if (ws.readyState === ws.CONNECTING) { ws.once('open', function open() { duplex._final(callback); }); return; } // If the value of the `_socket` property is `null` it means that `ws` is a // client websocket and the handshake failed. In fact, when this happens, a // socket is never assigned to the websocket. Wait for the `'error'` event // that will be emitted by the websocket. if (ws._socket === null) return; if (ws._socket._writableState.finished) { callback(); if (duplex._readableState.endEmitted) duplex.destroy(); } else { ws._socket.once('finish', function finish() { // `duplex` is not destroyed here because the `'end'` event will be // emitted on `duplex` after this `'finish'` event. The EOF signaling // `null` chunk is, in fact, pushed when the websocket emits `'close'`. callback(); }); ws.close(); } }; duplex._read = function () { if ( (ws.readyState === ws.OPEN || ws.readyState === ws.CLOSING) && !resumeOnReceiverDrain ) { resumeOnReceiverDrain = true; if (!ws._receiver._writableState.needDrain) ws._socket.resume(); } }; duplex._write = function (chunk, encoding, callback) { if (ws.readyState === ws.CONNECTING) { ws.once('open', function open() { duplex._write(chunk, encoding, callback); }); return; } ws.send(chunk, callback); }; duplex.on('end', duplexOnEnd); duplex.on('error', duplexOnError); return duplex; } module.exports = createWebSocketStream; /***/ }), /***/ 28541: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; /** * Checks if a status code is allowed in a close frame. * * @param {Number} code The status code * @return {Boolean} `true` if the status code is valid, else `false` * @public */ function isValidStatusCode(code) { return ( (code >= 1000 && code <= 1014 && code !== 1004 && code !== 1005 && code !== 1006) || (code >= 3000 && code <= 4999) ); } /** * Checks if a given buffer contains only correct UTF-8. * Ported from https://www.cl.cam.ac.uk/%7Emgk25/ucs/utf8_check.c by * Markus Kuhn. * * @param {Buffer} buf The buffer to check * @return {Boolean} `true` if `buf` contains only correct UTF-8, else `false` * @public */ function _isValidUTF8(buf) { const len = buf.length; let i = 0; while (i < len) { if ((buf[i] & 0x80) === 0) { // 0xxxxxxx i++; } else if ((buf[i] & 0xe0) === 0xc0) { // 110xxxxx 10xxxxxx if ( i + 1 === len || (buf[i + 1] & 0xc0) !== 0x80 || (buf[i] & 0xfe) === 0xc0 // Overlong ) { return false; } i += 2; } else if ((buf[i] & 0xf0) === 0xe0) { // 1110xxxx 10xxxxxx 10xxxxxx if ( i + 2 >= len || (buf[i + 1] & 0xc0) !== 0x80 || (buf[i + 2] & 0xc0) !== 0x80 || (buf[i] === 0xe0 && (buf[i + 1] & 0xe0) === 0x80) || // Overlong (buf[i] === 0xed && (buf[i + 1] & 0xe0) === 0xa0) // Surrogate (U+D800 - U+DFFF) ) { return false; } i += 3; } else if ((buf[i] & 0xf8) === 0xf0) { // 11110xxx 10xxxxxx 10xxxxxx 10xxxxxx if ( i + 3 >= len || (buf[i + 1] & 0xc0) !== 0x80 || (buf[i + 2] & 0xc0) !== 0x80 || (buf[i + 3] & 0xc0) !== 0x80 || (buf[i] === 0xf0 && (buf[i + 1] & 0xf0) === 0x80) || // Overlong (buf[i] === 0xf4 && buf[i + 1] > 0x8f) || buf[i] > 0xf4 // > U+10FFFF ) { return false; } i += 4; } else { return false; } } return true; } try { let isValidUTF8 = __webpack_require__(24592); /* istanbul ignore if */ if (typeof isValidUTF8 === 'object') { isValidUTF8 = isValidUTF8.Validation.isValidUTF8; // utf-8-validate@<3.0.0 } module.exports = { isValidStatusCode, isValidUTF8(buf) { return buf.length < 150 ? _isValidUTF8(buf) : isValidUTF8(buf); } }; } catch (e) /* istanbul ignore next */ { module.exports = { isValidStatusCode, isValidUTF8: _isValidUTF8 }; } /***/ }), /***/ 89535: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; /* eslint no-unused-vars: ["error", { "varsIgnorePattern": "^net|tls|https$" }] */ const EventEmitter = __webpack_require__(28614); const http = __webpack_require__(98605); const https = __webpack_require__(57211); const net = __webpack_require__(11631); const tls = __webpack_require__(4016); const { createHash } = __webpack_require__(33373); const PerMessageDeflate = __webpack_require__(99604); const WebSocket = __webpack_require__(30418); const { format, parse } = __webpack_require__(97821); const { GUID, kWebSocket } = __webpack_require__(94122); const keyRegex = /^[+/0-9A-Za-z]{22}==$/; const RUNNING = 0; const CLOSING = 1; const CLOSED = 2; /** * Class representing a WebSocket server. * * @extends EventEmitter */ class WebSocketServer extends EventEmitter { /** * Create a `WebSocketServer` instance. * * @param {Object} options Configuration options * @param {Number} [options.backlog=511] The maximum length of the queue of * pending connections * @param {Boolean} [options.clientTracking=true] Specifies whether or not to * track clients * @param {Function} [options.handleProtocols] A hook to handle protocols * @param {String} [options.host] The hostname where to bind the server * @param {Number} [options.maxPayload=104857600] The maximum allowed message * size * @param {Boolean} [options.noServer=false] Enable no server mode * @param {String} [options.path] Accept only connections matching this path * @param {(Boolean|Object)} [options.perMessageDeflate=false] Enable/disable * permessage-deflate * @param {Number} [options.port] The port where to bind the server * @param {(http.Server|https.Server)} [options.server] A pre-created HTTP/S * server to use * @param {Function} [options.verifyClient] A hook to reject connections * @param {Function} [callback] A listener for the `listening` event */ constructor(options, callback) { super(); options = { maxPayload: 100 * 1024 * 1024, perMessageDeflate: false, handleProtocols: null, clientTracking: true, verifyClient: null, noServer: false, backlog: null, // use default (511 as implemented in net.js) server: null, host: null, path: null, port: null, ...options }; if ( (options.port == null && !options.server && !options.noServer) || (options.port != null && (options.server || options.noServer)) || (options.server && options.noServer) ) { throw new TypeError( 'One and only one of the "port", "server", or "noServer" options ' + 'must be specified' ); } if (options.port != null) { this._server = http.createServer((req, res) => { const body = http.STATUS_CODES[426]; res.writeHead(426, { 'Content-Length': body.length, 'Content-Type': 'text/plain' }); res.end(body); }); this._server.listen( options.port, options.host, options.backlog, callback ); } else if (options.server) { this._server = options.server; } if (this._server) { const emitConnection = this.emit.bind(this, 'connection'); this._removeListeners = addListeners(this._server, { listening: this.emit.bind(this, 'listening'), error: this.emit.bind(this, 'error'), upgrade: (req, socket, head) => { this.handleUpgrade(req, socket, head, emitConnection); } }); } if (options.perMessageDeflate === true) options.perMessageDeflate = {}; if (options.clientTracking) this.clients = new Set(); this.options = options; this._state = RUNNING; } /** * Returns the bound address, the address family name, and port of the server * as reported by the operating system if listening on an IP socket. * If the server is listening on a pipe or UNIX domain socket, the name is * returned as a string. * * @return {(Object|String|null)} The address of the server * @public */ address() { if (this.options.noServer) { throw new Error('The server is operating in "noServer" mode'); } if (!this._server) return null; return this._server.address(); } /** * Close the server. * * @param {Function} [cb] Callback * @public */ close(cb) { if (cb) this.once('close', cb); if (this._state === CLOSED) { process.nextTick(emitClose, this); return; } if (this._state === CLOSING) return; this._state = CLOSING; // // Terminate all associated clients. // if (this.clients) { for (const client of this.clients) client.terminate(); } const server = this._server; if (server) { this._removeListeners(); this._removeListeners = this._server = null; // // Close the http server if it was internally created. // if (this.options.port != null) { server.close(emitClose.bind(undefined, this)); return; } } process.nextTick(emitClose, this); } /** * See if a given request should be handled by this server instance. * * @param {http.IncomingMessage} req Request object to inspect * @return {Boolean} `true` if the request is valid, else `false` * @public */ shouldHandle(req) { if (this.options.path) { const index = req.url.indexOf('?'); const pathname = index !== -1 ? req.url.slice(0, index) : req.url; if (pathname !== this.options.path) return false; } return true; } /** * Handle a HTTP Upgrade request. * * @param {http.IncomingMessage} req The request object * @param {(net.Socket|tls.Socket)} socket The network socket between the * server and client * @param {Buffer} head The first packet of the upgraded stream * @param {Function} cb Callback * @public */ handleUpgrade(req, socket, head, cb) { socket.on('error', socketOnError); const key = req.headers['sec-websocket-key'] !== undefined ? req.headers['sec-websocket-key'].trim() : false; const version = +req.headers['sec-websocket-version']; const extensions = {}; if ( req.method !== 'GET' || req.headers.upgrade.toLowerCase() !== 'websocket' || !key || !keyRegex.test(key) || (version !== 8 && version !== 13) || !this.shouldHandle(req) ) { return abortHandshake(socket, 400); } if (this.options.perMessageDeflate) { const perMessageDeflate = new PerMessageDeflate( this.options.perMessageDeflate, true, this.options.maxPayload ); try { const offers = parse(req.headers['sec-websocket-extensions']); if (offers[PerMessageDeflate.extensionName]) { perMessageDeflate.accept(offers[PerMessageDeflate.extensionName]); extensions[PerMessageDeflate.extensionName] = perMessageDeflate; } } catch (err) { return abortHandshake(socket, 400); } } // // Optionally call external client verification handler. // if (this.options.verifyClient) { const info = { origin: req.headers[`${version === 8 ? 'sec-websocket-origin' : 'origin'}`], secure: !!(req.socket.authorized || req.socket.encrypted), req }; if (this.options.verifyClient.length === 2) { this.options.verifyClient(info, (verified, code, message, headers) => { if (!verified) { return abortHandshake(socket, code || 401, message, headers); } this.completeUpgrade(key, extensions, req, socket, head, cb); }); return; } if (!this.options.verifyClient(info)) return abortHandshake(socket, 401); } this.completeUpgrade(key, extensions, req, socket, head, cb); } /** * Upgrade the connection to WebSocket. * * @param {String} key The value of the `Sec-WebSocket-Key` header * @param {Object} extensions The accepted extensions * @param {http.IncomingMessage} req The request object * @param {(net.Socket|tls.Socket)} socket The network socket between the * server and client * @param {Buffer} head The first packet of the upgraded stream * @param {Function} cb Callback * @throws {Error} If called more than once with the same socket * @private */ completeUpgrade(key, extensions, req, socket, head, cb) { // // Destroy the socket if the client has already sent a FIN packet. // if (!socket.readable || !socket.writable) return socket.destroy(); if (socket[kWebSocket]) { throw new Error( 'server.handleUpgrade() was called more than once with the same ' + 'socket, possibly due to a misconfiguration' ); } if (this._state > RUNNING) return abortHandshake(socket, 503); const digest = createHash('sha1') .update(key + GUID) .digest('base64'); const headers = [ 'HTTP/1.1 101 Switching Protocols', 'Upgrade: websocket', 'Connection: Upgrade', `Sec-WebSocket-Accept: ${digest}` ]; const ws = new WebSocket(null); let protocol = req.headers['sec-websocket-protocol']; if (protocol) { protocol = protocol.split(',').map(trim); // // Optionally call external protocol selection handler. // if (this.options.handleProtocols) { protocol = this.options.handleProtocols(protocol, req); } else { protocol = protocol[0]; } if (protocol) { headers.push(`Sec-WebSocket-Protocol: ${protocol}`); ws._protocol = protocol; } } if (extensions[PerMessageDeflate.extensionName]) { const params = extensions[PerMessageDeflate.extensionName].params; const value = format({ [PerMessageDeflate.extensionName]: [params] }); headers.push(`Sec-WebSocket-Extensions: ${value}`); ws._extensions = extensions; } // // Allow external modification/inspection of handshake headers. // this.emit('headers', headers, req); socket.write(headers.concat('\r\n').join('\r\n')); socket.removeListener('error', socketOnError); ws.setSocket(socket, head, this.options.maxPayload); if (this.clients) { this.clients.add(ws); ws.on('close', () => this.clients.delete(ws)); } cb(ws, req); } } module.exports = WebSocketServer; /** * Add event listeners on an `EventEmitter` using a map of * pairs. * * @param {EventEmitter} server The event emitter * @param {Object.} map The listeners to add * @return {Function} A function that will remove the added listeners when * called * @private */ function addListeners(server, map) { for (const event of Object.keys(map)) server.on(event, map[event]); return function removeListeners() { for (const event of Object.keys(map)) { server.removeListener(event, map[event]); } }; } /** * Emit a `'close'` event on an `EventEmitter`. * * @param {EventEmitter} server The event emitter * @private */ function emitClose(server) { server._state = CLOSED; server.emit('close'); } /** * Handle premature socket errors. * * @private */ function socketOnError() { this.destroy(); } /** * Close the connection when preconditions are not fulfilled. * * @param {(net.Socket|tls.Socket)} socket The socket of the upgrade request * @param {Number} code The HTTP response status code * @param {String} [message] The HTTP response body * @param {Object} [headers] Additional HTTP response headers * @private */ function abortHandshake(socket, code, message, headers) { if (socket.writable) { message = message || http.STATUS_CODES[code]; headers = { Connection: 'close', 'Content-Type': 'text/html', 'Content-Length': Buffer.byteLength(message), ...headers }; socket.write( `HTTP/1.1 ${code} ${http.STATUS_CODES[code]}\r\n` + Object.keys(headers) .map((h) => `${h}: ${headers[h]}`) .join('\r\n') + '\r\n\r\n' + message ); } socket.removeListener('error', socketOnError); socket.destroy(); } /** * Remove whitespace characters from both ends of a string. * * @param {String} str The string * @return {String} A new string representing `str` stripped of whitespace * characters from both its beginning and end * @private */ function trim(str) { return str.trim(); } /***/ }), /***/ 30418: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; /* eslint no-unused-vars: ["error", { "varsIgnorePattern": "^Readable$" }] */ const EventEmitter = __webpack_require__(28614); const https = __webpack_require__(57211); const http = __webpack_require__(98605); const net = __webpack_require__(11631); const tls = __webpack_require__(4016); const { randomBytes, createHash } = __webpack_require__(33373); const { Readable } = __webpack_require__(92413); const { URL } = __webpack_require__(78835); const PerMessageDeflate = __webpack_require__(99604); const Receiver = __webpack_require__(1937); const Sender = __webpack_require__(7748); const { BINARY_TYPES, EMPTY_BUFFER, GUID, kStatusCode, kWebSocket, NOOP } = __webpack_require__(94122); const { addEventListener, removeEventListener } = __webpack_require__(63406); const { format, parse } = __webpack_require__(97821); const { toBuffer } = __webpack_require__(20034); const readyStates = ['CONNECTING', 'OPEN', 'CLOSING', 'CLOSED']; const protocolVersions = [8, 13]; const closeTimeout = 30 * 1000; /** * Class representing a WebSocket. * * @extends EventEmitter */ class WebSocket extends EventEmitter { /** * Create a new `WebSocket`. * * @param {(String|URL)} address The URL to which to connect * @param {(String|String[])} [protocols] The subprotocols * @param {Object} [options] Connection options */ constructor(address, protocols, options) { super(); this._binaryType = BINARY_TYPES[0]; this._closeCode = 1006; this._closeFrameReceived = false; this._closeFrameSent = false; this._closeMessage = ''; this._closeTimer = null; this._extensions = {}; this._protocol = ''; this._readyState = WebSocket.CONNECTING; this._receiver = null; this._sender = null; this._socket = null; if (address !== null) { this._bufferedAmount = 0; this._isServer = false; this._redirects = 0; if (Array.isArray(protocols)) { protocols = protocols.join(', '); } else if (typeof protocols === 'object' && protocols !== null) { options = protocols; protocols = undefined; } initAsClient(this, address, protocols, options); } else { this._isServer = true; } } /** * This deviates from the WHATWG interface since ws doesn't support the * required default "blob" type (instead we define a custom "nodebuffer" * type). * * @type {String} */ get binaryType() { return this._binaryType; } set binaryType(type) { if (!BINARY_TYPES.includes(type)) return; this._binaryType = type; // // Allow to change `binaryType` on the fly. // if (this._receiver) this._receiver._binaryType = type; } /** * @type {Number} */ get bufferedAmount() { if (!this._socket) return this._bufferedAmount; return this._socket._writableState.length + this._sender._bufferedBytes; } /** * @type {String} */ get extensions() { return Object.keys(this._extensions).join(); } /** * @type {Function} */ /* istanbul ignore next */ get onclose() { return undefined; } /* istanbul ignore next */ set onclose(listener) {} /** * @type {Function} */ /* istanbul ignore next */ get onerror() { return undefined; } /* istanbul ignore next */ set onerror(listener) {} /** * @type {Function} */ /* istanbul ignore next */ get onopen() { return undefined; } /* istanbul ignore next */ set onopen(listener) {} /** * @type {Function} */ /* istanbul ignore next */ get onmessage() { return undefined; } /* istanbul ignore next */ set onmessage(listener) {} /** * @type {String} */ get protocol() { return this._protocol; } /** * @type {Number} */ get readyState() { return this._readyState; } /** * @type {String} */ get url() { return this._url; } /** * Set up the socket and the internal resources. * * @param {(net.Socket|tls.Socket)} socket The network socket between the * server and client * @param {Buffer} head The first packet of the upgraded stream * @param {Number} [maxPayload=0] The maximum allowed message size * @private */ setSocket(socket, head, maxPayload) { const receiver = new Receiver( this.binaryType, this._extensions, this._isServer, maxPayload ); this._sender = new Sender(socket, this._extensions); this._receiver = receiver; this._socket = socket; receiver[kWebSocket] = this; socket[kWebSocket] = this; receiver.on('conclude', receiverOnConclude); receiver.on('drain', receiverOnDrain); receiver.on('error', receiverOnError); receiver.on('message', receiverOnMessage); receiver.on('ping', receiverOnPing); receiver.on('pong', receiverOnPong); socket.setTimeout(0); socket.setNoDelay(); if (head.length > 0) socket.unshift(head); socket.on('close', socketOnClose); socket.on('data', socketOnData); socket.on('end', socketOnEnd); socket.on('error', socketOnError); this._readyState = WebSocket.OPEN; this.emit('open'); } /** * Emit the `'close'` event. * * @private */ emitClose() { if (!this._socket) { this._readyState = WebSocket.CLOSED; this.emit('close', this._closeCode, this._closeMessage); return; } if (this._extensions[PerMessageDeflate.extensionName]) { this._extensions[PerMessageDeflate.extensionName].cleanup(); } this._receiver.removeAllListeners(); this._readyState = WebSocket.CLOSED; this.emit('close', this._closeCode, this._closeMessage); } /** * Start a closing handshake. * * +----------+ +-----------+ +----------+ * - - -|ws.close()|-->|close frame|-->|ws.close()|- - - * | +----------+ +-----------+ +----------+ | * +----------+ +-----------+ | * CLOSING |ws.close()|<--|close frame|<--+-----+ CLOSING * +----------+ +-----------+ | * | | | +---+ | * +------------------------+-->|fin| - - - - * | +---+ | +---+ * - - - - -|fin|<---------------------+ * +---+ * * @param {Number} [code] Status code explaining why the connection is closing * @param {String} [data] A string explaining why the connection is closing * @public */ close(code, data) { if (this.readyState === WebSocket.CLOSED) return; if (this.readyState === WebSocket.CONNECTING) { const msg = 'WebSocket was closed before the connection was established'; return abortHandshake(this, this._req, msg); } if (this.readyState === WebSocket.CLOSING) { if ( this._closeFrameSent && (this._closeFrameReceived || this._receiver._writableState.errorEmitted) ) { this._socket.end(); } return; } this._readyState = WebSocket.CLOSING; this._sender.close(code, data, !this._isServer, (err) => { // // This error is handled by the `'error'` listener on the socket. We only // want to know if the close frame has been sent here. // if (err) return; this._closeFrameSent = true; if ( this._closeFrameReceived || this._receiver._writableState.errorEmitted ) { this._socket.end(); } }); // // Specify a timeout for the closing handshake to complete. // this._closeTimer = setTimeout( this._socket.destroy.bind(this._socket), closeTimeout ); } /** * Send a ping. * * @param {*} [data] The data to send * @param {Boolean} [mask] Indicates whether or not to mask `data` * @param {Function} [cb] Callback which is executed when the ping is sent * @public */ ping(data, mask, cb) { if (this.readyState === WebSocket.CONNECTING) { throw new Error('WebSocket is not open: readyState 0 (CONNECTING)'); } if (typeof data === 'function') { cb = data; data = mask = undefined; } else if (typeof mask === 'function') { cb = mask; mask = undefined; } if (typeof data === 'number') data = data.toString(); if (this.readyState !== WebSocket.OPEN) { sendAfterClose(this, data, cb); return; } if (mask === undefined) mask = !this._isServer; this._sender.ping(data || EMPTY_BUFFER, mask, cb); } /** * Send a pong. * * @param {*} [data] The data to send * @param {Boolean} [mask] Indicates whether or not to mask `data` * @param {Function} [cb] Callback which is executed when the pong is sent * @public */ pong(data, mask, cb) { if (this.readyState === WebSocket.CONNECTING) { throw new Error('WebSocket is not open: readyState 0 (CONNECTING)'); } if (typeof data === 'function') { cb = data; data = mask = undefined; } else if (typeof mask === 'function') { cb = mask; mask = undefined; } if (typeof data === 'number') data = data.toString(); if (this.readyState !== WebSocket.OPEN) { sendAfterClose(this, data, cb); return; } if (mask === undefined) mask = !this._isServer; this._sender.pong(data || EMPTY_BUFFER, mask, cb); } /** * Send a data message. * * @param {*} data The message to send * @param {Object} [options] Options object * @param {Boolean} [options.compress] Specifies whether or not to compress * `data` * @param {Boolean} [options.binary] Specifies whether `data` is binary or * text * @param {Boolean} [options.fin=true] Specifies whether the fragment is the * last one * @param {Boolean} [options.mask] Specifies whether or not to mask `data` * @param {Function} [cb] Callback which is executed when data is written out * @public */ send(data, options, cb) { if (this.readyState === WebSocket.CONNECTING) { throw new Error('WebSocket is not open: readyState 0 (CONNECTING)'); } if (typeof options === 'function') { cb = options; options = {}; } if (typeof data === 'number') data = data.toString(); if (this.readyState !== WebSocket.OPEN) { sendAfterClose(this, data, cb); return; } const opts = { binary: typeof data !== 'string', mask: !this._isServer, compress: true, fin: true, ...options }; if (!this._extensions[PerMessageDeflate.extensionName]) { opts.compress = false; } this._sender.send(data || EMPTY_BUFFER, opts, cb); } /** * Forcibly close the connection. * * @public */ terminate() { if (this.readyState === WebSocket.CLOSED) return; if (this.readyState === WebSocket.CONNECTING) { const msg = 'WebSocket was closed before the connection was established'; return abortHandshake(this, this._req, msg); } if (this._socket) { this._readyState = WebSocket.CLOSING; this._socket.destroy(); } } } /** * @constant {Number} CONNECTING * @memberof WebSocket */ Object.defineProperty(WebSocket, 'CONNECTING', { enumerable: true, value: readyStates.indexOf('CONNECTING') }); /** * @constant {Number} CONNECTING * @memberof WebSocket.prototype */ Object.defineProperty(WebSocket.prototype, 'CONNECTING', { enumerable: true, value: readyStates.indexOf('CONNECTING') }); /** * @constant {Number} OPEN * @memberof WebSocket */ Object.defineProperty(WebSocket, 'OPEN', { enumerable: true, value: readyStates.indexOf('OPEN') }); /** * @constant {Number} OPEN * @memberof WebSocket.prototype */ Object.defineProperty(WebSocket.prototype, 'OPEN', { enumerable: true, value: readyStates.indexOf('OPEN') }); /** * @constant {Number} CLOSING * @memberof WebSocket */ Object.defineProperty(WebSocket, 'CLOSING', { enumerable: true, value: readyStates.indexOf('CLOSING') }); /** * @constant {Number} CLOSING * @memberof WebSocket.prototype */ Object.defineProperty(WebSocket.prototype, 'CLOSING', { enumerable: true, value: readyStates.indexOf('CLOSING') }); /** * @constant {Number} CLOSED * @memberof WebSocket */ Object.defineProperty(WebSocket, 'CLOSED', { enumerable: true, value: readyStates.indexOf('CLOSED') }); /** * @constant {Number} CLOSED * @memberof WebSocket.prototype */ Object.defineProperty(WebSocket.prototype, 'CLOSED', { enumerable: true, value: readyStates.indexOf('CLOSED') }); [ 'binaryType', 'bufferedAmount', 'extensions', 'protocol', 'readyState', 'url' ].forEach((property) => { Object.defineProperty(WebSocket.prototype, property, { enumerable: true }); }); // // Add the `onopen`, `onerror`, `onclose`, and `onmessage` attributes. // See https://html.spec.whatwg.org/multipage/comms.html#the-websocket-interface // ['open', 'error', 'close', 'message'].forEach((method) => { Object.defineProperty(WebSocket.prototype, `on${method}`, { enumerable: true, get() { const listeners = this.listeners(method); for (let i = 0; i < listeners.length; i++) { if (listeners[i]._listener) return listeners[i]._listener; } return undefined; }, set(listener) { const listeners = this.listeners(method); for (let i = 0; i < listeners.length; i++) { // // Remove only the listeners added via `addEventListener`. // if (listeners[i]._listener) this.removeListener(method, listeners[i]); } this.addEventListener(method, listener); } }); }); WebSocket.prototype.addEventListener = addEventListener; WebSocket.prototype.removeEventListener = removeEventListener; module.exports = WebSocket; /** * Initialize a WebSocket client. * * @param {WebSocket} websocket The client to initialize * @param {(String|URL)} address The URL to which to connect * @param {String} [protocols] The subprotocols * @param {Object} [options] Connection options * @param {(Boolean|Object)} [options.perMessageDeflate=true] Enable/disable * permessage-deflate * @param {Number} [options.handshakeTimeout] Timeout in milliseconds for the * handshake request * @param {Number} [options.protocolVersion=13] Value of the * `Sec-WebSocket-Version` header * @param {String} [options.origin] Value of the `Origin` or * `Sec-WebSocket-Origin` header * @param {Number} [options.maxPayload=104857600] The maximum allowed message * size * @param {Boolean} [options.followRedirects=false] Whether or not to follow * redirects * @param {Number} [options.maxRedirects=10] The maximum number of redirects * allowed * @private */ function initAsClient(websocket, address, protocols, options) { const opts = { protocolVersion: protocolVersions[1], maxPayload: 100 * 1024 * 1024, perMessageDeflate: true, followRedirects: false, maxRedirects: 10, ...options, createConnection: undefined, socketPath: undefined, hostname: undefined, protocol: undefined, timeout: undefined, method: undefined, host: undefined, path: undefined, port: undefined }; if (!protocolVersions.includes(opts.protocolVersion)) { throw new RangeError( `Unsupported protocol version: ${opts.protocolVersion} ` + `(supported versions: ${protocolVersions.join(', ')})` ); } let parsedUrl; if (address instanceof URL) { parsedUrl = address; websocket._url = address.href; } else { parsedUrl = new URL(address); websocket._url = address; } const isUnixSocket = parsedUrl.protocol === 'ws+unix:'; if (!parsedUrl.host && (!isUnixSocket || !parsedUrl.pathname)) { const err = new Error(`Invalid URL: ${websocket.url}`); if (websocket._redirects === 0) { throw err; } else { emitErrorAndClose(websocket, err); return; } } const isSecure = parsedUrl.protocol === 'wss:' || parsedUrl.protocol === 'https:'; const defaultPort = isSecure ? 443 : 80; const key = randomBytes(16).toString('base64'); const get = isSecure ? https.get : http.get; let perMessageDeflate; opts.createConnection = isSecure ? tlsConnect : netConnect; opts.defaultPort = opts.defaultPort || defaultPort; opts.port = parsedUrl.port || defaultPort; opts.host = parsedUrl.hostname.startsWith('[') ? parsedUrl.hostname.slice(1, -1) : parsedUrl.hostname; opts.headers = { 'Sec-WebSocket-Version': opts.protocolVersion, 'Sec-WebSocket-Key': key, Connection: 'Upgrade', Upgrade: 'websocket', ...opts.headers }; opts.path = parsedUrl.pathname + parsedUrl.search; opts.timeout = opts.handshakeTimeout; if (opts.perMessageDeflate) { perMessageDeflate = new PerMessageDeflate( opts.perMessageDeflate !== true ? opts.perMessageDeflate : {}, false, opts.maxPayload ); opts.headers['Sec-WebSocket-Extensions'] = format({ [PerMessageDeflate.extensionName]: perMessageDeflate.offer() }); } if (protocols) { opts.headers['Sec-WebSocket-Protocol'] = protocols; } if (opts.origin) { if (opts.protocolVersion < 13) { opts.headers['Sec-WebSocket-Origin'] = opts.origin; } else { opts.headers.Origin = opts.origin; } } if (parsedUrl.username || parsedUrl.password) { opts.auth = `${parsedUrl.username}:${parsedUrl.password}`; } if (isUnixSocket) { const parts = opts.path.split(':'); opts.socketPath = parts[0]; opts.path = parts[1]; } let req = (websocket._req = get(opts)); if (opts.timeout) { req.on('timeout', () => { abortHandshake(websocket, req, 'Opening handshake has timed out'); }); } req.on('error', (err) => { if (req === null || req.aborted) return; req = websocket._req = null; emitErrorAndClose(websocket, err); }); req.on('response', (res) => { const location = res.headers.location; const statusCode = res.statusCode; if ( location && opts.followRedirects && statusCode >= 300 && statusCode < 400 ) { if (++websocket._redirects > opts.maxRedirects) { abortHandshake(websocket, req, 'Maximum redirects exceeded'); return; } req.abort(); let addr; try { addr = new URL(location, address); } catch (err) { emitErrorAndClose(websocket, err); return; } initAsClient(websocket, addr, protocols, options); } else if (!websocket.emit('unexpected-response', req, res)) { abortHandshake( websocket, req, `Unexpected server response: ${res.statusCode}` ); } }); req.on('upgrade', (res, socket, head) => { websocket.emit('upgrade', res); // // The user may have closed the connection from a listener of the `upgrade` // event. // if (websocket.readyState !== WebSocket.CONNECTING) return; req = websocket._req = null; const digest = createHash('sha1') .update(key + GUID) .digest('base64'); if (res.headers['sec-websocket-accept'] !== digest) { abortHandshake(websocket, socket, 'Invalid Sec-WebSocket-Accept header'); return; } const serverProt = res.headers['sec-websocket-protocol']; const protList = (protocols || '').split(/, */); let protError; if (!protocols && serverProt) { protError = 'Server sent a subprotocol but none was requested'; } else if (protocols && !serverProt) { protError = 'Server sent no subprotocol'; } else if (serverProt && !protList.includes(serverProt)) { protError = 'Server sent an invalid subprotocol'; } if (protError) { abortHandshake(websocket, socket, protError); return; } if (serverProt) websocket._protocol = serverProt; const secWebSocketExtensions = res.headers['sec-websocket-extensions']; if (secWebSocketExtensions !== undefined) { if (!perMessageDeflate) { const message = 'Server sent a Sec-WebSocket-Extensions header but no extension ' + 'was requested'; abortHandshake(websocket, socket, message); return; } let extensions; try { extensions = parse(secWebSocketExtensions); } catch (err) { const message = 'Invalid Sec-WebSocket-Extensions header'; abortHandshake(websocket, socket, message); return; } const extensionNames = Object.keys(extensions); if (extensionNames.length) { if ( extensionNames.length !== 1 || extensionNames[0] !== PerMessageDeflate.extensionName ) { const message = 'Server indicated an extension that was not requested'; abortHandshake(websocket, socket, message); return; } try { perMessageDeflate.accept(extensions[PerMessageDeflate.extensionName]); } catch (err) { const message = 'Invalid Sec-WebSocket-Extensions header'; abortHandshake(websocket, socket, message); return; } websocket._extensions[PerMessageDeflate.extensionName] = perMessageDeflate; } } websocket.setSocket(socket, head, opts.maxPayload); }); } /** * Emit the `'error'` and `'close'` event. * * @param {WebSocket} websocket The WebSocket instance * @param {Error} The error to emit * @private */ function emitErrorAndClose(websocket, err) { websocket._readyState = WebSocket.CLOSING; websocket.emit('error', err); websocket.emitClose(); } /** * Create a `net.Socket` and initiate a connection. * * @param {Object} options Connection options * @return {net.Socket} The newly created socket used to start the connection * @private */ function netConnect(options) { options.path = options.socketPath; return net.connect(options); } /** * Create a `tls.TLSSocket` and initiate a connection. * * @param {Object} options Connection options * @return {tls.TLSSocket} The newly created socket used to start the connection * @private */ function tlsConnect(options) { options.path = undefined; if (!options.servername && options.servername !== '') { options.servername = net.isIP(options.host) ? '' : options.host; } return tls.connect(options); } /** * Abort the handshake and emit an error. * * @param {WebSocket} websocket The WebSocket instance * @param {(http.ClientRequest|net.Socket|tls.Socket)} stream The request to * abort or the socket to destroy * @param {String} message The error message * @private */ function abortHandshake(websocket, stream, message) { websocket._readyState = WebSocket.CLOSING; const err = new Error(message); Error.captureStackTrace(err, abortHandshake); if (stream.setHeader) { stream.abort(); if (stream.socket && !stream.socket.destroyed) { // // On Node.js >= 14.3.0 `request.abort()` does not destroy the socket if // called after the request completed. See // https://github.com/websockets/ws/issues/1869. // stream.socket.destroy(); } stream.once('abort', websocket.emitClose.bind(websocket)); websocket.emit('error', err); } else { stream.destroy(err); stream.once('error', websocket.emit.bind(websocket, 'error')); stream.once('close', websocket.emitClose.bind(websocket)); } } /** * Handle cases where the `ping()`, `pong()`, or `send()` methods are called * when the `readyState` attribute is `CLOSING` or `CLOSED`. * * @param {WebSocket} websocket The WebSocket instance * @param {*} [data] The data to send * @param {Function} [cb] Callback * @private */ function sendAfterClose(websocket, data, cb) { if (data) { const length = toBuffer(data).length; // // The `_bufferedAmount` property is used only when the peer is a client and // the opening handshake fails. Under these circumstances, in fact, the // `setSocket()` method is not called, so the `_socket` and `_sender` // properties are set to `null`. // if (websocket._socket) websocket._sender._bufferedBytes += length; else websocket._bufferedAmount += length; } if (cb) { const err = new Error( `WebSocket is not open: readyState ${websocket.readyState} ` + `(${readyStates[websocket.readyState]})` ); cb(err); } } /** * The listener of the `Receiver` `'conclude'` event. * * @param {Number} code The status code * @param {String} reason The reason for closing * @private */ function receiverOnConclude(code, reason) { const websocket = this[kWebSocket]; websocket._closeFrameReceived = true; websocket._closeMessage = reason; websocket._closeCode = code; if (websocket._socket[kWebSocket] === undefined) return; websocket._socket.removeListener('data', socketOnData); process.nextTick(resume, websocket._socket); if (code === 1005) websocket.close(); else websocket.close(code, reason); } /** * The listener of the `Receiver` `'drain'` event. * * @private */ function receiverOnDrain() { this[kWebSocket]._socket.resume(); } /** * The listener of the `Receiver` `'error'` event. * * @param {(RangeError|Error)} err The emitted error * @private */ function receiverOnError(err) { const websocket = this[kWebSocket]; if (websocket._socket[kWebSocket] !== undefined) { websocket._socket.removeListener('data', socketOnData); // // On Node.js < 14.0.0 the `'error'` event is emitted synchronously. See // https://github.com/websockets/ws/issues/1940. // process.nextTick(resume, websocket._socket); websocket.close(err[kStatusCode]); } websocket.emit('error', err); } /** * The listener of the `Receiver` `'finish'` event. * * @private */ function receiverOnFinish() { this[kWebSocket].emitClose(); } /** * The listener of the `Receiver` `'message'` event. * * @param {(String|Buffer|ArrayBuffer|Buffer[])} data The message * @private */ function receiverOnMessage(data) { this[kWebSocket].emit('message', data); } /** * The listener of the `Receiver` `'ping'` event. * * @param {Buffer} data The data included in the ping frame * @private */ function receiverOnPing(data) { const websocket = this[kWebSocket]; websocket.pong(data, !websocket._isServer, NOOP); websocket.emit('ping', data); } /** * The listener of the `Receiver` `'pong'` event. * * @param {Buffer} data The data included in the pong frame * @private */ function receiverOnPong(data) { this[kWebSocket].emit('pong', data); } /** * Resume a readable stream * * @param {Readable} stream The readable stream * @private */ function resume(stream) { stream.resume(); } /** * The listener of the `net.Socket` `'close'` event. * * @private */ function socketOnClose() { const websocket = this[kWebSocket]; this.removeListener('close', socketOnClose); this.removeListener('data', socketOnData); this.removeListener('end', socketOnEnd); websocket._readyState = WebSocket.CLOSING; let chunk; // // The close frame might not have been received or the `'end'` event emitted, // for example, if the socket was destroyed due to an error. Ensure that the // `receiver` stream is closed after writing any remaining buffered data to // it. If the readable side of the socket is in flowing mode then there is no // buffered data as everything has been already written and `readable.read()` // will return `null`. If instead, the socket is paused, any possible buffered // data will be read as a single chunk. // if ( !this._readableState.endEmitted && !websocket._closeFrameReceived && !websocket._receiver._writableState.errorEmitted && (chunk = websocket._socket.read()) !== null ) { websocket._receiver.write(chunk); } websocket._receiver.end(); this[kWebSocket] = undefined; clearTimeout(websocket._closeTimer); if ( websocket._receiver._writableState.finished || websocket._receiver._writableState.errorEmitted ) { websocket.emitClose(); } else { websocket._receiver.on('error', receiverOnFinish); websocket._receiver.on('finish', receiverOnFinish); } } /** * The listener of the `net.Socket` `'data'` event. * * @param {Buffer} chunk A chunk of data * @private */ function socketOnData(chunk) { if (!this[kWebSocket]._receiver.write(chunk)) { this.pause(); } } /** * The listener of the `net.Socket` `'end'` event. * * @private */ function socketOnEnd() { const websocket = this[kWebSocket]; websocket._readyState = WebSocket.CLOSING; websocket._receiver.end(); this.end(); } /** * The listener of the `net.Socket` `'error'` event. * * @private */ function socketOnError() { const websocket = this[kWebSocket]; this.removeListener('error', socketOnError); this.on('error', NOOP); if (websocket) { websocket._readyState = WebSocket.CLOSING; this.destroy(); } } /***/ }), /***/ 9662: /***/ ((module) => { "use strict"; module.exports = function (obj) { var ret = {}; var keys = Object.keys(Object(obj)); for (var i = 0; i < keys.length; i++) { ret[keys[i].toLowerCase()] = obj[keys[i]]; } return ret; }; /***/ }), /***/ 7129: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; // A linked list to keep track of recently-used-ness const Yallist = __webpack_require__(40665) const MAX = Symbol('max') const LENGTH = Symbol('length') const LENGTH_CALCULATOR = Symbol('lengthCalculator') const ALLOW_STALE = Symbol('allowStale') const MAX_AGE = Symbol('maxAge') const DISPOSE = Symbol('dispose') const NO_DISPOSE_ON_SET = Symbol('noDisposeOnSet') const LRU_LIST = Symbol('lruList') const CACHE = Symbol('cache') const UPDATE_AGE_ON_GET = Symbol('updateAgeOnGet') const naiveLength = () => 1 // lruList is a yallist where the head is the youngest // item, and the tail is the oldest. the list contains the Hit // objects as the entries. // Each Hit object has a reference to its Yallist.Node. This // never changes. // // cache is a Map (or PseudoMap) that matches the keys to // the Yallist.Node object. class LRUCache { constructor (options) { if (typeof options === 'number') options = { max: options } if (!options) options = {} if (options.max && (typeof options.max !== 'number' || options.max < 0)) throw new TypeError('max must be a non-negative number') // Kind of weird to have a default max of Infinity, but oh well. const max = this[MAX] = options.max || Infinity const lc = options.length || naiveLength this[LENGTH_CALCULATOR] = (typeof lc !== 'function') ? naiveLength : lc this[ALLOW_STALE] = options.stale || false if (options.maxAge && typeof options.maxAge !== 'number') throw new TypeError('maxAge must be a number') this[MAX_AGE] = options.maxAge || 0 this[DISPOSE] = options.dispose this[NO_DISPOSE_ON_SET] = options.noDisposeOnSet || false this[UPDATE_AGE_ON_GET] = options.updateAgeOnGet || false this.reset() } // resize the cache when the max changes. set max (mL) { if (typeof mL !== 'number' || mL < 0) throw new TypeError('max must be a non-negative number') this[MAX] = mL || Infinity trim(this) } get max () { return this[MAX] } set allowStale (allowStale) { this[ALLOW_STALE] = !!allowStale } get allowStale () { return this[ALLOW_STALE] } set maxAge (mA) { if (typeof mA !== 'number') throw new TypeError('maxAge must be a non-negative number') this[MAX_AGE] = mA trim(this) } get maxAge () { return this[MAX_AGE] } // resize the cache when the lengthCalculator changes. set lengthCalculator (lC) { if (typeof lC !== 'function') lC = naiveLength if (lC !== this[LENGTH_CALCULATOR]) { this[LENGTH_CALCULATOR] = lC this[LENGTH] = 0 this[LRU_LIST].forEach(hit => { hit.length = this[LENGTH_CALCULATOR](hit.value, hit.key) this[LENGTH] += hit.length }) } trim(this) } get lengthCalculator () { return this[LENGTH_CALCULATOR] } get length () { return this[LENGTH] } get itemCount () { return this[LRU_LIST].length } rforEach (fn, thisp) { thisp = thisp || this for (let walker = this[LRU_LIST].tail; walker !== null;) { const prev = walker.prev forEachStep(this, fn, walker, thisp) walker = prev } } forEach (fn, thisp) { thisp = thisp || this for (let walker = this[LRU_LIST].head; walker !== null;) { const next = walker.next forEachStep(this, fn, walker, thisp) walker = next } } keys () { return this[LRU_LIST].toArray().map(k => k.key) } values () { return this[LRU_LIST].toArray().map(k => k.value) } reset () { if (this[DISPOSE] && this[LRU_LIST] && this[LRU_LIST].length) { this[LRU_LIST].forEach(hit => this[DISPOSE](hit.key, hit.value)) } this[CACHE] = new Map() // hash of items by key this[LRU_LIST] = new Yallist() // list of items in order of use recency this[LENGTH] = 0 // length of items in the list } dump () { return this[LRU_LIST].map(hit => isStale(this, hit) ? false : { k: hit.key, v: hit.value, e: hit.now + (hit.maxAge || 0) }).toArray().filter(h => h) } dumpLru () { return this[LRU_LIST] } set (key, value, maxAge) { maxAge = maxAge || this[MAX_AGE] if (maxAge && typeof maxAge !== 'number') throw new TypeError('maxAge must be a number') const now = maxAge ? Date.now() : 0 const len = this[LENGTH_CALCULATOR](value, key) if (this[CACHE].has(key)) { if (len > this[MAX]) { del(this, this[CACHE].get(key)) return false } const node = this[CACHE].get(key) const item = node.value // dispose of the old one before overwriting // split out into 2 ifs for better coverage tracking if (this[DISPOSE]) { if (!this[NO_DISPOSE_ON_SET]) this[DISPOSE](key, item.value) } item.now = now item.maxAge = maxAge item.value = value this[LENGTH] += len - item.length item.length = len this.get(key) trim(this) return true } const hit = new Entry(key, value, len, now, maxAge) // oversized objects fall out of cache automatically. if (hit.length > this[MAX]) { if (this[DISPOSE]) this[DISPOSE](key, value) return false } this[LENGTH] += hit.length this[LRU_LIST].unshift(hit) this[CACHE].set(key, this[LRU_LIST].head) trim(this) return true } has (key) { if (!this[CACHE].has(key)) return false const hit = this[CACHE].get(key).value return !isStale(this, hit) } get (key) { return get(this, key, true) } peek (key) { return get(this, key, false) } pop () { const node = this[LRU_LIST].tail if (!node) return null del(this, node) return node.value } del (key) { del(this, this[CACHE].get(key)) } load (arr) { // reset the cache this.reset() const now = Date.now() // A previous serialized cache has the most recent items first for (let l = arr.length - 1; l >= 0; l--) { const hit = arr[l] const expiresAt = hit.e || 0 if (expiresAt === 0) // the item was created without expiration in a non aged cache this.set(hit.k, hit.v) else { const maxAge = expiresAt - now // dont add already expired items if (maxAge > 0) { this.set(hit.k, hit.v, maxAge) } } } } prune () { this[CACHE].forEach((value, key) => get(this, key, false)) } } const get = (self, key, doUse) => { const node = self[CACHE].get(key) if (node) { const hit = node.value if (isStale(self, hit)) { del(self, node) if (!self[ALLOW_STALE]) return undefined } else { if (doUse) { if (self[UPDATE_AGE_ON_GET]) node.value.now = Date.now() self[LRU_LIST].unshiftNode(node) } } return hit.value } } const isStale = (self, hit) => { if (!hit || (!hit.maxAge && !self[MAX_AGE])) return false const diff = Date.now() - hit.now return hit.maxAge ? diff > hit.maxAge : self[MAX_AGE] && (diff > self[MAX_AGE]) } const trim = self => { if (self[LENGTH] > self[MAX]) { for (let walker = self[LRU_LIST].tail; self[LENGTH] > self[MAX] && walker !== null;) { // We know that we're about to delete this one, and also // what the next least recently used key will be, so just // go ahead and set it now. const prev = walker.prev del(self, walker) walker = prev } } } const del = (self, node) => { if (node) { const hit = node.value if (self[DISPOSE]) self[DISPOSE](hit.key, hit.value) self[LENGTH] -= hit.length self[CACHE].delete(hit.key) self[LRU_LIST].removeNode(node) } } class Entry { constructor (key, value, length, now, maxAge) { this.key = key this.value = value this.length = length this.now = now this.maxAge = maxAge || 0 } } const forEachStep = (self, fn, node, thisp) => { let hit = node.value if (isStale(self, hit)) { del(self, node) if (!self[ALLOW_STALE]) hit = undefined } if (hit) fn.call(thisp, hit.value, hit.key, self) } module.exports = LRUCache /***/ }), /***/ 21381: /***/ ((module, exports) => { "use strict"; // ISC @ Julien Fontanet // =================================================================== var construct = typeof Reflect !== "undefined" ? Reflect.construct : undefined; var defineProperty = Object.defineProperty; // ------------------------------------------------------------------- var captureStackTrace = Error.captureStackTrace; if (captureStackTrace === undefined) { captureStackTrace = function captureStackTrace(error) { var container = new Error(); defineProperty(error, "stack", { configurable: true, get: function getStack() { var stack = container.stack; // Replace property with value for faster future accesses. defineProperty(this, "stack", { configurable: true, value: stack, writable: true, }); return stack; }, set: function setStack(stack) { defineProperty(error, "stack", { configurable: true, value: stack, writable: true, }); }, }); }; } // ------------------------------------------------------------------- function BaseError(message) { if (message !== undefined) { defineProperty(this, "message", { configurable: true, value: message, writable: true, }); } var cname = this.constructor.name; if (cname !== undefined && cname !== this.name) { defineProperty(this, "name", { configurable: true, value: cname, writable: true, }); } captureStackTrace(this, this.constructor); } BaseError.prototype = Object.create(Error.prototype, { // See: https://github.com/JsCommunity/make-error/issues/4 constructor: { configurable: true, value: BaseError, writable: true, }, }); // ------------------------------------------------------------------- // Sets the name of a function if possible (depends of the JS engine). var setFunctionName = (function() { function setFunctionName(fn, name) { return defineProperty(fn, "name", { configurable: true, value: name, }); } try { var f = function() {}; setFunctionName(f, "foo"); if (f.name === "foo") { return setFunctionName; } } catch (_) {} })(); // ------------------------------------------------------------------- function makeError(constructor, super_) { if (super_ == null || super_ === Error) { super_ = BaseError; } else if (typeof super_ !== "function") { throw new TypeError("super_ should be a function"); } var name; if (typeof constructor === "string") { name = constructor; constructor = construct !== undefined ? function() { return construct(super_, arguments, this.constructor); } : function() { super_.apply(this, arguments); }; // If the name can be set, do it once and for all. if (setFunctionName !== undefined) { setFunctionName(constructor, name); name = undefined; } } else if (typeof constructor !== "function") { throw new TypeError("constructor should be either a string or a function"); } // Also register the super constructor also as `constructor.super_` just // like Node's `util.inherits()`. // // eslint-disable-next-line dot-notation constructor.super_ = constructor["super"] = super_; var properties = { constructor: { configurable: true, value: constructor, writable: true, }, }; // If the name could not be set on the constructor, set it on the // prototype. if (name !== undefined) { properties.name = { configurable: true, value: name, writable: true, }; } constructor.prototype = Object.create(super_.prototype, properties); return constructor; } exports = module.exports = makeError; exports.BaseError = BaseError; /***/ }), /***/ 47426: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { /*! * mime-db * Copyright(c) 2014 Jonathan Ong * MIT Licensed */ /** * Module exports. */ module.exports = __webpack_require__(73313) /***/ }), /***/ 43583: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; /*! * mime-types * Copyright(c) 2014 Jonathan Ong * Copyright(c) 2015 Douglas Christopher Wilson * MIT Licensed */ /** * Module dependencies. * @private */ var db = __webpack_require__(47426) var extname = __webpack_require__(85622).extname /** * Module variables. * @private */ var EXTRACT_TYPE_REGEXP = /^\s*([^;\s]*)(?:;|\s|$)/ var TEXT_TYPE_REGEXP = /^text\//i /** * Module exports. * @public */ exports.charset = charset exports.charsets = { lookup: charset } exports.contentType = contentType exports.extension = extension exports.extensions = Object.create(null) exports.lookup = lookup exports.types = Object.create(null) // Populate the extensions/types maps populateMaps(exports.extensions, exports.types) /** * Get the default charset for a MIME type. * * @param {string} type * @return {boolean|string} */ function charset (type) { if (!type || typeof type !== 'string') { return false } // TODO: use media-typer var match = EXTRACT_TYPE_REGEXP.exec(type) var mime = match && db[match[1].toLowerCase()] if (mime && mime.charset) { return mime.charset } // default text/* to utf-8 if (match && TEXT_TYPE_REGEXP.test(match[1])) { return 'UTF-8' } return false } /** * Create a full Content-Type header given a MIME type or extension. * * @param {string} str * @return {boolean|string} */ function contentType (str) { // TODO: should this even be in this module? if (!str || typeof str !== 'string') { return false } var mime = str.indexOf('/') === -1 ? exports.lookup(str) : str if (!mime) { return false } // TODO: use content-type or other module if (mime.indexOf('charset') === -1) { var charset = exports.charset(mime) if (charset) mime += '; charset=' + charset.toLowerCase() } return mime } /** * Get the default extension for a MIME type. * * @param {string} type * @return {boolean|string} */ function extension (type) { if (!type || typeof type !== 'string') { return false } // TODO: use media-typer var match = EXTRACT_TYPE_REGEXP.exec(type) // get extensions var exts = match && exports.extensions[match[1].toLowerCase()] if (!exts || !exts.length) { return false } return exts[0] } /** * Lookup the MIME type for a file path/extension. * * @param {string} path * @return {boolean|string} */ function lookup (path) { if (!path || typeof path !== 'string') { return false } // get the extension ("ext" or ".ext" or full path) var extension = extname('x.' + path) .toLowerCase() .substr(1) if (!extension) { return false } return exports.types[extension] || false } /** * Populate the extensions and types maps. * @private */ function populateMaps (extensions, types) { // source preference (least -> most) var preference = ['nginx', 'apache', undefined, 'iana'] Object.keys(db).forEach(function forEachMimeType (type) { var mime = db[type] var exts = mime.extensions if (!exts || !exts.length) { return } // mime -> extensions extensions[type] = exts // extension -> mime for (var i = 0; i < exts.length; i++) { var extension = exts[i] if (types[extension]) { var from = preference.indexOf(db[types[extension]].source) var to = preference.indexOf(mime.source) if (types[extension] !== 'application/octet-stream' && (from > to || (from === to && types[extension].substr(0, 12) === 'application/'))) { // skip the remapping continue } } // set the extension -> mime types[extension] = type } }) } /***/ }), /***/ 42610: /***/ ((module) => { "use strict"; // We define these manually to ensure they're always copied // even if they would move up the prototype chain // https://nodejs.org/api/http.html#http_class_http_incomingmessage const knownProps = [ 'destroy', 'setTimeout', 'socket', 'headers', 'trailers', 'rawHeaders', 'statusCode', 'httpVersion', 'httpVersionMinor', 'httpVersionMajor', 'rawTrailers', 'statusMessage' ]; module.exports = (fromStream, toStream) => { const fromProps = new Set(Object.keys(fromStream).concat(knownProps)); for (const prop of fromProps) { // Don't overwrite existing properties if (prop in toStream) { continue; } toStream[prop] = typeof fromStream[prop] === 'function' ? fromStream[prop].bind(fromStream) : fromStream[prop]; } }; /***/ }), /***/ 83973: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { module.exports = minimatch minimatch.Minimatch = Minimatch var path = { sep: '/' } try { path = __webpack_require__(85622) } catch (er) {} var GLOBSTAR = minimatch.GLOBSTAR = Minimatch.GLOBSTAR = {} var expand = __webpack_require__(33717) var plTypes = { '!': { open: '(?:(?!(?:', close: '))[^/]*?)'}, '?': { open: '(?:', close: ')?' }, '+': { open: '(?:', close: ')+' }, '*': { open: '(?:', close: ')*' }, '@': { open: '(?:', close: ')' } } // any single thing other than / // don't need to escape / when using new RegExp() var qmark = '[^/]' // * => any number of characters var star = qmark + '*?' // ** when dots are allowed. Anything goes, except .. and . // not (^ or / followed by one or two dots followed by $ or /), // followed by anything, any number of times. var twoStarDot = '(?:(?!(?:\\\/|^)(?:\\.{1,2})($|\\\/)).)*?' // not a ^ or / followed by a dot, // followed by anything, any number of times. var twoStarNoDot = '(?:(?!(?:\\\/|^)\\.).)*?' // characters that need to be escaped in RegExp. var reSpecials = charSet('().*{}+?[]^$\\!') // "abc" -> { a:true, b:true, c:true } function charSet (s) { return s.split('').reduce(function (set, c) { set[c] = true return set }, {}) } // normalizes slashes. var slashSplit = /\/+/ minimatch.filter = filter function filter (pattern, options) { options = options || {} return function (p, i, list) { return minimatch(p, pattern, options) } } function ext (a, b) { a = a || {} b = b || {} var t = {} Object.keys(b).forEach(function (k) { t[k] = b[k] }) Object.keys(a).forEach(function (k) { t[k] = a[k] }) return t } minimatch.defaults = function (def) { if (!def || !Object.keys(def).length) return minimatch var orig = minimatch var m = function minimatch (p, pattern, options) { return orig.minimatch(p, pattern, ext(def, options)) } m.Minimatch = function Minimatch (pattern, options) { return new orig.Minimatch(pattern, ext(def, options)) } return m } Minimatch.defaults = function (def) { if (!def || !Object.keys(def).length) return Minimatch return minimatch.defaults(def).Minimatch } function minimatch (p, pattern, options) { if (typeof pattern !== 'string') { throw new TypeError('glob pattern string required') } if (!options) options = {} // shortcut: comments match nothing. if (!options.nocomment && pattern.charAt(0) === '#') { return false } // "" only matches "" if (pattern.trim() === '') return p === '' return new Minimatch(pattern, options).match(p) } function Minimatch (pattern, options) { if (!(this instanceof Minimatch)) { return new Minimatch(pattern, options) } if (typeof pattern !== 'string') { throw new TypeError('glob pattern string required') } if (!options) options = {} pattern = pattern.trim() // windows support: need to use /, not \ if (path.sep !== '/') { pattern = pattern.split(path.sep).join('/') } this.options = options this.set = [] this.pattern = pattern this.regexp = null this.negate = false this.comment = false this.empty = false // make the set of regexps etc. this.make() } Minimatch.prototype.debug = function () {} Minimatch.prototype.make = make function make () { // don't do it more than once. if (this._made) return var pattern = this.pattern var options = this.options // empty patterns and comments match nothing. if (!options.nocomment && pattern.charAt(0) === '#') { this.comment = true return } if (!pattern) { this.empty = true return } // step 1: figure out negation, etc. this.parseNegate() // step 2: expand braces var set = this.globSet = this.braceExpand() if (options.debug) this.debug = console.error this.debug(this.pattern, set) // step 3: now we have a set, so turn each one into a series of path-portion // matching patterns. // These will be regexps, except in the case of "**", which is // set to the GLOBSTAR object for globstar behavior, // and will not contain any / characters set = this.globParts = set.map(function (s) { return s.split(slashSplit) }) this.debug(this.pattern, set) // glob --> regexps set = set.map(function (s, si, set) { return s.map(this.parse, this) }, this) this.debug(this.pattern, set) // filter out everything that didn't compile properly. set = set.filter(function (s) { return s.indexOf(false) === -1 }) this.debug(this.pattern, set) this.set = set } Minimatch.prototype.parseNegate = parseNegate function parseNegate () { var pattern = this.pattern var negate = false var options = this.options var negateOffset = 0 if (options.nonegate) return for (var i = 0, l = pattern.length ; i < l && pattern.charAt(i) === '!' ; i++) { negate = !negate negateOffset++ } if (negateOffset) this.pattern = pattern.substr(negateOffset) this.negate = negate } // Brace expansion: // a{b,c}d -> abd acd // a{b,}c -> abc ac // a{0..3}d -> a0d a1d a2d a3d // a{b,c{d,e}f}g -> abg acdfg acefg // a{b,c}d{e,f}g -> abdeg acdeg abdeg abdfg // // Invalid sets are not expanded. // a{2..}b -> a{2..}b // a{b}c -> a{b}c minimatch.braceExpand = function (pattern, options) { return braceExpand(pattern, options) } Minimatch.prototype.braceExpand = braceExpand function braceExpand (pattern, options) { if (!options) { if (this instanceof Minimatch) { options = this.options } else { options = {} } } pattern = typeof pattern === 'undefined' ? this.pattern : pattern if (typeof pattern === 'undefined') { throw new TypeError('undefined pattern') } if (options.nobrace || !pattern.match(/\{.*\}/)) { // shortcut. no need to expand. return [pattern] } return expand(pattern) } // parse a component of the expanded set. // At this point, no pattern may contain "/" in it // so we're going to return a 2d array, where each entry is the full // pattern, split on '/', and then turned into a regular expression. // A regexp is made at the end which joins each array with an // escaped /, and another full one which joins each regexp with |. // // Following the lead of Bash 4.1, note that "**" only has special meaning // when it is the *only* thing in a path portion. Otherwise, any series // of * is equivalent to a single *. Globstar behavior is enabled by // default, and can be disabled by setting options.noglobstar. Minimatch.prototype.parse = parse var SUBPARSE = {} function parse (pattern, isSub) { if (pattern.length > 1024 * 64) { throw new TypeError('pattern is too long') } var options = this.options // shortcuts if (!options.noglobstar && pattern === '**') return GLOBSTAR if (pattern === '') return '' var re = '' var hasMagic = !!options.nocase var escaping = false // ? => one single character var patternListStack = [] var negativeLists = [] var stateChar var inClass = false var reClassStart = -1 var classStart = -1 // . and .. never match anything that doesn't start with ., // even when options.dot is set. var patternStart = pattern.charAt(0) === '.' ? '' // anything // not (start or / followed by . or .. followed by / or end) : options.dot ? '(?!(?:^|\\\/)\\.{1,2}(?:$|\\\/))' : '(?!\\.)' var self = this function clearStateChar () { if (stateChar) { // we had some state-tracking character // that wasn't consumed by this pass. switch (stateChar) { case '*': re += star hasMagic = true break case '?': re += qmark hasMagic = true break default: re += '\\' + stateChar break } self.debug('clearStateChar %j %j', stateChar, re) stateChar = false } } for (var i = 0, len = pattern.length, c ; (i < len) && (c = pattern.charAt(i)) ; i++) { this.debug('%s\t%s %s %j', pattern, i, re, c) // skip over any that are escaped. if (escaping && reSpecials[c]) { re += '\\' + c escaping = false continue } switch (c) { case '/': // completely not allowed, even escaped. // Should already be path-split by now. return false case '\\': clearStateChar() escaping = true continue // the various stateChar values // for the "extglob" stuff. case '?': case '*': case '+': case '@': case '!': this.debug('%s\t%s %s %j <-- stateChar', pattern, i, re, c) // all of those are literals inside a class, except that // the glob [!a] means [^a] in regexp if (inClass) { this.debug(' in class') if (c === '!' && i === classStart + 1) c = '^' re += c continue } // if we already have a stateChar, then it means // that there was something like ** or +? in there. // Handle the stateChar, then proceed with this one. self.debug('call clearStateChar %j', stateChar) clearStateChar() stateChar = c // if extglob is disabled, then +(asdf|foo) isn't a thing. // just clear the statechar *now*, rather than even diving into // the patternList stuff. if (options.noext) clearStateChar() continue case '(': if (inClass) { re += '(' continue } if (!stateChar) { re += '\\(' continue } patternListStack.push({ type: stateChar, start: i - 1, reStart: re.length, open: plTypes[stateChar].open, close: plTypes[stateChar].close }) // negation is (?:(?!js)[^/]*) re += stateChar === '!' ? '(?:(?!(?:' : '(?:' this.debug('plType %j %j', stateChar, re) stateChar = false continue case ')': if (inClass || !patternListStack.length) { re += '\\)' continue } clearStateChar() hasMagic = true var pl = patternListStack.pop() // negation is (?:(?!js)[^/]*) // The others are (?:) re += pl.close if (pl.type === '!') { negativeLists.push(pl) } pl.reEnd = re.length continue case '|': if (inClass || !patternListStack.length || escaping) { re += '\\|' escaping = false continue } clearStateChar() re += '|' continue // these are mostly the same in regexp and glob case '[': // swallow any state-tracking char before the [ clearStateChar() if (inClass) { re += '\\' + c continue } inClass = true classStart = i reClassStart = re.length re += c continue case ']': // a right bracket shall lose its special // meaning and represent itself in // a bracket expression if it occurs // first in the list. -- POSIX.2 2.8.3.2 if (i === classStart + 1 || !inClass) { re += '\\' + c escaping = false continue } // handle the case where we left a class open. // "[z-a]" is valid, equivalent to "\[z-a\]" if (inClass) { // split where the last [ was, make sure we don't have // an invalid re. if so, re-walk the contents of the // would-be class to re-translate any characters that // were passed through as-is // TODO: It would probably be faster to determine this // without a try/catch and a new RegExp, but it's tricky // to do safely. For now, this is safe and works. var cs = pattern.substring(classStart + 1, i) try { RegExp('[' + cs + ']') } catch (er) { // not a valid class! var sp = this.parse(cs, SUBPARSE) re = re.substr(0, reClassStart) + '\\[' + sp[0] + '\\]' hasMagic = hasMagic || sp[1] inClass = false continue } } // finish up the class. hasMagic = true inClass = false re += c continue default: // swallow any state char that wasn't consumed clearStateChar() if (escaping) { // no need escaping = false } else if (reSpecials[c] && !(c === '^' && inClass)) { re += '\\' } re += c } // switch } // for // handle the case where we left a class open. // "[abc" is valid, equivalent to "\[abc" if (inClass) { // split where the last [ was, and escape it // this is a huge pita. We now have to re-walk // the contents of the would-be class to re-translate // any characters that were passed through as-is cs = pattern.substr(classStart + 1) sp = this.parse(cs, SUBPARSE) re = re.substr(0, reClassStart) + '\\[' + sp[0] hasMagic = hasMagic || sp[1] } // handle the case where we had a +( thing at the *end* // of the pattern. // each pattern list stack adds 3 chars, and we need to go through // and escape any | chars that were passed through as-is for the regexp. // Go through and escape them, taking care not to double-escape any // | chars that were already escaped. for (pl = patternListStack.pop(); pl; pl = patternListStack.pop()) { var tail = re.slice(pl.reStart + pl.open.length) this.debug('setting tail', re, pl) // maybe some even number of \, then maybe 1 \, followed by a | tail = tail.replace(/((?:\\{2}){0,64})(\\?)\|/g, function (_, $1, $2) { if (!$2) { // the | isn't already escaped, so escape it. $2 = '\\' } // need to escape all those slashes *again*, without escaping the // one that we need for escaping the | character. As it works out, // escaping an even number of slashes can be done by simply repeating // it exactly after itself. That's why this trick works. // // I am sorry that you have to see this. return $1 + $1 + $2 + '|' }) this.debug('tail=%j\n %s', tail, tail, pl, re) var t = pl.type === '*' ? star : pl.type === '?' ? qmark : '\\' + pl.type hasMagic = true re = re.slice(0, pl.reStart) + t + '\\(' + tail } // handle trailing things that only matter at the very end. clearStateChar() if (escaping) { // trailing \\ re += '\\\\' } // only need to apply the nodot start if the re starts with // something that could conceivably capture a dot var addPatternStart = false switch (re.charAt(0)) { case '.': case '[': case '(': addPatternStart = true } // Hack to work around lack of negative lookbehind in JS // A pattern like: *.!(x).!(y|z) needs to ensure that a name // like 'a.xyz.yz' doesn't match. So, the first negative // lookahead, has to look ALL the way ahead, to the end of // the pattern. for (var n = negativeLists.length - 1; n > -1; n--) { var nl = negativeLists[n] var nlBefore = re.slice(0, nl.reStart) var nlFirst = re.slice(nl.reStart, nl.reEnd - 8) var nlLast = re.slice(nl.reEnd - 8, nl.reEnd) var nlAfter = re.slice(nl.reEnd) nlLast += nlAfter // Handle nested stuff like *(*.js|!(*.json)), where open parens // mean that we should *not* include the ) in the bit that is considered // "after" the negated section. var openParensBefore = nlBefore.split('(').length - 1 var cleanAfter = nlAfter for (i = 0; i < openParensBefore; i++) { cleanAfter = cleanAfter.replace(/\)[+*?]?/, '') } nlAfter = cleanAfter var dollar = '' if (nlAfter === '' && isSub !== SUBPARSE) { dollar = '$' } var newRe = nlBefore + nlFirst + nlAfter + dollar + nlLast re = newRe } // if the re is not "" at this point, then we need to make sure // it doesn't match against an empty path part. // Otherwise a/* will match a/, which it should not. if (re !== '' && hasMagic) { re = '(?=.)' + re } if (addPatternStart) { re = patternStart + re } // parsing just a piece of a larger pattern. if (isSub === SUBPARSE) { return [re, hasMagic] } // skip the regexp for non-magical patterns // unescape anything in it, though, so that it'll be // an exact match against a file etc. if (!hasMagic) { return globUnescape(pattern) } var flags = options.nocase ? 'i' : '' try { var regExp = new RegExp('^' + re + '$', flags) } catch (er) { // If it was an invalid regular expression, then it can't match // anything. This trick looks for a character after the end of // the string, which is of course impossible, except in multi-line // mode, but it's not a /m regex. return new RegExp('$.') } regExp._glob = pattern regExp._src = re return regExp } minimatch.makeRe = function (pattern, options) { return new Minimatch(pattern, options || {}).makeRe() } Minimatch.prototype.makeRe = makeRe function makeRe () { if (this.regexp || this.regexp === false) return this.regexp // at this point, this.set is a 2d array of partial // pattern strings, or "**". // // It's better to use .match(). This function shouldn't // be used, really, but it's pretty convenient sometimes, // when you just want to work with a regex. var set = this.set if (!set.length) { this.regexp = false return this.regexp } var options = this.options var twoStar = options.noglobstar ? star : options.dot ? twoStarDot : twoStarNoDot var flags = options.nocase ? 'i' : '' var re = set.map(function (pattern) { return pattern.map(function (p) { return (p === GLOBSTAR) ? twoStar : (typeof p === 'string') ? regExpEscape(p) : p._src }).join('\\\/') }).join('|') // must match entire pattern // ending in a * or ** will make it less strict. re = '^(?:' + re + ')$' // can match anything, as long as it's not this. if (this.negate) re = '^(?!' + re + ').*$' try { this.regexp = new RegExp(re, flags) } catch (ex) { this.regexp = false } return this.regexp } minimatch.match = function (list, pattern, options) { options = options || {} var mm = new Minimatch(pattern, options) list = list.filter(function (f) { return mm.match(f) }) if (mm.options.nonull && !list.length) { list.push(pattern) } return list } Minimatch.prototype.match = match function match (f, partial) { this.debug('match', f, this.pattern) // short-circuit in the case of busted things. // comments, etc. if (this.comment) return false if (this.empty) return f === '' if (f === '/' && partial) return true var options = this.options // windows: need to use /, not \ if (path.sep !== '/') { f = f.split(path.sep).join('/') } // treat the test path as a set of pathparts. f = f.split(slashSplit) this.debug(this.pattern, 'split', f) // just ONE of the pattern sets in this.set needs to match // in order for it to be valid. If negating, then just one // match means that we have failed. // Either way, return on the first hit. var set = this.set this.debug(this.pattern, 'set', set) // Find the basename of the path by looking for the last non-empty segment var filename var i for (i = f.length - 1; i >= 0; i--) { filename = f[i] if (filename) break } for (i = 0; i < set.length; i++) { var pattern = set[i] var file = f if (options.matchBase && pattern.length === 1) { file = [filename] } var hit = this.matchOne(file, pattern, partial) if (hit) { if (options.flipNegate) return true return !this.negate } } // didn't get any hits. this is success if it's a negative // pattern, failure otherwise. if (options.flipNegate) return false return this.negate } // set partial to true to test if, for example, // "/a/b" matches the start of "/*/b/*/d" // Partial means, if you run out of file before you run // out of pattern, then that's fine, as long as all // the parts match. Minimatch.prototype.matchOne = function (file, pattern, partial) { var options = this.options this.debug('matchOne', { 'this': this, file: file, pattern: pattern }) this.debug('matchOne', file.length, pattern.length) for (var fi = 0, pi = 0, fl = file.length, pl = pattern.length ; (fi < fl) && (pi < pl) ; fi++, pi++) { this.debug('matchOne loop') var p = pattern[pi] var f = file[fi] this.debug(pattern, p, f) // should be impossible. // some invalid regexp stuff in the set. if (p === false) return false if (p === GLOBSTAR) { this.debug('GLOBSTAR', [pattern, p, f]) // "**" // a/**/b/**/c would match the following: // a/b/x/y/z/c // a/x/y/z/b/c // a/b/x/b/x/c // a/b/c // To do this, take the rest of the pattern after // the **, and see if it would match the file remainder. // If so, return success. // If not, the ** "swallows" a segment, and try again. // This is recursively awful. // // a/**/b/**/c matching a/b/x/y/z/c // - a matches a // - doublestar // - matchOne(b/x/y/z/c, b/**/c) // - b matches b // - doublestar // - matchOne(x/y/z/c, c) -> no // - matchOne(y/z/c, c) -> no // - matchOne(z/c, c) -> no // - matchOne(c, c) yes, hit var fr = fi var pr = pi + 1 if (pr === pl) { this.debug('** at the end') // a ** at the end will just swallow the rest. // We have found a match. // however, it will not swallow /.x, unless // options.dot is set. // . and .. are *never* matched by **, for explosively // exponential reasons. for (; fi < fl; fi++) { if (file[fi] === '.' || file[fi] === '..' || (!options.dot && file[fi].charAt(0) === '.')) return false } return true } // ok, let's see if we can swallow whatever we can. while (fr < fl) { var swallowee = file[fr] this.debug('\nglobstar while', file, fr, pattern, pr, swallowee) // XXX remove this slice. Just pass the start index. if (this.matchOne(file.slice(fr), pattern.slice(pr), partial)) { this.debug('globstar found match!', fr, fl, swallowee) // found a match. return true } else { // can't swallow "." or ".." ever. // can only swallow ".foo" when explicitly asked. if (swallowee === '.' || swallowee === '..' || (!options.dot && swallowee.charAt(0) === '.')) { this.debug('dot detected!', file, fr, pattern, pr) break } // ** swallows a segment, and continue. this.debug('globstar swallow a segment, and continue') fr++ } } // no match was found. // However, in partial mode, we can't say this is necessarily over. // If there's more *pattern* left, then if (partial) { // ran out of file this.debug('\n>>> no match, partial?', file, fr, pattern, pr) if (fr === fl) return true } return false } // something other than ** // non-magic patterns just have to match exactly // patterns with magic have been turned into regexps. var hit if (typeof p === 'string') { if (options.nocase) { hit = f.toLowerCase() === p.toLowerCase() } else { hit = f === p } this.debug('string match', p, f, hit) } else { hit = f.match(p) this.debug('pattern match', p, f, hit) } if (!hit) return false } // Note: ending in / means that we'll get a final "" // at the end of the pattern. This can only match a // corresponding "" at the end of the file. // If the file ends in /, then it can only match a // a pattern that ends in /, unless the pattern just // doesn't have any more for it. But, a/b/ should *not* // match "a/b/*", even though "" matches against the // [^/]*? pattern, except in partial mode, where it might // simply not be reached yet. // However, a/b/ should still satisfy a/* // now either we fell off the end of the pattern, or we're done. if (fi === fl && pi === pl) { // ran out of pattern and filename at the same time. // an exact hit! return true } else if (fi === fl) { // ran out of file, but still had pattern left. // this is ok if we're doing the match as part of // a glob fs traversal. return partial } else if (pi === pl) { // ran out of pattern, still have file left. // this is only acceptable if we're on the very last // empty segment of a file with a trailing slash. // a/* should match a/b/ var emptyFileEnd = (fi === fl - 1) && (file[fi] === '') return emptyFileEnd } // should be unreachable. throw new Error('wtf?') } // replace stuff like \* with * function globUnescape (s) { return s.replace(/\\(.)/g, '$1') } function regExpEscape (s) { return s.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, '\\$&') } /***/ }), /***/ 17952: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; // TODO: Use the `URL` global when targeting Node.js 10 const URLParser = typeof URL === 'undefined' ? __webpack_require__(78835).URL : URL; // https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/Data_URIs const DATA_URL_DEFAULT_MIME_TYPE = 'text/plain'; const DATA_URL_DEFAULT_CHARSET = 'us-ascii'; const testParameter = (name, filters) => { return filters.some(filter => filter instanceof RegExp ? filter.test(name) : filter === name); }; const normalizeDataURL = (urlString, {stripHash}) => { const parts = urlString.match(/^data:([^,]*?),([^#]*?)(?:#(.*))?$/); if (!parts) { throw new Error(`Invalid URL: ${urlString}`); } const mediaType = parts[1].split(';'); const body = parts[2]; const hash = stripHash ? '' : parts[3]; let base64 = false; if (mediaType[mediaType.length - 1] === 'base64') { mediaType.pop(); base64 = true; } // Lowercase MIME type const mimeType = (mediaType.shift() || '').toLowerCase(); const attributes = mediaType .map(attribute => { let [key, value = ''] = attribute.split('=').map(string => string.trim()); // Lowercase `charset` if (key === 'charset') { value = value.toLowerCase(); if (value === DATA_URL_DEFAULT_CHARSET) { return ''; } } return `${key}${value ? `=${value}` : ''}`; }) .filter(Boolean); const normalizedMediaType = [ ...attributes ]; if (base64) { normalizedMediaType.push('base64'); } if (normalizedMediaType.length !== 0 || (mimeType && mimeType !== DATA_URL_DEFAULT_MIME_TYPE)) { normalizedMediaType.unshift(mimeType); } return `data:${normalizedMediaType.join(';')},${base64 ? body.trim() : body}${hash ? `#${hash}` : ''}`; }; const normalizeUrl = (urlString, options) => { options = { defaultProtocol: 'http:', normalizeProtocol: true, forceHttp: false, forceHttps: false, stripAuthentication: true, stripHash: false, stripWWW: true, removeQueryParameters: [/^utm_\w+/i], removeTrailingSlash: true, removeDirectoryIndex: false, sortQueryParameters: true, ...options }; // TODO: Remove this at some point in the future if (Reflect.has(options, 'normalizeHttps')) { throw new Error('options.normalizeHttps is renamed to options.forceHttp'); } if (Reflect.has(options, 'normalizeHttp')) { throw new Error('options.normalizeHttp is renamed to options.forceHttps'); } if (Reflect.has(options, 'stripFragment')) { throw new Error('options.stripFragment is renamed to options.stripHash'); } urlString = urlString.trim(); // Data URL if (/^data:/i.test(urlString)) { return normalizeDataURL(urlString, options); } const hasRelativeProtocol = urlString.startsWith('//'); const isRelativeUrl = !hasRelativeProtocol && /^\.*\//.test(urlString); // Prepend protocol if (!isRelativeUrl) { urlString = urlString.replace(/^(?!(?:\w+:)?\/\/)|^\/\//, options.defaultProtocol); } const urlObj = new URLParser(urlString); if (options.forceHttp && options.forceHttps) { throw new Error('The `forceHttp` and `forceHttps` options cannot be used together'); } if (options.forceHttp && urlObj.protocol === 'https:') { urlObj.protocol = 'http:'; } if (options.forceHttps && urlObj.protocol === 'http:') { urlObj.protocol = 'https:'; } // Remove auth if (options.stripAuthentication) { urlObj.username = ''; urlObj.password = ''; } // Remove hash if (options.stripHash) { urlObj.hash = ''; } // Remove duplicate slashes if not preceded by a protocol if (urlObj.pathname) { // TODO: Use the following instead when targeting Node.js 10 // `urlObj.pathname = urlObj.pathname.replace(/(? { if (/^(?!\/)/g.test(p1)) { return `${p1}/`; } return '/'; }); } // Decode URI octets if (urlObj.pathname) { urlObj.pathname = decodeURI(urlObj.pathname); } // Remove directory index if (options.removeDirectoryIndex === true) { options.removeDirectoryIndex = [/^index\.[a-z]+$/]; } if (Array.isArray(options.removeDirectoryIndex) && options.removeDirectoryIndex.length > 0) { let pathComponents = urlObj.pathname.split('/'); const lastComponent = pathComponents[pathComponents.length - 1]; if (testParameter(lastComponent, options.removeDirectoryIndex)) { pathComponents = pathComponents.slice(0, pathComponents.length - 1); urlObj.pathname = pathComponents.slice(1).join('/') + '/'; } } if (urlObj.hostname) { // Remove trailing dot urlObj.hostname = urlObj.hostname.replace(/\.$/, ''); // Remove `www.` if (options.stripWWW && /^www\.([a-z\-\d]{2,63})\.([a-z.]{2,5})$/.test(urlObj.hostname)) { // Each label should be max 63 at length (min: 2). // The extension should be max 5 at length (min: 2). // Source: https://en.wikipedia.org/wiki/Hostname#Restrictions_on_valid_host_names urlObj.hostname = urlObj.hostname.replace(/^www\./, ''); } } // Remove query unwanted parameters if (Array.isArray(options.removeQueryParameters)) { for (const key of [...urlObj.searchParams.keys()]) { if (testParameter(key, options.removeQueryParameters)) { urlObj.searchParams.delete(key); } } } // Sort query parameters if (options.sortQueryParameters) { urlObj.searchParams.sort(); } if (options.removeTrailingSlash) { urlObj.pathname = urlObj.pathname.replace(/\/$/, ''); } // Take advantage of many of the Node `url` normalizations urlString = urlObj.toString(); // Remove ending `/` if ((options.removeTrailingSlash || urlObj.pathname === '/') && urlObj.hash === '') { urlString = urlString.replace(/\/$/, ''); } // Restore relative protocol, if applicable if (hasRelativeProtocol && !options.normalizeProtocol) { urlString = urlString.replace(/^http:\/\//, '//'); } // Remove http/https if (options.stripProtocol) { urlString = urlString.replace(/^(?:https?:)?\/\//, ''); } return urlString; }; module.exports = normalizeUrl; // TODO: Remove this for the next major release module.exports.default = normalizeUrl; /***/ }), /***/ 43248: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { var crypto = __webpack_require__(33373) function sha (key, body, algorithm) { return crypto.createHmac(algorithm, key).update(body).digest('base64') } function rsa (key, body) { return crypto.createSign('RSA-SHA1').update(body).sign(key, 'base64') } function rfc3986 (str) { return encodeURIComponent(str) .replace(/!/g,'%21') .replace(/\*/g,'%2A') .replace(/\(/g,'%28') .replace(/\)/g,'%29') .replace(/'/g,'%27') } // Maps object to bi-dimensional array // Converts { foo: 'A', bar: [ 'b', 'B' ]} to // [ ['foo', 'A'], ['bar', 'b'], ['bar', 'B'] ] function map (obj) { var key, val, arr = [] for (key in obj) { val = obj[key] if (Array.isArray(val)) for (var i = 0; i < val.length; i++) arr.push([key, val[i]]) else if (typeof val === 'object') for (var prop in val) arr.push([key + '[' + prop + ']', val[prop]]) else arr.push([key, val]) } return arr } // Compare function for sort function compare (a, b) { return a > b ? 1 : a < b ? -1 : 0 } function generateBase (httpMethod, base_uri, params) { // adapted from https://dev.twitter.com/docs/auth/oauth and // https://dev.twitter.com/docs/auth/creating-signature // Parameter normalization // http://tools.ietf.org/html/rfc5849#section-3.4.1.3.2 var normalized = map(params) // 1. First, the name and value of each parameter are encoded .map(function (p) { return [ rfc3986(p[0]), rfc3986(p[1] || '') ] }) // 2. The parameters are sorted by name, using ascending byte value // ordering. If two or more parameters share the same name, they // are sorted by their value. .sort(function (a, b) { return compare(a[0], b[0]) || compare(a[1], b[1]) }) // 3. The name of each parameter is concatenated to its corresponding // value using an "=" character (ASCII code 61) as a separator, even // if the value is empty. .map(function (p) { return p.join('=') }) // 4. The sorted name/value pairs are concatenated together into a // single string by using an "&" character (ASCII code 38) as // separator. .join('&') var base = [ rfc3986(httpMethod ? httpMethod.toUpperCase() : 'GET'), rfc3986(base_uri), rfc3986(normalized) ].join('&') return base } function hmacsign (httpMethod, base_uri, params, consumer_secret, token_secret) { var base = generateBase(httpMethod, base_uri, params) var key = [ consumer_secret || '', token_secret || '' ].map(rfc3986).join('&') return sha(key, base, 'sha1') } function hmacsign256 (httpMethod, base_uri, params, consumer_secret, token_secret) { var base = generateBase(httpMethod, base_uri, params) var key = [ consumer_secret || '', token_secret || '' ].map(rfc3986).join('&') return sha(key, base, 'sha256') } function rsasign (httpMethod, base_uri, params, private_key, token_secret) { var base = generateBase(httpMethod, base_uri, params) var key = private_key || '' return rsa(key, base) } function plaintext (consumer_secret, token_secret) { var key = [ consumer_secret || '', token_secret || '' ].map(rfc3986).join('&') return key } function sign (signMethod, httpMethod, base_uri, params, consumer_secret, token_secret) { var method var skipArgs = 1 switch (signMethod) { case 'RSA-SHA1': method = rsasign break case 'HMAC-SHA1': method = hmacsign break case 'HMAC-SHA256': method = hmacsign256 break case 'PLAINTEXT': method = plaintext skipArgs = 4 break default: throw new Error('Signature method not supported: ' + signMethod) } return method.apply(null, [].slice.call(arguments, skipArgs)) } exports.hmacsign = hmacsign exports.hmacsign256 = hmacsign256 exports.rsasign = rsasign exports.plaintext = plaintext exports.sign = sign exports.rfc3986 = rfc3986 exports.generateBase = generateBase /***/ }), /***/ 24856: /***/ ((module, exports, __webpack_require__) => { "use strict"; var crypto = __webpack_require__(33373); /** * Exported function * * Options: * * - `algorithm` hash algo to be used by this instance: *'sha1', 'md5' * - `excludeValues` {true|*false} hash object keys, values ignored * - `encoding` hash encoding, supports 'buffer', '*hex', 'binary', 'base64' * - `ignoreUnknown` {true|*false} ignore unknown object types * - `replacer` optional function that replaces values before hashing * - `respectFunctionProperties` {*true|false} consider function properties when hashing * - `respectFunctionNames` {*true|false} consider 'name' property of functions for hashing * - `respectType` {*true|false} Respect special properties (prototype, constructor) * when hashing to distinguish between types * - `unorderedArrays` {true|*false} Sort all arrays before hashing * - `unorderedSets` {*true|false} Sort `Set` and `Map` instances before hashing * * = default * * @param {object} object value to hash * @param {object} options hashing options * @return {string} hash value * @api public */ exports = module.exports = objectHash; function objectHash(object, options){ options = applyDefaults(object, options); return hash(object, options); } /** * Exported sugar methods * * @param {object} object value to hash * @return {string} hash value * @api public */ exports.sha1 = function(object){ return objectHash(object); }; exports.keys = function(object){ return objectHash(object, {excludeValues: true, algorithm: 'sha1', encoding: 'hex'}); }; exports.MD5 = function(object){ return objectHash(object, {algorithm: 'md5', encoding: 'hex'}); }; exports.keysMD5 = function(object){ return objectHash(object, {algorithm: 'md5', encoding: 'hex', excludeValues: true}); }; // Internals var hashes = crypto.getHashes ? crypto.getHashes().slice() : ['sha1', 'md5']; hashes.push('passthrough'); var encodings = ['buffer', 'hex', 'binary', 'base64']; function applyDefaults(object, sourceOptions){ sourceOptions = sourceOptions || {}; // create a copy rather than mutating var options = {}; options.algorithm = sourceOptions.algorithm || 'sha1'; options.encoding = sourceOptions.encoding || 'hex'; options.excludeValues = sourceOptions.excludeValues ? true : false; options.algorithm = options.algorithm.toLowerCase(); options.encoding = options.encoding.toLowerCase(); options.ignoreUnknown = sourceOptions.ignoreUnknown !== true ? false : true; // default to false options.respectType = sourceOptions.respectType === false ? false : true; // default to true options.respectFunctionNames = sourceOptions.respectFunctionNames === false ? false : true; options.respectFunctionProperties = sourceOptions.respectFunctionProperties === false ? false : true; options.unorderedArrays = sourceOptions.unorderedArrays !== true ? false : true; // default to false options.unorderedSets = sourceOptions.unorderedSets === false ? false : true; // default to false options.unorderedObjects = sourceOptions.unorderedObjects === false ? false : true; // default to true options.replacer = sourceOptions.replacer || undefined; options.excludeKeys = sourceOptions.excludeKeys || undefined; if(typeof object === 'undefined') { throw new Error('Object argument required.'); } // if there is a case-insensitive match in the hashes list, accept it // (i.e. SHA256 for sha256) for (var i = 0; i < hashes.length; ++i) { if (hashes[i].toLowerCase() === options.algorithm.toLowerCase()) { options.algorithm = hashes[i]; } } if(hashes.indexOf(options.algorithm) === -1){ throw new Error('Algorithm "' + options.algorithm + '" not supported. ' + 'supported values: ' + hashes.join(', ')); } if(encodings.indexOf(options.encoding) === -1 && options.algorithm !== 'passthrough'){ throw new Error('Encoding "' + options.encoding + '" not supported. ' + 'supported values: ' + encodings.join(', ')); } return options; } /** Check if the given function is a native function */ function isNativeFunction(f) { if ((typeof f) !== 'function') { return false; } var exp = /^function\s+\w*\s*\(\s*\)\s*{\s+\[native code\]\s+}$/i; return exp.exec(Function.prototype.toString.call(f)) != null; } function hash(object, options) { var hashingStream; if (options.algorithm !== 'passthrough') { hashingStream = crypto.createHash(options.algorithm); } else { hashingStream = new PassThrough(); } if (typeof hashingStream.write === 'undefined') { hashingStream.write = hashingStream.update; hashingStream.end = hashingStream.update; } var hasher = typeHasher(options, hashingStream); hasher.dispatch(object); if (!hashingStream.update) { hashingStream.end(''); } if (hashingStream.digest) { return hashingStream.digest(options.encoding === 'buffer' ? undefined : options.encoding); } var buf = hashingStream.read(); if (options.encoding === 'buffer') { return buf; } return buf.toString(options.encoding); } /** * Expose streaming API * * @param {object} object Value to serialize * @param {object} options Options, as for hash() * @param {object} stream A stream to write the serializiation to * @api public */ exports.writeToStream = function(object, options, stream) { if (typeof stream === 'undefined') { stream = options; options = {}; } options = applyDefaults(object, options); return typeHasher(options, stream).dispatch(object); }; function typeHasher(options, writeTo, context){ context = context || []; var write = function(str) { if (writeTo.update) { return writeTo.update(str, 'utf8'); } else { return writeTo.write(str, 'utf8'); } }; return { dispatch: function(value){ if (options.replacer) { value = options.replacer(value); } var type = typeof value; if (value === null) { type = 'null'; } //console.log("[DEBUG] Dispatch: ", value, "->", type, " -> ", "_" + type); return this['_' + type](value); }, _object: function(object) { var pattern = (/\[object (.*)\]/i); var objString = Object.prototype.toString.call(object); var objType = pattern.exec(objString); if (!objType) { // object type did not match [object ...] objType = 'unknown:[' + objString + ']'; } else { objType = objType[1]; // take only the class name } objType = objType.toLowerCase(); var objectNumber = null; if ((objectNumber = context.indexOf(object)) >= 0) { return this.dispatch('[CIRCULAR:' + objectNumber + ']'); } else { context.push(object); } if (typeof Buffer !== 'undefined' && Buffer.isBuffer && Buffer.isBuffer(object)) { write('buffer:'); return write(object); } if(objType !== 'object' && objType !== 'function' && objType !== 'asyncfunction') { if(this['_' + objType]) { this['_' + objType](object); } else if (options.ignoreUnknown) { return write('[' + objType + ']'); } else { throw new Error('Unknown object type "' + objType + '"'); } }else{ var keys = Object.keys(object); if (options.unorderedObjects) { keys = keys.sort(); } // Make sure to incorporate special properties, so // Types with different prototypes will produce // a different hash and objects derived from // different functions (`new Foo`, `new Bar`) will // produce different hashes. // We never do this for native functions since some // seem to break because of that. if (options.respectType !== false && !isNativeFunction(object)) { keys.splice(0, 0, 'prototype', '__proto__', 'constructor'); } if (options.excludeKeys) { keys = keys.filter(function(key) { return !options.excludeKeys(key); }); } write('object:' + keys.length + ':'); var self = this; return keys.forEach(function(key){ self.dispatch(key); write(':'); if(!options.excludeValues) { self.dispatch(object[key]); } write(','); }); } }, _array: function(arr, unordered){ unordered = typeof unordered !== 'undefined' ? unordered : options.unorderedArrays !== false; // default to options.unorderedArrays var self = this; write('array:' + arr.length + ':'); if (!unordered || arr.length <= 1) { return arr.forEach(function(entry) { return self.dispatch(entry); }); } // the unordered case is a little more complicated: // since there is no canonical ordering on objects, // i.e. {a:1} < {a:2} and {a:1} > {a:2} are both false, // we first serialize each entry using a PassThrough stream // before sorting. // also: we can’t use the same context array for all entries // since the order of hashing should *not* matter. instead, // we keep track of the additions to a copy of the context array // and add all of them to the global context array when we’re done var contextAdditions = []; var entries = arr.map(function(entry) { var strm = new PassThrough(); var localContext = context.slice(); // make copy var hasher = typeHasher(options, strm, localContext); hasher.dispatch(entry); // take only what was added to localContext and append it to contextAdditions contextAdditions = contextAdditions.concat(localContext.slice(context.length)); return strm.read().toString(); }); context = context.concat(contextAdditions); entries.sort(); return this._array(entries, false); }, _date: function(date){ return write('date:' + date.toJSON()); }, _symbol: function(sym){ return write('symbol:' + sym.toString()); }, _error: function(err){ return write('error:' + err.toString()); }, _boolean: function(bool){ return write('bool:' + bool.toString()); }, _string: function(string){ write('string:' + string.length + ':'); write(string.toString()); }, _function: function(fn){ write('fn:'); if (isNativeFunction(fn)) { this.dispatch('[native]'); } else { this.dispatch(fn.toString()); } if (options.respectFunctionNames !== false) { // Make sure we can still distinguish native functions // by their name, otherwise String and Function will // have the same hash this.dispatch("function-name:" + String(fn.name)); } if (options.respectFunctionProperties) { this._object(fn); } }, _number: function(number){ return write('number:' + number.toString()); }, _xml: function(xml){ return write('xml:' + xml.toString()); }, _null: function() { return write('Null'); }, _undefined: function() { return write('Undefined'); }, _regexp: function(regex){ return write('regex:' + regex.toString()); }, _uint8array: function(arr){ write('uint8array:'); return this.dispatch(Array.prototype.slice.call(arr)); }, _uint8clampedarray: function(arr){ write('uint8clampedarray:'); return this.dispatch(Array.prototype.slice.call(arr)); }, _int8array: function(arr){ write('uint8array:'); return this.dispatch(Array.prototype.slice.call(arr)); }, _uint16array: function(arr){ write('uint16array:'); return this.dispatch(Array.prototype.slice.call(arr)); }, _int16array: function(arr){ write('uint16array:'); return this.dispatch(Array.prototype.slice.call(arr)); }, _uint32array: function(arr){ write('uint32array:'); return this.dispatch(Array.prototype.slice.call(arr)); }, _int32array: function(arr){ write('uint32array:'); return this.dispatch(Array.prototype.slice.call(arr)); }, _float32array: function(arr){ write('float32array:'); return this.dispatch(Array.prototype.slice.call(arr)); }, _float64array: function(arr){ write('float64array:'); return this.dispatch(Array.prototype.slice.call(arr)); }, _arraybuffer: function(arr){ write('arraybuffer:'); return this.dispatch(new Uint8Array(arr)); }, _url: function(url) { return write('url:' + url.toString(), 'utf8'); }, _map: function(map) { write('map:'); var arr = Array.from(map); return this._array(arr, options.unorderedSets !== false); }, _set: function(set) { write('set:'); var arr = Array.from(set); return this._array(arr, options.unorderedSets !== false); }, _file: function(file) { write('file:'); return this.dispatch([file.name, file.size, file.type, file.lastModfied]); }, _blob: function() { if (options.ignoreUnknown) { return write('[blob]'); } throw Error('Hashing Blob objects is currently not supported\n' + '(see https://github.com/puleos/object-hash/issues/26)\n' + 'Use "options.replacer" or "options.ignoreUnknown"\n'); }, _domwindow: function() { return write('domwindow'); }, /* Node.js standard native objects */ _process: function() { return write('process'); }, _timer: function() { return write('timer'); }, _pipe: function() { return write('pipe'); }, _tcp: function() { return write('tcp'); }, _udp: function() { return write('udp'); }, _tty: function() { return write('tty'); }, _statwatcher: function() { return write('statwatcher'); }, _securecontext: function() { return write('securecontext'); }, _connection: function() { return write('connection'); }, _zlib: function() { return write('zlib'); }, _context: function() { return write('context'); }, _nodescript: function() { return write('nodescript'); }, _httpparser: function() { return write('httpparser'); }, _dataview: function() { return write('dataview'); }, _signal: function() { return write('signal'); }, _fsevent: function() { return write('fsevent'); }, _tlswrap: function() { return write('tlswrap'); }, }; } // Mini-implementation of stream.PassThrough // We are far from having need for the full implementation, and we can // make assumptions like "many writes, then only one final read" // and we can ignore encoding specifics function PassThrough() { return { buf: '', write: function(b) { this.buf += b; }, end: function(b) { this.buf += b; }, read: function() { return this.buf; } }; } /***/ }), /***/ 20504: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { var hasMap = typeof Map === 'function' && Map.prototype; var mapSizeDescriptor = Object.getOwnPropertyDescriptor && hasMap ? Object.getOwnPropertyDescriptor(Map.prototype, 'size') : null; var mapSize = hasMap && mapSizeDescriptor && typeof mapSizeDescriptor.get === 'function' ? mapSizeDescriptor.get : null; var mapForEach = hasMap && Map.prototype.forEach; var hasSet = typeof Set === 'function' && Set.prototype; var setSizeDescriptor = Object.getOwnPropertyDescriptor && hasSet ? Object.getOwnPropertyDescriptor(Set.prototype, 'size') : null; var setSize = hasSet && setSizeDescriptor && typeof setSizeDescriptor.get === 'function' ? setSizeDescriptor.get : null; var setForEach = hasSet && Set.prototype.forEach; var hasWeakMap = typeof WeakMap === 'function' && WeakMap.prototype; var weakMapHas = hasWeakMap ? WeakMap.prototype.has : null; var hasWeakSet = typeof WeakSet === 'function' && WeakSet.prototype; var weakSetHas = hasWeakSet ? WeakSet.prototype.has : null; var hasWeakRef = typeof WeakRef === 'function' && WeakRef.prototype; var weakRefDeref = hasWeakRef ? WeakRef.prototype.deref : null; var booleanValueOf = Boolean.prototype.valueOf; var objectToString = Object.prototype.toString; var functionToString = Function.prototype.toString; var match = String.prototype.match; var bigIntValueOf = typeof BigInt === 'function' ? BigInt.prototype.valueOf : null; var gOPS = Object.getOwnPropertySymbols; var symToString = typeof Symbol === 'function' && typeof Symbol.iterator === 'symbol' ? Symbol.prototype.toString : null; var hasShammedSymbols = typeof Symbol === 'function' && typeof Symbol.iterator === 'object'; // ie, `has-tostringtag/shams var toStringTag = typeof Symbol === 'function' && Symbol.toStringTag && (typeof Symbol.toStringTag === hasShammedSymbols ? 'object' : 'symbol') ? Symbol.toStringTag : null; var isEnumerable = Object.prototype.propertyIsEnumerable; var gPO = (typeof Reflect === 'function' ? Reflect.getPrototypeOf : Object.getPrototypeOf) || ( [].__proto__ === Array.prototype // eslint-disable-line no-proto ? function (O) { return O.__proto__; // eslint-disable-line no-proto } : null ); var inspectCustom = __webpack_require__(37265).custom; var inspectSymbol = inspectCustom && isSymbol(inspectCustom) ? inspectCustom : null; module.exports = function inspect_(obj, options, depth, seen) { var opts = options || {}; if (has(opts, 'quoteStyle') && (opts.quoteStyle !== 'single' && opts.quoteStyle !== 'double')) { throw new TypeError('option "quoteStyle" must be "single" or "double"'); } if ( has(opts, 'maxStringLength') && (typeof opts.maxStringLength === 'number' ? opts.maxStringLength < 0 && opts.maxStringLength !== Infinity : opts.maxStringLength !== null ) ) { throw new TypeError('option "maxStringLength", if provided, must be a positive integer, Infinity, or `null`'); } var customInspect = has(opts, 'customInspect') ? opts.customInspect : true; if (typeof customInspect !== 'boolean' && customInspect !== 'symbol') { throw new TypeError('option "customInspect", if provided, must be `true`, `false`, or `\'symbol\'`'); } if ( has(opts, 'indent') && opts.indent !== null && opts.indent !== '\t' && !(parseInt(opts.indent, 10) === opts.indent && opts.indent > 0) ) { throw new TypeError('options "indent" must be "\\t", an integer > 0, or `null`'); } if (typeof obj === 'undefined') { return 'undefined'; } if (obj === null) { return 'null'; } if (typeof obj === 'boolean') { return obj ? 'true' : 'false'; } if (typeof obj === 'string') { return inspectString(obj, opts); } if (typeof obj === 'number') { if (obj === 0) { return Infinity / obj > 0 ? '0' : '-0'; } return String(obj); } if (typeof obj === 'bigint') { return String(obj) + 'n'; } var maxDepth = typeof opts.depth === 'undefined' ? 5 : opts.depth; if (typeof depth === 'undefined') { depth = 0; } if (depth >= maxDepth && maxDepth > 0 && typeof obj === 'object') { return isArray(obj) ? '[Array]' : '[Object]'; } var indent = getIndent(opts, depth); if (typeof seen === 'undefined') { seen = []; } else if (indexOf(seen, obj) >= 0) { return '[Circular]'; } function inspect(value, from, noIndent) { if (from) { seen = seen.slice(); seen.push(from); } if (noIndent) { var newOpts = { depth: opts.depth }; if (has(opts, 'quoteStyle')) { newOpts.quoteStyle = opts.quoteStyle; } return inspect_(value, newOpts, depth + 1, seen); } return inspect_(value, opts, depth + 1, seen); } if (typeof obj === 'function') { var name = nameOf(obj); var keys = arrObjKeys(obj, inspect); return '[Function' + (name ? ': ' + name : ' (anonymous)') + ']' + (keys.length > 0 ? ' { ' + keys.join(', ') + ' }' : ''); } if (isSymbol(obj)) { var symString = hasShammedSymbols ? String(obj).replace(/^(Symbol\(.*\))_[^)]*$/, '$1') : symToString.call(obj); return typeof obj === 'object' && !hasShammedSymbols ? markBoxed(symString) : symString; } if (isElement(obj)) { var s = '<' + String(obj.nodeName).toLowerCase(); var attrs = obj.attributes || []; for (var i = 0; i < attrs.length; i++) { s += ' ' + attrs[i].name + '=' + wrapQuotes(quote(attrs[i].value), 'double', opts); } s += '>'; if (obj.childNodes && obj.childNodes.length) { s += '...'; } s += ''; return s; } if (isArray(obj)) { if (obj.length === 0) { return '[]'; } var xs = arrObjKeys(obj, inspect); if (indent && !singleLineValues(xs)) { return '[' + indentedJoin(xs, indent) + ']'; } return '[ ' + xs.join(', ') + ' ]'; } if (isError(obj)) { var parts = arrObjKeys(obj, inspect); if (parts.length === 0) { return '[' + String(obj) + ']'; } return '{ [' + String(obj) + '] ' + parts.join(', ') + ' }'; } if (typeof obj === 'object' && customInspect) { if (inspectSymbol && typeof obj[inspectSymbol] === 'function') { return obj[inspectSymbol](); } else if (customInspect !== 'symbol' && typeof obj.inspect === 'function') { return obj.inspect(); } } if (isMap(obj)) { var mapParts = []; mapForEach.call(obj, function (value, key) { mapParts.push(inspect(key, obj, true) + ' => ' + inspect(value, obj)); }); return collectionOf('Map', mapSize.call(obj), mapParts, indent); } if (isSet(obj)) { var setParts = []; setForEach.call(obj, function (value) { setParts.push(inspect(value, obj)); }); return collectionOf('Set', setSize.call(obj), setParts, indent); } if (isWeakMap(obj)) { return weakCollectionOf('WeakMap'); } if (isWeakSet(obj)) { return weakCollectionOf('WeakSet'); } if (isWeakRef(obj)) { return weakCollectionOf('WeakRef'); } if (isNumber(obj)) { return markBoxed(inspect(Number(obj))); } if (isBigInt(obj)) { return markBoxed(inspect(bigIntValueOf.call(obj))); } if (isBoolean(obj)) { return markBoxed(booleanValueOf.call(obj)); } if (isString(obj)) { return markBoxed(inspect(String(obj))); } if (!isDate(obj) && !isRegExp(obj)) { var ys = arrObjKeys(obj, inspect); var isPlainObject = gPO ? gPO(obj) === Object.prototype : obj instanceof Object || obj.constructor === Object; var protoTag = obj instanceof Object ? '' : 'null prototype'; var stringTag = !isPlainObject && toStringTag && Object(obj) === obj && toStringTag in obj ? toStr(obj).slice(8, -1) : protoTag ? 'Object' : ''; var constructorTag = isPlainObject || typeof obj.constructor !== 'function' ? '' : obj.constructor.name ? obj.constructor.name + ' ' : ''; var tag = constructorTag + (stringTag || protoTag ? '[' + [].concat(stringTag || [], protoTag || []).join(': ') + '] ' : ''); if (ys.length === 0) { return tag + '{}'; } if (indent) { return tag + '{' + indentedJoin(ys, indent) + '}'; } return tag + '{ ' + ys.join(', ') + ' }'; } return String(obj); }; function wrapQuotes(s, defaultStyle, opts) { var quoteChar = (opts.quoteStyle || defaultStyle) === 'double' ? '"' : "'"; return quoteChar + s + quoteChar; } function quote(s) { return String(s).replace(/"/g, '"'); } function isArray(obj) { return toStr(obj) === '[object Array]' && (!toStringTag || !(typeof obj === 'object' && toStringTag in obj)); } function isDate(obj) { return toStr(obj) === '[object Date]' && (!toStringTag || !(typeof obj === 'object' && toStringTag in obj)); } function isRegExp(obj) { return toStr(obj) === '[object RegExp]' && (!toStringTag || !(typeof obj === 'object' && toStringTag in obj)); } function isError(obj) { return toStr(obj) === '[object Error]' && (!toStringTag || !(typeof obj === 'object' && toStringTag in obj)); } function isString(obj) { return toStr(obj) === '[object String]' && (!toStringTag || !(typeof obj === 'object' && toStringTag in obj)); } function isNumber(obj) { return toStr(obj) === '[object Number]' && (!toStringTag || !(typeof obj === 'object' && toStringTag in obj)); } function isBoolean(obj) { return toStr(obj) === '[object Boolean]' && (!toStringTag || !(typeof obj === 'object' && toStringTag in obj)); } // Symbol and BigInt do have Symbol.toStringTag by spec, so that can't be used to eliminate false positives function isSymbol(obj) { if (hasShammedSymbols) { return obj && typeof obj === 'object' && obj instanceof Symbol; } if (typeof obj === 'symbol') { return true; } if (!obj || typeof obj !== 'object' || !symToString) { return false; } try { symToString.call(obj); return true; } catch (e) {} return false; } function isBigInt(obj) { if (!obj || typeof obj !== 'object' || !bigIntValueOf) { return false; } try { bigIntValueOf.call(obj); return true; } catch (e) {} return false; } var hasOwn = Object.prototype.hasOwnProperty || function (key) { return key in this; }; function has(obj, key) { return hasOwn.call(obj, key); } function toStr(obj) { return objectToString.call(obj); } function nameOf(f) { if (f.name) { return f.name; } var m = match.call(functionToString.call(f), /^function\s*([\w$]+)/); if (m) { return m[1]; } return null; } function indexOf(xs, x) { if (xs.indexOf) { return xs.indexOf(x); } for (var i = 0, l = xs.length; i < l; i++) { if (xs[i] === x) { return i; } } return -1; } function isMap(x) { if (!mapSize || !x || typeof x !== 'object') { return false; } try { mapSize.call(x); try { setSize.call(x); } catch (s) { return true; } return x instanceof Map; // core-js workaround, pre-v2.5.0 } catch (e) {} return false; } function isWeakMap(x) { if (!weakMapHas || !x || typeof x !== 'object') { return false; } try { weakMapHas.call(x, weakMapHas); try { weakSetHas.call(x, weakSetHas); } catch (s) { return true; } return x instanceof WeakMap; // core-js workaround, pre-v2.5.0 } catch (e) {} return false; } function isWeakRef(x) { if (!weakRefDeref || !x || typeof x !== 'object') { return false; } try { weakRefDeref.call(x); return true; } catch (e) {} return false; } function isSet(x) { if (!setSize || !x || typeof x !== 'object') { return false; } try { setSize.call(x); try { mapSize.call(x); } catch (m) { return true; } return x instanceof Set; // core-js workaround, pre-v2.5.0 } catch (e) {} return false; } function isWeakSet(x) { if (!weakSetHas || !x || typeof x !== 'object') { return false; } try { weakSetHas.call(x, weakSetHas); try { weakMapHas.call(x, weakMapHas); } catch (s) { return true; } return x instanceof WeakSet; // core-js workaround, pre-v2.5.0 } catch (e) {} return false; } function isElement(x) { if (!x || typeof x !== 'object') { return false; } if (typeof HTMLElement !== 'undefined' && x instanceof HTMLElement) { return true; } return typeof x.nodeName === 'string' && typeof x.getAttribute === 'function'; } function inspectString(str, opts) { if (str.length > opts.maxStringLength) { var remaining = str.length - opts.maxStringLength; var trailer = '... ' + remaining + ' more character' + (remaining > 1 ? 's' : ''); return inspectString(str.slice(0, opts.maxStringLength), opts) + trailer; } // eslint-disable-next-line no-control-regex var s = str.replace(/(['\\])/g, '\\$1').replace(/[\x00-\x1f]/g, lowbyte); return wrapQuotes(s, 'single', opts); } function lowbyte(c) { var n = c.charCodeAt(0); var x = { 8: 'b', 9: 't', 10: 'n', 12: 'f', 13: 'r' }[n]; if (x) { return '\\' + x; } return '\\x' + (n < 0x10 ? '0' : '') + n.toString(16).toUpperCase(); } function markBoxed(str) { return 'Object(' + str + ')'; } function weakCollectionOf(type) { return type + ' { ? }'; } function collectionOf(type, size, entries, indent) { var joinedEntries = indent ? indentedJoin(entries, indent) : entries.join(', '); return type + ' (' + size + ') {' + joinedEntries + '}'; } function singleLineValues(xs) { for (var i = 0; i < xs.length; i++) { if (indexOf(xs[i], '\n') >= 0) { return false; } } return true; } function getIndent(opts, depth) { var baseIndent; if (opts.indent === '\t') { baseIndent = '\t'; } else if (typeof opts.indent === 'number' && opts.indent > 0) { baseIndent = Array(opts.indent + 1).join(' '); } else { return null; } return { base: baseIndent, prev: Array(depth + 1).join(baseIndent) }; } function indentedJoin(xs, indent) { if (xs.length === 0) { return ''; } var lineJoiner = '\n' + indent.prev + indent.base; return lineJoiner + xs.join(',' + lineJoiner) + '\n' + indent.prev; } function arrObjKeys(obj, inspect) { var isArr = isArray(obj); var xs = []; if (isArr) { xs.length = obj.length; for (var i = 0; i < obj.length; i++) { xs[i] = has(obj, i) ? inspect(obj[i], obj) : ''; } } var syms = typeof gOPS === 'function' ? gOPS(obj) : []; var symMap; if (hasShammedSymbols) { symMap = {}; for (var k = 0; k < syms.length; k++) { symMap['$' + syms[k]] = syms[k]; } } for (var key in obj) { // eslint-disable-line no-restricted-syntax if (!has(obj, key)) { continue; } // eslint-disable-line no-restricted-syntax, no-continue if (isArr && String(Number(key)) === key && key < obj.length) { continue; } // eslint-disable-line no-restricted-syntax, no-continue if (hasShammedSymbols && symMap['$' + key] instanceof Symbol) { // this is to prevent shammed Symbols, which are stored as strings, from being included in the string key section continue; // eslint-disable-line no-restricted-syntax, no-continue } else if ((/[^\w$]/).test(key)) { xs.push(inspect(key, obj) + ': ' + inspect(obj[key], obj)); } else { xs.push(key + ': ' + inspect(obj[key], obj)); } } if (typeof gOPS === 'function') { for (var j = 0; j < syms.length; j++) { if (isEnumerable.call(obj, syms[j])) { xs.push('[' + inspect(syms[j]) + ']: ' + inspect(obj[syms[j]], obj)); } } } return xs; } /***/ }), /***/ 37265: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { module.exports = __webpack_require__(31669).inspect; /***/ }), /***/ 1270: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { const { strict: assert } = __webpack_require__(42357); const { createHash } = __webpack_require__(33373); const { format } = __webpack_require__(31669); const shake256 = __webpack_require__(19811); let encode; if (Buffer.isEncoding('base64url')) { encode = (input) => input.toString('base64url'); } else { const fromBase64 = (base64) => base64.replace(/=/g, '').replace(/\+/g, '-').replace(/\//g, '_'); encode = (input) => fromBase64(input.toString('base64')); } /** SPECIFICATION * Its (_hash) value is the base64url encoding of the left-most half of the hash of the octets of * the ASCII representation of the token value, where the hash algorithm used is the hash algorithm * used in the alg Header Parameter of the ID Token's JOSE Header. For instance, if the alg is * RS256, hash the token value with SHA-256, then take the left-most 128 bits and base64url encode * them. The _hash value is a case sensitive string. */ /** * @name getHash * @api private * * returns the sha length based off the JOSE alg heade value, defaults to sha256 * * @param token {String} token value to generate the hash from * @param alg {String} ID Token JOSE header alg value (i.e. RS256, HS384, ES512, PS256) * @param [crv] {String} For EdDSA the curve decides what hash algorithm is used. Required for EdDSA */ function getHash(alg, crv) { switch (alg) { case 'HS256': case 'RS256': case 'PS256': case 'ES256': case 'ES256K': return createHash('sha256'); case 'HS384': case 'RS384': case 'PS384': case 'ES384': return createHash('sha384'); case 'HS512': case 'RS512': case 'PS512': case 'ES512': return createHash('sha512'); case 'EdDSA': switch (crv) { case 'Ed25519': return createHash('sha512'); case 'Ed448': if (!shake256) { throw new TypeError('Ed448 *_hash calculation is not supported in your Node.js runtime version'); } return createHash('shake256', { outputLength: 114 }); default: throw new TypeError('unrecognized or invalid EdDSA curve provided'); } default: throw new TypeError('unrecognized or invalid JWS algorithm provided'); } } function generate(token, alg, crv) { const digest = getHash(alg, crv).update(token).digest(); return encode(digest.slice(0, digest.length / 2)); } function validate(names, actual, source, alg, crv) { if (typeof names.claim !== 'string' || !names.claim) { throw new TypeError('names.claim must be a non-empty string'); } if (typeof names.source !== 'string' || !names.source) { throw new TypeError('names.source must be a non-empty string'); } assert(typeof actual === 'string' && actual, `${names.claim} must be a non-empty string`); assert(typeof source === 'string' && source, `${names.source} must be a non-empty string`); let expected; let msg; try { expected = generate(source, alg, crv); } catch (err) { msg = format('%s could not be validated (%s)', names.claim, err.message); } msg = msg || format('%s mismatch, expected %s, got: %s', names.claim, expected, actual); assert.equal(expected, actual, msg); } module.exports = { validate, generate, }; /***/ }), /***/ 19811: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { const crypto = __webpack_require__(33373); const [major, minor] = process.version.substr(1).split('.').map((x) => parseInt(x, 10)); const xofOutputLength = major > 12 || (major === 12 && minor >= 8); const shake256 = xofOutputLength && crypto.getHashes().includes('shake256'); module.exports = shake256; /***/ }), /***/ 1223: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { var wrappy = __webpack_require__(62940) module.exports = wrappy(once) module.exports.strict = wrappy(onceStrict) once.proto = once(function () { Object.defineProperty(Function.prototype, 'once', { value: function () { return once(this) }, configurable: true }) Object.defineProperty(Function.prototype, 'onceStrict', { value: function () { return onceStrict(this) }, configurable: true }) }) function once (fn) { var f = function () { if (f.called) return f.value f.called = true return f.value = fn.apply(this, arguments) } f.called = false return f } function onceStrict (fn) { var f = function () { if (f.called) throw new Error(f.onceError) f.called = true return f.value = fn.apply(this, arguments) } var name = fn.name || 'Function wrapped with `once`' f.onceError = name + " shouldn't be called more than once" f.called = false return f } /***/ }), /***/ 28300: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { /* eslint-disable max-classes-per-file */ const { inspect, deprecate } = __webpack_require__(31669); const stdhttp = __webpack_require__(98605); const crypto = __webpack_require__(33373); const { strict: assert } = __webpack_require__(42357); const querystring = __webpack_require__(71191); const url = __webpack_require__(78835); const { ParseError } = __webpack_require__(44462); const jose = __webpack_require__(16425); const base64url = __webpack_require__(27291); const tokenHash = __webpack_require__(1270); const defaults = __webpack_require__(26457); const { assertSigningAlgValuesSupport, assertIssuerConfiguration } = __webpack_require__(63217); const pick = __webpack_require__(78857); const isPlainObject = __webpack_require__(39862); const processResponse = __webpack_require__(28576); const TokenSet = __webpack_require__(39029); const { OPError, RPError } = __webpack_require__(45061); const now = __webpack_require__(8542); const { random } = __webpack_require__(75421); const request = __webpack_require__(92946); const { CALLBACK_PROPERTIES, CLIENT_DEFAULTS, JWT_CONTENT, CLOCK_TOLERANCE, } = __webpack_require__(27556); const issuerRegistry = __webpack_require__(30730); const instance = __webpack_require__(36546); const { authenticatedPost, resolveResponseType, resolveRedirectUri } = __webpack_require__(7619); const DeviceFlowHandle = __webpack_require__(23979); const { deep: defaultsDeep } = defaults; function pickCb(input) { return pick(input, ...CALLBACK_PROPERTIES); } function authorizationHeaderValue(token, tokenType = 'Bearer') { return `${tokenType} ${token}`; } function cleanUpClaims(claims) { if (Object.keys(claims._claim_names).length === 0) { delete claims._claim_names; } if (Object.keys(claims._claim_sources).length === 0) { delete claims._claim_sources; } } function assignClaim(target, source, sourceName, throwOnMissing = true) { return ([claim, inSource]) => { if (inSource === sourceName) { if (throwOnMissing && source[claim] === undefined) { throw new RPError(`expected claim "${claim}" in "${sourceName}"`); } else if (source[claim] !== undefined) { target[claim] = source[claim]; } delete target._claim_names[claim]; } }; } function verifyPresence(payload, jwt, prop) { if (payload[prop] === undefined) { throw new RPError({ message: `missing required JWT property ${prop}`, jwt, }); } } function authorizationParams(params) { const authParams = { client_id: this.client_id, scope: 'openid', response_type: resolveResponseType.call(this), redirect_uri: resolveRedirectUri.call(this), ...params, }; Object.entries(authParams).forEach(([key, value]) => { if (value === null || value === undefined) { delete authParams[key]; } else if (key === 'claims' && typeof value === 'object') { authParams[key] = JSON.stringify(value); } else if (key === 'resource' && Array.isArray(value)) { authParams[key] = value; } else if (typeof value !== 'string') { authParams[key] = String(value); } }); return authParams; } async function claimJWT(label, jwt) { try { const { header, payload } = jose.JWT.decode(jwt, { complete: true }); const { iss } = payload; if (header.alg === 'none') { return payload; } let key; if (!iss || iss === this.issuer.issuer) { key = await this.issuer.queryKeyStore(header); } else if (issuerRegistry.has(iss)) { key = await issuerRegistry.get(iss).queryKeyStore(header); } else { const discovered = await this.issuer.constructor.discover(iss); key = await discovered.queryKeyStore(header); } return jose.JWT.verify(jwt, key); } catch (err) { if (err instanceof RPError || err instanceof OPError || err.name === 'AggregateError') { throw err; } else { throw new RPError({ printf: ['failed to validate the %s JWT (%s: %s)', label, err.name, err.message], jwt, }); } } } function getKeystore(jwks) { const keystore = jose.JWKS.asKeyStore(jwks); if (keystore.all().some((key) => key.type !== 'private')) { throw new TypeError('jwks must only contain private keys'); } return keystore; } // if an OP doesnt support client_secret_basic but supports client_secret_post, use it instead // this is in place to take care of most common pitfalls when first using discovered Issuers without // the support for default values defined by Discovery 1.0 function checkBasicSupport(client, metadata, properties) { try { const supported = client.issuer.token_endpoint_auth_methods_supported; if (!supported.includes(properties.token_endpoint_auth_method)) { if (supported.includes('client_secret_post')) { properties.token_endpoint_auth_method = 'client_secret_post'; } } } catch (err) {} } function handleCommonMistakes(client, metadata, properties) { if (!metadata.token_endpoint_auth_method) { // if no explicit value was provided checkBasicSupport(client, metadata, properties); } // :fp: c'mon people... RTFM if (metadata.redirect_uri) { if (metadata.redirect_uris) { throw new TypeError('provide a redirect_uri or redirect_uris, not both'); } properties.redirect_uris = [metadata.redirect_uri]; delete properties.redirect_uri; } if (metadata.response_type) { if (metadata.response_types) { throw new TypeError('provide a response_type or response_types, not both'); } properties.response_types = [metadata.response_type]; delete properties.response_type; } } function getDefaultsForEndpoint(endpoint, issuer, properties) { if (!issuer[`${endpoint}_endpoint`]) return; const tokenEndpointAuthMethod = properties.token_endpoint_auth_method; const tokenEndpointAuthSigningAlg = properties.token_endpoint_auth_signing_alg; const eam = `${endpoint}_endpoint_auth_method`; const easa = `${endpoint}_endpoint_auth_signing_alg`; if (properties[eam] === undefined && properties[easa] === undefined) { if (tokenEndpointAuthMethod !== undefined) { properties[eam] = tokenEndpointAuthMethod; } if (tokenEndpointAuthSigningAlg !== undefined) { properties[easa] = tokenEndpointAuthSigningAlg; } } } class BaseClient {} module.exports = (issuer, aadIssValidation = false) => class Client extends BaseClient { /** * @name constructor * @api public */ constructor(metadata = {}, jwks, options) { super(); if (typeof metadata.client_id !== 'string' || !metadata.client_id) { throw new TypeError('client_id is required'); } const properties = { ...CLIENT_DEFAULTS, ...metadata }; handleCommonMistakes(this, metadata, properties); assertSigningAlgValuesSupport('token', this.issuer, properties); ['introspection', 'revocation'].forEach((endpoint) => { getDefaultsForEndpoint(endpoint, this.issuer, properties); assertSigningAlgValuesSupport(endpoint, this.issuer, properties); }); Object.entries(properties).forEach(([key, value]) => { instance(this).get('metadata').set(key, value); if (!this[key]) { Object.defineProperty(this, key, { get() { return instance(this).get('metadata').get(key); }, enumerable: true, }); } }); if (jwks !== undefined) { const keystore = getKeystore.call(this, jwks); instance(this).set('keystore', keystore); } if (options !== undefined) { instance(this).set('options', options); } this[CLOCK_TOLERANCE] = 0; } /** * @name authorizationUrl * @api public */ authorizationUrl(params = {}) { if (!isPlainObject(params)) { throw new TypeError('params must be a plain object'); } assertIssuerConfiguration(this.issuer, 'authorization_endpoint'); const target = url.parse(this.issuer.authorization_endpoint, true); target.search = null; target.query = { ...target.query, ...authorizationParams.call(this, params), }; return url.format(target); } /** * @name authorizationPost * @api public */ authorizationPost(params = {}) { if (!isPlainObject(params)) { throw new TypeError('params must be a plain object'); } const inputs = authorizationParams.call(this, params); const formInputs = Object.keys(inputs) .map((name) => ``).join('\n'); return ` Requesting Authorization
${formInputs}
`; } /** * @name endSessionUrl * @api public */ endSessionUrl(params = {}) { assertIssuerConfiguration(this.issuer, 'end_session_endpoint'); const { 0: postLogout, length, } = this.post_logout_redirect_uris || []; const { post_logout_redirect_uri = length === 1 ? postLogout : undefined, } = params; let hint = params.id_token_hint; if (hint instanceof TokenSet) { if (!hint.id_token) { throw new TypeError('id_token not present in TokenSet'); } hint = hint.id_token; } const target = url.parse(this.issuer.end_session_endpoint, true); target.search = null; target.query = { ...params, ...target.query, ...{ post_logout_redirect_uri, id_token_hint: hint, }, }; Object.entries(target.query).forEach(([key, value]) => { if (value === null || value === undefined) { delete target.query[key]; } }); return url.format(target); } /** * @name callbackParams * @api public */ callbackParams(input) { // eslint-disable-line class-methods-use-this const isIncomingMessage = input instanceof stdhttp.IncomingMessage || (input && input.method && input.url); const isString = typeof input === 'string'; if (!isString && !isIncomingMessage) { throw new TypeError('#callbackParams only accepts string urls, http.IncomingMessage or a lookalike'); } if (isIncomingMessage) { switch (input.method) { case 'GET': return pickCb(url.parse(input.url, true).query); case 'POST': if (input.body === undefined) { throw new TypeError('incoming message body missing, include a body parser prior to this method call'); } switch (typeof input.body) { case 'object': case 'string': if (Buffer.isBuffer(input.body)) { return pickCb(querystring.parse(input.body.toString('utf-8'))); } if (typeof input.body === 'string') { return pickCb(querystring.parse(input.body)); } return pickCb(input.body); default: throw new TypeError('invalid IncomingMessage body object'); } default: throw new TypeError('invalid IncomingMessage method'); } } else { return pickCb(url.parse(input, true).query); } } /** * @name callback * @api public */ async callback( redirectUri, parameters, checks = {}, { exchangeBody, clientAssertionPayload } = {}, ) { let params = pickCb(parameters); if (checks.jarm && !('response' in parameters)) { throw new RPError({ message: 'expected a JARM response', checks, params, }); } else if ('response' in parameters) { const decrypted = await this.decryptJARM(params.response); params = await this.validateJARM(decrypted); } if (this.default_max_age && !checks.max_age) { checks.max_age = this.default_max_age; } if (params.state && !checks.state) { throw new TypeError('checks.state argument is missing'); } if (!params.state && checks.state) { throw new RPError({ message: 'state missing from the response', checks, params, }); } if (checks.state !== params.state) { throw new RPError({ printf: ['state mismatch, expected %s, got: %s', checks.state, params.state], checks, params, }); } if (params.error) { throw new OPError(params); } const RESPONSE_TYPE_REQUIRED_PARAMS = { code: ['code'], id_token: ['id_token'], token: ['access_token', 'token_type'], }; if (checks.response_type) { for (const type of checks.response_type.split(' ')) { // eslint-disable-line no-restricted-syntax if (type === 'none') { if (params.code || params.id_token || params.access_token) { throw new RPError({ message: 'unexpected params encountered for "none" response', checks, params, }); } } else { for (const param of RESPONSE_TYPE_REQUIRED_PARAMS[type]) { // eslint-disable-line no-restricted-syntax, max-len if (!params[param]) { throw new RPError({ message: `${param} missing from response`, checks, params, }); } } } } } if (params.id_token) { const tokenset = new TokenSet(params); await this.decryptIdToken(tokenset); await this.validateIdToken(tokenset, checks.nonce, 'authorization', checks.max_age, checks.state); if (!params.code) { return tokenset; } } if (params.code) { const tokenset = await this.grant({ ...exchangeBody, grant_type: 'authorization_code', code: params.code, redirect_uri: redirectUri, code_verifier: checks.code_verifier, }, { clientAssertionPayload }); await this.decryptIdToken(tokenset); await this.validateIdToken(tokenset, checks.nonce, 'token', checks.max_age); if (params.session_state) { tokenset.session_state = params.session_state; } return tokenset; } return new TokenSet(params); } /** * @name oauthCallback * @api public */ async oauthCallback( redirectUri, parameters, checks = {}, { exchangeBody, clientAssertionPayload } = {}, ) { let params = pickCb(parameters); if (checks.jarm && !('response' in parameters)) { throw new RPError({ message: 'expected a JARM response', checks, params, }); } else if ('response' in parameters) { const decrypted = await this.decryptJARM(params.response); params = await this.validateJARM(decrypted); } if (params.state && !checks.state) { throw new TypeError('checks.state argument is missing'); } if (!params.state && checks.state) { throw new RPError({ message: 'state missing from the response', checks, params, }); } if (checks.state !== params.state) { throw new RPError({ printf: ['state mismatch, expected %s, got: %s', checks.state, params.state], checks, params, }); } if (params.error) { throw new OPError(params); } const RESPONSE_TYPE_REQUIRED_PARAMS = { code: ['code'], token: ['access_token', 'token_type'], }; if (checks.response_type) { for (const type of checks.response_type.split(' ')) { // eslint-disable-line no-restricted-syntax if (type === 'none') { if (params.code || params.id_token || params.access_token) { throw new RPError({ message: 'unexpected params encountered for "none" response', checks, params, }); } } if (RESPONSE_TYPE_REQUIRED_PARAMS[type]) { for (const param of RESPONSE_TYPE_REQUIRED_PARAMS[type]) { // eslint-disable-line no-restricted-syntax, max-len if (!params[param]) { throw new RPError({ message: `${param} missing from response`, checks, params, }); } } } } } if (params.code) { return this.grant({ ...exchangeBody, grant_type: 'authorization_code', code: params.code, redirect_uri: redirectUri, code_verifier: checks.code_verifier, }, { clientAssertionPayload }); } return new TokenSet(params); } /** * @name decryptIdToken * @api private */ async decryptIdToken(token) { if (!this.id_token_encrypted_response_alg) { return token; } let idToken = token; if (idToken instanceof TokenSet) { if (!idToken.id_token) { throw new TypeError('id_token not present in TokenSet'); } idToken = idToken.id_token; } const expectedAlg = this.id_token_encrypted_response_alg; const expectedEnc = this.id_token_encrypted_response_enc; const result = await this.decryptJWE(idToken, expectedAlg, expectedEnc); if (token instanceof TokenSet) { token.id_token = result; return token; } return result; } async validateJWTUserinfo(body) { const expectedAlg = this.userinfo_signed_response_alg; return this.validateJWT(body, expectedAlg, []); } /** * @name decryptJARM * @api private */ async decryptJARM(response) { if (!this.authorization_encrypted_response_alg) { return response; } const expectedAlg = this.authorization_encrypted_response_alg; const expectedEnc = this.authorization_encrypted_response_enc; return this.decryptJWE(response, expectedAlg, expectedEnc); } /** * @name validateJARM * @api private */ async validateJARM(response) { const expectedAlg = this.authorization_signed_response_alg; const { payload } = await this.validateJWT(response, expectedAlg, ['iss', 'exp', 'aud']); return pickCb(payload); } /** * @name decryptJWTUserinfo * @api private */ async decryptJWTUserinfo(body) { if (!this.userinfo_encrypted_response_alg) { return body; } const expectedAlg = this.userinfo_encrypted_response_alg; const expectedEnc = this.userinfo_encrypted_response_enc; return this.decryptJWE(body, expectedAlg, expectedEnc); } /** * @name decryptJWE * @api private */ async decryptJWE(jwe, expectedAlg, expectedEnc = 'A128CBC-HS256') { const header = JSON.parse(base64url.decode(jwe.split('.')[0])); if (header.alg !== expectedAlg) { throw new RPError({ printf: ['unexpected JWE alg received, expected %s, got: %s', expectedAlg, header.alg], jwt: jwe, }); } if (header.enc !== expectedEnc) { throw new RPError({ printf: ['unexpected JWE enc received, expected %s, got: %s', expectedEnc, header.enc], jwt: jwe, }); } let keyOrStore; if (expectedAlg.match(/^(?:RSA|ECDH)/)) { keyOrStore = instance(this).get('keystore'); } else { keyOrStore = await this.joseSecret(expectedAlg === 'dir' ? expectedEnc : expectedAlg); } const payload = jose.JWE.decrypt(jwe, keyOrStore); return payload.toString('utf8'); } /** * @name validateIdToken * @api private */ async validateIdToken(tokenSet, nonce, returnedBy, maxAge, state) { let idToken = tokenSet; const expectedAlg = this.id_token_signed_response_alg; const isTokenSet = idToken instanceof TokenSet; if (isTokenSet) { if (!idToken.id_token) { throw new TypeError('id_token not present in TokenSet'); } idToken = idToken.id_token; } idToken = String(idToken); const timestamp = now(); const { protected: header, payload, key } = await this.validateJWT(idToken, expectedAlg); if (maxAge || (maxAge !== null && this.require_auth_time)) { if (!payload.auth_time) { throw new RPError({ message: 'missing required JWT property auth_time', jwt: idToken, }); } if (typeof payload.auth_time !== 'number') { throw new RPError({ message: 'JWT auth_time claim must be a JSON numeric value', jwt: idToken, }); } } if (maxAge && (payload.auth_time + maxAge < timestamp - this[CLOCK_TOLERANCE])) { throw new RPError({ 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]], now: timestamp, tolerance: this[CLOCK_TOLERANCE], auth_time: payload.auth_time, jwt: idToken, }); } if (nonce !== null && (payload.nonce || nonce !== undefined) && payload.nonce !== nonce) { throw new RPError({ printf: ['nonce mismatch, expected %s, got: %s', nonce, payload.nonce], jwt: idToken, }); } if (returnedBy === 'authorization') { if (!payload.at_hash && tokenSet.access_token) { throw new RPError({ message: 'missing required property at_hash', jwt: idToken, }); } if (!payload.c_hash && tokenSet.code) { throw new RPError({ message: 'missing required property c_hash', jwt: idToken, }); } const fapi = this.constructor.name === 'FAPIClient'; if (fapi) { if (payload.iat < timestamp - 3600) { throw new RPError({ printf: ['JWT issued too far in the past, now %i, iat %i', timestamp, payload.iat], now: timestamp, tolerance: this[CLOCK_TOLERANCE], iat: payload.iat, jwt: idToken, }); } if (!payload.s_hash && (tokenSet.state || state)) { throw new RPError({ message: 'missing required property s_hash', jwt: idToken, }); } } if (payload.s_hash) { if (!state) { throw new TypeError('cannot verify s_hash, "checks.state" property not provided'); } try { tokenHash.validate({ claim: 's_hash', source: 'state' }, payload.s_hash, state, header.alg, key && key.crv); } catch (err) { throw new RPError({ message: err.message, jwt: idToken }); } } } if (tokenSet.access_token && payload.at_hash !== undefined) { try { tokenHash.validate({ claim: 'at_hash', source: 'access_token' }, payload.at_hash, tokenSet.access_token, header.alg, key && key.crv); } catch (err) { throw new RPError({ message: err.message, jwt: idToken }); } } if (tokenSet.code && payload.c_hash !== undefined) { try { tokenHash.validate({ claim: 'c_hash', source: 'code' }, payload.c_hash, tokenSet.code, header.alg, key && key.crv); } catch (err) { throw new RPError({ message: err.message, jwt: idToken }); } } return tokenSet; } /** * @name validateJWT * @api private */ async validateJWT(jwt, expectedAlg, required = ['iss', 'sub', 'aud', 'exp', 'iat']) { const isSelfIssued = this.issuer.issuer === 'https://self-issued.me'; const timestamp = now(); let header; let payload; try { ({ header, payload } = jose.JWT.decode(jwt, { complete: true })); } catch (err) { throw new RPError({ printf: ['failed to decode JWT (%s: %s)', err.name, err.message], jwt, }); } if (header.alg !== expectedAlg) { throw new RPError({ printf: ['unexpected JWT alg received, expected %s, got: %s', expectedAlg, header.alg], jwt, }); } if (isSelfIssued) { required = [...required, 'sub_jwk']; // eslint-disable-line no-param-reassign } required.forEach(verifyPresence.bind(undefined, payload, jwt)); if (payload.iss !== undefined) { let expectedIss = this.issuer.issuer; if (aadIssValidation) { expectedIss = this.issuer.issuer.replace('{tenantid}', payload.tid); } if (payload.iss !== expectedIss) { throw new RPError({ printf: ['unexpected iss value, expected %s, got: %s', expectedIss, payload.iss], jwt, }); } } if (payload.iat !== undefined) { if (typeof payload.iat !== 'number') { throw new RPError({ message: 'JWT iat claim must be a JSON numeric value', jwt, }); } } if (payload.nbf !== undefined) { if (typeof payload.nbf !== 'number') { throw new RPError({ message: 'JWT nbf claim must be a JSON numeric value', jwt, }); } if (payload.nbf > timestamp + this[CLOCK_TOLERANCE]) { throw new RPError({ printf: ['JWT not active yet, now %i, nbf %i', timestamp + this[CLOCK_TOLERANCE], payload.nbf], now: timestamp, tolerance: this[CLOCK_TOLERANCE], nbf: payload.nbf, jwt, }); } } if (payload.exp !== undefined) { if (typeof payload.exp !== 'number') { throw new RPError({ message: 'JWT exp claim must be a JSON numeric value', jwt, }); } if (timestamp - this[CLOCK_TOLERANCE] >= payload.exp) { throw new RPError({ printf: ['JWT expired, now %i, exp %i', timestamp - this[CLOCK_TOLERANCE], payload.exp], now: timestamp, tolerance: this[CLOCK_TOLERANCE], exp: payload.exp, jwt, }); } } if (payload.aud !== undefined) { if (Array.isArray(payload.aud)) { if (payload.aud.length > 1 && !payload.azp) { throw new RPError({ message: 'missing required JWT property azp', jwt, }); } if (!payload.aud.includes(this.client_id)) { throw new RPError({ printf: ['aud is missing the client_id, expected %s to be included in %j', this.client_id, payload.aud], jwt, }); } } else if (payload.aud !== this.client_id) { throw new RPError({ printf: ['aud mismatch, expected %s, got: %s', this.client_id, payload.aud], jwt, }); } } if (payload.azp !== undefined) { let { additionalAuthorizedParties } = instance(this).get('options') || {}; if (typeof additionalAuthorizedParties === 'string') { additionalAuthorizedParties = [this.client_id, additionalAuthorizedParties]; } else if (Array.isArray(additionalAuthorizedParties)) { additionalAuthorizedParties = [this.client_id, ...additionalAuthorizedParties]; } else { additionalAuthorizedParties = [this.client_id]; } if (!additionalAuthorizedParties.includes(payload.azp)) { throw new RPError({ printf: ['azp mismatch, got: %s', payload.azp], jwt, }); } } let key; if (isSelfIssued) { try { assert(isPlainObject(payload.sub_jwk)); key = jose.JWK.asKey(payload.sub_jwk); assert.equal(key.type, 'public'); } catch (err) { throw new RPError({ message: 'failed to use sub_jwk claim as an asymmetric JSON Web Key', jwt, }); } if (key.thumbprint !== payload.sub) { throw new RPError({ message: 'failed to match the subject with sub_jwk', jwt, }); } } else if (header.alg.startsWith('HS')) { key = await this.joseSecret(); } else if (header.alg !== 'none') { key = await this.issuer.queryKeyStore(header); } if (!key && header.alg === 'none') { return { protected: header, payload }; } try { return jose.JWS.verify(jwt, key, { complete: true }); } catch (err) { throw new RPError({ message: 'failed to validate JWT signature', jwt, }); } } /** * @name refresh * @api public */ async refresh(refreshToken, { exchangeBody, clientAssertionPayload } = {}) { let token = refreshToken; if (token instanceof TokenSet) { if (!token.refresh_token) { throw new TypeError('refresh_token not present in TokenSet'); } token = token.refresh_token; } const tokenset = await this.grant({ ...exchangeBody, grant_type: 'refresh_token', refresh_token: String(token), }, { clientAssertionPayload }); if (tokenset.id_token) { await this.decryptIdToken(tokenset); await this.validateIdToken(tokenset, null, 'token', null); if (refreshToken instanceof TokenSet && refreshToken.id_token) { const expectedSub = refreshToken.claims().sub; const actualSub = tokenset.claims().sub; if (actualSub !== expectedSub) { throw new RPError({ printf: ['sub mismatch, expected %s, got: %s', expectedSub, actualSub], jwt: tokenset.id_token, }); } } } return tokenset; } async requestResource( resourceUrl, accessToken, { method, headers, body, tokenType = accessToken instanceof TokenSet ? accessToken.token_type : 'Bearer', } = {}, ) { if (accessToken instanceof TokenSet) { if (!accessToken.access_token) { throw new TypeError('access_token not present in TokenSet'); } accessToken = accessToken.access_token; // eslint-disable-line no-param-reassign } const requestOpts = { headers: { Authorization: authorizationHeaderValue(accessToken, tokenType), ...headers, }, body, }; const mTLS = !!this.tls_client_certificate_bound_access_tokens; return request.call(this, { ...requestOpts, encoding: null, method, url: resourceUrl, }, { mTLS }); } /** * @name userinfo * @api public */ async userinfo(accessToken, { verb = 'GET', via = 'header', tokenType, params, } = {}) { // TODO: in v4.x remove verb in favour of method assertIssuerConfiguration(this.issuer, 'userinfo_endpoint'); const options = { tokenType, method: String(verb).toUpperCase(), }; if (options.method !== 'GET' && options.method !== 'POST') { throw new TypeError('#userinfo() verb can only be POST or a GET'); } if (via === 'query' && options.method !== 'GET') { throw new TypeError('userinfo endpoints will only parse query strings for GET requests'); } else if (via === 'body' && options.method !== 'POST') { throw new TypeError('can only send body on POST'); } const jwt = !!(this.userinfo_signed_response_alg || this.userinfo_encrypted_response_alg); if (jwt) { options.headers = { Accept: 'application/jwt' }; } else { options.headers = { Accept: 'application/json' }; } const mTLS = !!this.tls_client_certificate_bound_access_tokens; let targetUrl; if (mTLS && this.issuer.mtls_endpoint_aliases) { targetUrl = this.issuer.mtls_endpoint_aliases.userinfo_endpoint; } targetUrl = new url.URL(targetUrl || this.issuer.userinfo_endpoint); // when via is not header we clear the Authorization header and add either // query string parameters or urlencoded body access_token parameter if (via === 'query') { options.headers.Authorization = undefined; targetUrl.searchParams.append('access_token', accessToken instanceof TokenSet ? accessToken.access_token : accessToken); } else if (via === 'body') { options.headers.Authorization = undefined; options.headers['Content-Type'] = 'application/x-www-form-urlencoded'; options.body = new url.URLSearchParams(); options.body.append('access_token', accessToken instanceof TokenSet ? accessToken.access_token : accessToken); } // handle additional parameters, GET via querystring, POST via urlencoded body if (params) { if (options.method === 'GET') { Object.entries(params).forEach(([key, value]) => { targetUrl.searchParams.append(key, value); }); } else if (options.body) { // POST && via body Object.entries(params).forEach(([key, value]) => { options.body.append(key, value); }); } else { // POST && via header options.body = new url.URLSearchParams(); options.headers['Content-Type'] = 'application/x-www-form-urlencoded'; Object.entries(params).forEach(([key, value]) => { options.body.append(key, value); }); } } if (options.body) { options.body = options.body.toString(); } const response = await this.requestResource(targetUrl, accessToken, options); let parsed = processResponse(response, { bearer: true }); if (jwt) { if (!JWT_CONTENT.test(response.headers['content-type'])) { throw new RPError({ message: 'expected application/jwt response from the userinfo_endpoint', response, }); } const body = response.body.toString(); const userinfo = await this.decryptJWTUserinfo(body); if (!this.userinfo_signed_response_alg) { try { parsed = JSON.parse(userinfo); assert(isPlainObject(parsed)); } catch (err) { throw new RPError({ message: 'failed to parse userinfo JWE payload as JSON', jwt: userinfo, }); } } else { ({ payload: parsed } = await this.validateJWTUserinfo(userinfo)); } } else { try { parsed = JSON.parse(response.body); } catch (error) { const parseError = new ParseError( error, response.statusCode, response.request.gotOptions, response.body, ); Object.defineProperty(parseError, 'response', { value: response }); throw parseError; } } if (accessToken instanceof TokenSet && accessToken.id_token) { const expectedSub = accessToken.claims().sub; if (parsed.sub !== expectedSub) { throw new RPError({ printf: ['userinfo sub mismatch, expected %s, got: %s', expectedSub, parsed.sub], body: parsed, jwt: accessToken.id_token, }); } } return parsed; } /** * @name derivedKey * @api private */ async derivedKey(len) { const cacheKey = `${len}_key`; if (instance(this).has(cacheKey)) { return instance(this).get(cacheKey); } const hash = len <= 256 ? 'sha256' : len <= 384 ? 'sha384' : len <= 512 ? 'sha512' : false; // eslint-disable-line no-nested-ternary if (!hash) { throw new Error('unsupported symmetric encryption key derivation'); } const derivedBuffer = crypto.createHash(hash) .update(this.client_secret) .digest() .slice(0, len / 8); const key = jose.JWK.asKey({ k: base64url.encode(derivedBuffer), kty: 'oct' }); instance(this).set(cacheKey, key); return key; } /** * @name joseSecret * @api private */ async joseSecret(alg) { if (!this.client_secret) { throw new TypeError('client_secret is required'); } if (/^A(\d{3})(?:GCM)?KW$/.test(alg)) { return this.derivedKey(parseInt(RegExp.$1, 10)); } if (/^A(\d{3})(?:GCM|CBC-HS(\d{3}))$/.test(alg)) { return this.derivedKey(parseInt(RegExp.$2 || RegExp.$1, 10)); } if (instance(this).has('jose_secret')) { return instance(this).get('jose_secret'); } const key = jose.JWK.asKey({ k: base64url.encode(this.client_secret), kty: 'oct' }); instance(this).set('jose_secret', key); return key; } /** * @name grant * @api public */ async grant(body, { clientAssertionPayload } = {}) { assertIssuerConfiguration(this.issuer, 'token_endpoint'); const response = await authenticatedPost.call( this, 'token', { form: true, body, json: true, }, { clientAssertionPayload }, ); const responseBody = processResponse(response); return new TokenSet(responseBody); } /** * @name deviceAuthorization * @api public */ async deviceAuthorization(params = {}, { exchangeBody, clientAssertionPayload } = {}) { assertIssuerConfiguration(this.issuer, 'device_authorization_endpoint'); assertIssuerConfiguration(this.issuer, 'token_endpoint'); const body = authorizationParams.call(this, { client_id: this.client_id, redirect_uri: null, response_type: null, ...params, }); const response = await authenticatedPost.call( this, 'device_authorization', { form: true, body, json: true, }, { clientAssertionPayload, endpointAuthMethod: 'token' }, ); const responseBody = processResponse(response); return new DeviceFlowHandle({ client: this, exchangeBody, clientAssertionPayload, response: responseBody, maxAge: params.max_age, }); } /** * @name revoke * @api public */ async revoke(token, hint, { revokeBody, clientAssertionPayload } = {}) { assertIssuerConfiguration(this.issuer, 'revocation_endpoint'); if (hint !== undefined && typeof hint !== 'string') { throw new TypeError('hint must be a string'); } const body = { ...revokeBody, token }; if (hint) { body.token_type_hint = hint; } const response = await authenticatedPost.call( this, 'revocation', { body, form: true, }, { clientAssertionPayload }, ); processResponse(response, { body: false }); } /** * @name introspect * @api public */ async introspect(token, hint, { introspectBody, clientAssertionPayload } = {}) { assertIssuerConfiguration(this.issuer, 'introspection_endpoint'); if (hint !== undefined && typeof hint !== 'string') { throw new TypeError('hint must be a string'); } const body = { ...introspectBody, token }; if (hint) { body.token_type_hint = hint; } const response = await authenticatedPost.call( this, 'introspection', { body, form: true, json: true }, { clientAssertionPayload }, ); const responseBody = processResponse(response); return responseBody; } /** * @name fetchDistributedClaims * @api public */ async fetchDistributedClaims(claims, tokens = {}) { if (!isPlainObject(claims)) { throw new TypeError('claims argument must be a plain object'); } if (!isPlainObject(claims._claim_sources)) { return claims; } if (!isPlainObject(claims._claim_names)) { return claims; } const distributedSources = Object.entries(claims._claim_sources) .filter(([, value]) => value && value.endpoint); await Promise.all(distributedSources.map(async ([sourceName, def]) => { try { const requestOpts = { headers: { Accept: 'application/jwt', Authorization: authorizationHeaderValue(def.access_token || tokens[sourceName]), }, }; const response = await request.call(this, { ...requestOpts, method: 'GET', url: def.endpoint, }); const body = processResponse(response, { bearer: true }); const decoded = await claimJWT.call(this, 'distributed', body); delete claims._claim_sources[sourceName]; Object.entries(claims._claim_names).forEach( assignClaim(claims, decoded, sourceName, false), ); } catch (err) { err.src = sourceName; throw err; } })); cleanUpClaims(claims); return claims; } /** * @name unpackAggregatedClaims * @api public */ async unpackAggregatedClaims(claims) { if (!isPlainObject(claims)) { throw new TypeError('claims argument must be a plain object'); } if (!isPlainObject(claims._claim_sources)) { return claims; } if (!isPlainObject(claims._claim_names)) { return claims; } const aggregatedSources = Object.entries(claims._claim_sources) .filter(([, value]) => value && value.JWT); await Promise.all(aggregatedSources.map(async ([sourceName, def]) => { try { const decoded = await claimJWT.call(this, 'aggregated', def.JWT); delete claims._claim_sources[sourceName]; Object.entries(claims._claim_names).forEach(assignClaim(claims, decoded, sourceName)); } catch (err) { err.src = sourceName; throw err; } })); cleanUpClaims(claims); return claims; } /** * @name register * @api public */ static async register(metadata, options = {}) { const { initialAccessToken, jwks, ...clientOptions } = options; assertIssuerConfiguration(this.issuer, 'registration_endpoint'); if (jwks !== undefined && !(metadata.jwks || metadata.jwks_uri)) { const keystore = getKeystore.call(this, jwks); metadata.jwks = keystore.toJWKS(false); } const response = await request.call(this, { headers: initialAccessToken ? { Authorization: authorizationHeaderValue(initialAccessToken), } : undefined, json: true, body: metadata, url: this.issuer.registration_endpoint, method: 'POST', }); const responseBody = processResponse(response, { statusCode: 201, bearer: true }); return new this(responseBody, jwks, clientOptions); } /** * @name metadata * @api public */ get metadata() { const copy = {}; instance(this).get('metadata').forEach((value, key) => { copy[key] = value; }); return copy; } /** * @name fromUri * @api public */ static async fromUri(registrationClientUri, registrationAccessToken, jwks, clientOptions) { const response = await request.call(this, { method: 'GET', url: registrationClientUri, json: true, headers: { Authorization: authorizationHeaderValue(registrationAccessToken) }, }); const responseBody = processResponse(response, { bearer: true }); return new this(responseBody, jwks, clientOptions); } /** * @name requestObject * @api public */ async requestObject(requestObject = {}, { sign: signingAlgorithm = this.request_object_signing_alg || 'none', encrypt: { alg: eKeyManagement = this.request_object_encryption_alg, enc: eContentEncryption = this.request_object_encryption_enc || 'A128CBC-HS256', } = {}, } = {}) { if (!isPlainObject(requestObject)) { throw new TypeError('requestObject must be a plain object'); } let signed; let key; const header = { alg: signingAlgorithm, typ: 'JWT' }; const payload = JSON.stringify(defaults({}, requestObject, { iss: this.client_id, aud: this.issuer.issuer, client_id: this.client_id, jti: random(), iat: now(), exp: now() + 300, })); if (signingAlgorithm === 'none') { signed = [ base64url.encode(JSON.stringify(header)), base64url.encode(payload), '', ].join('.'); } else { const symmetric = signingAlgorithm.startsWith('HS'); if (symmetric) { key = await this.joseSecret(); } else { const keystore = instance(this).get('keystore'); if (!keystore) { throw new TypeError(`no keystore present for client, cannot sign using alg ${signingAlgorithm}`); } key = keystore.get({ alg: signingAlgorithm, use: 'sig' }); if (!key) { throw new TypeError(`no key to sign with found for alg ${signingAlgorithm}`); } } signed = jose.JWS.sign(payload, key, { ...header, kid: symmetric ? undefined : key.kid, }); } if (!eKeyManagement) { return signed; } const fields = { alg: eKeyManagement, enc: eContentEncryption, cty: 'JWT' }; if (fields.alg.match(/^(RSA|ECDH)/)) { [key] = await this.issuer.queryKeyStore({ alg: fields.alg, enc: fields.enc, use: 'enc', }, { allowMulti: true }); } else { key = await this.joseSecret(fields.alg === 'dir' ? fields.enc : fields.alg); } return jose.JWE.encrypt(signed, key, { ...fields, kid: key.kty === 'oct' ? undefined : key.kid, }); } /** * @name issuer * @api public */ static get issuer() { return issuer; } /** * @name issuer * @api public */ get issuer() { // eslint-disable-line class-methods-use-this return issuer; } /* istanbul ignore next */ [inspect.custom]() { return `${this.constructor.name} ${inspect(this.metadata, { depth: Infinity, colors: process.stdout.isTTY, compact: false, sorted: true, })}`; } }; // TODO: remove in 4.x BaseClient.prototype.resource = deprecate( /* istanbul ignore next */ async function resource(resourceUrl, accessToken, options) { let token = accessToken; const opts = { verb: 'GET', via: 'header', ...options, }; if (token instanceof TokenSet) { if (!token.access_token) { throw new TypeError('access_token not present in TokenSet'); } opts.tokenType = opts.tokenType || token.token_type; token = token.access_token; } const verb = String(opts.verb).toUpperCase(); let requestOpts; switch (opts.via) { case 'query': if (verb !== 'GET') { throw new TypeError('resource servers should only parse query strings for GET requests'); } requestOpts = { query: { access_token: token } }; break; case 'body': if (verb !== 'POST') { throw new TypeError('can only send body on POST'); } requestOpts = { form: true, body: { access_token: token } }; break; default: requestOpts = { headers: { Authorization: authorizationHeaderValue(token, opts.tokenType), }, }; } if (opts.params) { if (verb === 'POST') { defaultsDeep(requestOpts, { body: opts.params }); } else { defaultsDeep(requestOpts, { query: opts.params }); } } if (opts.headers) { defaultsDeep(requestOpts, { headers: opts.headers }); } const mTLS = !!this.tls_client_certificate_bound_access_tokens; return request.call(this, { ...requestOpts, encoding: null, method: verb, url: resourceUrl, }, { mTLS }); }, 'client.resource() is deprecated, use client.requestResource() instead, see docs for API details', ); module.exports.BaseClient = BaseClient; /***/ }), /***/ 23979: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { /* eslint-disable camelcase */ const { inspect } = __webpack_require__(31669); const { RPError, OPError } = __webpack_require__(45061); const instance = __webpack_require__(36546); const now = __webpack_require__(8542); const { authenticatedPost } = __webpack_require__(7619); const processResponse = __webpack_require__(28576); const TokenSet = __webpack_require__(39029); class DeviceFlowHandle { constructor({ client, exchangeBody, clientAssertionPayload, response, maxAge, }) { ['verification_uri', 'user_code', 'device_code'].forEach((prop) => { if (typeof response[prop] !== 'string' || !response[prop]) { throw new RPError(`expected ${prop} string to be returned by Device Authorization Response, got %j`, response[prop]); } }); if (!Number.isSafeInteger(response.expires_in)) { throw new RPError('expected expires_in number to be returned by Device Authorization Response, got %j', response.expires_in); } instance(this).expires_at = now() + response.expires_in; instance(this).client = client; instance(this).maxAge = maxAge; instance(this).exchangeBody = exchangeBody; instance(this).clientAssertionPayload = clientAssertionPayload; instance(this).response = response; instance(this).interval = response.interval * 1000 || 5000; } async poll() { if (this.expired()) { throw new RPError('the device code %j has expired and the device authorization session has concluded', this.device_code); } await new Promise((resolve) => setTimeout(resolve, instance(this).interval)); const response = await authenticatedPost.call( instance(this).client, 'token', { form: true, body: { ...instance(this).exchangeBody, grant_type: 'urn:ietf:params:oauth:grant-type:device_code', device_code: this.device_code, }, json: true, }, { clientAssertionPayload: instance(this).clientAssertionPayload }, ); let responseBody; try { responseBody = processResponse(response); } catch (err) { switch (err instanceof OPError && err.error) { case 'slow_down': instance(this).interval += 5000; case 'authorization_pending': // eslint-disable-line no-fallthrough return this.poll(); default: throw err; } } const tokenset = new TokenSet(responseBody); if ('id_token' in tokenset) { await instance(this).client.decryptIdToken(tokenset); await instance(this).client.validateIdToken(tokenset, undefined, 'token', instance(this).maxAge); } return tokenset; } get device_code() { return instance(this).response.device_code; } get user_code() { return instance(this).response.user_code; } get verification_uri() { return instance(this).response.verification_uri; } get verification_uri_complete() { return instance(this).response.verification_uri_complete; } get expires_in() { return Math.max.apply(null, [instance(this).expires_at - now(), 0]); } expired() { return this.expires_in === 0; } /* istanbul ignore next */ [inspect.custom]() { return `${this.constructor.name} ${inspect(instance(this).response, { depth: Infinity, colors: process.stdout.isTTY, compact: false, sorted: true, })}`; } } module.exports = DeviceFlowHandle; /***/ }), /***/ 45061: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { /* eslint-disable camelcase */ const { format } = __webpack_require__(31669); const makeError = __webpack_require__(21381); function OPError({ error_description, error, error_uri, session_state, state, scope, }, response) { OPError.super.call(this, !error_description ? error : `${error} (${error_description})`); Object.assign( this, { error }, (error_description && { error_description }), (error_uri && { error_uri }), (state && { state }), (scope && { scope }), (session_state && { session_state }), ); if (response) { Object.defineProperty(this, 'response', { value: response, }); } } makeError(OPError); function RPError(...args) { if (typeof args[0] === 'string') { RPError.super.call(this, format(...args)); } else { const { message, printf, response, ...rest } = args[0]; if (printf) { RPError.super.call(this, format(...printf)); } else { RPError.super.call(this, message); } Object.assign(this, rest); if (response) { Object.defineProperty(this, 'response', { value: response, }); } } } makeError(RPError); module.exports = { OPError, RPError, }; /***/ }), /***/ 63217: /***/ ((module) => { function assertSigningAlgValuesSupport(endpoint, issuer, properties) { if (!issuer[`${endpoint}_endpoint`]) return; const eam = `${endpoint}_endpoint_auth_method`; const easa = `${endpoint}_endpoint_auth_signing_alg`; const easavs = `${endpoint}_endpoint_auth_signing_alg_values_supported`; if (properties[eam] && properties[eam].endsWith('_jwt') && !properties[easa] && !issuer[easavs]) { throw new TypeError(`${easavs} must be configured on the issuer if ${easa} is not defined on a client`); } } function assertIssuerConfiguration(issuer, endpoint) { if (!issuer[endpoint]) { throw new TypeError(`${endpoint} must be configured on the issuer`); } } module.exports = { assertSigningAlgValuesSupport, assertIssuerConfiguration, }; /***/ }), /***/ 7619: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { const jose = __webpack_require__(16425); const { assertIssuerConfiguration } = __webpack_require__(63217); const { random } = __webpack_require__(75421); const now = __webpack_require__(8542); const request = __webpack_require__(92946); const instance = __webpack_require__(36546); const merge = __webpack_require__(2494); const formUrlEncode = (value) => encodeURIComponent(value).replace(/%20/g, '+'); async function clientAssertion(endpoint, payload) { let alg = this[`${endpoint}_endpoint_auth_signing_alg`]; if (!alg) { assertIssuerConfiguration(this.issuer, `${endpoint}_endpoint_auth_signing_alg_values_supported`); } if (this[`${endpoint}_endpoint_auth_method`] === 'client_secret_jwt') { const key = await this.joseSecret(); if (!alg) { const supported = this.issuer[`${endpoint}_endpoint_auth_signing_alg_values_supported`]; alg = Array.isArray(supported) && supported.find((signAlg) => key.algorithms('sign').has(signAlg)); } return jose.JWS.sign(payload, key, { alg, typ: 'JWT' }); } const keystore = instance(this).get('keystore'); if (!keystore) { throw new TypeError('no client jwks provided for signing a client assertion with'); } if (!alg) { const algs = new Set(); keystore.all().forEach((key) => { key.algorithms('sign').forEach(Set.prototype.add.bind(algs)); }); const supported = this.issuer[`${endpoint}_endpoint_auth_signing_alg_values_supported`]; alg = Array.isArray(supported) && supported.find((signAlg) => algs.has(signAlg)); } const key = keystore.get({ alg, use: 'sig' }); if (!key) { throw new TypeError(`no key found in client jwks to sign a client assertion with using alg ${alg}`); } return jose.JWS.sign(payload, key, { alg, typ: 'JWT', kid: key.kid }); } async function authFor(endpoint, { clientAssertionPayload } = {}) { const authMethod = this[`${endpoint}_endpoint_auth_method`]; switch (authMethod) { case 'self_signed_tls_client_auth': case 'tls_client_auth': case 'none': return { body: { client_id: this.client_id } }; case 'client_secret_post': if (!this.client_secret) { throw new TypeError('client_secret_post client authentication method requires a client_secret'); } return { body: { client_id: this.client_id, client_secret: this.client_secret } }; case 'private_key_jwt': case 'client_secret_jwt': { const timestamp = now(); const assertion = await clientAssertion.call(this, endpoint, { iat: timestamp, exp: timestamp + 60, jti: random(), iss: this.client_id, sub: this.client_id, aud: this.issuer[`${endpoint}_endpoint`], // TODO: in v4.x pass the issuer instead (for now clientAssertionPayload can be used for that) ...clientAssertionPayload, }); return { body: { client_id: this.client_id, client_assertion: assertion, client_assertion_type: 'urn:ietf:params:oauth:client-assertion-type:jwt-bearer', }, }; } default: { // client_secret_basic // This is correct behaviour, see https://tools.ietf.org/html/rfc6749#section-2.3.1 and the // related appendix. (also https://github.com/panva/node-openid-client/pull/91) // > The client identifier is encoded using the // > "application/x-www-form-urlencoded" encoding algorithm per // > Appendix B, and the encoded value is used as the username; the client // > password is encoded using the same algorithm and used as the // > password. if (!this.client_secret) { throw new TypeError('client_secret_basic client authentication method requires a client_secret'); } const encoded = `${formUrlEncode(this.client_id)}:${formUrlEncode(this.client_secret)}`; const value = Buffer.from(encoded).toString('base64'); return { headers: { Authorization: `Basic ${value}` } }; } } } function resolveResponseType() { const { length, 0: value } = this.response_types; if (length === 1) { return value; } return undefined; } function resolveRedirectUri() { const { length, 0: value } = this.redirect_uris || []; if (length === 1) { return value; } return undefined; } async function authenticatedPost(endpoint, opts, { clientAssertionPayload, endpointAuthMethod = endpoint, } = {}) { const auth = await authFor.call(this, endpointAuthMethod, { clientAssertionPayload }); const requestOpts = merge(opts, auth, { form: true }); const mTLS = this[`${endpointAuthMethod}_endpoint_auth_method`].includes('tls_client_auth') || (endpoint === 'token' && this.tls_client_certificate_bound_access_tokens); let targetUrl; if (mTLS && this.issuer.mtls_endpoint_aliases) { targetUrl = this.issuer.mtls_endpoint_aliases[`${endpoint}_endpoint`]; } targetUrl = targetUrl || this.issuer[`${endpoint}_endpoint`]; if ('body' in requestOpts) { for (const [key, value] of Object.entries(requestOpts.body)) { // eslint-disable-line no-restricted-syntax, max-len if (typeof value === 'undefined') { delete requestOpts.body[key]; } } } return request.call(this, { ...requestOpts, method: 'POST', url: targetUrl, }, { mTLS }); } module.exports = { resolveResponseType, resolveRedirectUri, authFor, authenticatedPost, }; /***/ }), /***/ 27556: /***/ ((module) => { const OIDC_DISCOVERY = '/.well-known/openid-configuration'; const OAUTH2_DISCOVERY = '/.well-known/oauth-authorization-server'; const WEBFINGER = '/.well-known/webfinger'; const REL = 'http://openid.net/specs/connect/1.0/issuer'; const AAD_MULTITENANT_DISCOVERY = [ `https://login.microsoftonline.com/common${OIDC_DISCOVERY}`, `https://login.microsoftonline.com/common/v2.0${OIDC_DISCOVERY}`, `https://login.microsoftonline.com/organizations/v2.0${OIDC_DISCOVERY}`, `https://login.microsoftonline.com/consumers/v2.0${OIDC_DISCOVERY}`, ]; const CLIENT_DEFAULTS = { grant_types: ['authorization_code'], id_token_signed_response_alg: 'RS256', authorization_signed_response_alg: 'RS256', response_types: ['code'], token_endpoint_auth_method: 'client_secret_basic', }; const ISSUER_DEFAULTS = { claim_types_supported: ['normal'], claims_parameter_supported: false, grant_types_supported: ['authorization_code', 'implicit'], request_parameter_supported: false, request_uri_parameter_supported: true, require_request_uri_registration: false, response_modes_supported: ['query', 'fragment'], token_endpoint_auth_methods_supported: ['client_secret_basic'], }; const CALLBACK_PROPERTIES = [ 'access_token', // 6749 'code', // 6749 'error', // 6749 'error_description', // 6749 'error_uri', // 6749 'expires_in', // 6749 'id_token', // Core 1.0 'state', // 6749 'token_type', // 6749 'session_state', // Session Management 'response', // JARM ]; const JWT_CONTENT = /^application\/jwt/; const HTTP_OPTIONS = Symbol('openid-client.custom.http-options'); const CLOCK_TOLERANCE = Symbol('openid-client.custom.clock-tolerance'); module.exports = { AAD_MULTITENANT_DISCOVERY, CALLBACK_PROPERTIES, CLIENT_DEFAULTS, CLOCK_TOLERANCE, HTTP_OPTIONS, ISSUER_DEFAULTS, JWT_CONTENT, OAUTH2_DISCOVERY, OIDC_DISCOVERY, REL, WEBFINGER, }; /***/ }), /***/ 21004: /***/ ((module) => { module.exports = (obj) => JSON.parse(JSON.stringify(obj)); /***/ }), /***/ 26457: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { /* eslint-disable no-restricted-syntax, no-continue */ const isPlainObject = __webpack_require__(39862); function defaults(deep, target, ...sources) { for (const source of sources) { if (!isPlainObject(source)) { continue; } for (const [key, value] of Object.entries(source)) { /* istanbul ignore if */ if (key === '__proto__' || key === 'constructor') { continue; } if (typeof target[key] === 'undefined' && typeof value !== 'undefined') { target[key] = value; } if (deep && isPlainObject(target[key]) && isPlainObject(value)) { defaults(true, target[key], value); } } } return target; } module.exports = defaults.bind(undefined, false); module.exports.deep = defaults.bind(undefined, true); /***/ }), /***/ 75421: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { const { createHash, randomBytes } = __webpack_require__(33373); const { encode: base64url } = __webpack_require__(27291); const random = (bytes = 32) => base64url(randomBytes(bytes)); module.exports = { random, state: random, nonce: random, codeVerifier: random, codeChallenge: (codeVerifier) => base64url(createHash('sha256').update(codeVerifier).digest()), }; /***/ }), /***/ 61797: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { const url = __webpack_require__(78835); const { strict: assert } = __webpack_require__(42357); module.exports = (target) => { try { const { protocol } = new url.URL(target); assert(protocol.match(/^(https?:)$/)); return true; } catch (err) { throw new TypeError('only valid absolute URLs can be requested'); } }; /***/ }), /***/ 39862: /***/ ((module) => { module.exports = (a) => !!a && a.constructor === Object; /***/ }), /***/ 2494: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { /* eslint-disable no-restricted-syntax, no-param-reassign, no-continue */ const isPlainObject = __webpack_require__(39862); function merge(target, ...sources) { for (const source of sources) { if (!isPlainObject(source)) { continue; } for (const [key, value] of Object.entries(source)) { /* istanbul ignore if */ if (key === '__proto__' || key === 'constructor') { continue; } if (isPlainObject(target[key]) && isPlainObject(value)) { target[key] = merge(target[key], value); } else if (typeof value !== 'undefined') { target[key] = value; } } } return target; } module.exports = merge; /***/ }), /***/ 78857: /***/ ((module) => { module.exports = function pick(object, ...paths) { const obj = {}; for (const path of paths) { // eslint-disable-line no-restricted-syntax if (object[path]) { obj[path] = object[path]; } } return obj; }; /***/ }), /***/ 28576: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { const { STATUS_CODES } = __webpack_require__(98605); const { format } = __webpack_require__(31669); const { OPError } = __webpack_require__(45061); const REGEXP = /(\w+)=("[^"]*")/g; const throwAuthenticateErrors = (response) => { const params = {}; try { while ((REGEXP.exec(response.headers['www-authenticate'])) !== null) { if (RegExp.$1 && RegExp.$2) { params[RegExp.$1] = RegExp.$2.slice(1, -1); } } } catch (err) {} if (params.error) { throw new OPError(params, response); } }; const isStandardBodyError = (response) => { let result = false; try { let jsonbody; if (typeof response.body !== 'object' || Buffer.isBuffer(response.body)) { jsonbody = JSON.parse(response.body); } else { jsonbody = response.body; } result = typeof jsonbody.error === 'string' && jsonbody.error.length; if (result) response.body = jsonbody; } catch (err) {} return result; }; function processResponse(response, { statusCode = 200, body = true, bearer = false } = {}) { if (response.statusCode !== statusCode) { if (bearer) { throwAuthenticateErrors(response); } if (isStandardBodyError(response)) { throw new OPError(response.body, response); } throw new OPError({ error: format('expected %i %s, got: %i %s', statusCode, STATUS_CODES[statusCode], response.statusCode, STATUS_CODES[response.statusCode]), }, response); } if (body && !response.body) { throw new OPError({ error: format('expected %i %s with body but no body was returned', statusCode, STATUS_CODES[statusCode]), }, response); } return response.body; } module.exports = processResponse; /***/ }), /***/ 92946: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { const Got = __webpack_require__(44462); const pkg = __webpack_require__(76710); const { deep: defaultsDeep } = __webpack_require__(26457); const isAbsoluteUrl = __webpack_require__(61797); const { HTTP_OPTIONS } = __webpack_require__(27556); let DEFAULT_HTTP_OPTIONS; let got; const setDefaults = (options) => { DEFAULT_HTTP_OPTIONS = defaultsDeep({}, options, DEFAULT_HTTP_OPTIONS); got = Got.extend(DEFAULT_HTTP_OPTIONS); }; setDefaults({ followRedirect: false, headers: { 'User-Agent': `${pkg.name}/${pkg.version} (${pkg.homepage})` }, retry: 0, timeout: 2500, throwHttpErrors: false, }); module.exports = function request(options, { mTLS = false } = {}) { const { url } = options; isAbsoluteUrl(url); const optsFn = this[HTTP_OPTIONS]; let opts; if (optsFn) { opts = optsFn.call(this, defaultsDeep({}, options, DEFAULT_HTTP_OPTIONS)); } else { opts = options; } if (mTLS && (!opts.key || !opts.cert)) { throw new TypeError('mutual-TLS certificate and key not set'); } return got(opts); }; module.exports.setDefaults = setDefaults; /***/ }), /***/ 8542: /***/ ((module) => { module.exports = () => Math.floor(Date.now() / 1000); /***/ }), /***/ 36546: /***/ ((module) => { const privateProps = new WeakMap(); module.exports = (ctx) => { if (!privateProps.has(ctx)) { privateProps.set(ctx, new Map([['metadata', new Map()]])); } return privateProps.get(ctx); }; /***/ }), /***/ 27416: /***/ ((module) => { // Credit: https://github.com/rohe/pyoidc/blob/master/src/oic/utils/webfinger.py // -- Normalization -- // A string of any other type is interpreted as a URI either the form of scheme // "://" authority path-abempty [ "?" query ] [ "#" fragment ] or authority // path-abempty [ "?" query ] [ "#" fragment ] per RFC 3986 [RFC3986] and is // normalized according to the following rules: // // If the user input Identifier does not have an RFC 3986 [RFC3986] scheme // portion, the string is interpreted as [userinfo "@"] host [":" port] // path-abempty [ "?" query ] [ "#" fragment ] per RFC 3986 [RFC3986]. // If the userinfo component is present and all of the path component, query // component, and port component are empty, the acct scheme is assumed. In this // case, the normalized URI is formed by prefixing acct: to the string as the // scheme. Per the 'acct' URI Scheme [I‑D.ietf‑appsawg‑acct‑uri], if there is an // at-sign character ('@') in the userinfo component, it needs to be // percent-encoded as described in RFC 3986 [RFC3986]. // For all other inputs without a scheme portion, the https scheme is assumed, // and the normalized URI is formed by prefixing https:// to the string as the // scheme. // If the resulting URI contains a fragment portion, it MUST be stripped off // together with the fragment delimiter character "#". // The WebFinger [I‑D.ietf‑appsawg‑webfinger] Resource in this case is the // resulting URI, and the WebFinger Host is the authority component. // // Note: Since the definition of authority in RFC 3986 [RFC3986] is // [ userinfo "@" ] host [ ":" port ], it is legal to have a user input // identifier like userinfo@host:port, e.g., alice@example.com:8080. const PORT = /^\d+$/; function hasScheme(input) { if (input.includes('://')) return true; const authority = input.replace(/(\/|\?)/g, '#').split('#')[0]; if (authority.includes(':')) { const index = authority.indexOf(':'); const hostOrPort = authority.slice(index + 1); if (!PORT.test(hostOrPort)) { return true; } } return false; } function acctSchemeAssumed(input) { if (!input.includes('@')) return false; const parts = input.split('@'); const host = parts[parts.length - 1]; return !(host.includes(':') || host.includes('/') || host.includes('?')); } function normalize(input) { if (typeof input !== 'string') { throw new TypeError('input must be a string'); } let output; if (hasScheme(input)) { output = input; } else if (acctSchemeAssumed(input)) { output = `acct:${input}`; } else { output = `https://${input}`; } return output.split('#')[0]; } module.exports = normalize; /***/ }), /***/ 53140: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { const Issuer = __webpack_require__(27213); const { OPError, RPError } = __webpack_require__(45061); const Registry = __webpack_require__(30730); const Strategy = __webpack_require__(22134); const TokenSet = __webpack_require__(39029); const { CLOCK_TOLERANCE, HTTP_OPTIONS } = __webpack_require__(27556); const generators = __webpack_require__(75421); const { setDefaults } = __webpack_require__(92946); module.exports = { Issuer, Registry, Strategy, TokenSet, errors: { OPError, RPError, }, custom: { setHttpOptionsDefaults: setDefaults, http_options: HTTP_OPTIONS, clock_tolerance: CLOCK_TOLERANCE, }, generators, }; /***/ }), /***/ 27213: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { /* eslint-disable max-classes-per-file */ const { inspect, deprecate } = __webpack_require__(31669); const url = __webpack_require__(78835); const jose = __webpack_require__(16425); const pAny = __webpack_require__(56693); const LRU = __webpack_require__(7129); const objectHash = __webpack_require__(24856); const { RPError } = __webpack_require__(45061); const getClient = __webpack_require__(28300); const registry = __webpack_require__(30730); const processResponse = __webpack_require__(28576); const webfingerNormalize = __webpack_require__(27416); const instance = __webpack_require__(36546); const request = __webpack_require__(92946); const { assertIssuerConfiguration } = __webpack_require__(63217); const { ISSUER_DEFAULTS, OIDC_DISCOVERY, OAUTH2_DISCOVERY, WEBFINGER, REL, AAD_MULTITENANT_DISCOVERY, } = __webpack_require__(27556); const AAD_MULTITENANT = Symbol('AAD_MULTITENANT'); class Issuer { /** * @name constructor * @api public */ constructor(meta = {}) { const aadIssValidation = meta[AAD_MULTITENANT]; delete meta[AAD_MULTITENANT]; ['introspection', 'revocation'].forEach((endpoint) => { // if intro/revocation endpoint auth specific meta is missing use the token ones if they // are defined if ( meta[`${endpoint}_endpoint`] && meta[`${endpoint}_endpoint_auth_methods_supported`] === undefined && meta[`${endpoint}_endpoint_auth_signing_alg_values_supported`] === undefined ) { if (meta.token_endpoint_auth_methods_supported) { meta[`${endpoint}_endpoint_auth_methods_supported`] = meta.token_endpoint_auth_methods_supported; } if (meta.token_endpoint_auth_signing_alg_values_supported) { meta[`${endpoint}_endpoint_auth_signing_alg_values_supported`] = meta.token_endpoint_auth_signing_alg_values_supported; } } }); Object.entries(meta).forEach(([key, value]) => { instance(this).get('metadata').set(key, value); if (!this[key]) { Object.defineProperty(this, key, { get() { return instance(this).get('metadata').get(key); }, enumerable: true, }); } }); instance(this).set('cache', new LRU({ max: 100 })); registry.set(this.issuer, this); Object.defineProperty(this, 'Client', { value: getClient(this, aadIssValidation), }); Object.defineProperty(this, 'FAPIClient', { value: class FAPIClient extends this.Client {}, }); } /** * @name keystore * @api public */ async keystore(reload = false) { assertIssuerConfiguration(this, 'jwks_uri'); const keystore = instance(this).get('keystore'); const cache = instance(this).get('cache'); if (reload || !keystore) { cache.reset(); const response = await request.call(this, { method: 'GET', json: true, url: this.jwks_uri, }); const jwks = processResponse(response); const joseKeyStore = jose.JWKS.asKeyStore(jwks, { ignoreErrors: true }); cache.set('throttle', true, 60 * 1000); instance(this).set('keystore', joseKeyStore); return joseKeyStore; } return keystore; } /** * @name queryKeyStore * @api private */ async queryKeyStore({ kid, kty, alg, use, key_ops: ops, }, { allowMulti = false } = {}) { const cache = instance(this).get('cache'); const def = { kid, kty, alg, use, key_ops: ops, }; const defHash = objectHash(def, { algorithm: 'sha256', ignoreUnknown: true, unorderedArrays: true, unorderedSets: true, }); // refresh keystore on every unknown key but also only upto once every minute const freshJwksUri = cache.get(defHash) || cache.get('throttle'); const keystore = await this.keystore(!freshJwksUri); const keys = keystore.all(def); if (keys.length === 0) { throw new RPError({ printf: ["no valid key found in issuer's jwks_uri for key parameters %j", def], jwks: keystore, }); } if (!allowMulti && keys.length > 1 && !kid) { throw new RPError({ printf: ["multiple matching keys found in issuer's jwks_uri for key parameters %j, kid must be provided in this case", def], jwks: keystore, }); } cache.set(defHash, true); return new jose.JWKS.KeyStore(keys); } /** * @name metadata * @api public */ get metadata() { const copy = {}; instance(this).get('metadata').forEach((value, key) => { copy[key] = value; }); return copy; } /** * @name webfinger * @api public */ static async webfinger(input) { const resource = webfingerNormalize(input); const { host } = url.parse(resource); const webfingerUrl = `https://${host}${WEBFINGER}`; const response = await request.call(this, { method: 'GET', url: webfingerUrl, json: true, query: { resource, rel: REL }, followRedirect: true, }); const body = processResponse(response); const location = Array.isArray(body.links) && body.links.find((link) => typeof link === 'object' && link.rel === REL && link.href); if (!location) { throw new RPError({ message: 'no issuer found in webfinger response', body, }); } if (typeof location.href !== 'string' || !location.href.startsWith('https://')) { throw new RPError({ printf: ['invalid issuer location %s', location.href], body, }); } const expectedIssuer = location.href; if (registry.has(expectedIssuer)) { return registry.get(expectedIssuer); } const issuer = await this.discover(expectedIssuer); if (issuer.issuer !== expectedIssuer) { registry.delete(issuer.issuer); throw new RPError('discovered issuer mismatch, expected %s, got: %s', expectedIssuer, issuer.issuer); } return issuer; } /** * @name discover * @api public */ static async discover(uri) { const parsed = url.parse(uri); if (parsed.pathname.includes('/.well-known/')) { const response = await request.call(this, { method: 'GET', json: true, url: uri, }); const body = processResponse(response); return new Issuer({ ...ISSUER_DEFAULTS, ...body, [AAD_MULTITENANT]: !!AAD_MULTITENANT_DISCOVERY.find( (discoveryURL) => uri.startsWith(discoveryURL), ), }); } const uris = []; if (parsed.pathname === '/') { uris.push(`${OAUTH2_DISCOVERY}`); } else { uris.push(`${OAUTH2_DISCOVERY}${parsed.pathname}`); } if (parsed.pathname.endsWith('/')) { uris.push(`${parsed.pathname}${OIDC_DISCOVERY.substring(1)}`); } else { uris.push(`${parsed.pathname}${OIDC_DISCOVERY}`); } return pAny(uris.map(async (pathname) => { const wellKnownUri = url.format({ ...parsed, pathname }); const response = await request.call(this, { method: 'GET', json: true, url: wellKnownUri, }); const body = processResponse(response); return new Issuer({ ...ISSUER_DEFAULTS, ...body, [AAD_MULTITENANT]: !!AAD_MULTITENANT_DISCOVERY.find( (discoveryURL) => wellKnownUri.startsWith(discoveryURL), ), }); })); } /* istanbul ignore next */ [inspect.custom]() { return `${this.constructor.name} ${inspect(this.metadata, { depth: Infinity, colors: process.stdout.isTTY, compact: false, sorted: true, })}`; } } /** * @name key * @api private */ Issuer.prototype.key = deprecate(async function key({ kid, kty, alg, use, key_ops: ops, }, allowMulti = false) { const cache = instance(this).get('cache'); const def = { kid, kty, alg, use, key_ops: ops, }; const defHash = objectHash(def, { algorithm: 'sha256', ignoreUnknown: true, unorderedArrays: true, unorderedSets: true, }); // refresh keystore on every unknown key but also only upto once every minute const freshJwksUri = cache.get(defHash) || cache.get('throttle'); const keystore = await this.keystore(!freshJwksUri); const keys = keystore.all(def); if (keys.length === 0) { throw new RPError({ printf: ["no valid key found in issuer's jwks_uri for key parameters %j", def], jwks: keystore, }); } if (!allowMulti) { if (keys.length !== 1) { throw new RPError({ printf: ["multiple matching keys found in issuer's jwks_uri for key parameters %j, kid must be provided in this case", def], jwks: keystore, }); } cache.set(defHash, true); } return keys[0]; }, 'issuer.key is not only a private API, it is also deprecated'); module.exports = Issuer; /***/ }), /***/ 30730: /***/ ((module) => { const REGISTRY = new Map(); module.exports = REGISTRY; /***/ }), /***/ 22134: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { /* eslint-disable no-underscore-dangle */ const url = __webpack_require__(78835); const { format } = __webpack_require__(31669); const cloneDeep = __webpack_require__(21004); const { RPError, OPError } = __webpack_require__(45061); const { BaseClient } = __webpack_require__(28300); const { random, codeChallenge } = __webpack_require__(75421); const pick = __webpack_require__(78857); const { resolveResponseType, resolveRedirectUri } = __webpack_require__(7619); function verified(err, user, info = {}) { if (err) { this.error(err); } else if (!user) { this.fail(info); } else { this.success(user, info); } } /** * @name constructor * @api public */ function OpenIDConnectStrategy({ client, params = {}, passReqToCallback = false, sessionKey, usePKCE = false, } = {}, verify) { if (!(client instanceof BaseClient)) { throw new TypeError('client must be an instance of openid-client Client'); } if (typeof verify !== 'function') { throw new TypeError('verify callback must be a function'); } if (!client.issuer || !client.issuer.issuer) { throw new TypeError('client must have an issuer with an identifier'); } this._client = client; this._issuer = client.issuer; this._verify = verify; this._passReqToCallback = passReqToCallback; this._usePKCE = usePKCE; this._key = sessionKey || `oidc:${url.parse(this._issuer.issuer).hostname}`; this._params = cloneDeep(params); if (this._usePKCE === true) { const supportedMethods = this._issuer.code_challenge_methods_supported; if (!Array.isArray(supportedMethods)) { throw new TypeError('code_challenge_methods_supported is not properly set on issuer'); } if (supportedMethods.includes('S256')) { this._usePKCE = 'S256'; } else if (supportedMethods.includes('plain')) { this._usePKCE = 'plain'; } else { throw new TypeError('neither supported code_challenge_method is supported by the issuer'); } } else if (typeof this._usePKCE === 'string' && !['plain', 'S256'].includes(this._usePKCE)) { throw new TypeError(`${this._usePKCE} is not valid/implemented PKCE code_challenge_method`); } this.name = url.parse(client.issuer.issuer).hostname; if (!this._params.response_type) this._params.response_type = resolveResponseType.call(client); if (!this._params.redirect_uri) this._params.redirect_uri = resolveRedirectUri.call(client); if (!this._params.scope) this._params.scope = 'openid'; } OpenIDConnectStrategy.prototype.authenticate = function authenticate(req, options) { (async () => { const client = this._client; if (!req.session) { throw new TypeError('authentication requires session support'); } const reqParams = client.callbackParams(req); const sessionKey = this._key; /* start authentication request */ if (Object.keys(reqParams).length === 0) { // provide options object with extra authentication parameters const params = { state: random(), ...this._params, ...options, }; if (!params.nonce && params.response_type.includes('id_token')) { params.nonce = random(); } req.session[sessionKey] = pick(params, 'nonce', 'state', 'max_age', 'response_type'); if (this._usePKCE) { const verifier = random(); req.session[sessionKey].code_verifier = verifier; switch (this._usePKCE) { // eslint-disable-line default-case case 'S256': params.code_challenge = codeChallenge(verifier); params.code_challenge_method = 'S256'; break; case 'plain': params.code_challenge = verifier; break; } } this.redirect(client.authorizationUrl(params)); return; } /* end authentication request */ /* start authentication response */ const session = req.session[sessionKey]; if (Object.keys(session || {}).length === 0) { throw new Error(format('did not find expected authorization request details in session, req.session["%s"] is %j', sessionKey, session)); } const { state, nonce, max_age: maxAge, code_verifier: codeVerifier, response_type: responseType, } = session; try { delete req.session[sessionKey]; } catch (err) {} const opts = { redirect_uri: this._params.redirect_uri, ...options, }; const checks = { state, nonce, max_age: maxAge, code_verifier: codeVerifier, response_type: responseType, }; const tokenset = await client.callback(opts.redirect_uri, reqParams, checks); const passReq = this._passReqToCallback; const loadUserinfo = this._verify.length > (passReq ? 3 : 2) && client.issuer.userinfo_endpoint; const args = [tokenset, verified.bind(this)]; if (loadUserinfo) { if (!tokenset.access_token) { throw new RPError({ message: 'expected access_token to be returned when asking for userinfo in verify callback', tokenset, }); } const userinfo = await client.userinfo(tokenset); args.splice(1, 0, userinfo); } if (passReq) { args.unshift(req); } this._verify(...args); /* end authentication response */ })().catch((error) => { if ( (error instanceof OPError && error.error !== 'server_error' && !error.error.startsWith('invalid')) || error instanceof RPError ) { this.fail(error); } else { this.error(error); } }); }; module.exports = OpenIDConnectStrategy; /***/ }), /***/ 39029: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { const base64url = __webpack_require__(27291); const now = __webpack_require__(8542); class TokenSet { /** * @name constructor * @api public */ constructor(values) { Object.assign(this, values); } /** * @name expires_in= * @api public */ set expires_in(value) { // eslint-disable-line camelcase this.expires_at = now() + Number(value); } /** * @name expires_in * @api public */ get expires_in() { // eslint-disable-line camelcase return Math.max.apply(null, [this.expires_at - now(), 0]); } /** * @name expired * @api public */ expired() { return this.expires_in === 0; } /** * @name claims * @api public */ claims() { if (!this.id_token) { throw new TypeError('id_token not present in TokenSet'); } return JSON.parse(base64url.decode(this.id_token.split('.')[1])); } } module.exports = TokenSet; /***/ }), /***/ 56693: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; const pSome = __webpack_require__(82822); const PCancelable = __webpack_require__(19072); module.exports = (iterable, options) => { const anyCancelable = pSome(iterable, {...options, count: 1}); return PCancelable.fn(async onCancel => { onCancel(() => { anyCancelable.cancel(); }); const [value] = await anyCancelable; return value; })(); }; module.exports.AggregateError = pSome.AggregateError; /***/ }), /***/ 19072: /***/ ((module) => { "use strict"; class CancelError extends Error { constructor(reason) { super(reason || 'Promise was canceled'); this.name = 'CancelError'; } get isCanceled() { return true; } } class PCancelable { static fn(userFn) { return (...arguments_) => { return new PCancelable((resolve, reject, onCancel) => { arguments_.push(onCancel); // eslint-disable-next-line promise/prefer-await-to-then userFn(...arguments_).then(resolve, reject); }); }; } constructor(executor) { this._cancelHandlers = []; this._isPending = true; this._isCanceled = false; this._rejectOnCancel = true; this._promise = new Promise((resolve, reject) => { this._reject = reject; const onResolve = value => { if (!this._isCanceled || !onCancel.shouldReject) { this._isPending = false; resolve(value); } }; const onReject = error => { this._isPending = false; reject(error); }; const onCancel = handler => { if (!this._isPending) { throw new Error('The `onCancel` handler was attached after the promise settled.'); } this._cancelHandlers.push(handler); }; Object.defineProperties(onCancel, { shouldReject: { get: () => this._rejectOnCancel, set: boolean => { this._rejectOnCancel = boolean; } } }); return executor(onResolve, onReject, onCancel); }); } then(onFulfilled, onRejected) { // eslint-disable-next-line promise/prefer-await-to-then return this._promise.then(onFulfilled, onRejected); } catch(onRejected) { return this._promise.catch(onRejected); } finally(onFinally) { return this._promise.finally(onFinally); } cancel(reason) { if (!this._isPending || this._isCanceled) { return; } this._isCanceled = true; if (this._cancelHandlers.length > 0) { try { for (const handler of this._cancelHandlers) { handler(); } } catch (error) { this._reject(error); return; } } if (this._rejectOnCancel) { this._reject(new CancelError(reason)); } } get isCanceled() { return this._isCanceled; } } Object.setPrototypeOf(PCancelable.prototype, Promise.prototype); module.exports = PCancelable; module.exports.CancelError = CancelError; /***/ }), /***/ 82822: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; const AggregateError = __webpack_require__(61231); const PCancelable = __webpack_require__(19072); class FilterError extends Error { } const pSome = (iterable, options) => new PCancelable((resolve, reject, onCancel) => { const { count, filter = () => true } = options; if (!Number.isFinite(count)) { reject(new TypeError(`Expected a finite number, got ${typeof options.count}`)); return; } const values = []; const errors = []; let elementCount = 0; let isSettled = false; const completed = new Set(); const maybeSettle = () => { if (values.length === count) { resolve(values); isSettled = true; } if (elementCount - errors.length < count) { reject(new AggregateError(errors)); isSettled = true; } return isSettled; }; const cancelPending = () => { for (const promise of iterable) { if (!completed.has(promise) && typeof promise.cancel === 'function') { promise.cancel(); } } }; onCancel(cancelPending); for (const element of iterable) { elementCount++; (async () => { try { const value = await element; if (isSettled) { return; } if (!filter(value)) { throw new FilterError('Value does not satisfy filter'); } values.push(value); } catch (error) { errors.push(error); } finally { completed.add(element); if (!isSettled && maybeSettle()) { cancelPending(); } } })(); } if (count > elementCount) { reject(new RangeError(`Expected input to contain at least ${options.count} items, but contains ${elementCount} items`)); cancelPending(); } }); module.exports = pSome; module.exports.AggregateError = AggregateError; module.exports.FilterError = FilterError; /***/ }), /***/ 38714: /***/ ((module) => { "use strict"; function posix(path) { return path.charAt(0) === '/'; } function win32(path) { // https://github.com/nodejs/node/blob/b3fcc245fb25539909ef1d5eaa01dbf92e168633/lib/path.js#L56 var splitDeviceRe = /^([a-zA-Z]:|[\\\/]{2}[^\\\/]+[\\\/]+[^\\\/]+)?([\\\/])?([\s\S]*?)$/; var result = splitDeviceRe.exec(path); var device = result[1] || ''; var isUnc = Boolean(device && device.charAt(1) !== ':'); // UNC paths are always absolute return Boolean(result[2] || isUnc); } module.exports = process.platform === 'win32' ? win32 : posix; module.exports.posix = posix; module.exports.win32 = win32; /***/ }), /***/ 85644: /***/ (function(module) { // Generated by CoffeeScript 1.12.2 (function() { var getNanoSeconds, hrtime, loadTime, moduleLoadTime, nodeLoadTime, upTime; if ((typeof performance !== "undefined" && performance !== null) && performance.now) { module.exports = function() { return performance.now(); }; } else if ((typeof process !== "undefined" && process !== null) && process.hrtime) { module.exports = function() { return (getNanoSeconds() - nodeLoadTime) / 1e6; }; hrtime = process.hrtime; getNanoSeconds = function() { var hr; hr = hrtime(); return hr[0] * 1e9 + hr[1]; }; moduleLoadTime = getNanoSeconds(); upTime = process.uptime() * 1e9; nodeLoadTime = moduleLoadTime - upTime; } else if (Date.now) { module.exports = function() { return Date.now() - loadTime; }; loadTime = Date.now(); } else { module.exports = function() { return new Date().getTime() - loadTime; }; loadTime = new Date().getTime(); } }).call(this); //# sourceMappingURL=performance-now.js.map /***/ }), /***/ 56143: /***/ ((module) => { "use strict"; module.exports = (url, opts) => { if (typeof url !== 'string') { throw new TypeError(`Expected \`url\` to be of type \`string\`, got \`${typeof url}\``); } url = url.trim(); opts = Object.assign({https: false}, opts); if (/^\.*\/|^(?!localhost)\w+:/.test(url)) { return url; } return url.replace(/^(?!(?:\w+:)?\/\/)/, opts.https ? 'https://' : 'http://'); }; /***/ }), /***/ 29975: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; /*eslint no-var:0, prefer-arrow-callback: 0, object-shorthand: 0 */ var Punycode = __webpack_require__(94213); var internals = {}; // // Read rules from file. // internals.rules = __webpack_require__(2156).map(function (rule) { return { rule: rule, suffix: rule.replace(/^(\*\.|\!)/, ''), punySuffix: -1, wildcard: rule.charAt(0) === '*', exception: rule.charAt(0) === '!' }; }); // // Check is given string ends with `suffix`. // internals.endsWith = function (str, suffix) { return str.indexOf(suffix, str.length - suffix.length) !== -1; }; // // Find rule for a given domain. // internals.findRule = function (domain) { var punyDomain = Punycode.toASCII(domain); return internals.rules.reduce(function (memo, rule) { if (rule.punySuffix === -1){ rule.punySuffix = Punycode.toASCII(rule.suffix); } if (!internals.endsWith(punyDomain, '.' + rule.punySuffix) && punyDomain !== rule.punySuffix) { return memo; } // This has been commented out as it never seems to run. This is because // sub tlds always appear after their parents and we never find a shorter // match. //if (memo) { // var memoSuffix = Punycode.toASCII(memo.suffix); // if (memoSuffix.length >= punySuffix.length) { // return memo; // } //} return rule; }, null); }; // // Error codes and messages. // exports.errorCodes = { DOMAIN_TOO_SHORT: 'Domain name too short.', DOMAIN_TOO_LONG: 'Domain name too long. It should be no more than 255 chars.', LABEL_STARTS_WITH_DASH: 'Domain name label can not start with a dash.', LABEL_ENDS_WITH_DASH: 'Domain name label can not end with a dash.', LABEL_TOO_LONG: 'Domain name label should be at most 63 chars long.', LABEL_TOO_SHORT: 'Domain name label should be at least 1 character long.', LABEL_INVALID_CHARS: 'Domain name label can only contain alphanumeric characters or dashes.' }; // // Validate domain name and throw if not valid. // // From wikipedia: // // Hostnames are composed of series of labels concatenated with dots, as are all // domain names. Each label must be between 1 and 63 characters long, and the // entire hostname (including the delimiting dots) has a maximum of 255 chars. // // Allowed chars: // // * `a-z` // * `0-9` // * `-` but not as a starting or ending character // * `.` as a separator for the textual portions of a domain name // // * http://en.wikipedia.org/wiki/Domain_name // * http://en.wikipedia.org/wiki/Hostname // internals.validate = function (input) { // Before we can validate we need to take care of IDNs with unicode chars. var ascii = Punycode.toASCII(input); if (ascii.length < 1) { return 'DOMAIN_TOO_SHORT'; } if (ascii.length > 255) { return 'DOMAIN_TOO_LONG'; } // Check each part's length and allowed chars. var labels = ascii.split('.'); var label; for (var i = 0; i < labels.length; ++i) { label = labels[i]; if (!label.length) { return 'LABEL_TOO_SHORT'; } if (label.length > 63) { return 'LABEL_TOO_LONG'; } if (label.charAt(0) === '-') { return 'LABEL_STARTS_WITH_DASH'; } if (label.charAt(label.length - 1) === '-') { return 'LABEL_ENDS_WITH_DASH'; } if (!/^[a-z0-9\-]+$/.test(label)) { return 'LABEL_INVALID_CHARS'; } } }; // // Public API // // // Parse domain. // exports.parse = function (input) { if (typeof input !== 'string') { throw new TypeError('Domain name must be a string.'); } // Force domain to lowercase. var domain = input.slice(0).toLowerCase(); // Handle FQDN. // TODO: Simply remove trailing dot? if (domain.charAt(domain.length - 1) === '.') { domain = domain.slice(0, domain.length - 1); } // Validate and sanitise input. var error = internals.validate(domain); if (error) { return { input: input, error: { message: exports.errorCodes[error], code: error } }; } var parsed = { input: input, tld: null, sld: null, domain: null, subdomain: null, listed: false }; var domainParts = domain.split('.'); // Non-Internet TLD if (domainParts[domainParts.length - 1] === 'local') { return parsed; } var handlePunycode = function () { if (!/xn--/.test(domain)) { return parsed; } if (parsed.domain) { parsed.domain = Punycode.toASCII(parsed.domain); } if (parsed.subdomain) { parsed.subdomain = Punycode.toASCII(parsed.subdomain); } return parsed; }; var rule = internals.findRule(domain); // Unlisted tld. if (!rule) { if (domainParts.length < 2) { return parsed; } parsed.tld = domainParts.pop(); parsed.sld = domainParts.pop(); parsed.domain = [parsed.sld, parsed.tld].join('.'); if (domainParts.length) { parsed.subdomain = domainParts.pop(); } return handlePunycode(); } // At this point we know the public suffix is listed. parsed.listed = true; var tldParts = rule.suffix.split('.'); var privateParts = domainParts.slice(0, domainParts.length - tldParts.length); if (rule.exception) { privateParts.push(tldParts.shift()); } parsed.tld = tldParts.join('.'); if (!privateParts.length) { return handlePunycode(); } if (rule.wildcard) { tldParts.unshift(privateParts.pop()); parsed.tld = tldParts.join('.'); } if (!privateParts.length) { return handlePunycode(); } parsed.sld = privateParts.pop(); parsed.domain = [parsed.sld, parsed.tld].join('.'); if (privateParts.length) { parsed.subdomain = privateParts.join('.'); } return handlePunycode(); }; // // Get domain. // exports.get = function (domain) { if (!domain) { return null; } return exports.parse(domain).domain || null; }; // // Check whether domain belongs to a known public suffix. // exports.isValid = function (domain) { var parsed = exports.parse(domain); return Boolean(parsed.domain && parsed.listed); }; /***/ }), /***/ 18341: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { var once = __webpack_require__(1223) var eos = __webpack_require__(81205) var fs = __webpack_require__(35747) // we only need fs to get the ReadStream and WriteStream prototypes var noop = function () {} var ancient = /^v?\.0/.test(process.version) var isFn = function (fn) { return typeof fn === 'function' } var isFS = function (stream) { if (!ancient) return false // newer node version do not need to care about fs is a special way if (!fs) return false // browser return (stream instanceof (fs.ReadStream || noop) || stream instanceof (fs.WriteStream || noop)) && isFn(stream.close) } var isRequest = function (stream) { return stream.setHeader && isFn(stream.abort) } var destroyer = function (stream, reading, writing, callback) { callback = once(callback) var closed = false stream.on('close', function () { closed = true }) eos(stream, {readable: reading, writable: writing}, function (err) { if (err) return callback(err) closed = true callback() }) var destroyed = false return function (err) { if (closed) return if (destroyed) return destroyed = true if (isFS(stream)) return stream.close(noop) // use close for fs streams to avoid fd leaks if (isRequest(stream)) return stream.abort() // request.destroy just do .end - .abort is what we want if (isFn(stream.destroy)) return stream.destroy() callback(err || new Error('stream was destroyed')) } } var call = function (fn) { fn() } var pipe = function (from, to) { return from.pipe(to) } var pump = function () { var streams = Array.prototype.slice.call(arguments) var callback = isFn(streams[streams.length - 1] || noop) && streams.pop() || noop if (Array.isArray(streams[0])) streams = streams[0] if (streams.length < 2) throw new Error('pump requires two streams per minimum') var error var destroys = streams.map(function (stream, i) { var reading = i < streams.length - 1 var writing = i > 0 return destroyer(stream, reading, writing, function (err) { if (!error) error = err if (err) destroys.forEach(call) if (reading) return destroys.forEach(call) callback(error) }) }) return streams.reduce(pipe) } module.exports = pump /***/ }), /***/ 74907: /***/ ((module) => { "use strict"; var replace = String.prototype.replace; var percentTwenties = /%20/g; var Format = { RFC1738: 'RFC1738', RFC3986: 'RFC3986' }; module.exports = { 'default': Format.RFC3986, formatters: { RFC1738: function (value) { return replace.call(value, percentTwenties, '+'); }, RFC3986: function (value) { return String(value); } }, RFC1738: Format.RFC1738, RFC3986: Format.RFC3986 }; /***/ }), /***/ 22760: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; var stringify = __webpack_require__(79954); var parse = __webpack_require__(33912); var formats = __webpack_require__(74907); module.exports = { formats: formats, parse: parse, stringify: stringify }; /***/ }), /***/ 33912: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; var utils = __webpack_require__(72360); var has = Object.prototype.hasOwnProperty; var isArray = Array.isArray; var defaults = { allowDots: false, allowPrototypes: false, allowSparse: false, arrayLimit: 20, charset: 'utf-8', charsetSentinel: false, comma: false, decoder: utils.decode, delimiter: '&', depth: 5, ignoreQueryPrefix: false, interpretNumericEntities: false, parameterLimit: 1000, parseArrays: true, plainObjects: false, strictNullHandling: false }; var interpretNumericEntities = function (str) { return str.replace(/&#(\d+);/g, function ($0, numberStr) { return String.fromCharCode(parseInt(numberStr, 10)); }); }; var parseArrayValue = function (val, options) { if (val && typeof val === 'string' && options.comma && val.indexOf(',') > -1) { return val.split(','); } return val; }; // This is what browsers will submit when the ✓ character occurs in an // application/x-www-form-urlencoded body and the encoding of the page containing // the form is iso-8859-1, or when the submitted form has an accept-charset // attribute of iso-8859-1. Presumably also with other charsets that do not contain // the ✓ character, such as us-ascii. var isoSentinel = 'utf8=%26%2310003%3B'; // encodeURIComponent('✓') // These are the percent-encoded utf-8 octets representing a checkmark, indicating that the request actually is utf-8 encoded. var charsetSentinel = 'utf8=%E2%9C%93'; // encodeURIComponent('✓') var parseValues = function parseQueryStringValues(str, options) { var obj = {}; var cleanStr = options.ignoreQueryPrefix ? str.replace(/^\?/, '') : str; var limit = options.parameterLimit === Infinity ? undefined : options.parameterLimit; var parts = cleanStr.split(options.delimiter, limit); var skipIndex = -1; // Keep track of where the utf8 sentinel was found var i; var charset = options.charset; if (options.charsetSentinel) { for (i = 0; i < parts.length; ++i) { if (parts[i].indexOf('utf8=') === 0) { if (parts[i] === charsetSentinel) { charset = 'utf-8'; } else if (parts[i] === isoSentinel) { charset = 'iso-8859-1'; } skipIndex = i; i = parts.length; // The eslint settings do not allow break; } } } for (i = 0; i < parts.length; ++i) { if (i === skipIndex) { continue; } var part = parts[i]; var bracketEqualsPos = part.indexOf(']='); var pos = bracketEqualsPos === -1 ? part.indexOf('=') : bracketEqualsPos + 1; var key, val; if (pos === -1) { key = options.decoder(part, defaults.decoder, charset, 'key'); val = options.strictNullHandling ? null : ''; } else { key = options.decoder(part.slice(0, pos), defaults.decoder, charset, 'key'); val = utils.maybeMap( parseArrayValue(part.slice(pos + 1), options), function (encodedVal) { return options.decoder(encodedVal, defaults.decoder, charset, 'value'); } ); } if (val && options.interpretNumericEntities && charset === 'iso-8859-1') { val = interpretNumericEntities(val); } if (part.indexOf('[]=') > -1) { val = isArray(val) ? [val] : val; } if (has.call(obj, key)) { obj[key] = utils.combine(obj[key], val); } else { obj[key] = val; } } return obj; }; var parseObject = function (chain, val, options, valuesParsed) { var leaf = valuesParsed ? val : parseArrayValue(val, options); for (var i = chain.length - 1; i >= 0; --i) { var obj; var root = chain[i]; if (root === '[]' && options.parseArrays) { obj = [].concat(leaf); } else { obj = options.plainObjects ? Object.create(null) : {}; var cleanRoot = root.charAt(0) === '[' && root.charAt(root.length - 1) === ']' ? root.slice(1, -1) : root; var index = parseInt(cleanRoot, 10); if (!options.parseArrays && cleanRoot === '') { obj = { 0: leaf }; } else if ( !isNaN(index) && root !== cleanRoot && String(index) === cleanRoot && index >= 0 && (options.parseArrays && index <= options.arrayLimit) ) { obj = []; obj[index] = leaf; } else { obj[cleanRoot] = leaf; } } leaf = obj; } return leaf; }; var parseKeys = function parseQueryStringKeys(givenKey, val, options, valuesParsed) { if (!givenKey) { return; } // Transform dot notation to bracket notation var key = options.allowDots ? givenKey.replace(/\.([^.[]+)/g, '[$1]') : givenKey; // The regex chunks var brackets = /(\[[^[\]]*])/; var child = /(\[[^[\]]*])/g; // Get the parent var segment = options.depth > 0 && brackets.exec(key); var parent = segment ? key.slice(0, segment.index) : key; // Stash the parent if it exists var keys = []; if (parent) { // If we aren't using plain objects, optionally prefix keys that would overwrite object prototype properties if (!options.plainObjects && has.call(Object.prototype, parent)) { if (!options.allowPrototypes) { return; } } keys.push(parent); } // Loop through children appending to the array until we hit depth var i = 0; while (options.depth > 0 && (segment = child.exec(key)) !== null && i < options.depth) { i += 1; if (!options.plainObjects && has.call(Object.prototype, segment[1].slice(1, -1))) { if (!options.allowPrototypes) { return; } } keys.push(segment[1]); } // If there's a remainder, just add whatever is left if (segment) { keys.push('[' + key.slice(segment.index) + ']'); } return parseObject(keys, val, options, valuesParsed); }; var normalizeParseOptions = function normalizeParseOptions(opts) { if (!opts) { return defaults; } if (opts.decoder !== null && opts.decoder !== undefined && typeof opts.decoder !== 'function') { throw new TypeError('Decoder has to be a function.'); } if (typeof opts.charset !== 'undefined' && opts.charset !== 'utf-8' && opts.charset !== 'iso-8859-1') { throw new TypeError('The charset option must be either utf-8, iso-8859-1, or undefined'); } var charset = typeof opts.charset === 'undefined' ? defaults.charset : opts.charset; return { allowDots: typeof opts.allowDots === 'undefined' ? defaults.allowDots : !!opts.allowDots, allowPrototypes: typeof opts.allowPrototypes === 'boolean' ? opts.allowPrototypes : defaults.allowPrototypes, allowSparse: typeof opts.allowSparse === 'boolean' ? opts.allowSparse : defaults.allowSparse, arrayLimit: typeof opts.arrayLimit === 'number' ? opts.arrayLimit : defaults.arrayLimit, charset: charset, charsetSentinel: typeof opts.charsetSentinel === 'boolean' ? opts.charsetSentinel : defaults.charsetSentinel, comma: typeof opts.comma === 'boolean' ? opts.comma : defaults.comma, decoder: typeof opts.decoder === 'function' ? opts.decoder : defaults.decoder, delimiter: typeof opts.delimiter === 'string' || utils.isRegExp(opts.delimiter) ? opts.delimiter : defaults.delimiter, // eslint-disable-next-line no-implicit-coercion, no-extra-parens depth: (typeof opts.depth === 'number' || opts.depth === false) ? +opts.depth : defaults.depth, ignoreQueryPrefix: opts.ignoreQueryPrefix === true, interpretNumericEntities: typeof opts.interpretNumericEntities === 'boolean' ? opts.interpretNumericEntities : defaults.interpretNumericEntities, parameterLimit: typeof opts.parameterLimit === 'number' ? opts.parameterLimit : defaults.parameterLimit, parseArrays: opts.parseArrays !== false, plainObjects: typeof opts.plainObjects === 'boolean' ? opts.plainObjects : defaults.plainObjects, strictNullHandling: typeof opts.strictNullHandling === 'boolean' ? opts.strictNullHandling : defaults.strictNullHandling }; }; module.exports = function (str, opts) { var options = normalizeParseOptions(opts); if (str === '' || str === null || typeof str === 'undefined') { return options.plainObjects ? Object.create(null) : {}; } var tempObj = typeof str === 'string' ? parseValues(str, options) : str; var obj = options.plainObjects ? Object.create(null) : {}; // Iterate over the keys and setup the new object var keys = Object.keys(tempObj); for (var i = 0; i < keys.length; ++i) { var key = keys[i]; var newObj = parseKeys(key, tempObj[key], options, typeof str === 'string'); obj = utils.merge(obj, newObj, options); } if (options.allowSparse === true) { return obj; } return utils.compact(obj); }; /***/ }), /***/ 79954: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; var getSideChannel = __webpack_require__(14334); var utils = __webpack_require__(72360); var formats = __webpack_require__(74907); var has = Object.prototype.hasOwnProperty; var arrayPrefixGenerators = { brackets: function brackets(prefix) { return prefix + '[]'; }, comma: 'comma', indices: function indices(prefix, key) { return prefix + '[' + key + ']'; }, repeat: function repeat(prefix) { return prefix; } }; var isArray = Array.isArray; var push = Array.prototype.push; var pushToArray = function (arr, valueOrArray) { push.apply(arr, isArray(valueOrArray) ? valueOrArray : [valueOrArray]); }; var toISO = Date.prototype.toISOString; var defaultFormat = formats['default']; var defaults = { addQueryPrefix: false, allowDots: false, charset: 'utf-8', charsetSentinel: false, delimiter: '&', encode: true, encoder: utils.encode, encodeValuesOnly: false, format: defaultFormat, formatter: formats.formatters[defaultFormat], // deprecated indices: false, serializeDate: function serializeDate(date) { return toISO.call(date); }, skipNulls: false, strictNullHandling: false }; var isNonNullishPrimitive = function isNonNullishPrimitive(v) { return typeof v === 'string' || typeof v === 'number' || typeof v === 'boolean' || typeof v === 'symbol' || typeof v === 'bigint'; }; var stringify = function stringify( object, prefix, generateArrayPrefix, strictNullHandling, skipNulls, encoder, filter, sort, allowDots, serializeDate, format, formatter, encodeValuesOnly, charset, sideChannel ) { var obj = object; if (sideChannel.has(object)) { throw new RangeError('Cyclic object value'); } if (typeof filter === 'function') { obj = filter(prefix, obj); } else if (obj instanceof Date) { obj = serializeDate(obj); } else if (generateArrayPrefix === 'comma' && isArray(obj)) { obj = utils.maybeMap(obj, function (value) { if (value instanceof Date) { return serializeDate(value); } return value; }); } if (obj === null) { if (strictNullHandling) { return encoder && !encodeValuesOnly ? encoder(prefix, defaults.encoder, charset, 'key', format) : prefix; } obj = ''; } if (isNonNullishPrimitive(obj) || utils.isBuffer(obj)) { if (encoder) { var keyValue = encodeValuesOnly ? prefix : encoder(prefix, defaults.encoder, charset, 'key', format); return [formatter(keyValue) + '=' + formatter(encoder(obj, defaults.encoder, charset, 'value', format))]; } return [formatter(prefix) + '=' + formatter(String(obj))]; } var values = []; if (typeof obj === 'undefined') { return values; } var objKeys; if (generateArrayPrefix === 'comma' && isArray(obj)) { // we need to join elements in objKeys = [{ value: obj.length > 0 ? obj.join(',') || null : undefined }]; } else if (isArray(filter)) { objKeys = filter; } else { var keys = Object.keys(obj); objKeys = sort ? keys.sort(sort) : keys; } for (var i = 0; i < objKeys.length; ++i) { var key = objKeys[i]; var value = typeof key === 'object' && key.value !== undefined ? key.value : obj[key]; if (skipNulls && value === null) { continue; } var keyPrefix = isArray(obj) ? typeof generateArrayPrefix === 'function' ? generateArrayPrefix(prefix, key) : prefix : prefix + (allowDots ? '.' + key : '[' + key + ']'); sideChannel.set(object, true); var valueSideChannel = getSideChannel(); pushToArray(values, stringify( value, keyPrefix, generateArrayPrefix, strictNullHandling, skipNulls, encoder, filter, sort, allowDots, serializeDate, format, formatter, encodeValuesOnly, charset, valueSideChannel )); } return values; }; var normalizeStringifyOptions = function normalizeStringifyOptions(opts) { if (!opts) { return defaults; } if (opts.encoder !== null && opts.encoder !== undefined && typeof opts.encoder !== 'function') { throw new TypeError('Encoder has to be a function.'); } var charset = opts.charset || defaults.charset; if (typeof opts.charset !== 'undefined' && opts.charset !== 'utf-8' && opts.charset !== 'iso-8859-1') { throw new TypeError('The charset option must be either utf-8, iso-8859-1, or undefined'); } var format = formats['default']; if (typeof opts.format !== 'undefined') { if (!has.call(formats.formatters, opts.format)) { throw new TypeError('Unknown format option provided.'); } format = opts.format; } var formatter = formats.formatters[format]; var filter = defaults.filter; if (typeof opts.filter === 'function' || isArray(opts.filter)) { filter = opts.filter; } return { addQueryPrefix: typeof opts.addQueryPrefix === 'boolean' ? opts.addQueryPrefix : defaults.addQueryPrefix, allowDots: typeof opts.allowDots === 'undefined' ? defaults.allowDots : !!opts.allowDots, charset: charset, charsetSentinel: typeof opts.charsetSentinel === 'boolean' ? opts.charsetSentinel : defaults.charsetSentinel, delimiter: typeof opts.delimiter === 'undefined' ? defaults.delimiter : opts.delimiter, encode: typeof opts.encode === 'boolean' ? opts.encode : defaults.encode, encoder: typeof opts.encoder === 'function' ? opts.encoder : defaults.encoder, encodeValuesOnly: typeof opts.encodeValuesOnly === 'boolean' ? opts.encodeValuesOnly : defaults.encodeValuesOnly, filter: filter, format: format, formatter: formatter, serializeDate: typeof opts.serializeDate === 'function' ? opts.serializeDate : defaults.serializeDate, skipNulls: typeof opts.skipNulls === 'boolean' ? opts.skipNulls : defaults.skipNulls, sort: typeof opts.sort === 'function' ? opts.sort : null, strictNullHandling: typeof opts.strictNullHandling === 'boolean' ? opts.strictNullHandling : defaults.strictNullHandling }; }; module.exports = function (object, opts) { var obj = object; var options = normalizeStringifyOptions(opts); var objKeys; var filter; if (typeof options.filter === 'function') { filter = options.filter; obj = filter('', obj); } else if (isArray(options.filter)) { filter = options.filter; objKeys = filter; } var keys = []; if (typeof obj !== 'object' || obj === null) { return ''; } var arrayFormat; if (opts && opts.arrayFormat in arrayPrefixGenerators) { arrayFormat = opts.arrayFormat; } else if (opts && 'indices' in opts) { arrayFormat = opts.indices ? 'indices' : 'repeat'; } else { arrayFormat = 'indices'; } var generateArrayPrefix = arrayPrefixGenerators[arrayFormat]; if (!objKeys) { objKeys = Object.keys(obj); } if (options.sort) { objKeys.sort(options.sort); } var sideChannel = getSideChannel(); for (var i = 0; i < objKeys.length; ++i) { var key = objKeys[i]; if (options.skipNulls && obj[key] === null) { continue; } pushToArray(keys, stringify( obj[key], key, generateArrayPrefix, options.strictNullHandling, options.skipNulls, options.encode ? options.encoder : null, options.filter, options.sort, options.allowDots, options.serializeDate, options.format, options.formatter, options.encodeValuesOnly, options.charset, sideChannel )); } var joined = keys.join(options.delimiter); var prefix = options.addQueryPrefix === true ? '?' : ''; if (options.charsetSentinel) { if (options.charset === 'iso-8859-1') { // encodeURIComponent('✓'), the "numeric entity" representation of a checkmark prefix += 'utf8=%26%2310003%3B&'; } else { // encodeURIComponent('✓') prefix += 'utf8=%E2%9C%93&'; } } return joined.length > 0 ? prefix + joined : ''; }; /***/ }), /***/ 72360: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; var formats = __webpack_require__(74907); var has = Object.prototype.hasOwnProperty; var isArray = Array.isArray; var hexTable = (function () { var array = []; for (var i = 0; i < 256; ++i) { array.push('%' + ((i < 16 ? '0' : '') + i.toString(16)).toUpperCase()); } return array; }()); var compactQueue = function compactQueue(queue) { while (queue.length > 1) { var item = queue.pop(); var obj = item.obj[item.prop]; if (isArray(obj)) { var compacted = []; for (var j = 0; j < obj.length; ++j) { if (typeof obj[j] !== 'undefined') { compacted.push(obj[j]); } } item.obj[item.prop] = compacted; } } }; var arrayToObject = function arrayToObject(source, options) { var obj = options && options.plainObjects ? Object.create(null) : {}; for (var i = 0; i < source.length; ++i) { if (typeof source[i] !== 'undefined') { obj[i] = source[i]; } } return obj; }; var merge = function merge(target, source, options) { /* eslint no-param-reassign: 0 */ if (!source) { return target; } if (typeof source !== 'object') { if (isArray(target)) { target.push(source); } else if (target && typeof target === 'object') { if ((options && (options.plainObjects || options.allowPrototypes)) || !has.call(Object.prototype, source)) { target[source] = true; } } else { return [target, source]; } return target; } if (!target || typeof target !== 'object') { return [target].concat(source); } var mergeTarget = target; if (isArray(target) && !isArray(source)) { mergeTarget = arrayToObject(target, options); } if (isArray(target) && isArray(source)) { source.forEach(function (item, i) { if (has.call(target, i)) { var targetItem = target[i]; if (targetItem && typeof targetItem === 'object' && item && typeof item === 'object') { target[i] = merge(targetItem, item, options); } else { target.push(item); } } else { target[i] = item; } }); return target; } return Object.keys(source).reduce(function (acc, key) { var value = source[key]; if (has.call(acc, key)) { acc[key] = merge(acc[key], value, options); } else { acc[key] = value; } return acc; }, mergeTarget); }; var assign = function assignSingleSource(target, source) { return Object.keys(source).reduce(function (acc, key) { acc[key] = source[key]; return acc; }, target); }; var decode = function (str, decoder, charset) { var strWithoutPlus = str.replace(/\+/g, ' '); if (charset === 'iso-8859-1') { // unescape never throws, no try...catch needed: return strWithoutPlus.replace(/%[0-9a-f]{2}/gi, unescape); } // utf-8 try { return decodeURIComponent(strWithoutPlus); } catch (e) { return strWithoutPlus; } }; var encode = function encode(str, defaultEncoder, charset, kind, format) { // This code was originally written by Brian White (mscdex) for the io.js core querystring library. // It has been adapted here for stricter adherence to RFC 3986 if (str.length === 0) { return str; } var string = str; if (typeof str === 'symbol') { string = Symbol.prototype.toString.call(str); } else if (typeof str !== 'string') { string = String(str); } if (charset === 'iso-8859-1') { return escape(string).replace(/%u[0-9a-f]{4}/gi, function ($0) { return '%26%23' + parseInt($0.slice(2), 16) + '%3B'; }); } var out = ''; for (var i = 0; i < string.length; ++i) { var c = string.charCodeAt(i); if ( c === 0x2D // - || c === 0x2E // . || c === 0x5F // _ || c === 0x7E // ~ || (c >= 0x30 && c <= 0x39) // 0-9 || (c >= 0x41 && c <= 0x5A) // a-z || (c >= 0x61 && c <= 0x7A) // A-Z || (format === formats.RFC1738 && (c === 0x28 || c === 0x29)) // ( ) ) { out += string.charAt(i); continue; } if (c < 0x80) { out = out + hexTable[c]; continue; } if (c < 0x800) { out = out + (hexTable[0xC0 | (c >> 6)] + hexTable[0x80 | (c & 0x3F)]); continue; } if (c < 0xD800 || c >= 0xE000) { out = out + (hexTable[0xE0 | (c >> 12)] + hexTable[0x80 | ((c >> 6) & 0x3F)] + hexTable[0x80 | (c & 0x3F)]); continue; } i += 1; c = 0x10000 + (((c & 0x3FF) << 10) | (string.charCodeAt(i) & 0x3FF)); out += hexTable[0xF0 | (c >> 18)] + hexTable[0x80 | ((c >> 12) & 0x3F)] + hexTable[0x80 | ((c >> 6) & 0x3F)] + hexTable[0x80 | (c & 0x3F)]; } return out; }; var compact = function compact(value) { var queue = [{ obj: { o: value }, prop: 'o' }]; var refs = []; for (var i = 0; i < queue.length; ++i) { var item = queue[i]; var obj = item.obj[item.prop]; var keys = Object.keys(obj); for (var j = 0; j < keys.length; ++j) { var key = keys[j]; var val = obj[key]; if (typeof val === 'object' && val !== null && refs.indexOf(val) === -1) { queue.push({ obj: obj, prop: key }); refs.push(val); } } } compactQueue(queue); return value; }; var isRegExp = function isRegExp(obj) { return Object.prototype.toString.call(obj) === '[object RegExp]'; }; var isBuffer = function isBuffer(obj) { if (!obj || typeof obj !== 'object') { return false; } return !!(obj.constructor && obj.constructor.isBuffer && obj.constructor.isBuffer(obj)); }; var combine = function combine(a, b) { return [].concat(a, b); }; var maybeMap = function maybeMap(val, fn) { if (isArray(val)) { var mapped = []; for (var i = 0; i < val.length; i += 1) { mapped.push(fn(val[i])); } return mapped; } return fn(val); }; module.exports = { arrayToObject: arrayToObject, assign: assign, combine: combine, compact: compact, decode: decode, encode: encode, isBuffer: isBuffer, isRegExp: isRegExp, maybeMap: maybeMap, merge: merge }; /***/ }), /***/ 48699: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; // Copyright 2010-2012 Mikeal Rogers // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. var extend = __webpack_require__(38171) var cookies = __webpack_require__(50976) var helpers = __webpack_require__(74845) var paramsHaveRequestBody = helpers.paramsHaveRequestBody // organize params for patch, post, put, head, del function initParams (uri, options, callback) { if (typeof options === 'function') { callback = options } var params = {} if (options !== null && typeof options === 'object') { extend(params, options, {uri: uri}) } else if (typeof uri === 'string') { extend(params, {uri: uri}) } else { extend(params, uri) } params.callback = callback || params.callback return params } function request (uri, options, callback) { if (typeof uri === 'undefined') { throw new Error('undefined is not a valid uri or options object.') } var params = initParams(uri, options, callback) if (params.method === 'HEAD' && paramsHaveRequestBody(params)) { throw new Error('HTTP HEAD requests MUST NOT include a request body.') } return new request.Request(params) } function verbFunc (verb) { var method = verb.toUpperCase() return function (uri, options, callback) { var params = initParams(uri, options, callback) params.method = method return request(params, params.callback) } } // define like this to please codeintel/intellisense IDEs request.get = verbFunc('get') request.head = verbFunc('head') request.options = verbFunc('options') request.post = verbFunc('post') request.put = verbFunc('put') request.patch = verbFunc('patch') request.del = verbFunc('delete') request['delete'] = verbFunc('delete') request.jar = function (store) { return cookies.jar(store) } request.cookie = function (str) { return cookies.parse(str) } function wrapRequestMethod (method, options, requester, verb) { return function (uri, opts, callback) { var params = initParams(uri, opts, callback) var target = {} extend(true, target, options, params) target.pool = params.pool || options.pool if (verb) { target.method = verb.toUpperCase() } if (typeof requester === 'function') { method = requester } return method(target, target.callback) } } request.defaults = function (options, requester) { var self = this options = options || {} if (typeof options === 'function') { requester = options options = {} } var defaults = wrapRequestMethod(self, options, requester) var verbs = ['get', 'head', 'post', 'put', 'patch', 'del', 'delete'] verbs.forEach(function (verb) { defaults[verb] = wrapRequestMethod(self[verb], options, requester, verb) }) defaults.cookie = wrapRequestMethod(self.cookie, options, requester) defaults.jar = self.jar defaults.defaults = self.defaults return defaults } request.forever = function (agentOptions, optionsArg) { var options = {} if (optionsArg) { extend(options, optionsArg) } if (agentOptions) { options.agentOptions = agentOptions } options.forever = true return request.defaults(options) } // Exports module.exports = request request.Request = __webpack_require__(70304) request.initParams = initParams // Backwards compatibility for request.debug Object.defineProperty(request, 'debug', { enumerable: true, get: function () { return request.Request.debug }, set: function (debug) { request.Request.debug = debug } }) /***/ }), /***/ 76996: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; var caseless = __webpack_require__(35684) var uuid = __webpack_require__(71435) var helpers = __webpack_require__(74845) var md5 = helpers.md5 var toBase64 = helpers.toBase64 function Auth (request) { // define all public properties here this.request = request this.hasAuth = false this.sentAuth = false this.bearerToken = null this.user = null this.pass = null } Auth.prototype.basic = function (user, pass, sendImmediately) { var self = this if (typeof user !== 'string' || (pass !== undefined && typeof pass !== 'string')) { self.request.emit('error', new Error('auth() received invalid user or password')) } self.user = user self.pass = pass self.hasAuth = true var header = user + ':' + (pass || '') if (sendImmediately || typeof sendImmediately === 'undefined') { var authHeader = 'Basic ' + toBase64(header) self.sentAuth = true return authHeader } } Auth.prototype.bearer = function (bearer, sendImmediately) { var self = this self.bearerToken = bearer self.hasAuth = true if (sendImmediately || typeof sendImmediately === 'undefined') { if (typeof bearer === 'function') { bearer = bearer() } var authHeader = 'Bearer ' + (bearer || '') self.sentAuth = true return authHeader } } Auth.prototype.digest = function (method, path, authHeader) { // TODO: More complete implementation of RFC 2617. // - handle challenge.domain // - support qop="auth-int" only // - handle Authentication-Info (not necessarily?) // - check challenge.stale (not necessarily?) // - increase nc (not necessarily?) // For reference: // http://tools.ietf.org/html/rfc2617#section-3 // https://github.com/bagder/curl/blob/master/lib/http_digest.c var self = this var challenge = {} var re = /([a-z0-9_-]+)=(?:"([^"]+)"|([a-z0-9_-]+))/gi while (true) { var match = re.exec(authHeader) if (!match) { break } challenge[match[1]] = match[2] || match[3] } /** * RFC 2617: handle both MD5 and MD5-sess algorithms. * * If the algorithm directive's value is "MD5" or unspecified, then HA1 is * HA1=MD5(username:realm:password) * If the algorithm directive's value is "MD5-sess", then HA1 is * HA1=MD5(MD5(username:realm:password):nonce:cnonce) */ var ha1Compute = function (algorithm, user, realm, pass, nonce, cnonce) { var ha1 = md5(user + ':' + realm + ':' + pass) if (algorithm && algorithm.toLowerCase() === 'md5-sess') { return md5(ha1 + ':' + nonce + ':' + cnonce) } else { return ha1 } } var qop = /(^|,)\s*auth\s*($|,)/.test(challenge.qop) && 'auth' var nc = qop && '00000001' var cnonce = qop && uuid().replace(/-/g, '') var ha1 = ha1Compute(challenge.algorithm, self.user, challenge.realm, self.pass, challenge.nonce, cnonce) var ha2 = md5(method + ':' + path) var digestResponse = qop ? md5(ha1 + ':' + challenge.nonce + ':' + nc + ':' + cnonce + ':' + qop + ':' + ha2) : md5(ha1 + ':' + challenge.nonce + ':' + ha2) var authValues = { username: self.user, realm: challenge.realm, nonce: challenge.nonce, uri: path, qop: qop, response: digestResponse, nc: nc, cnonce: cnonce, algorithm: challenge.algorithm, opaque: challenge.opaque } authHeader = [] for (var k in authValues) { if (authValues[k]) { if (k === 'qop' || k === 'nc' || k === 'algorithm') { authHeader.push(k + '=' + authValues[k]) } else { authHeader.push(k + '="' + authValues[k] + '"') } } } authHeader = 'Digest ' + authHeader.join(', ') self.sentAuth = true return authHeader } Auth.prototype.onRequest = function (user, pass, sendImmediately, bearer) { var self = this var request = self.request var authHeader if (bearer === undefined && user === undefined) { self.request.emit('error', new Error('no auth mechanism defined')) } else if (bearer !== undefined) { authHeader = self.bearer(bearer, sendImmediately) } else { authHeader = self.basic(user, pass, sendImmediately) } if (authHeader) { request.setHeader('authorization', authHeader) } } Auth.prototype.onResponse = function (response) { var self = this var request = self.request if (!self.hasAuth || self.sentAuth) { return null } var c = caseless(response.headers) var authHeader = c.get('www-authenticate') var authVerb = authHeader && authHeader.split(' ')[0].toLowerCase() request.debug('reauth', authVerb) switch (authVerb) { case 'basic': return self.basic(self.user, self.pass, true) case 'bearer': return self.bearer(self.bearerToken, true) case 'digest': return self.digest(request.method, request.path, authHeader) } } exports.g = Auth /***/ }), /***/ 50976: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; var tough = __webpack_require__(47372) var Cookie = tough.Cookie var CookieJar = tough.CookieJar exports.parse = function (str) { if (str && str.uri) { str = str.uri } if (typeof str !== 'string') { throw new Error('The cookie function only accepts STRING as param') } return Cookie.parse(str, {loose: true}) } // Adapt the sometimes-Async api of tough.CookieJar to our requirements function RequestJar (store) { var self = this self._jar = new CookieJar(store, {looseMode: true}) } RequestJar.prototype.setCookie = function (cookieOrStr, uri, options) { var self = this return self._jar.setCookieSync(cookieOrStr, uri, options || {}) } RequestJar.prototype.getCookieString = function (uri) { var self = this return self._jar.getCookieStringSync(uri) } RequestJar.prototype.getCookies = function (uri) { var self = this return self._jar.getCookiesSync(uri) } exports.jar = function (store) { return new RequestJar(store) } /***/ }), /***/ 75654: /***/ ((module) => { "use strict"; function formatHostname (hostname) { // canonicalize the hostname, so that 'oogle.com' won't match 'google.com' return hostname.replace(/^\.*/, '.').toLowerCase() } function parseNoProxyZone (zone) { zone = zone.trim().toLowerCase() var zoneParts = zone.split(':', 2) var zoneHost = formatHostname(zoneParts[0]) var zonePort = zoneParts[1] var hasPort = zone.indexOf(':') > -1 return {hostname: zoneHost, port: zonePort, hasPort: hasPort} } function uriInNoProxy (uri, noProxy) { var port = uri.port || (uri.protocol === 'https:' ? '443' : '80') var hostname = formatHostname(uri.hostname) var noProxyList = noProxy.split(',') // iterate through the noProxyList until it finds a match. return noProxyList.map(parseNoProxyZone).some(function (noProxyZone) { var isMatchedAt = hostname.indexOf(noProxyZone.hostname) var hostnameMatched = ( isMatchedAt > -1 && (isMatchedAt === hostname.length - noProxyZone.hostname.length) ) if (noProxyZone.hasPort) { return (port === noProxyZone.port) && hostnameMatched } return hostnameMatched }) } function getProxyFromURI (uri) { // Decide the proper request proxy to use based on the request URI object and the // environmental variables (NO_PROXY, HTTP_PROXY, etc.) // respect NO_PROXY environment variables (see: https://lynx.invisible-island.net/lynx2.8.7/breakout/lynx_help/keystrokes/environments.html) var noProxy = process.env.NO_PROXY || process.env.no_proxy || '' // if the noProxy is a wildcard then return null if (noProxy === '*') { return null } // if the noProxy is not empty and the uri is found return null if (noProxy !== '' && uriInNoProxy(uri, noProxy)) { return null } // Check for HTTP or HTTPS Proxy in environment Else default to null if (uri.protocol === 'http:') { return process.env.HTTP_PROXY || process.env.http_proxy || null } if (uri.protocol === 'https:') { return process.env.HTTPS_PROXY || process.env.https_proxy || process.env.HTTP_PROXY || process.env.http_proxy || null } // if none of that works, return null // (What uri protocol are you using then?) return null } module.exports = getProxyFromURI /***/ }), /***/ 3248: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; var fs = __webpack_require__(35747) var qs = __webpack_require__(71191) var validate = __webpack_require__(75697) var extend = __webpack_require__(38171) function Har (request) { this.request = request } Har.prototype.reducer = function (obj, pair) { // new property ? if (obj[pair.name] === undefined) { obj[pair.name] = pair.value return obj } // existing? convert to array var arr = [ obj[pair.name], pair.value ] obj[pair.name] = arr return obj } Har.prototype.prep = function (data) { // construct utility properties data.queryObj = {} data.headersObj = {} data.postData.jsonObj = false data.postData.paramsObj = false // construct query objects if (data.queryString && data.queryString.length) { data.queryObj = data.queryString.reduce(this.reducer, {}) } // construct headers objects if (data.headers && data.headers.length) { // loweCase header keys data.headersObj = data.headers.reduceRight(function (headers, header) { headers[header.name] = header.value return headers }, {}) } // construct Cookie header if (data.cookies && data.cookies.length) { var cookies = data.cookies.map(function (cookie) { return cookie.name + '=' + cookie.value }) if (cookies.length) { data.headersObj.cookie = cookies.join('; ') } } // prep body function some (arr) { return arr.some(function (type) { return data.postData.mimeType.indexOf(type) === 0 }) } if (some([ 'multipart/mixed', 'multipart/related', 'multipart/form-data', 'multipart/alternative'])) { // reset values data.postData.mimeType = 'multipart/form-data' } else if (some([ 'application/x-www-form-urlencoded'])) { if (!data.postData.params) { data.postData.text = '' } else { data.postData.paramsObj = data.postData.params.reduce(this.reducer, {}) // always overwrite data.postData.text = qs.stringify(data.postData.paramsObj) } } else if (some([ 'text/json', 'text/x-json', 'application/json', 'application/x-json'])) { data.postData.mimeType = 'application/json' if (data.postData.text) { try { data.postData.jsonObj = JSON.parse(data.postData.text) } catch (e) { this.request.debug(e) // force back to text/plain data.postData.mimeType = 'text/plain' } } } return data } Har.prototype.options = function (options) { // skip if no har property defined if (!options.har) { return options } var har = {} extend(har, options.har) // only process the first entry if (har.log && har.log.entries) { har = har.log.entries[0] } // add optional properties to make validation successful har.url = har.url || options.url || options.uri || options.baseUrl || '/' har.httpVersion = har.httpVersion || 'HTTP/1.1' har.queryString = har.queryString || [] har.headers = har.headers || [] har.cookies = har.cookies || [] har.postData = har.postData || {} har.postData.mimeType = har.postData.mimeType || 'application/octet-stream' har.bodySize = 0 har.headersSize = 0 har.postData.size = 0 if (!validate.request(har)) { return options } // clean up and get some utility properties var req = this.prep(har) // construct new options if (req.url) { options.url = req.url } if (req.method) { options.method = req.method } if (Object.keys(req.queryObj).length) { options.qs = req.queryObj } if (Object.keys(req.headersObj).length) { options.headers = req.headersObj } function test (type) { return req.postData.mimeType.indexOf(type) === 0 } if (test('application/x-www-form-urlencoded')) { options.form = req.postData.paramsObj } else if (test('application/json')) { if (req.postData.jsonObj) { options.body = req.postData.jsonObj options.json = true } } else if (test('multipart/form-data')) { options.formData = {} req.postData.params.forEach(function (param) { var attachment = {} if (!param.fileName && !param.contentType) { options.formData[param.name] = param.value return } // attempt to read from disk! if (param.fileName && !param.value) { attachment.value = fs.createReadStream(param.fileName) } else if (param.value) { attachment.value = param.value } if (param.fileName) { attachment.options = { filename: param.fileName, contentType: param.contentType ? param.contentType : null } } options.formData[param.name] = attachment }) } else { if (req.postData.text) { options.body = req.postData.text } } return options } exports.t = Har /***/ }), /***/ 34473: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; var crypto = __webpack_require__(33373) function randomString (size) { var bits = (size + 1) * 6 var buffer = crypto.randomBytes(Math.ceil(bits / 8)) var string = buffer.toString('base64').replace(/\+/g, '-').replace(/\//g, '_').replace(/=/g, '') return string.slice(0, size) } function calculatePayloadHash (payload, algorithm, contentType) { var hash = crypto.createHash(algorithm) hash.update('hawk.1.payload\n') hash.update((contentType ? contentType.split(';')[0].trim().toLowerCase() : '') + '\n') hash.update(payload || '') hash.update('\n') return hash.digest('base64') } exports.calculateMac = function (credentials, opts) { var normalized = 'hawk.1.header\n' + opts.ts + '\n' + opts.nonce + '\n' + (opts.method || '').toUpperCase() + '\n' + opts.resource + '\n' + opts.host.toLowerCase() + '\n' + opts.port + '\n' + (opts.hash || '') + '\n' if (opts.ext) { normalized = normalized + opts.ext.replace('\\', '\\\\').replace('\n', '\\n') } normalized = normalized + '\n' if (opts.app) { normalized = normalized + opts.app + '\n' + (opts.dlg || '') + '\n' } var hmac = crypto.createHmac(credentials.algorithm, credentials.key).update(normalized) var digest = hmac.digest('base64') return digest } exports.header = function (uri, method, opts) { var timestamp = opts.timestamp || Math.floor((Date.now() + (opts.localtimeOffsetMsec || 0)) / 1000) var credentials = opts.credentials if (!credentials || !credentials.id || !credentials.key || !credentials.algorithm) { return '' } if (['sha1', 'sha256'].indexOf(credentials.algorithm) === -1) { return '' } var artifacts = { ts: timestamp, nonce: opts.nonce || randomString(6), method: method, resource: uri.pathname + (uri.search || ''), host: uri.hostname, port: uri.port || (uri.protocol === 'http:' ? 80 : 443), hash: opts.hash, ext: opts.ext, app: opts.app, dlg: opts.dlg } if (!artifacts.hash && (opts.payload || opts.payload === '')) { artifacts.hash = calculatePayloadHash(opts.payload, credentials.algorithm, opts.contentType) } var mac = exports.calculateMac(credentials, artifacts) var hasExt = artifacts.ext !== null && artifacts.ext !== undefined && artifacts.ext !== '' var header = 'Hawk id="' + credentials.id + '", ts="' + artifacts.ts + '", nonce="' + artifacts.nonce + (artifacts.hash ? '", hash="' + artifacts.hash : '') + (hasExt ? '", ext="' + artifacts.ext.replace(/\\/g, '\\\\').replace(/"/g, '\\"') : '') + '", mac="' + mac + '"' if (artifacts.app) { header = header + ', app="' + artifacts.app + (artifacts.dlg ? '", dlg="' + artifacts.dlg : '') + '"' } return header } /***/ }), /***/ 74845: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; var jsonSafeStringify = __webpack_require__(57073) var crypto = __webpack_require__(33373) var Buffer = __webpack_require__(21867).Buffer var defer = typeof setImmediate === 'undefined' ? process.nextTick : setImmediate function paramsHaveRequestBody (params) { return ( params.body || params.requestBodyStream || (params.json && typeof params.json !== 'boolean') || params.multipart ) } function safeStringify (obj, replacer) { var ret try { ret = JSON.stringify(obj, replacer) } catch (e) { ret = jsonSafeStringify(obj, replacer) } return ret } function md5 (str) { return crypto.createHash('md5').update(str).digest('hex') } function isReadStream (rs) { return rs.readable && rs.path && rs.mode } function toBase64 (str) { return Buffer.from(str || '', 'utf8').toString('base64') } function copy (obj) { var o = {} Object.keys(obj).forEach(function (i) { o[i] = obj[i] }) return o } function version () { var numbers = process.version.replace('v', '').split('.') return { major: parseInt(numbers[0], 10), minor: parseInt(numbers[1], 10), patch: parseInt(numbers[2], 10) } } exports.paramsHaveRequestBody = paramsHaveRequestBody exports.safeStringify = safeStringify exports.md5 = md5 exports.isReadStream = isReadStream exports.toBase64 = toBase64 exports.copy = copy exports.version = version exports.defer = defer /***/ }), /***/ 87810: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; var uuid = __webpack_require__(71435) var CombinedStream = __webpack_require__(85443) var isstream = __webpack_require__(83362) var Buffer = __webpack_require__(21867).Buffer function Multipart (request) { this.request = request this.boundary = uuid() this.chunked = false this.body = null } Multipart.prototype.isChunked = function (options) { var self = this var chunked = false var parts = options.data || options if (!parts.forEach) { self.request.emit('error', new Error('Argument error, options.multipart.')) } if (options.chunked !== undefined) { chunked = options.chunked } if (self.request.getHeader('transfer-encoding') === 'chunked') { chunked = true } if (!chunked) { parts.forEach(function (part) { if (typeof part.body === 'undefined') { self.request.emit('error', new Error('Body attribute missing in multipart.')) } if (isstream(part.body)) { chunked = true } }) } return chunked } Multipart.prototype.setHeaders = function (chunked) { var self = this if (chunked && !self.request.hasHeader('transfer-encoding')) { self.request.setHeader('transfer-encoding', 'chunked') } var header = self.request.getHeader('content-type') if (!header || header.indexOf('multipart') === -1) { self.request.setHeader('content-type', 'multipart/related; boundary=' + self.boundary) } else { if (header.indexOf('boundary') !== -1) { self.boundary = header.replace(/.*boundary=([^\s;]+).*/, '$1') } else { self.request.setHeader('content-type', header + '; boundary=' + self.boundary) } } } Multipart.prototype.build = function (parts, chunked) { var self = this var body = chunked ? new CombinedStream() : [] function add (part) { if (typeof part === 'number') { part = part.toString() } return chunked ? body.append(part) : body.push(Buffer.from(part)) } if (self.request.preambleCRLF) { add('\r\n') } parts.forEach(function (part) { var preamble = '--' + self.boundary + '\r\n' Object.keys(part).forEach(function (key) { if (key === 'body') { return } preamble += key + ': ' + part[key] + '\r\n' }) preamble += '\r\n' add(preamble) add(part.body) add('\r\n') }) add('--' + self.boundary + '--') if (self.request.postambleCRLF) { add('\r\n') } return body } Multipart.prototype.onRequest = function (options) { var self = this var chunked = self.isChunked(options) var parts = options.data || options self.setHeaders(chunked) self.chunked = chunked self.body = self.build(parts, chunked) } exports.$ = Multipart /***/ }), /***/ 41174: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; var url = __webpack_require__(78835) var qs = __webpack_require__(47457) var caseless = __webpack_require__(35684) var uuid = __webpack_require__(71435) var oauth = __webpack_require__(43248) var crypto = __webpack_require__(33373) var Buffer = __webpack_require__(21867).Buffer function OAuth (request) { this.request = request this.params = null } OAuth.prototype.buildParams = function (_oauth, uri, method, query, form, qsLib) { var oa = {} for (var i in _oauth) { oa['oauth_' + i] = _oauth[i] } if (!oa.oauth_version) { oa.oauth_version = '1.0' } if (!oa.oauth_timestamp) { oa.oauth_timestamp = Math.floor(Date.now() / 1000).toString() } if (!oa.oauth_nonce) { oa.oauth_nonce = uuid().replace(/-/g, '') } if (!oa.oauth_signature_method) { oa.oauth_signature_method = 'HMAC-SHA1' } var consumer_secret_or_private_key = oa.oauth_consumer_secret || oa.oauth_private_key // eslint-disable-line camelcase delete oa.oauth_consumer_secret delete oa.oauth_private_key var token_secret = oa.oauth_token_secret // eslint-disable-line camelcase delete oa.oauth_token_secret var realm = oa.oauth_realm delete oa.oauth_realm delete oa.oauth_transport_method var baseurl = uri.protocol + '//' + uri.host + uri.pathname var params = qsLib.parse([].concat(query, form, qsLib.stringify(oa)).join('&')) oa.oauth_signature = oauth.sign( oa.oauth_signature_method, method, baseurl, params, consumer_secret_or_private_key, // eslint-disable-line camelcase token_secret // eslint-disable-line camelcase ) if (realm) { oa.realm = realm } return oa } OAuth.prototype.buildBodyHash = function (_oauth, body) { if (['HMAC-SHA1', 'RSA-SHA1'].indexOf(_oauth.signature_method || 'HMAC-SHA1') < 0) { this.request.emit('error', new Error('oauth: ' + _oauth.signature_method + ' signature_method not supported with body_hash signing.')) } var shasum = crypto.createHash('sha1') shasum.update(body || '') var sha1 = shasum.digest('hex') return Buffer.from(sha1, 'hex').toString('base64') } OAuth.prototype.concatParams = function (oa, sep, wrap) { wrap = wrap || '' var params = Object.keys(oa).filter(function (i) { return i !== 'realm' && i !== 'oauth_signature' }).sort() if (oa.realm) { params.splice(0, 0, 'realm') } params.push('oauth_signature') return params.map(function (i) { return i + '=' + wrap + oauth.rfc3986(oa[i]) + wrap }).join(sep) } OAuth.prototype.onRequest = function (_oauth) { var self = this self.params = _oauth var uri = self.request.uri || {} var method = self.request.method || '' var headers = caseless(self.request.headers) var body = self.request.body || '' var qsLib = self.request.qsLib || qs var form var query var contentType = headers.get('content-type') || '' var formContentType = 'application/x-www-form-urlencoded' var transport = _oauth.transport_method || 'header' if (contentType.slice(0, formContentType.length) === formContentType) { contentType = formContentType form = body } if (uri.query) { query = uri.query } if (transport === 'body' && (method !== 'POST' || contentType !== formContentType)) { self.request.emit('error', new Error('oauth: transport_method of body requires POST ' + 'and content-type ' + formContentType)) } if (!form && typeof _oauth.body_hash === 'boolean') { _oauth.body_hash = self.buildBodyHash(_oauth, self.request.body.toString()) } var oa = self.buildParams(_oauth, uri, method, query, form, qsLib) switch (transport) { case 'header': self.request.setHeader('Authorization', 'OAuth ' + self.concatParams(oa, ',', '"')) break case 'query': var href = self.request.uri.href += (query ? '&' : '?') + self.concatParams(oa, '&') self.request.uri = url.parse(href) self.request.path = self.request.uri.path break case 'body': self.request.body = (form ? form + '&' : '') + self.concatParams(oa, '&') break default: self.request.emit('error', new Error('oauth: transport_method invalid')) } } exports.f = OAuth /***/ }), /***/ 66476: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; var qs = __webpack_require__(47457) var querystring = __webpack_require__(71191) function Querystring (request) { this.request = request this.lib = null this.useQuerystring = null this.parseOptions = null this.stringifyOptions = null } Querystring.prototype.init = function (options) { if (this.lib) { return } this.useQuerystring = options.useQuerystring this.lib = (this.useQuerystring ? querystring : qs) this.parseOptions = options.qsParseOptions || {} this.stringifyOptions = options.qsStringifyOptions || {} } Querystring.prototype.stringify = function (obj) { return (this.useQuerystring) ? this.rfc3986(this.lib.stringify(obj, this.stringifyOptions.sep || null, this.stringifyOptions.eq || null, this.stringifyOptions)) : this.lib.stringify(obj, this.stringifyOptions) } Querystring.prototype.parse = function (str) { return (this.useQuerystring) ? this.lib.parse(str, this.parseOptions.sep || null, this.parseOptions.eq || null, this.parseOptions) : this.lib.parse(str, this.parseOptions) } Querystring.prototype.rfc3986 = function (str) { return str.replace(/[!'()*]/g, function (c) { return '%' + c.charCodeAt(0).toString(16).toUpperCase() }) } Querystring.prototype.unescape = querystring.unescape exports.h = Querystring /***/ }), /***/ 3048: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; var url = __webpack_require__(78835) var isUrl = /^https?:/ function Redirect (request) { this.request = request this.followRedirect = true this.followRedirects = true this.followAllRedirects = false this.followOriginalHttpMethod = false this.allowRedirect = function () { return true } this.maxRedirects = 10 this.redirects = [] this.redirectsFollowed = 0 this.removeRefererHeader = false } Redirect.prototype.onRequest = function (options) { var self = this if (options.maxRedirects !== undefined) { self.maxRedirects = options.maxRedirects } if (typeof options.followRedirect === 'function') { self.allowRedirect = options.followRedirect } if (options.followRedirect !== undefined) { self.followRedirects = !!options.followRedirect } if (options.followAllRedirects !== undefined) { self.followAllRedirects = options.followAllRedirects } if (self.followRedirects || self.followAllRedirects) { self.redirects = self.redirects || [] } if (options.removeRefererHeader !== undefined) { self.removeRefererHeader = options.removeRefererHeader } if (options.followOriginalHttpMethod !== undefined) { self.followOriginalHttpMethod = options.followOriginalHttpMethod } } Redirect.prototype.redirectTo = function (response) { var self = this var request = self.request var redirectTo = null if (response.statusCode >= 300 && response.statusCode < 400 && response.caseless.has('location')) { var location = response.caseless.get('location') request.debug('redirect', location) if (self.followAllRedirects) { redirectTo = location } else if (self.followRedirects) { switch (request.method) { case 'PATCH': case 'PUT': case 'POST': case 'DELETE': // Do not follow redirects break default: redirectTo = location break } } } else if (response.statusCode === 401) { var authHeader = request._auth.onResponse(response) if (authHeader) { request.setHeader('authorization', authHeader) redirectTo = request.uri } } return redirectTo } Redirect.prototype.onResponse = function (response) { var self = this var request = self.request var redirectTo = self.redirectTo(response) if (!redirectTo || !self.allowRedirect.call(request, response)) { return false } request.debug('redirect to', redirectTo) // ignore any potential response body. it cannot possibly be useful // to us at this point. // response.resume should be defined, but check anyway before calling. Workaround for browserify. if (response.resume) { response.resume() } if (self.redirectsFollowed >= self.maxRedirects) { request.emit('error', new Error('Exceeded maxRedirects. Probably stuck in a redirect loop ' + request.uri.href)) return false } self.redirectsFollowed += 1 if (!isUrl.test(redirectTo)) { redirectTo = url.resolve(request.uri.href, redirectTo) } var uriPrev = request.uri request.uri = url.parse(redirectTo) // handle the case where we change protocol from https to http or vice versa if (request.uri.protocol !== uriPrev.protocol) { delete request.agent } self.redirects.push({ statusCode: response.statusCode, redirectUri: redirectTo }) if (self.followAllRedirects && request.method !== 'HEAD' && response.statusCode !== 401 && response.statusCode !== 307) { request.method = self.followOriginalHttpMethod ? request.method : 'GET' } // request.method = 'GET' // Force all redirects to use GET || commented out fixes #215 delete request.src delete request.req delete request._started if (response.statusCode !== 401 && response.statusCode !== 307) { // Remove parameters from the previous response, unless this is the second request // for a server that requires digest authentication. delete request.body delete request._form if (request.headers) { request.removeHeader('host') request.removeHeader('content-type') request.removeHeader('content-length') if (request.uri.hostname !== request.originalHost.split(':')[0]) { // Remove authorization if changing hostnames (but not if just // changing ports or protocols). This matches the behavior of curl: // https://github.com/bagder/curl/blob/6beb0eee/lib/http.c#L710 request.removeHeader('authorization') } } } if (!self.removeRefererHeader) { request.setHeader('referer', uriPrev.href) } request.emit('redirect') request.init() return true } exports.l = Redirect /***/ }), /***/ 17619: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; var url = __webpack_require__(78835) var tunnel = __webpack_require__(11137) var defaultProxyHeaderWhiteList = [ 'accept', 'accept-charset', 'accept-encoding', 'accept-language', 'accept-ranges', 'cache-control', 'content-encoding', 'content-language', 'content-location', 'content-md5', 'content-range', 'content-type', 'connection', 'date', 'expect', 'max-forwards', 'pragma', 'referer', 'te', 'user-agent', 'via' ] var defaultProxyHeaderExclusiveList = [ 'proxy-authorization' ] function constructProxyHost (uriObject) { var port = uriObject.port var protocol = uriObject.protocol var proxyHost = uriObject.hostname + ':' if (port) { proxyHost += port } else if (protocol === 'https:') { proxyHost += '443' } else { proxyHost += '80' } return proxyHost } function constructProxyHeaderWhiteList (headers, proxyHeaderWhiteList) { var whiteList = proxyHeaderWhiteList .reduce(function (set, header) { set[header.toLowerCase()] = true return set }, {}) return Object.keys(headers) .filter(function (header) { return whiteList[header.toLowerCase()] }) .reduce(function (set, header) { set[header] = headers[header] return set }, {}) } function constructTunnelOptions (request, proxyHeaders) { var proxy = request.proxy var tunnelOptions = { proxy: { host: proxy.hostname, port: +proxy.port, proxyAuth: proxy.auth, headers: proxyHeaders }, headers: request.headers, ca: request.ca, cert: request.cert, key: request.key, passphrase: request.passphrase, pfx: request.pfx, ciphers: request.ciphers, rejectUnauthorized: request.rejectUnauthorized, secureOptions: request.secureOptions, secureProtocol: request.secureProtocol } return tunnelOptions } function constructTunnelFnName (uri, proxy) { var uriProtocol = (uri.protocol === 'https:' ? 'https' : 'http') var proxyProtocol = (proxy.protocol === 'https:' ? 'Https' : 'Http') return [uriProtocol, proxyProtocol].join('Over') } function getTunnelFn (request) { var uri = request.uri var proxy = request.proxy var tunnelFnName = constructTunnelFnName(uri, proxy) return tunnel[tunnelFnName] } function Tunnel (request) { this.request = request this.proxyHeaderWhiteList = defaultProxyHeaderWhiteList this.proxyHeaderExclusiveList = [] if (typeof request.tunnel !== 'undefined') { this.tunnelOverride = request.tunnel } } Tunnel.prototype.isEnabled = function () { var self = this var request = self.request // Tunnel HTTPS by default. Allow the user to override this setting. // If self.tunnelOverride is set (the user specified a value), use it. if (typeof self.tunnelOverride !== 'undefined') { return self.tunnelOverride } // If the destination is HTTPS, tunnel. if (request.uri.protocol === 'https:') { return true } // Otherwise, do not use tunnel. return false } Tunnel.prototype.setup = function (options) { var self = this var request = self.request options = options || {} if (typeof request.proxy === 'string') { request.proxy = url.parse(request.proxy) } if (!request.proxy || !request.tunnel) { return false } // Setup Proxy Header Exclusive List and White List if (options.proxyHeaderWhiteList) { self.proxyHeaderWhiteList = options.proxyHeaderWhiteList } if (options.proxyHeaderExclusiveList) { self.proxyHeaderExclusiveList = options.proxyHeaderExclusiveList } var proxyHeaderExclusiveList = self.proxyHeaderExclusiveList.concat(defaultProxyHeaderExclusiveList) var proxyHeaderWhiteList = self.proxyHeaderWhiteList.concat(proxyHeaderExclusiveList) // Setup Proxy Headers and Proxy Headers Host // Only send the Proxy White Listed Header names var proxyHeaders = constructProxyHeaderWhiteList(request.headers, proxyHeaderWhiteList) proxyHeaders.host = constructProxyHost(request.uri) proxyHeaderExclusiveList.forEach(request.removeHeader, request) // Set Agent from Tunnel Data var tunnelFn = getTunnelFn(request) var tunnelOptions = constructTunnelOptions(request, proxyHeaders) request.agent = tunnelFn(tunnelOptions) return true } Tunnel.defaultProxyHeaderWhiteList = defaultProxyHeaderWhiteList Tunnel.defaultProxyHeaderExclusiveList = defaultProxyHeaderExclusiveList exports.n = Tunnel /***/ }), /***/ 11377: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { var CombinedStream = __webpack_require__(85443); var util = __webpack_require__(31669); var path = __webpack_require__(85622); var http = __webpack_require__(98605); var https = __webpack_require__(57211); var parseUrl = __webpack_require__(78835).parse; var fs = __webpack_require__(35747); var mime = __webpack_require__(43583); var asynckit = __webpack_require__(14812); var populate = __webpack_require__(94932); // Public API module.exports = FormData; // make it a Stream util.inherits(FormData, CombinedStream); /** * Create readable "multipart/form-data" streams. * Can be used to submit forms * and file uploads to other web applications. * * @constructor * @param {Object} options - Properties to be added/overriden for FormData and CombinedStream */ function FormData(options) { if (!(this instanceof FormData)) { return new FormData(); } this._overheadLength = 0; this._valueLength = 0; this._valuesToMeasure = []; CombinedStream.call(this); options = options || {}; for (var option in options) { this[option] = options[option]; } } FormData.LINE_BREAK = '\r\n'; FormData.DEFAULT_CONTENT_TYPE = 'application/octet-stream'; FormData.prototype.append = function(field, value, options) { options = options || {}; // allow filename as single option if (typeof options == 'string') { options = {filename: options}; } var append = CombinedStream.prototype.append.bind(this); // all that streamy business can't handle numbers if (typeof value == 'number') { value = '' + value; } // https://github.com/felixge/node-form-data/issues/38 if (util.isArray(value)) { // Please convert your array into string // the way web server expects it this._error(new Error('Arrays are not supported.')); return; } var header = this._multiPartHeader(field, value, options); var footer = this._multiPartFooter(); append(header); append(value); append(footer); // pass along options.knownLength this._trackLength(header, value, options); }; FormData.prototype._trackLength = function(header, value, options) { var valueLength = 0; // used w/ getLengthSync(), when length is known. // e.g. for streaming directly from a remote server, // w/ a known file a size, and not wanting to wait for // incoming file to finish to get its size. if (options.knownLength != null) { valueLength += +options.knownLength; } else if (Buffer.isBuffer(value)) { valueLength = value.length; } else if (typeof value === 'string') { valueLength = Buffer.byteLength(value); } this._valueLength += valueLength; // @check why add CRLF? does this account for custom/multiple CRLFs? this._overheadLength += Buffer.byteLength(header) + FormData.LINE_BREAK.length; // empty or either doesn't have path or not an http response if (!value || ( !value.path && !(value.readable && value.hasOwnProperty('httpVersion')) )) { return; } // no need to bother with the length if (!options.knownLength) { this._valuesToMeasure.push(value); } }; FormData.prototype._lengthRetriever = function(value, callback) { if (value.hasOwnProperty('fd')) { // take read range into a account // `end` = Infinity –> read file till the end // // TODO: Looks like there is bug in Node fs.createReadStream // it doesn't respect `end` options without `start` options // Fix it when node fixes it. // https://github.com/joyent/node/issues/7819 if (value.end != undefined && value.end != Infinity && value.start != undefined) { // when end specified // no need to calculate range // inclusive, starts with 0 callback(null, value.end + 1 - (value.start ? value.start : 0)); // not that fast snoopy } else { // still need to fetch file size from fs fs.stat(value.path, function(err, stat) { var fileSize; if (err) { callback(err); return; } // update final size based on the range options fileSize = stat.size - (value.start ? value.start : 0); callback(null, fileSize); }); } // or http response } else if (value.hasOwnProperty('httpVersion')) { callback(null, +value.headers['content-length']); // or request stream http://github.com/mikeal/request } else if (value.hasOwnProperty('httpModule')) { // wait till response come back value.on('response', function(response) { value.pause(); callback(null, +response.headers['content-length']); }); value.resume(); // something else } else { callback('Unknown stream'); } }; FormData.prototype._multiPartHeader = function(field, value, options) { // custom header specified (as string)? // it becomes responsible for boundary // (e.g. to handle extra CRLFs on .NET servers) if (typeof options.header == 'string') { return options.header; } var contentDisposition = this._getContentDisposition(value, options); var contentType = this._getContentType(value, options); var contents = ''; var headers = { // add custom disposition as third element or keep it two elements if not 'Content-Disposition': ['form-data', 'name="' + field + '"'].concat(contentDisposition || []), // if no content type. allow it to be empty array 'Content-Type': [].concat(contentType || []) }; // allow custom headers. if (typeof options.header == 'object') { populate(headers, options.header); } var header; for (var prop in headers) { if (!headers.hasOwnProperty(prop)) continue; header = headers[prop]; // skip nullish headers. if (header == null) { continue; } // convert all headers to arrays. if (!Array.isArray(header)) { header = [header]; } // add non-empty headers. if (header.length) { contents += prop + ': ' + header.join('; ') + FormData.LINE_BREAK; } } return '--' + this.getBoundary() + FormData.LINE_BREAK + contents + FormData.LINE_BREAK; }; FormData.prototype._getContentDisposition = function(value, options) { var filename , contentDisposition ; if (typeof options.filepath === 'string') { // custom filepath for relative paths filename = path.normalize(options.filepath).replace(/\\/g, '/'); } else if (options.filename || value.name || value.path) { // custom filename take precedence // formidable and the browser add a name property // fs- and request- streams have path property filename = path.basename(options.filename || value.name || value.path); } else if (value.readable && value.hasOwnProperty('httpVersion')) { // or try http response filename = path.basename(value.client._httpMessage.path); } if (filename) { contentDisposition = 'filename="' + filename + '"'; } return contentDisposition; }; FormData.prototype._getContentType = function(value, options) { // use custom content-type above all var contentType = options.contentType; // or try `name` from formidable, browser if (!contentType && value.name) { contentType = mime.lookup(value.name); } // or try `path` from fs-, request- streams if (!contentType && value.path) { contentType = mime.lookup(value.path); } // or if it's http-reponse if (!contentType && value.readable && value.hasOwnProperty('httpVersion')) { contentType = value.headers['content-type']; } // or guess it from the filepath or filename if (!contentType && (options.filepath || options.filename)) { contentType = mime.lookup(options.filepath || options.filename); } // fallback to the default content type if `value` is not simple value if (!contentType && typeof value == 'object') { contentType = FormData.DEFAULT_CONTENT_TYPE; } return contentType; }; FormData.prototype._multiPartFooter = function() { return function(next) { var footer = FormData.LINE_BREAK; var lastPart = (this._streams.length === 0); if (lastPart) { footer += this._lastBoundary(); } next(footer); }.bind(this); }; FormData.prototype._lastBoundary = function() { return '--' + this.getBoundary() + '--' + FormData.LINE_BREAK; }; FormData.prototype.getHeaders = function(userHeaders) { var header; var formHeaders = { 'content-type': 'multipart/form-data; boundary=' + this.getBoundary() }; for (header in userHeaders) { if (userHeaders.hasOwnProperty(header)) { formHeaders[header.toLowerCase()] = userHeaders[header]; } } return formHeaders; }; FormData.prototype.getBoundary = function() { if (!this._boundary) { this._generateBoundary(); } return this._boundary; }; FormData.prototype._generateBoundary = function() { // This generates a 50 character boundary similar to those used by Firefox. // They are optimized for boyer-moore parsing. var boundary = '--------------------------'; for (var i = 0; i < 24; i++) { boundary += Math.floor(Math.random() * 10).toString(16); } this._boundary = boundary; }; // Note: getLengthSync DOESN'T calculate streams length // As workaround one can calculate file size manually // and add it as knownLength option FormData.prototype.getLengthSync = function() { var knownLength = this._overheadLength + this._valueLength; // Don't get confused, there are 3 "internal" streams for each keyval pair // so it basically checks if there is any value added to the form if (this._streams.length) { knownLength += this._lastBoundary().length; } // https://github.com/form-data/form-data/issues/40 if (!this.hasKnownLength()) { // Some async length retrievers are present // therefore synchronous length calculation is false. // Please use getLength(callback) to get proper length this._error(new Error('Cannot calculate proper length in synchronous way.')); } return knownLength; }; // Public API to check if length of added values is known // https://github.com/form-data/form-data/issues/196 // https://github.com/form-data/form-data/issues/262 FormData.prototype.hasKnownLength = function() { var hasKnownLength = true; if (this._valuesToMeasure.length) { hasKnownLength = false; } return hasKnownLength; }; FormData.prototype.getLength = function(cb) { var knownLength = this._overheadLength + this._valueLength; if (this._streams.length) { knownLength += this._lastBoundary().length; } if (!this._valuesToMeasure.length) { process.nextTick(cb.bind(this, null, knownLength)); return; } asynckit.parallel(this._valuesToMeasure, this._lengthRetriever, function(err, values) { if (err) { cb(err); return; } values.forEach(function(length) { knownLength += length; }); cb(null, knownLength); }); }; FormData.prototype.submit = function(params, cb) { var request , options , defaults = {method: 'post'} ; // parse provided url if it's string // or treat it as options object if (typeof params == 'string') { params = parseUrl(params); options = populate({ port: params.port, path: params.pathname, host: params.hostname, protocol: params.protocol }, defaults); // use custom params } else { options = populate(params, defaults); // if no port provided use default one if (!options.port) { options.port = options.protocol == 'https:' ? 443 : 80; } } // put that good code in getHeaders to some use options.headers = this.getHeaders(params.headers); // https if specified, fallback to http in any other case if (options.protocol == 'https:') { request = https.request(options); } else { request = http.request(options); } // get content length and fire away this.getLength(function(err, length) { if (err) { this._error(err); return; } // add content length request.setHeader('Content-Length', length); this.pipe(request); if (cb) { request.on('error', cb); request.on('response', cb.bind(this, null)); } }.bind(this)); return request; }; FormData.prototype._error = function(err) { if (!this.error) { this.error = err; this.pause(); this.emit('error', err); } }; FormData.prototype.toString = function () { return '[object FormData]'; }; /***/ }), /***/ 94932: /***/ ((module) => { // populates missing values module.exports = function(dst, src) { Object.keys(src).forEach(function(prop) { dst[prop] = dst[prop] || src[prop]; }); return dst; }; /***/ }), /***/ 28321: /***/ ((module) => { "use strict"; var replace = String.prototype.replace; var percentTwenties = /%20/g; module.exports = { 'default': 'RFC3986', formatters: { RFC1738: function (value) { return replace.call(value, percentTwenties, '+'); }, RFC3986: function (value) { return value; } }, RFC1738: 'RFC1738', RFC3986: 'RFC3986' }; /***/ }), /***/ 47457: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; var stringify = __webpack_require__(64021); var parse = __webpack_require__(90693); var formats = __webpack_require__(28321); module.exports = { formats: formats, parse: parse, stringify: stringify }; /***/ }), /***/ 90693: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; var utils = __webpack_require__(17409); var has = Object.prototype.hasOwnProperty; var defaults = { allowDots: false, allowPrototypes: false, arrayLimit: 20, decoder: utils.decode, delimiter: '&', depth: 5, parameterLimit: 1000, plainObjects: false, strictNullHandling: false }; var parseValues = function parseQueryStringValues(str, options) { var obj = {}; var cleanStr = options.ignoreQueryPrefix ? str.replace(/^\?/, '') : str; var limit = options.parameterLimit === Infinity ? undefined : options.parameterLimit; var parts = cleanStr.split(options.delimiter, limit); for (var i = 0; i < parts.length; ++i) { var part = parts[i]; var bracketEqualsPos = part.indexOf(']='); var pos = bracketEqualsPos === -1 ? part.indexOf('=') : bracketEqualsPos + 1; var key, val; if (pos === -1) { key = options.decoder(part, defaults.decoder); val = options.strictNullHandling ? null : ''; } else { key = options.decoder(part.slice(0, pos), defaults.decoder); val = options.decoder(part.slice(pos + 1), defaults.decoder); } if (has.call(obj, key)) { obj[key] = [].concat(obj[key]).concat(val); } else { obj[key] = val; } } return obj; }; var parseObject = function (chain, val, options) { var leaf = val; for (var i = chain.length - 1; i >= 0; --i) { var obj; var root = chain[i]; if (root === '[]') { obj = []; obj = obj.concat(leaf); } else { obj = options.plainObjects ? Object.create(null) : {}; var cleanRoot = root.charAt(0) === '[' && root.charAt(root.length - 1) === ']' ? root.slice(1, -1) : root; var index = parseInt(cleanRoot, 10); if ( !isNaN(index) && root !== cleanRoot && String(index) === cleanRoot && index >= 0 && (options.parseArrays && index <= options.arrayLimit) ) { obj = []; obj[index] = leaf; } else { obj[cleanRoot] = leaf; } } leaf = obj; } return leaf; }; var parseKeys = function parseQueryStringKeys(givenKey, val, options) { if (!givenKey) { return; } // Transform dot notation to bracket notation var key = options.allowDots ? givenKey.replace(/\.([^.[]+)/g, '[$1]') : givenKey; // The regex chunks var brackets = /(\[[^[\]]*])/; var child = /(\[[^[\]]*])/g; // Get the parent var segment = brackets.exec(key); var parent = segment ? key.slice(0, segment.index) : key; // Stash the parent if it exists var keys = []; if (parent) { // If we aren't using plain objects, optionally prefix keys // that would overwrite object prototype properties if (!options.plainObjects && has.call(Object.prototype, parent)) { if (!options.allowPrototypes) { return; } } keys.push(parent); } // Loop through children appending to the array until we hit depth var i = 0; while ((segment = child.exec(key)) !== null && i < options.depth) { i += 1; if (!options.plainObjects && has.call(Object.prototype, segment[1].slice(1, -1))) { if (!options.allowPrototypes) { return; } } keys.push(segment[1]); } // If there's a remainder, just add whatever is left if (segment) { keys.push('[' + key.slice(segment.index) + ']'); } return parseObject(keys, val, options); }; module.exports = function (str, opts) { var options = opts ? utils.assign({}, opts) : {}; if (options.decoder !== null && options.decoder !== undefined && typeof options.decoder !== 'function') { throw new TypeError('Decoder has to be a function.'); } options.ignoreQueryPrefix = options.ignoreQueryPrefix === true; options.delimiter = typeof options.delimiter === 'string' || utils.isRegExp(options.delimiter) ? options.delimiter : defaults.delimiter; options.depth = typeof options.depth === 'number' ? options.depth : defaults.depth; options.arrayLimit = typeof options.arrayLimit === 'number' ? options.arrayLimit : defaults.arrayLimit; options.parseArrays = options.parseArrays !== false; options.decoder = typeof options.decoder === 'function' ? options.decoder : defaults.decoder; options.allowDots = typeof options.allowDots === 'boolean' ? options.allowDots : defaults.allowDots; options.plainObjects = typeof options.plainObjects === 'boolean' ? options.plainObjects : defaults.plainObjects; options.allowPrototypes = typeof options.allowPrototypes === 'boolean' ? options.allowPrototypes : defaults.allowPrototypes; options.parameterLimit = typeof options.parameterLimit === 'number' ? options.parameterLimit : defaults.parameterLimit; options.strictNullHandling = typeof options.strictNullHandling === 'boolean' ? options.strictNullHandling : defaults.strictNullHandling; if (str === '' || str === null || typeof str === 'undefined') { return options.plainObjects ? Object.create(null) : {}; } var tempObj = typeof str === 'string' ? parseValues(str, options) : str; var obj = options.plainObjects ? Object.create(null) : {}; // Iterate over the keys and setup the new object var keys = Object.keys(tempObj); for (var i = 0; i < keys.length; ++i) { var key = keys[i]; var newObj = parseKeys(key, tempObj[key], options); obj = utils.merge(obj, newObj, options); } return utils.compact(obj); }; /***/ }), /***/ 64021: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; var utils = __webpack_require__(17409); var formats = __webpack_require__(28321); var arrayPrefixGenerators = { brackets: function brackets(prefix) { // eslint-disable-line func-name-matching return prefix + '[]'; }, indices: function indices(prefix, key) { // eslint-disable-line func-name-matching return prefix + '[' + key + ']'; }, repeat: function repeat(prefix) { // eslint-disable-line func-name-matching return prefix; } }; var toISO = Date.prototype.toISOString; var defaults = { delimiter: '&', encode: true, encoder: utils.encode, encodeValuesOnly: false, serializeDate: function serializeDate(date) { // eslint-disable-line func-name-matching return toISO.call(date); }, skipNulls: false, strictNullHandling: false }; var stringify = function stringify( // eslint-disable-line func-name-matching object, prefix, generateArrayPrefix, strictNullHandling, skipNulls, encoder, filter, sort, allowDots, serializeDate, formatter, encodeValuesOnly ) { var obj = object; if (typeof filter === 'function') { obj = filter(prefix, obj); } else if (obj instanceof Date) { obj = serializeDate(obj); } else if (obj === null) { if (strictNullHandling) { return encoder && !encodeValuesOnly ? encoder(prefix, defaults.encoder) : prefix; } obj = ''; } if (typeof obj === 'string' || typeof obj === 'number' || typeof obj === 'boolean' || utils.isBuffer(obj)) { if (encoder) { var keyValue = encodeValuesOnly ? prefix : encoder(prefix, defaults.encoder); return [formatter(keyValue) + '=' + formatter(encoder(obj, defaults.encoder))]; } return [formatter(prefix) + '=' + formatter(String(obj))]; } var values = []; if (typeof obj === 'undefined') { return values; } var objKeys; if (Array.isArray(filter)) { objKeys = filter; } else { var keys = Object.keys(obj); objKeys = sort ? keys.sort(sort) : keys; } for (var i = 0; i < objKeys.length; ++i) { var key = objKeys[i]; if (skipNulls && obj[key] === null) { continue; } if (Array.isArray(obj)) { values = values.concat(stringify( obj[key], generateArrayPrefix(prefix, key), generateArrayPrefix, strictNullHandling, skipNulls, encoder, filter, sort, allowDots, serializeDate, formatter, encodeValuesOnly )); } else { values = values.concat(stringify( obj[key], prefix + (allowDots ? '.' + key : '[' + key + ']'), generateArrayPrefix, strictNullHandling, skipNulls, encoder, filter, sort, allowDots, serializeDate, formatter, encodeValuesOnly )); } } return values; }; module.exports = function (object, opts) { var obj = object; var options = opts ? utils.assign({}, opts) : {}; if (options.encoder !== null && options.encoder !== undefined && typeof options.encoder !== 'function') { throw new TypeError('Encoder has to be a function.'); } var delimiter = typeof options.delimiter === 'undefined' ? defaults.delimiter : options.delimiter; var strictNullHandling = typeof options.strictNullHandling === 'boolean' ? options.strictNullHandling : defaults.strictNullHandling; var skipNulls = typeof options.skipNulls === 'boolean' ? options.skipNulls : defaults.skipNulls; var encode = typeof options.encode === 'boolean' ? options.encode : defaults.encode; var encoder = typeof options.encoder === 'function' ? options.encoder : defaults.encoder; var sort = typeof options.sort === 'function' ? options.sort : null; var allowDots = typeof options.allowDots === 'undefined' ? false : options.allowDots; var serializeDate = typeof options.serializeDate === 'function' ? options.serializeDate : defaults.serializeDate; var encodeValuesOnly = typeof options.encodeValuesOnly === 'boolean' ? options.encodeValuesOnly : defaults.encodeValuesOnly; if (typeof options.format === 'undefined') { options.format = formats['default']; } else if (!Object.prototype.hasOwnProperty.call(formats.formatters, options.format)) { throw new TypeError('Unknown format option provided.'); } var formatter = formats.formatters[options.format]; var objKeys; var filter; if (typeof options.filter === 'function') { filter = options.filter; obj = filter('', obj); } else if (Array.isArray(options.filter)) { filter = options.filter; objKeys = filter; } var keys = []; if (typeof obj !== 'object' || obj === null) { return ''; } var arrayFormat; if (options.arrayFormat in arrayPrefixGenerators) { arrayFormat = options.arrayFormat; } else if ('indices' in options) { arrayFormat = options.indices ? 'indices' : 'repeat'; } else { arrayFormat = 'indices'; } var generateArrayPrefix = arrayPrefixGenerators[arrayFormat]; if (!objKeys) { objKeys = Object.keys(obj); } if (sort) { objKeys.sort(sort); } for (var i = 0; i < objKeys.length; ++i) { var key = objKeys[i]; if (skipNulls && obj[key] === null) { continue; } keys = keys.concat(stringify( obj[key], key, generateArrayPrefix, strictNullHandling, skipNulls, encode ? encoder : null, filter, sort, allowDots, serializeDate, formatter, encodeValuesOnly )); } var joined = keys.join(delimiter); var prefix = options.addQueryPrefix === true ? '?' : ''; return joined.length > 0 ? prefix + joined : ''; }; /***/ }), /***/ 17409: /***/ ((module) => { "use strict"; var has = Object.prototype.hasOwnProperty; var hexTable = (function () { var array = []; for (var i = 0; i < 256; ++i) { array.push('%' + ((i < 16 ? '0' : '') + i.toString(16)).toUpperCase()); } return array; }()); var compactQueue = function compactQueue(queue) { var obj; while (queue.length) { var item = queue.pop(); obj = item.obj[item.prop]; if (Array.isArray(obj)) { var compacted = []; for (var j = 0; j < obj.length; ++j) { if (typeof obj[j] !== 'undefined') { compacted.push(obj[j]); } } item.obj[item.prop] = compacted; } } return obj; }; var arrayToObject = function arrayToObject(source, options) { var obj = options && options.plainObjects ? Object.create(null) : {}; for (var i = 0; i < source.length; ++i) { if (typeof source[i] !== 'undefined') { obj[i] = source[i]; } } return obj; }; var merge = function merge(target, source, options) { if (!source) { return target; } if (typeof source !== 'object') { if (Array.isArray(target)) { target.push(source); } else if (typeof target === 'object') { if (options.plainObjects || options.allowPrototypes || !has.call(Object.prototype, source)) { target[source] = true; } } else { return [target, source]; } return target; } if (typeof target !== 'object') { return [target].concat(source); } var mergeTarget = target; if (Array.isArray(target) && !Array.isArray(source)) { mergeTarget = arrayToObject(target, options); } if (Array.isArray(target) && Array.isArray(source)) { source.forEach(function (item, i) { if (has.call(target, i)) { if (target[i] && typeof target[i] === 'object') { target[i] = merge(target[i], item, options); } else { target.push(item); } } else { target[i] = item; } }); return target; } return Object.keys(source).reduce(function (acc, key) { var value = source[key]; if (has.call(acc, key)) { acc[key] = merge(acc[key], value, options); } else { acc[key] = value; } return acc; }, mergeTarget); }; var assign = function assignSingleSource(target, source) { return Object.keys(source).reduce(function (acc, key) { acc[key] = source[key]; return acc; }, target); }; var decode = function (str) { try { return decodeURIComponent(str.replace(/\+/g, ' ')); } catch (e) { return str; } }; var encode = function encode(str) { // This code was originally written by Brian White (mscdex) for the io.js core querystring library. // It has been adapted here for stricter adherence to RFC 3986 if (str.length === 0) { return str; } var string = typeof str === 'string' ? str : String(str); var out = ''; for (var i = 0; i < string.length; ++i) { var c = string.charCodeAt(i); if ( c === 0x2D // - || c === 0x2E // . || c === 0x5F // _ || c === 0x7E // ~ || (c >= 0x30 && c <= 0x39) // 0-9 || (c >= 0x41 && c <= 0x5A) // a-z || (c >= 0x61 && c <= 0x7A) // A-Z ) { out += string.charAt(i); continue; } if (c < 0x80) { out = out + hexTable[c]; continue; } if (c < 0x800) { out = out + (hexTable[0xC0 | (c >> 6)] + hexTable[0x80 | (c & 0x3F)]); continue; } if (c < 0xD800 || c >= 0xE000) { out = out + (hexTable[0xE0 | (c >> 12)] + hexTable[0x80 | ((c >> 6) & 0x3F)] + hexTable[0x80 | (c & 0x3F)]); continue; } i += 1; c = 0x10000 + (((c & 0x3FF) << 10) | (string.charCodeAt(i) & 0x3FF)); out += hexTable[0xF0 | (c >> 18)] + hexTable[0x80 | ((c >> 12) & 0x3F)] + hexTable[0x80 | ((c >> 6) & 0x3F)] + hexTable[0x80 | (c & 0x3F)]; } return out; }; var compact = function compact(value) { var queue = [{ obj: { o: value }, prop: 'o' }]; var refs = []; for (var i = 0; i < queue.length; ++i) { var item = queue[i]; var obj = item.obj[item.prop]; var keys = Object.keys(obj); for (var j = 0; j < keys.length; ++j) { var key = keys[j]; var val = obj[key]; if (typeof val === 'object' && val !== null && refs.indexOf(val) === -1) { queue.push({ obj: obj, prop: key }); refs.push(val); } } } return compactQueue(queue); }; var isRegExp = function isRegExp(obj) { return Object.prototype.toString.call(obj) === '[object RegExp]'; }; var isBuffer = function isBuffer(obj) { if (obj === null || typeof obj === 'undefined') { return false; } return !!(obj.constructor && obj.constructor.isBuffer && obj.constructor.isBuffer(obj)); }; module.exports = { arrayToObject: arrayToObject, assign: assign, compact: compact, decode: decode, encode: encode, isBuffer: isBuffer, isRegExp: isRegExp, merge: merge }; /***/ }), /***/ 67087: /***/ ((module) => { /** * Convert array of 16 byte values to UUID string format of the form: * XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX */ var byteToHex = []; for (var i = 0; i < 256; ++i) { byteToHex[i] = (i + 0x100).toString(16).substr(1); } function bytesToUuid(buf, offset) { var i = offset || 0; var bth = byteToHex; // join used to fix memory issue caused by concatenation: https://bugs.chromium.org/p/v8/issues/detail?id=3175#c4 return ([ bth[buf[i++]], bth[buf[i++]], bth[buf[i++]], bth[buf[i++]], '-', bth[buf[i++]], bth[buf[i++]], '-', bth[buf[i++]], bth[buf[i++]], '-', bth[buf[i++]], bth[buf[i++]], '-', bth[buf[i++]], bth[buf[i++]], bth[buf[i++]], bth[buf[i++]], bth[buf[i++]], bth[buf[i++]] ]).join(''); } module.exports = bytesToUuid; /***/ }), /***/ 9117: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { // Unique ID creation requires a high quality random # generator. In node.js // this is pretty straight-forward - we use the crypto API. var crypto = __webpack_require__(33373); module.exports = function nodeRNG() { return crypto.randomBytes(16); }; /***/ }), /***/ 71435: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { var rng = __webpack_require__(9117); var bytesToUuid = __webpack_require__(67087); function v4(options, buf, offset) { var i = buf && offset || 0; if (typeof(options) == 'string') { buf = options === 'binary' ? new Array(16) : null; options = null; } options = options || {}; var rnds = options.random || (options.rng || rng)(); // Per 4.4, set bits for version and `clock_seq_hi_and_reserved` rnds[6] = (rnds[6] & 0x0f) | 0x40; rnds[8] = (rnds[8] & 0x3f) | 0x80; // Copy bytes to buffer, if provided if (buf) { for (var ii = 0; ii < 16; ++ii) { buf[i + ii] = rnds[ii]; } } return buf || bytesToUuid(rnds); } module.exports = v4; /***/ }), /***/ 70304: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; var http = __webpack_require__(98605) var https = __webpack_require__(57211) var url = __webpack_require__(78835) var util = __webpack_require__(31669) var stream = __webpack_require__(92413) var zlib = __webpack_require__(78761) var aws2 = __webpack_require__(96342) var aws4 = __webpack_require__(16071) var httpSignature = __webpack_require__(42479) var mime = __webpack_require__(43583) var caseless = __webpack_require__(35684) var ForeverAgent = __webpack_require__(47568) var FormData = __webpack_require__(11377) var extend = __webpack_require__(38171) var isstream = __webpack_require__(83362) var isTypedArray = __webpack_require__(10657).strict var helpers = __webpack_require__(74845) var cookies = __webpack_require__(50976) var getProxyFromURI = __webpack_require__(75654) var Querystring = __webpack_require__(66476)/* .Querystring */ .h var Har = __webpack_require__(3248)/* .Har */ .t var Auth = __webpack_require__(76996)/* .Auth */ .g var OAuth = __webpack_require__(41174)/* .OAuth */ .f var hawk = __webpack_require__(34473) var Multipart = __webpack_require__(87810)/* .Multipart */ .$ var Redirect = __webpack_require__(3048)/* .Redirect */ .l var Tunnel = __webpack_require__(17619)/* .Tunnel */ .n var now = __webpack_require__(85644) var Buffer = __webpack_require__(21867).Buffer var safeStringify = helpers.safeStringify var isReadStream = helpers.isReadStream var toBase64 = helpers.toBase64 var defer = helpers.defer var copy = helpers.copy var version = helpers.version var globalCookieJar = cookies.jar() var globalPool = {} function filterForNonReserved (reserved, options) { // Filter out properties that are not reserved. // Reserved values are passed in at call site. var object = {} for (var i in options) { var notReserved = (reserved.indexOf(i) === -1) if (notReserved) { object[i] = options[i] } } return object } function filterOutReservedFunctions (reserved, options) { // Filter out properties that are functions and are reserved. // Reserved values are passed in at call site. var object = {} for (var i in options) { var isReserved = !(reserved.indexOf(i) === -1) var isFunction = (typeof options[i] === 'function') if (!(isReserved && isFunction)) { object[i] = options[i] } } return object } // Return a simpler request object to allow serialization function requestToJSON () { var self = this return { uri: self.uri, method: self.method, headers: self.headers } } // Return a simpler response object to allow serialization function responseToJSON () { var self = this return { statusCode: self.statusCode, body: self.body, headers: self.headers, request: requestToJSON.call(self.request) } } function Request (options) { // if given the method property in options, set property explicitMethod to true // extend the Request instance with any non-reserved properties // remove any reserved functions from the options object // set Request instance to be readable and writable // call init var self = this // start with HAR, then override with additional options if (options.har) { self._har = new Har(self) options = self._har.options(options) } stream.Stream.call(self) var reserved = Object.keys(Request.prototype) var nonReserved = filterForNonReserved(reserved, options) extend(self, nonReserved) options = filterOutReservedFunctions(reserved, options) self.readable = true self.writable = true if (options.method) { self.explicitMethod = true } self._qs = new Querystring(self) self._auth = new Auth(self) self._oauth = new OAuth(self) self._multipart = new Multipart(self) self._redirect = new Redirect(self) self._tunnel = new Tunnel(self) self.init(options) } util.inherits(Request, stream.Stream) // Debugging Request.debug = process.env.NODE_DEBUG && /\brequest\b/.test(process.env.NODE_DEBUG) function debug () { if (Request.debug) { console.error('REQUEST %s', util.format.apply(util, arguments)) } } Request.prototype.debug = debug Request.prototype.init = function (options) { // init() contains all the code to setup the request object. // the actual outgoing request is not started until start() is called // this function is called from both the constructor and on redirect. var self = this if (!options) { options = {} } self.headers = self.headers ? copy(self.headers) : {} // Delete headers with value undefined since they break // ClientRequest.OutgoingMessage.setHeader in node 0.12 for (var headerName in self.headers) { if (typeof self.headers[headerName] === 'undefined') { delete self.headers[headerName] } } caseless.httpify(self, self.headers) if (!self.method) { self.method = options.method || 'GET' } if (!self.localAddress) { self.localAddress = options.localAddress } self._qs.init(options) debug(options) if (!self.pool && self.pool !== false) { self.pool = globalPool } self.dests = self.dests || [] self.__isRequestRequest = true // Protect against double callback if (!self._callback && self.callback) { self._callback = self.callback self.callback = function () { if (self._callbackCalled) { return // Print a warning maybe? } self._callbackCalled = true self._callback.apply(self, arguments) } self.on('error', self.callback.bind()) self.on('complete', self.callback.bind(self, null)) } // People use this property instead all the time, so support it if (!self.uri && self.url) { self.uri = self.url delete self.url } // If there's a baseUrl, then use it as the base URL (i.e. uri must be // specified as a relative path and is appended to baseUrl). if (self.baseUrl) { if (typeof self.baseUrl !== 'string') { return self.emit('error', new Error('options.baseUrl must be a string')) } if (typeof self.uri !== 'string') { return self.emit('error', new Error('options.uri must be a string when using options.baseUrl')) } if (self.uri.indexOf('//') === 0 || self.uri.indexOf('://') !== -1) { return self.emit('error', new Error('options.uri must be a path when using options.baseUrl')) } // Handle all cases to make sure that there's only one slash between // baseUrl and uri. var baseUrlEndsWithSlash = self.baseUrl.lastIndexOf('/') === self.baseUrl.length - 1 var uriStartsWithSlash = self.uri.indexOf('/') === 0 if (baseUrlEndsWithSlash && uriStartsWithSlash) { self.uri = self.baseUrl + self.uri.slice(1) } else if (baseUrlEndsWithSlash || uriStartsWithSlash) { self.uri = self.baseUrl + self.uri } else if (self.uri === '') { self.uri = self.baseUrl } else { self.uri = self.baseUrl + '/' + self.uri } delete self.baseUrl } // A URI is needed by this point, emit error if we haven't been able to get one if (!self.uri) { return self.emit('error', new Error('options.uri is a required argument')) } // If a string URI/URL was given, parse it into a URL object if (typeof self.uri === 'string') { self.uri = url.parse(self.uri) } // Some URL objects are not from a URL parsed string and need href added if (!self.uri.href) { self.uri.href = url.format(self.uri) } // DEPRECATED: Warning for users of the old Unix Sockets URL Scheme if (self.uri.protocol === 'unix:') { return self.emit('error', new Error('`unix://` URL scheme is no longer supported. Please use the format `http://unix:SOCKET:PATH`')) } // Support Unix Sockets if (self.uri.host === 'unix') { self.enableUnixSocket() } if (self.strictSSL === false) { self.rejectUnauthorized = false } if (!self.uri.pathname) { self.uri.pathname = '/' } if (!(self.uri.host || (self.uri.hostname && self.uri.port)) && !self.uri.isUnix) { // Invalid URI: it may generate lot of bad errors, like 'TypeError: Cannot call method `indexOf` of undefined' in CookieJar // Detect and reject it as soon as possible var faultyUri = url.format(self.uri) var message = 'Invalid URI "' + faultyUri + '"' if (Object.keys(options).length === 0) { // No option ? This can be the sign of a redirect // As this is a case where the user cannot do anything (they didn't call request directly with this URL) // they should be warned that it can be caused by a redirection (can save some hair) message += '. This can be caused by a crappy redirection.' } // This error was fatal self.abort() return self.emit('error', new Error(message)) } if (!self.hasOwnProperty('proxy')) { self.proxy = getProxyFromURI(self.uri) } self.tunnel = self._tunnel.isEnabled() if (self.proxy) { self._tunnel.setup(options) } self._redirect.onRequest(options) self.setHost = false if (!self.hasHeader('host')) { var hostHeaderName = self.originalHostHeaderName || 'host' self.setHeader(hostHeaderName, self.uri.host) // Drop :port suffix from Host header if known protocol. if (self.uri.port) { if ((self.uri.port === '80' && self.uri.protocol === 'http:') || (self.uri.port === '443' && self.uri.protocol === 'https:')) { self.setHeader(hostHeaderName, self.uri.hostname) } } self.setHost = true } self.jar(self._jar || options.jar) if (!self.uri.port) { if (self.uri.protocol === 'http:') { self.uri.port = 80 } else if (self.uri.protocol === 'https:') { self.uri.port = 443 } } if (self.proxy && !self.tunnel) { self.port = self.proxy.port self.host = self.proxy.hostname } else { self.port = self.uri.port self.host = self.uri.hostname } if (options.form) { self.form(options.form) } if (options.formData) { var formData = options.formData var requestForm = self.form() var appendFormValue = function (key, value) { if (value && value.hasOwnProperty('value') && value.hasOwnProperty('options')) { requestForm.append(key, value.value, value.options) } else { requestForm.append(key, value) } } for (var formKey in formData) { if (formData.hasOwnProperty(formKey)) { var formValue = formData[formKey] if (formValue instanceof Array) { for (var j = 0; j < formValue.length; j++) { appendFormValue(formKey, formValue[j]) } } else { appendFormValue(formKey, formValue) } } } } if (options.qs) { self.qs(options.qs) } if (self.uri.path) { self.path = self.uri.path } else { self.path = self.uri.pathname + (self.uri.search || '') } if (self.path.length === 0) { self.path = '/' } // Auth must happen last in case signing is dependent on other headers if (options.aws) { self.aws(options.aws) } if (options.hawk) { self.hawk(options.hawk) } if (options.httpSignature) { self.httpSignature(options.httpSignature) } if (options.auth) { if (Object.prototype.hasOwnProperty.call(options.auth, 'username')) { options.auth.user = options.auth.username } if (Object.prototype.hasOwnProperty.call(options.auth, 'password')) { options.auth.pass = options.auth.password } self.auth( options.auth.user, options.auth.pass, options.auth.sendImmediately, options.auth.bearer ) } if (self.gzip && !self.hasHeader('accept-encoding')) { self.setHeader('accept-encoding', 'gzip, deflate') } if (self.uri.auth && !self.hasHeader('authorization')) { var uriAuthPieces = self.uri.auth.split(':').map(function (item) { return self._qs.unescape(item) }) self.auth(uriAuthPieces[0], uriAuthPieces.slice(1).join(':'), true) } if (!self.tunnel && self.proxy && self.proxy.auth && !self.hasHeader('proxy-authorization')) { var proxyAuthPieces = self.proxy.auth.split(':').map(function (item) { return self._qs.unescape(item) }) var authHeader = 'Basic ' + toBase64(proxyAuthPieces.join(':')) self.setHeader('proxy-authorization', authHeader) } if (self.proxy && !self.tunnel) { self.path = (self.uri.protocol + '//' + self.uri.host + self.path) } if (options.json) { self.json(options.json) } if (options.multipart) { self.multipart(options.multipart) } if (options.time) { self.timing = true // NOTE: elapsedTime is deprecated in favor of .timings self.elapsedTime = self.elapsedTime || 0 } function setContentLength () { if (isTypedArray(self.body)) { self.body = Buffer.from(self.body) } if (!self.hasHeader('content-length')) { var length if (typeof self.body === 'string') { length = Buffer.byteLength(self.body) } else if (Array.isArray(self.body)) { length = self.body.reduce(function (a, b) { return a + b.length }, 0) } else { length = self.body.length } if (length) { self.setHeader('content-length', length) } else { self.emit('error', new Error('Argument error, options.body.')) } } } if (self.body && !isstream(self.body)) { setContentLength() } if (options.oauth) { self.oauth(options.oauth) } else if (self._oauth.params && self.hasHeader('authorization')) { self.oauth(self._oauth.params) } var protocol = self.proxy && !self.tunnel ? self.proxy.protocol : self.uri.protocol var defaultModules = {'http:': http, 'https:': https} var httpModules = self.httpModules || {} self.httpModule = httpModules[protocol] || defaultModules[protocol] if (!self.httpModule) { return self.emit('error', new Error('Invalid protocol: ' + protocol)) } if (options.ca) { self.ca = options.ca } if (!self.agent) { if (options.agentOptions) { self.agentOptions = options.agentOptions } if (options.agentClass) { self.agentClass = options.agentClass } else if (options.forever) { var v = version() // use ForeverAgent in node 0.10- only if (v.major === 0 && v.minor <= 10) { self.agentClass = protocol === 'http:' ? ForeverAgent : ForeverAgent.SSL } else { self.agentClass = self.httpModule.Agent self.agentOptions = self.agentOptions || {} self.agentOptions.keepAlive = true } } else { self.agentClass = self.httpModule.Agent } } if (self.pool === false) { self.agent = false } else { self.agent = self.agent || self.getNewAgent() } self.on('pipe', function (src) { if (self.ntick && self._started) { self.emit('error', new Error('You cannot pipe to this stream after the outbound request has started.')) } self.src = src if (isReadStream(src)) { if (!self.hasHeader('content-type')) { self.setHeader('content-type', mime.lookup(src.path)) } } else { if (src.headers) { for (var i in src.headers) { if (!self.hasHeader(i)) { self.setHeader(i, src.headers[i]) } } } if (self._json && !self.hasHeader('content-type')) { self.setHeader('content-type', 'application/json') } if (src.method && !self.explicitMethod) { self.method = src.method } } // self.on('pipe', function () { // console.error('You have already piped to this stream. Pipeing twice is likely to break the request.') // }) }) defer(function () { if (self._aborted) { return } var end = function () { if (self._form) { if (!self._auth.hasAuth) { self._form.pipe(self) } else if (self._auth.hasAuth && self._auth.sentAuth) { self._form.pipe(self) } } if (self._multipart && self._multipart.chunked) { self._multipart.body.pipe(self) } if (self.body) { if (isstream(self.body)) { self.body.pipe(self) } else { setContentLength() if (Array.isArray(self.body)) { self.body.forEach(function (part) { self.write(part) }) } else { self.write(self.body) } self.end() } } else if (self.requestBodyStream) { console.warn('options.requestBodyStream is deprecated, please pass the request object to stream.pipe.') self.requestBodyStream.pipe(self) } else if (!self.src) { if (self._auth.hasAuth && !self._auth.sentAuth) { self.end() return } if (self.method !== 'GET' && typeof self.method !== 'undefined') { self.setHeader('content-length', 0) } self.end() } } if (self._form && !self.hasHeader('content-length')) { // Before ending the request, we had to compute the length of the whole form, asyncly self.setHeader(self._form.getHeaders(), true) self._form.getLength(function (err, length) { if (!err && !isNaN(length)) { self.setHeader('content-length', length) } end() }) } else { end() } self.ntick = true }) } Request.prototype.getNewAgent = function () { var self = this var Agent = self.agentClass var options = {} if (self.agentOptions) { for (var i in self.agentOptions) { options[i] = self.agentOptions[i] } } if (self.ca) { options.ca = self.ca } if (self.ciphers) { options.ciphers = self.ciphers } if (self.secureProtocol) { options.secureProtocol = self.secureProtocol } if (self.secureOptions) { options.secureOptions = self.secureOptions } if (typeof self.rejectUnauthorized !== 'undefined') { options.rejectUnauthorized = self.rejectUnauthorized } if (self.cert && self.key) { options.key = self.key options.cert = self.cert } if (self.pfx) { options.pfx = self.pfx } if (self.passphrase) { options.passphrase = self.passphrase } var poolKey = '' // different types of agents are in different pools if (Agent !== self.httpModule.Agent) { poolKey += Agent.name } // ca option is only relevant if proxy or destination are https var proxy = self.proxy if (typeof proxy === 'string') { proxy = url.parse(proxy) } var isHttps = (proxy && proxy.protocol === 'https:') || this.uri.protocol === 'https:' if (isHttps) { if (options.ca) { if (poolKey) { poolKey += ':' } poolKey += options.ca } if (typeof options.rejectUnauthorized !== 'undefined') { if (poolKey) { poolKey += ':' } poolKey += options.rejectUnauthorized } if (options.cert) { if (poolKey) { poolKey += ':' } poolKey += options.cert.toString('ascii') + options.key.toString('ascii') } if (options.pfx) { if (poolKey) { poolKey += ':' } poolKey += options.pfx.toString('ascii') } if (options.ciphers) { if (poolKey) { poolKey += ':' } poolKey += options.ciphers } if (options.secureProtocol) { if (poolKey) { poolKey += ':' } poolKey += options.secureProtocol } if (options.secureOptions) { if (poolKey) { poolKey += ':' } poolKey += options.secureOptions } } if (self.pool === globalPool && !poolKey && Object.keys(options).length === 0 && self.httpModule.globalAgent) { // not doing anything special. Use the globalAgent return self.httpModule.globalAgent } // we're using a stored agent. Make sure it's protocol-specific poolKey = self.uri.protocol + poolKey // generate a new agent for this setting if none yet exists if (!self.pool[poolKey]) { self.pool[poolKey] = new Agent(options) // properly set maxSockets on new agents if (self.pool.maxSockets) { self.pool[poolKey].maxSockets = self.pool.maxSockets } } return self.pool[poolKey] } Request.prototype.start = function () { // start() is called once we are ready to send the outgoing HTTP request. // this is usually called on the first write(), end() or on nextTick() var self = this if (self.timing) { // All timings will be relative to this request's startTime. In order to do this, // we need to capture the wall-clock start time (via Date), immediately followed // by the high-resolution timer (via now()). While these two won't be set // at the _exact_ same time, they should be close enough to be able to calculate // high-resolution, monotonically non-decreasing timestamps relative to startTime. var startTime = new Date().getTime() var startTimeNow = now() } if (self._aborted) { return } self._started = true self.method = self.method || 'GET' self.href = self.uri.href if (self.src && self.src.stat && self.src.stat.size && !self.hasHeader('content-length')) { self.setHeader('content-length', self.src.stat.size) } if (self._aws) { self.aws(self._aws, true) } // We have a method named auth, which is completely different from the http.request // auth option. If we don't remove it, we're gonna have a bad time. var reqOptions = copy(self) delete reqOptions.auth debug('make request', self.uri.href) // node v6.8.0 now supports a `timeout` value in `http.request()`, but we // should delete it for now since we handle timeouts manually for better // consistency with node versions before v6.8.0 delete reqOptions.timeout try { self.req = self.httpModule.request(reqOptions) } catch (err) { self.emit('error', err) return } if (self.timing) { self.startTime = startTime self.startTimeNow = startTimeNow // Timing values will all be relative to startTime (by comparing to startTimeNow // so we have an accurate clock) self.timings = {} } var timeout if (self.timeout && !self.timeoutTimer) { if (self.timeout < 0) { timeout = 0 } else if (typeof self.timeout === 'number' && isFinite(self.timeout)) { timeout = self.timeout } } self.req.on('response', self.onRequestResponse.bind(self)) self.req.on('error', self.onRequestError.bind(self)) self.req.on('drain', function () { self.emit('drain') }) self.req.on('socket', function (socket) { // `._connecting` was the old property which was made public in node v6.1.0 var isConnecting = socket._connecting || socket.connecting if (self.timing) { self.timings.socket = now() - self.startTimeNow if (isConnecting) { var onLookupTiming = function () { self.timings.lookup = now() - self.startTimeNow } var onConnectTiming = function () { self.timings.connect = now() - self.startTimeNow } socket.once('lookup', onLookupTiming) socket.once('connect', onConnectTiming) // clean up timing event listeners if needed on error self.req.once('error', function () { socket.removeListener('lookup', onLookupTiming) socket.removeListener('connect', onConnectTiming) }) } } var setReqTimeout = function () { // This timeout sets the amount of time to wait *between* bytes sent // from the server once connected. // // In particular, it's useful for erroring if the server fails to send // data halfway through streaming a response. self.req.setTimeout(timeout, function () { if (self.req) { self.abort() var e = new Error('ESOCKETTIMEDOUT') e.code = 'ESOCKETTIMEDOUT' e.connect = false self.emit('error', e) } }) } if (timeout !== undefined) { // Only start the connection timer if we're actually connecting a new // socket, otherwise if we're already connected (because this is a // keep-alive connection) do not bother. This is important since we won't // get a 'connect' event for an already connected socket. if (isConnecting) { var onReqSockConnect = function () { socket.removeListener('connect', onReqSockConnect) self.clearTimeout() setReqTimeout() } socket.on('connect', onReqSockConnect) self.req.on('error', function (err) { // eslint-disable-line handle-callback-err socket.removeListener('connect', onReqSockConnect) }) // Set a timeout in memory - this block will throw if the server takes more // than `timeout` to write the HTTP status and headers (corresponding to // the on('response') event on the client). NB: this measures wall-clock // time, not the time between bytes sent by the server. self.timeoutTimer = setTimeout(function () { socket.removeListener('connect', onReqSockConnect) self.abort() var e = new Error('ETIMEDOUT') e.code = 'ETIMEDOUT' e.connect = true self.emit('error', e) }, timeout) } else { // We're already connected setReqTimeout() } } self.emit('socket', socket) }) self.emit('request', self.req) } Request.prototype.onRequestError = function (error) { var self = this if (self._aborted) { return } if (self.req && self.req._reusedSocket && error.code === 'ECONNRESET' && self.agent.addRequestNoreuse) { self.agent = { addRequest: self.agent.addRequestNoreuse.bind(self.agent) } self.start() self.req.end() return } self.clearTimeout() self.emit('error', error) } Request.prototype.onRequestResponse = function (response) { var self = this if (self.timing) { self.timings.response = now() - self.startTimeNow } debug('onRequestResponse', self.uri.href, response.statusCode, response.headers) response.on('end', function () { if (self.timing) { self.timings.end = now() - self.startTimeNow response.timingStart = self.startTime // fill in the blanks for any periods that didn't trigger, such as // no lookup or connect due to keep alive if (!self.timings.socket) { self.timings.socket = 0 } if (!self.timings.lookup) { self.timings.lookup = self.timings.socket } if (!self.timings.connect) { self.timings.connect = self.timings.lookup } if (!self.timings.response) { self.timings.response = self.timings.connect } debug('elapsed time', self.timings.end) // elapsedTime includes all redirects self.elapsedTime += Math.round(self.timings.end) // NOTE: elapsedTime is deprecated in favor of .timings response.elapsedTime = self.elapsedTime // timings is just for the final fetch response.timings = self.timings // pre-calculate phase timings as well response.timingPhases = { wait: self.timings.socket, dns: self.timings.lookup - self.timings.socket, tcp: self.timings.connect - self.timings.lookup, firstByte: self.timings.response - self.timings.connect, download: self.timings.end - self.timings.response, total: self.timings.end } } debug('response end', self.uri.href, response.statusCode, response.headers) }) if (self._aborted) { debug('aborted', self.uri.href) response.resume() return } self.response = response response.request = self response.toJSON = responseToJSON // XXX This is different on 0.10, because SSL is strict by default if (self.httpModule === https && self.strictSSL && (!response.hasOwnProperty('socket') || !response.socket.authorized)) { debug('strict ssl error', self.uri.href) var sslErr = response.hasOwnProperty('socket') ? response.socket.authorizationError : self.uri.href + ' does not support SSL' self.emit('error', new Error('SSL Error: ' + sslErr)) return } // Save the original host before any redirect (if it changes, we need to // remove any authorization headers). Also remember the case of the header // name because lots of broken servers expect Host instead of host and we // want the caller to be able to specify this. self.originalHost = self.getHeader('host') if (!self.originalHostHeaderName) { self.originalHostHeaderName = self.hasHeader('host') } if (self.setHost) { self.removeHeader('host') } self.clearTimeout() var targetCookieJar = (self._jar && self._jar.setCookie) ? self._jar : globalCookieJar var addCookie = function (cookie) { // set the cookie if it's domain in the href's domain. try { targetCookieJar.setCookie(cookie, self.uri.href, {ignoreError: true}) } catch (e) { self.emit('error', e) } } response.caseless = caseless(response.headers) if (response.caseless.has('set-cookie') && (!self._disableCookies)) { var headerName = response.caseless.has('set-cookie') if (Array.isArray(response.headers[headerName])) { response.headers[headerName].forEach(addCookie) } else { addCookie(response.headers[headerName]) } } if (self._redirect.onResponse(response)) { return // Ignore the rest of the response } else { // Be a good stream and emit end when the response is finished. // Hack to emit end on close because of a core bug that never fires end response.on('close', function () { if (!self._ended) { self.response.emit('end') } }) response.once('end', function () { self._ended = true }) var noBody = function (code) { return ( self.method === 'HEAD' || // Informational (code >= 100 && code < 200) || // No Content code === 204 || // Not Modified code === 304 ) } var responseContent if (self.gzip && !noBody(response.statusCode)) { var contentEncoding = response.headers['content-encoding'] || 'identity' contentEncoding = contentEncoding.trim().toLowerCase() // Be more lenient with decoding compressed responses, since (very rarely) // servers send slightly invalid gzip responses that are still accepted // by common browsers. // Always using Z_SYNC_FLUSH is what cURL does. var zlibOptions = { flush: zlib.Z_SYNC_FLUSH, finishFlush: zlib.Z_SYNC_FLUSH } if (contentEncoding === 'gzip') { responseContent = zlib.createGunzip(zlibOptions) response.pipe(responseContent) } else if (contentEncoding === 'deflate') { responseContent = zlib.createInflate(zlibOptions) response.pipe(responseContent) } else { // Since previous versions didn't check for Content-Encoding header, // ignore any invalid values to preserve backwards-compatibility if (contentEncoding !== 'identity') { debug('ignoring unrecognized Content-Encoding ' + contentEncoding) } responseContent = response } } else { responseContent = response } if (self.encoding) { if (self.dests.length !== 0) { console.error('Ignoring encoding parameter as this stream is being piped to another stream which makes the encoding option invalid.') } else { responseContent.setEncoding(self.encoding) } } if (self._paused) { responseContent.pause() } self.responseContent = responseContent self.emit('response', response) self.dests.forEach(function (dest) { self.pipeDest(dest) }) responseContent.on('data', function (chunk) { if (self.timing && !self.responseStarted) { self.responseStartTime = (new Date()).getTime() // NOTE: responseStartTime is deprecated in favor of .timings response.responseStartTime = self.responseStartTime } self._destdata = true self.emit('data', chunk) }) responseContent.once('end', function (chunk) { self.emit('end', chunk) }) responseContent.on('error', function (error) { self.emit('error', error) }) responseContent.on('close', function () { self.emit('close') }) if (self.callback) { self.readResponseBody(response) } else { // if no callback self.on('end', function () { if (self._aborted) { debug('aborted', self.uri.href) return } self.emit('complete', response) }) } } debug('finish init function', self.uri.href) } Request.prototype.readResponseBody = function (response) { var self = this debug("reading response's body") var buffers = [] var bufferLength = 0 var strings = [] self.on('data', function (chunk) { if (!Buffer.isBuffer(chunk)) { strings.push(chunk) } else if (chunk.length) { bufferLength += chunk.length buffers.push(chunk) } }) self.on('end', function () { debug('end event', self.uri.href) if (self._aborted) { debug('aborted', self.uri.href) // `buffer` is defined in the parent scope and used in a closure it exists for the life of the request. // This can lead to leaky behavior if the user retains a reference to the request object. buffers = [] bufferLength = 0 return } if (bufferLength) { debug('has body', self.uri.href, bufferLength) response.body = Buffer.concat(buffers, bufferLength) if (self.encoding !== null) { response.body = response.body.toString(self.encoding) } // `buffer` is defined in the parent scope and used in a closure it exists for the life of the Request. // This can lead to leaky behavior if the user retains a reference to the request object. buffers = [] bufferLength = 0 } else if (strings.length) { // The UTF8 BOM [0xEF,0xBB,0xBF] is converted to [0xFE,0xFF] in the JS UTC16/UCS2 representation. // Strip this value out when the encoding is set to 'utf8', as upstream consumers won't expect it and it breaks JSON.parse(). if (self.encoding === 'utf8' && strings[0].length > 0 && strings[0][0] === '\uFEFF') { strings[0] = strings[0].substring(1) } response.body = strings.join('') } if (self._json) { try { response.body = JSON.parse(response.body, self._jsonReviver) } catch (e) { debug('invalid JSON received', self.uri.href) } } debug('emitting complete', self.uri.href) if (typeof response.body === 'undefined' && !self._json) { response.body = self.encoding === null ? Buffer.alloc(0) : '' } self.emit('complete', response, response.body) }) } Request.prototype.abort = function () { var self = this self._aborted = true if (self.req) { self.req.abort() } else if (self.response) { self.response.destroy() } self.clearTimeout() self.emit('abort') } Request.prototype.pipeDest = function (dest) { var self = this var response = self.response // Called after the response is received if (dest.headers && !dest.headersSent) { if (response.caseless.has('content-type')) { var ctname = response.caseless.has('content-type') if (dest.setHeader) { dest.setHeader(ctname, response.headers[ctname]) } else { dest.headers[ctname] = response.headers[ctname] } } if (response.caseless.has('content-length')) { var clname = response.caseless.has('content-length') if (dest.setHeader) { dest.setHeader(clname, response.headers[clname]) } else { dest.headers[clname] = response.headers[clname] } } } if (dest.setHeader && !dest.headersSent) { for (var i in response.headers) { // If the response content is being decoded, the Content-Encoding header // of the response doesn't represent the piped content, so don't pass it. if (!self.gzip || i !== 'content-encoding') { dest.setHeader(i, response.headers[i]) } } dest.statusCode = response.statusCode } if (self.pipefilter) { self.pipefilter(response, dest) } } Request.prototype.qs = function (q, clobber) { var self = this var base if (!clobber && self.uri.query) { base = self._qs.parse(self.uri.query) } else { base = {} } for (var i in q) { base[i] = q[i] } var qs = self._qs.stringify(base) if (qs === '') { return self } self.uri = url.parse(self.uri.href.split('?')[0] + '?' + qs) self.url = self.uri self.path = self.uri.path if (self.uri.host === 'unix') { self.enableUnixSocket() } return self } Request.prototype.form = function (form) { var self = this if (form) { if (!/^application\/x-www-form-urlencoded\b/.test(self.getHeader('content-type'))) { self.setHeader('content-type', 'application/x-www-form-urlencoded') } self.body = (typeof form === 'string') ? self._qs.rfc3986(form.toString('utf8')) : self._qs.stringify(form).toString('utf8') return self } // create form-data object self._form = new FormData() self._form.on('error', function (err) { err.message = 'form-data: ' + err.message self.emit('error', err) self.abort() }) return self._form } Request.prototype.multipart = function (multipart) { var self = this self._multipart.onRequest(multipart) if (!self._multipart.chunked) { self.body = self._multipart.body } return self } Request.prototype.json = function (val) { var self = this if (!self.hasHeader('accept')) { self.setHeader('accept', 'application/json') } if (typeof self.jsonReplacer === 'function') { self._jsonReplacer = self.jsonReplacer } self._json = true if (typeof val === 'boolean') { if (self.body !== undefined) { if (!/^application\/x-www-form-urlencoded\b/.test(self.getHeader('content-type'))) { self.body = safeStringify(self.body, self._jsonReplacer) } else { self.body = self._qs.rfc3986(self.body) } if (!self.hasHeader('content-type')) { self.setHeader('content-type', 'application/json') } } } else { self.body = safeStringify(val, self._jsonReplacer) if (!self.hasHeader('content-type')) { self.setHeader('content-type', 'application/json') } } if (typeof self.jsonReviver === 'function') { self._jsonReviver = self.jsonReviver } return self } Request.prototype.getHeader = function (name, headers) { var self = this var result, re, match if (!headers) { headers = self.headers } Object.keys(headers).forEach(function (key) { if (key.length !== name.length) { return } re = new RegExp(name, 'i') match = key.match(re) if (match) { result = headers[key] } }) return result } Request.prototype.enableUnixSocket = function () { // Get the socket & request paths from the URL var unixParts = this.uri.path.split(':') var host = unixParts[0] var path = unixParts[1] // Apply unix properties to request this.socketPath = host this.uri.pathname = path this.uri.path = path this.uri.host = host this.uri.hostname = host this.uri.isUnix = true } Request.prototype.auth = function (user, pass, sendImmediately, bearer) { var self = this self._auth.onRequest(user, pass, sendImmediately, bearer) return self } Request.prototype.aws = function (opts, now) { var self = this if (!now) { self._aws = opts return self } if (opts.sign_version === 4 || opts.sign_version === '4') { // use aws4 var options = { host: self.uri.host, path: self.uri.path, method: self.method, headers: self.headers, body: self.body } if (opts.service) { options.service = opts.service } var signRes = aws4.sign(options, { accessKeyId: opts.key, secretAccessKey: opts.secret, sessionToken: opts.session }) self.setHeader('authorization', signRes.headers.Authorization) self.setHeader('x-amz-date', signRes.headers['X-Amz-Date']) if (signRes.headers['X-Amz-Security-Token']) { self.setHeader('x-amz-security-token', signRes.headers['X-Amz-Security-Token']) } } else { // default: use aws-sign2 var date = new Date() self.setHeader('date', date.toUTCString()) var auth = { key: opts.key, secret: opts.secret, verb: self.method.toUpperCase(), date: date, contentType: self.getHeader('content-type') || '', md5: self.getHeader('content-md5') || '', amazonHeaders: aws2.canonicalizeHeaders(self.headers) } var path = self.uri.path if (opts.bucket && path) { auth.resource = '/' + opts.bucket + path } else if (opts.bucket && !path) { auth.resource = '/' + opts.bucket } else if (!opts.bucket && path) { auth.resource = path } else if (!opts.bucket && !path) { auth.resource = '/' } auth.resource = aws2.canonicalizeResource(auth.resource) self.setHeader('authorization', aws2.authorization(auth)) } return self } Request.prototype.httpSignature = function (opts) { var self = this httpSignature.signRequest({ getHeader: function (header) { return self.getHeader(header, self.headers) }, setHeader: function (header, value) { self.setHeader(header, value) }, method: self.method, path: self.path }, opts) debug('httpSignature authorization', self.getHeader('authorization')) return self } Request.prototype.hawk = function (opts) { var self = this self.setHeader('Authorization', hawk.header(self.uri, self.method, opts)) } Request.prototype.oauth = function (_oauth) { var self = this self._oauth.onRequest(_oauth) return self } Request.prototype.jar = function (jar) { var self = this var cookies if (self._redirect.redirectsFollowed === 0) { self.originalCookieHeader = self.getHeader('cookie') } if (!jar) { // disable cookies cookies = false self._disableCookies = true } else { var targetCookieJar = jar.getCookieString ? jar : globalCookieJar var urihref = self.uri.href // fetch cookie in the Specified host if (targetCookieJar) { cookies = targetCookieJar.getCookieString(urihref) } } // if need cookie and cookie is not empty if (cookies && cookies.length) { if (self.originalCookieHeader) { // Don't overwrite existing Cookie header self.setHeader('cookie', self.originalCookieHeader + '; ' + cookies) } else { self.setHeader('cookie', cookies) } } self._jar = jar return self } // Stream API Request.prototype.pipe = function (dest, opts) { var self = this if (self.response) { if (self._destdata) { self.emit('error', new Error('You cannot pipe after data has been emitted from the response.')) } else if (self._ended) { self.emit('error', new Error('You cannot pipe after the response has been ended.')) } else { stream.Stream.prototype.pipe.call(self, dest, opts) self.pipeDest(dest) return dest } } else { self.dests.push(dest) stream.Stream.prototype.pipe.call(self, dest, opts) return dest } } Request.prototype.write = function () { var self = this if (self._aborted) { return } if (!self._started) { self.start() } if (self.req) { return self.req.write.apply(self.req, arguments) } } Request.prototype.end = function (chunk) { var self = this if (self._aborted) { return } if (chunk) { self.write(chunk) } if (!self._started) { self.start() } if (self.req) { self.req.end() } } Request.prototype.pause = function () { var self = this if (!self.responseContent) { self._paused = true } else { self.responseContent.pause.apply(self.responseContent, arguments) } } Request.prototype.resume = function () { var self = this if (!self.responseContent) { self._paused = false } else { self.responseContent.resume.apply(self.responseContent, arguments) } } Request.prototype.destroy = function () { var self = this this.clearTimeout() if (!self._ended) { self.end() } else if (self.response) { self.response.destroy() } } Request.prototype.clearTimeout = function () { if (this.timeoutTimer) { clearTimeout(this.timeoutTimer) this.timeoutTimer = null } } Request.defaultProxyHeaderWhiteList = Tunnel.defaultProxyHeaderWhiteList.slice() Request.defaultProxyHeaderExclusiveList = Tunnel.defaultProxyHeaderExclusiveList.slice() // Exports Request.prototype.toJSON = requestToJSON module.exports = Request /***/ }), /***/ 9004: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; const Readable = __webpack_require__(92413).Readable; const lowercaseKeys = __webpack_require__(9662); class Response extends Readable { constructor(statusCode, headers, body, url) { if (typeof statusCode !== 'number') { throw new TypeError('Argument `statusCode` should be a number'); } if (typeof headers !== 'object') { throw new TypeError('Argument `headers` should be an object'); } if (!(body instanceof Buffer)) { throw new TypeError('Argument `body` should be a buffer'); } if (typeof url !== 'string') { throw new TypeError('Argument `url` should be a string'); } super(); this.statusCode = statusCode; this.headers = lowercaseKeys(headers); this.body = body; this.url = url; } _read() { this.push(this.body); this.push(null); } } module.exports = Response; /***/ }), /***/ 21867: /***/ ((module, exports, __webpack_require__) => { /*! safe-buffer. MIT License. Feross Aboukhadijeh */ /* eslint-disable node/no-deprecated-api */ var buffer = __webpack_require__(64293) var Buffer = buffer.Buffer // alternative to using Object.keys for old browsers function copyProps (src, dst) { for (var key in src) { dst[key] = src[key] } } if (Buffer.from && Buffer.alloc && Buffer.allocUnsafe && Buffer.allocUnsafeSlow) { module.exports = buffer } else { // Copy properties from require('buffer') copyProps(buffer, exports) exports.Buffer = SafeBuffer } function SafeBuffer (arg, encodingOrOffset, length) { return Buffer(arg, encodingOrOffset, length) } SafeBuffer.prototype = Object.create(Buffer.prototype) // Copy static methods from Buffer copyProps(Buffer, SafeBuffer) SafeBuffer.from = function (arg, encodingOrOffset, length) { if (typeof arg === 'number') { throw new TypeError('Argument must not be a number') } return Buffer(arg, encodingOrOffset, length) } SafeBuffer.alloc = function (size, fill, encoding) { if (typeof size !== 'number') { throw new TypeError('Argument must be a number') } var buf = Buffer(size) if (fill !== undefined) { if (typeof encoding === 'string') { buf.fill(fill, encoding) } else { buf.fill(fill) } } else { buf.fill(0) } return buf } SafeBuffer.allocUnsafe = function (size) { if (typeof size !== 'number') { throw new TypeError('Argument must be a number') } return Buffer(size) } SafeBuffer.allocUnsafeSlow = function (size) { if (typeof size !== 'number') { throw new TypeError('Argument must be a number') } return buffer.SlowBuffer(size) } /***/ }), /***/ 15118: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; /* eslint-disable node/no-deprecated-api */ var buffer = __webpack_require__(64293) var Buffer = buffer.Buffer var safer = {} var key for (key in buffer) { if (!buffer.hasOwnProperty(key)) continue if (key === 'SlowBuffer' || key === 'Buffer') continue safer[key] = buffer[key] } var Safer = safer.Buffer = {} for (key in Buffer) { if (!Buffer.hasOwnProperty(key)) continue if (key === 'allocUnsafe' || key === 'allocUnsafeSlow') continue Safer[key] = Buffer[key] } safer.Buffer.prototype = Buffer.prototype if (!Safer.from || Safer.from === Uint8Array.from) { Safer.from = function (value, encodingOrOffset, length) { if (typeof value === 'number') { throw new TypeError('The "value" argument must not be of type number. Received type ' + typeof value) } if (value && typeof value.length === 'undefined') { throw new TypeError('The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type ' + typeof value) } return Buffer(value, encodingOrOffset, length) } } if (!Safer.alloc) { Safer.alloc = function (size, fill, encoding) { if (typeof size !== 'number') { throw new TypeError('The "size" argument must be of type number. Received type ' + typeof size) } if (size < 0 || size >= 2 * (1 << 30)) { throw new RangeError('The value "' + size + '" is invalid for option "size"') } var buf = Buffer(size) if (!fill || fill.length === 0) { buf.fill(0) } else if (typeof encoding === 'string') { buf.fill(fill, encoding) } else { buf.fill(fill) } return buf } } if (!safer.kStringMaxLength) { try { safer.kStringMaxLength = process.binding('buffer').kStringMaxLength } catch (e) { // we can't determine kStringMaxLength in environments where process.binding // is unsupported, so let's not set it } } if (!safer.constants) { safer.constants = { MAX_LENGTH: safer.kMaxLength } if (safer.kStringMaxLength) { safer.constants.MAX_STRING_LENGTH = safer.kStringMaxLength } } module.exports = safer /***/ }), /***/ 91532: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { const ANY = Symbol('SemVer ANY') // hoisted class for cyclic dependency class Comparator { static get ANY () { return ANY } constructor (comp, options) { options = parseOptions(options) if (comp instanceof Comparator) { if (comp.loose === !!options.loose) { return comp } else { comp = comp.value } } debug('comparator', comp, options) this.options = options this.loose = !!options.loose this.parse(comp) if (this.semver === ANY) { this.value = '' } else { this.value = this.operator + this.semver.version } debug('comp', this) } parse (comp) { const r = this.options.loose ? re[t.COMPARATORLOOSE] : re[t.COMPARATOR] const m = comp.match(r) if (!m) { throw new TypeError(`Invalid comparator: ${comp}`) } this.operator = m[1] !== undefined ? m[1] : '' if (this.operator === '=') { this.operator = '' } // if it literally is just '>' or '' then allow anything. if (!m[2]) { this.semver = ANY } else { this.semver = new SemVer(m[2], this.options.loose) } } toString () { return this.value } test (version) { debug('Comparator.test', version, this.options.loose) if (this.semver === ANY || version === ANY) { return true } if (typeof version === 'string') { try { version = new SemVer(version, this.options) } catch (er) { return false } } return cmp(version, this.operator, this.semver, this.options) } intersects (comp, options) { if (!(comp instanceof Comparator)) { throw new TypeError('a Comparator is required') } if (!options || typeof options !== 'object') { options = { loose: !!options, includePrerelease: false } } if (this.operator === '') { if (this.value === '') { return true } return new Range(comp.value, options).test(this.value) } else if (comp.operator === '') { if (comp.value === '') { return true } return new Range(this.value, options).test(comp.semver) } const sameDirectionIncreasing = (this.operator === '>=' || this.operator === '>') && (comp.operator === '>=' || comp.operator === '>') const sameDirectionDecreasing = (this.operator === '<=' || this.operator === '<') && (comp.operator === '<=' || comp.operator === '<') const sameSemVer = this.semver.version === comp.semver.version const differentDirectionsInclusive = (this.operator === '>=' || this.operator === '<=') && (comp.operator === '>=' || comp.operator === '<=') const oppositeDirectionsLessThan = cmp(this.semver, '<', comp.semver, options) && (this.operator === '>=' || this.operator === '>') && (comp.operator === '<=' || comp.operator === '<') const oppositeDirectionsGreaterThan = cmp(this.semver, '>', comp.semver, options) && (this.operator === '<=' || this.operator === '<') && (comp.operator === '>=' || comp.operator === '>') return ( sameDirectionIncreasing || sameDirectionDecreasing || (sameSemVer && differentDirectionsInclusive) || oppositeDirectionsLessThan || oppositeDirectionsGreaterThan ) } } module.exports = Comparator const parseOptions = __webpack_require__(40785) const {re, t} = __webpack_require__(9523) const cmp = __webpack_require__(75098) const debug = __webpack_require__(50427) const SemVer = __webpack_require__(48088) const Range = __webpack_require__(9828) /***/ }), /***/ 9828: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { // hoisted class for cyclic dependency class Range { constructor (range, options) { options = parseOptions(options) if (range instanceof Range) { if ( range.loose === !!options.loose && range.includePrerelease === !!options.includePrerelease ) { return range } else { return new Range(range.raw, options) } } if (range instanceof Comparator) { // just put it in the set and return this.raw = range.value this.set = [[range]] this.format() return this } this.options = options this.loose = !!options.loose this.includePrerelease = !!options.includePrerelease // First, split based on boolean or || this.raw = range this.set = range .split(/\s*\|\|\s*/) // map the range to a 2d array of comparators .map(range => this.parseRange(range.trim())) // throw out any comparator lists that are empty // this generally means that it was not a valid range, which is allowed // in loose mode, but will still throw if the WHOLE range is invalid. .filter(c => c.length) if (!this.set.length) { throw new TypeError(`Invalid SemVer Range: ${range}`) } // if we have any that are not the null set, throw out null sets. if (this.set.length > 1) { // keep the first one, in case they're all null sets const first = this.set[0] this.set = this.set.filter(c => !isNullSet(c[0])) if (this.set.length === 0) this.set = [first] else if (this.set.length > 1) { // if we have any that are *, then the range is just * for (const c of this.set) { if (c.length === 1 && isAny(c[0])) { this.set = [c] break } } } } this.format() } format () { this.range = this.set .map((comps) => { return comps.join(' ').trim() }) .join('||') .trim() return this.range } toString () { return this.range } parseRange (range) { range = range.trim() // memoize range parsing for performance. // this is a very hot path, and fully deterministic. const memoOpts = Object.keys(this.options).join(',') const memoKey = `parseRange:${memoOpts}:${range}` const cached = cache.get(memoKey) if (cached) return cached const loose = this.options.loose // `1.2.3 - 1.2.4` => `>=1.2.3 <=1.2.4` const hr = loose ? re[t.HYPHENRANGELOOSE] : re[t.HYPHENRANGE] range = range.replace(hr, hyphenReplace(this.options.includePrerelease)) debug('hyphen replace', range) // `> 1.2.3 < 1.2.5` => `>1.2.3 <1.2.5` range = range.replace(re[t.COMPARATORTRIM], comparatorTrimReplace) debug('comparator trim', range, re[t.COMPARATORTRIM]) // `~ 1.2.3` => `~1.2.3` range = range.replace(re[t.TILDETRIM], tildeTrimReplace) // `^ 1.2.3` => `^1.2.3` range = range.replace(re[t.CARETTRIM], caretTrimReplace) // normalize spaces range = range.split(/\s+/).join(' ') // At this point, the range is completely trimmed and // ready to be split into comparators. const compRe = loose ? re[t.COMPARATORLOOSE] : re[t.COMPARATOR] const rangeList = range .split(' ') .map(comp => parseComparator(comp, this.options)) .join(' ') .split(/\s+/) // >=0.0.0 is equivalent to * .map(comp => replaceGTE0(comp, this.options)) // in loose mode, throw out any that are not valid comparators .filter(this.options.loose ? comp => !!comp.match(compRe) : () => true) .map(comp => new Comparator(comp, this.options)) // if any comparators are the null set, then replace with JUST null set // if more than one comparator, remove any * comparators // also, don't include the same comparator more than once const l = rangeList.length const rangeMap = new Map() for (const comp of rangeList) { if (isNullSet(comp)) return [comp] rangeMap.set(comp.value, comp) } if (rangeMap.size > 1 && rangeMap.has('')) rangeMap.delete('') const result = [...rangeMap.values()] cache.set(memoKey, result) return result } intersects (range, options) { if (!(range instanceof Range)) { throw new TypeError('a Range is required') } return this.set.some((thisComparators) => { return ( isSatisfiable(thisComparators, options) && range.set.some((rangeComparators) => { return ( isSatisfiable(rangeComparators, options) && thisComparators.every((thisComparator) => { return rangeComparators.every((rangeComparator) => { return thisComparator.intersects(rangeComparator, options) }) }) ) }) ) }) } // if ANY of the sets match ALL of its comparators, then pass test (version) { if (!version) { return false } if (typeof version === 'string') { try { version = new SemVer(version, this.options) } catch (er) { return false } } for (let i = 0; i < this.set.length; i++) { if (testSet(this.set[i], version, this.options)) { return true } } return false } } module.exports = Range const LRU = __webpack_require__(7129) const cache = new LRU({ max: 1000 }) const parseOptions = __webpack_require__(40785) const Comparator = __webpack_require__(91532) const debug = __webpack_require__(50427) const SemVer = __webpack_require__(48088) const { re, t, comparatorTrimReplace, tildeTrimReplace, caretTrimReplace } = __webpack_require__(9523) const isNullSet = c => c.value === '<0.0.0-0' const isAny = c => c.value === '' // take a set of comparators and determine whether there // exists a version which can satisfy it const isSatisfiable = (comparators, options) => { let result = true const remainingComparators = comparators.slice() let testComparator = remainingComparators.pop() while (result && remainingComparators.length) { result = remainingComparators.every((otherComparator) => { return testComparator.intersects(otherComparator, options) }) testComparator = remainingComparators.pop() } return result } // comprised of xranges, tildes, stars, and gtlt's at this point. // already replaced the hyphen ranges // turn into a set of JUST comparators. const parseComparator = (comp, options) => { debug('comp', comp, options) comp = replaceCarets(comp, options) debug('caret', comp) comp = replaceTildes(comp, options) debug('tildes', comp) comp = replaceXRanges(comp, options) debug('xrange', comp) comp = replaceStars(comp, options) debug('stars', comp) return comp } const isX = id => !id || id.toLowerCase() === 'x' || id === '*' // ~, ~> --> * (any, kinda silly) // ~2, ~2.x, ~2.x.x, ~>2, ~>2.x ~>2.x.x --> >=2.0.0 <3.0.0-0 // ~2.0, ~2.0.x, ~>2.0, ~>2.0.x --> >=2.0.0 <2.1.0-0 // ~1.2, ~1.2.x, ~>1.2, ~>1.2.x --> >=1.2.0 <1.3.0-0 // ~1.2.3, ~>1.2.3 --> >=1.2.3 <1.3.0-0 // ~1.2.0, ~>1.2.0 --> >=1.2.0 <1.3.0-0 const replaceTildes = (comp, options) => comp.trim().split(/\s+/).map((comp) => { return replaceTilde(comp, options) }).join(' ') const replaceTilde = (comp, options) => { const r = options.loose ? re[t.TILDELOOSE] : re[t.TILDE] return comp.replace(r, (_, M, m, p, pr) => { debug('tilde', comp, _, M, m, p, pr) let ret if (isX(M)) { ret = '' } else if (isX(m)) { ret = `>=${M}.0.0 <${+M + 1}.0.0-0` } else if (isX(p)) { // ~1.2 == >=1.2.0 <1.3.0-0 ret = `>=${M}.${m}.0 <${M}.${+m + 1}.0-0` } else if (pr) { debug('replaceTilde pr', pr) ret = `>=${M}.${m}.${p}-${pr } <${M}.${+m + 1}.0-0` } else { // ~1.2.3 == >=1.2.3 <1.3.0-0 ret = `>=${M}.${m}.${p } <${M}.${+m + 1}.0-0` } debug('tilde return', ret) return ret }) } // ^ --> * (any, kinda silly) // ^2, ^2.x, ^2.x.x --> >=2.0.0 <3.0.0-0 // ^2.0, ^2.0.x --> >=2.0.0 <3.0.0-0 // ^1.2, ^1.2.x --> >=1.2.0 <2.0.0-0 // ^1.2.3 --> >=1.2.3 <2.0.0-0 // ^1.2.0 --> >=1.2.0 <2.0.0-0 const replaceCarets = (comp, options) => comp.trim().split(/\s+/).map((comp) => { return replaceCaret(comp, options) }).join(' ') const replaceCaret = (comp, options) => { debug('caret', comp, options) const r = options.loose ? re[t.CARETLOOSE] : re[t.CARET] const z = options.includePrerelease ? '-0' : '' return comp.replace(r, (_, M, m, p, pr) => { debug('caret', comp, _, M, m, p, pr) let ret if (isX(M)) { ret = '' } else if (isX(m)) { ret = `>=${M}.0.0${z} <${+M + 1}.0.0-0` } else if (isX(p)) { if (M === '0') { ret = `>=${M}.${m}.0${z} <${M}.${+m + 1}.0-0` } else { ret = `>=${M}.${m}.0${z} <${+M + 1}.0.0-0` } } else if (pr) { debug('replaceCaret pr', pr) if (M === '0') { if (m === '0') { ret = `>=${M}.${m}.${p}-${pr } <${M}.${m}.${+p + 1}-0` } else { ret = `>=${M}.${m}.${p}-${pr } <${M}.${+m + 1}.0-0` } } else { ret = `>=${M}.${m}.${p}-${pr } <${+M + 1}.0.0-0` } } else { debug('no pr') if (M === '0') { if (m === '0') { ret = `>=${M}.${m}.${p }${z} <${M}.${m}.${+p + 1}-0` } else { ret = `>=${M}.${m}.${p }${z} <${M}.${+m + 1}.0-0` } } else { ret = `>=${M}.${m}.${p } <${+M + 1}.0.0-0` } } debug('caret return', ret) return ret }) } const replaceXRanges = (comp, options) => { debug('replaceXRanges', comp, options) return comp.split(/\s+/).map((comp) => { return replaceXRange(comp, options) }).join(' ') } const replaceXRange = (comp, options) => { comp = comp.trim() const r = options.loose ? re[t.XRANGELOOSE] : re[t.XRANGE] return comp.replace(r, (ret, gtlt, M, m, p, pr) => { debug('xRange', comp, ret, gtlt, M, m, p, pr) const xM = isX(M) const xm = xM || isX(m) const xp = xm || isX(p) const anyX = xp if (gtlt === '=' && anyX) { gtlt = '' } // if we're including prereleases in the match, then we need // to fix this to -0, the lowest possible prerelease value pr = options.includePrerelease ? '-0' : '' if (xM) { if (gtlt === '>' || gtlt === '<') { // nothing is allowed ret = '<0.0.0-0' } else { // nothing is forbidden ret = '*' } } else if (gtlt && anyX) { // we know patch is an x, because we have any x at all. // replace X with 0 if (xm) { m = 0 } p = 0 if (gtlt === '>') { // >1 => >=2.0.0 // >1.2 => >=1.3.0 gtlt = '>=' if (xm) { M = +M + 1 m = 0 p = 0 } else { m = +m + 1 p = 0 } } else if (gtlt === '<=') { // <=0.7.x is actually <0.8.0, since any 0.7.x should // pass. Similarly, <=7.x is actually <8.0.0, etc. gtlt = '<' if (xm) { M = +M + 1 } else { m = +m + 1 } } if (gtlt === '<') pr = '-0' ret = `${gtlt + M}.${m}.${p}${pr}` } else if (xm) { ret = `>=${M}.0.0${pr} <${+M + 1}.0.0-0` } else if (xp) { ret = `>=${M}.${m}.0${pr } <${M}.${+m + 1}.0-0` } debug('xRange return', ret) return ret }) } // Because * is AND-ed with everything else in the comparator, // and '' means "any version", just remove the *s entirely. const replaceStars = (comp, options) => { debug('replaceStars', comp, options) // Looseness is ignored here. star is always as loose as it gets! return comp.trim().replace(re[t.STAR], '') } const replaceGTE0 = (comp, options) => { debug('replaceGTE0', comp, options) return comp.trim() .replace(re[options.includePrerelease ? t.GTE0PRE : t.GTE0], '') } // This function is passed to string.replace(re[t.HYPHENRANGE]) // M, m, patch, prerelease, build // 1.2 - 3.4.5 => >=1.2.0 <=3.4.5 // 1.2.3 - 3.4 => >=1.2.0 <3.5.0-0 Any 3.4.x will do // 1.2 - 3.4 => >=1.2.0 <3.5.0-0 const hyphenReplace = incPr => ($0, from, fM, fm, fp, fpr, fb, to, tM, tm, tp, tpr, tb) => { if (isX(fM)) { from = '' } else if (isX(fm)) { from = `>=${fM}.0.0${incPr ? '-0' : ''}` } else if (isX(fp)) { from = `>=${fM}.${fm}.0${incPr ? '-0' : ''}` } else if (fpr) { from = `>=${from}` } else { from = `>=${from}${incPr ? '-0' : ''}` } if (isX(tM)) { to = '' } else if (isX(tm)) { to = `<${+tM + 1}.0.0-0` } else if (isX(tp)) { to = `<${tM}.${+tm + 1}.0-0` } else if (tpr) { to = `<=${tM}.${tm}.${tp}-${tpr}` } else if (incPr) { to = `<${tM}.${tm}.${+tp + 1}-0` } else { to = `<=${to}` } return (`${from} ${to}`).trim() } const testSet = (set, version, options) => { for (let i = 0; i < set.length; i++) { if (!set[i].test(version)) { return false } } if (version.prerelease.length && !options.includePrerelease) { // Find the set of versions that are allowed to have prereleases // For example, ^1.2.3-pr.1 desugars to >=1.2.3-pr.1 <2.0.0 // That should allow `1.2.3-pr.2` to pass. // However, `1.2.4-alpha.notready` should NOT be allowed, // even though it's within the range set by the comparators. for (let i = 0; i < set.length; i++) { debug(set[i].semver) if (set[i].semver === Comparator.ANY) { continue } if (set[i].semver.prerelease.length > 0) { const allowed = set[i].semver if (allowed.major === version.major && allowed.minor === version.minor && allowed.patch === version.patch) { return true } } } // Version has a -pre, but it's not one of the ones we like. return false } return true } /***/ }), /***/ 48088: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { const debug = __webpack_require__(50427) const { MAX_LENGTH, MAX_SAFE_INTEGER } = __webpack_require__(42293) const { re, t } = __webpack_require__(9523) const parseOptions = __webpack_require__(40785) const { compareIdentifiers } = __webpack_require__(92463) class SemVer { constructor (version, options) { options = parseOptions(options) if (version instanceof SemVer) { if (version.loose === !!options.loose && version.includePrerelease === !!options.includePrerelease) { return version } else { version = version.version } } else if (typeof version !== 'string') { throw new TypeError(`Invalid Version: ${version}`) } if (version.length > MAX_LENGTH) { throw new TypeError( `version is longer than ${MAX_LENGTH} characters` ) } debug('SemVer', version, options) this.options = options this.loose = !!options.loose // this isn't actually relevant for versions, but keep it so that we // don't run into trouble passing this.options around. this.includePrerelease = !!options.includePrerelease const m = version.trim().match(options.loose ? re[t.LOOSE] : re[t.FULL]) if (!m) { throw new TypeError(`Invalid Version: ${version}`) } this.raw = version // these are actually numbers this.major = +m[1] this.minor = +m[2] this.patch = +m[3] if (this.major > MAX_SAFE_INTEGER || this.major < 0) { throw new TypeError('Invalid major version') } if (this.minor > MAX_SAFE_INTEGER || this.minor < 0) { throw new TypeError('Invalid minor version') } if (this.patch > MAX_SAFE_INTEGER || this.patch < 0) { throw new TypeError('Invalid patch version') } // numberify any prerelease numeric ids if (!m[4]) { this.prerelease = [] } else { this.prerelease = m[4].split('.').map((id) => { if (/^[0-9]+$/.test(id)) { const num = +id if (num >= 0 && num < MAX_SAFE_INTEGER) { return num } } return id }) } this.build = m[5] ? m[5].split('.') : [] this.format() } format () { this.version = `${this.major}.${this.minor}.${this.patch}` if (this.prerelease.length) { this.version += `-${this.prerelease.join('.')}` } return this.version } toString () { return this.version } compare (other) { debug('SemVer.compare', this.version, this.options, other) if (!(other instanceof SemVer)) { if (typeof other === 'string' && other === this.version) { return 0 } other = new SemVer(other, this.options) } if (other.version === this.version) { return 0 } return this.compareMain(other) || this.comparePre(other) } compareMain (other) { if (!(other instanceof SemVer)) { other = new SemVer(other, this.options) } return ( compareIdentifiers(this.major, other.major) || compareIdentifiers(this.minor, other.minor) || compareIdentifiers(this.patch, other.patch) ) } comparePre (other) { if (!(other instanceof SemVer)) { other = new SemVer(other, this.options) } // NOT having a prerelease is > having one if (this.prerelease.length && !other.prerelease.length) { return -1 } else if (!this.prerelease.length && other.prerelease.length) { return 1 } else if (!this.prerelease.length && !other.prerelease.length) { return 0 } let i = 0 do { const a = this.prerelease[i] const b = other.prerelease[i] debug('prerelease compare', i, a, b) if (a === undefined && b === undefined) { return 0 } else if (b === undefined) { return 1 } else if (a === undefined) { return -1 } else if (a === b) { continue } else { return compareIdentifiers(a, b) } } while (++i) } compareBuild (other) { if (!(other instanceof SemVer)) { other = new SemVer(other, this.options) } let i = 0 do { const a = this.build[i] const b = other.build[i] debug('prerelease compare', i, a, b) if (a === undefined && b === undefined) { return 0 } else if (b === undefined) { return 1 } else if (a === undefined) { return -1 } else if (a === b) { continue } else { return compareIdentifiers(a, b) } } while (++i) } // preminor will bump the version up to the next minor release, and immediately // down to pre-release. premajor and prepatch work the same way. inc (release, identifier) { switch (release) { case 'premajor': this.prerelease.length = 0 this.patch = 0 this.minor = 0 this.major++ this.inc('pre', identifier) break case 'preminor': this.prerelease.length = 0 this.patch = 0 this.minor++ this.inc('pre', identifier) break case 'prepatch': // If this is already a prerelease, it will bump to the next version // drop any prereleases that might already exist, since they are not // relevant at this point. this.prerelease.length = 0 this.inc('patch', identifier) this.inc('pre', identifier) break // If the input is a non-prerelease version, this acts the same as // prepatch. case 'prerelease': if (this.prerelease.length === 0) { this.inc('patch', identifier) } this.inc('pre', identifier) break case 'major': // If this is a pre-major version, bump up to the same major version. // Otherwise increment major. // 1.0.0-5 bumps to 1.0.0 // 1.1.0 bumps to 2.0.0 if ( this.minor !== 0 || this.patch !== 0 || this.prerelease.length === 0 ) { this.major++ } this.minor = 0 this.patch = 0 this.prerelease = [] break case 'minor': // If this is a pre-minor version, bump up to the same minor version. // Otherwise increment minor. // 1.2.0-5 bumps to 1.2.0 // 1.2.1 bumps to 1.3.0 if (this.patch !== 0 || this.prerelease.length === 0) { this.minor++ } this.patch = 0 this.prerelease = [] break case 'patch': // If this is not a pre-release version, it will increment the patch. // If it is a pre-release it will bump up to the same patch version. // 1.2.0-5 patches to 1.2.0 // 1.2.0 patches to 1.2.1 if (this.prerelease.length === 0) { this.patch++ } this.prerelease = [] break // This probably shouldn't be used publicly. // 1.0.0 'pre' would become 1.0.0-0 which is the wrong direction. case 'pre': if (this.prerelease.length === 0) { this.prerelease = [0] } else { let i = this.prerelease.length while (--i >= 0) { if (typeof this.prerelease[i] === 'number') { this.prerelease[i]++ i = -2 } } if (i === -1) { // didn't increment anything this.prerelease.push(0) } } if (identifier) { // 1.2.0-beta.1 bumps to 1.2.0-beta.2, // 1.2.0-beta.fooblz or 1.2.0-beta bumps to 1.2.0-beta.0 if (this.prerelease[0] === identifier) { if (isNaN(this.prerelease[1])) { this.prerelease = [identifier, 0] } } else { this.prerelease = [identifier, 0] } } break default: throw new Error(`invalid increment argument: ${release}`) } this.format() this.raw = this.version return this } } module.exports = SemVer /***/ }), /***/ 48848: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { const parse = __webpack_require__(75925) const clean = (version, options) => { const s = parse(version.trim().replace(/^[=v]+/, ''), options) return s ? s.version : null } module.exports = clean /***/ }), /***/ 75098: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { const eq = __webpack_require__(91898) const neq = __webpack_require__(6017) const gt = __webpack_require__(84123) const gte = __webpack_require__(15522) const lt = __webpack_require__(80194) const lte = __webpack_require__(77520) const cmp = (a, op, b, loose) => { switch (op) { case '===': if (typeof a === 'object') a = a.version if (typeof b === 'object') b = b.version return a === b case '!==': if (typeof a === 'object') a = a.version if (typeof b === 'object') b = b.version return a !== b case '': case '=': case '==': return eq(a, b, loose) case '!=': return neq(a, b, loose) case '>': return gt(a, b, loose) case '>=': return gte(a, b, loose) case '<': return lt(a, b, loose) case '<=': return lte(a, b, loose) default: throw new TypeError(`Invalid operator: ${op}`) } } module.exports = cmp /***/ }), /***/ 13466: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { const SemVer = __webpack_require__(48088) const parse = __webpack_require__(75925) const {re, t} = __webpack_require__(9523) const coerce = (version, options) => { if (version instanceof SemVer) { return version } if (typeof version === 'number') { version = String(version) } if (typeof version !== 'string') { return null } options = options || {} let match = null if (!options.rtl) { match = version.match(re[t.COERCE]) } else { // Find the right-most coercible string that does not share // a terminus with a more left-ward coercible string. // Eg, '1.2.3.4' wants to coerce '2.3.4', not '3.4' or '4' // // Walk through the string checking with a /g regexp // Manually set the index so as to pick up overlapping matches. // Stop when we get a match that ends at the string end, since no // coercible string can be more right-ward without the same terminus. let next while ((next = re[t.COERCERTL].exec(version)) && (!match || match.index + match[0].length !== version.length) ) { if (!match || next.index + next[0].length !== match.index + match[0].length) { match = next } re[t.COERCERTL].lastIndex = next.index + next[1].length + next[2].length } // leave it in a clean state re[t.COERCERTL].lastIndex = -1 } if (match === null) return null return parse(`${match[2]}.${match[3] || '0'}.${match[4] || '0'}`, options) } module.exports = coerce /***/ }), /***/ 92156: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { const SemVer = __webpack_require__(48088) const compareBuild = (a, b, loose) => { const versionA = new SemVer(a, loose) const versionB = new SemVer(b, loose) return versionA.compare(versionB) || versionA.compareBuild(versionB) } module.exports = compareBuild /***/ }), /***/ 62804: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { const compare = __webpack_require__(44309) const compareLoose = (a, b) => compare(a, b, true) module.exports = compareLoose /***/ }), /***/ 44309: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { const SemVer = __webpack_require__(48088) const compare = (a, b, loose) => new SemVer(a, loose).compare(new SemVer(b, loose)) module.exports = compare /***/ }), /***/ 64297: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { const parse = __webpack_require__(75925) const eq = __webpack_require__(91898) const diff = (version1, version2) => { if (eq(version1, version2)) { return null } else { const v1 = parse(version1) const v2 = parse(version2) const hasPre = v1.prerelease.length || v2.prerelease.length const prefix = hasPre ? 'pre' : '' const defaultResult = hasPre ? 'prerelease' : '' for (const key in v1) { if (key === 'major' || key === 'minor' || key === 'patch') { if (v1[key] !== v2[key]) { return prefix + key } } } return defaultResult // may be undefined } } module.exports = diff /***/ }), /***/ 91898: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { const compare = __webpack_require__(44309) const eq = (a, b, loose) => compare(a, b, loose) === 0 module.exports = eq /***/ }), /***/ 84123: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { const compare = __webpack_require__(44309) const gt = (a, b, loose) => compare(a, b, loose) > 0 module.exports = gt /***/ }), /***/ 15522: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { const compare = __webpack_require__(44309) const gte = (a, b, loose) => compare(a, b, loose) >= 0 module.exports = gte /***/ }), /***/ 30900: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { const SemVer = __webpack_require__(48088) const inc = (version, release, options, identifier) => { if (typeof (options) === 'string') { identifier = options options = undefined } try { return new SemVer(version, options).inc(release, identifier).version } catch (er) { return null } } module.exports = inc /***/ }), /***/ 80194: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { const compare = __webpack_require__(44309) const lt = (a, b, loose) => compare(a, b, loose) < 0 module.exports = lt /***/ }), /***/ 77520: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { const compare = __webpack_require__(44309) const lte = (a, b, loose) => compare(a, b, loose) <= 0 module.exports = lte /***/ }), /***/ 76688: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { const SemVer = __webpack_require__(48088) const major = (a, loose) => new SemVer(a, loose).major module.exports = major /***/ }), /***/ 38447: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { const SemVer = __webpack_require__(48088) const minor = (a, loose) => new SemVer(a, loose).minor module.exports = minor /***/ }), /***/ 6017: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { const compare = __webpack_require__(44309) const neq = (a, b, loose) => compare(a, b, loose) !== 0 module.exports = neq /***/ }), /***/ 75925: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { const {MAX_LENGTH} = __webpack_require__(42293) const { re, t } = __webpack_require__(9523) const SemVer = __webpack_require__(48088) const parseOptions = __webpack_require__(40785) const parse = (version, options) => { options = parseOptions(options) if (version instanceof SemVer) { return version } if (typeof version !== 'string') { return null } if (version.length > MAX_LENGTH) { return null } const r = options.loose ? re[t.LOOSE] : re[t.FULL] if (!r.test(version)) { return null } try { return new SemVer(version, options) } catch (er) { return null } } module.exports = parse /***/ }), /***/ 42866: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { const SemVer = __webpack_require__(48088) const patch = (a, loose) => new SemVer(a, loose).patch module.exports = patch /***/ }), /***/ 24016: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { const parse = __webpack_require__(75925) const prerelease = (version, options) => { const parsed = parse(version, options) return (parsed && parsed.prerelease.length) ? parsed.prerelease : null } module.exports = prerelease /***/ }), /***/ 76417: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { const compare = __webpack_require__(44309) const rcompare = (a, b, loose) => compare(b, a, loose) module.exports = rcompare /***/ }), /***/ 8701: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { const compareBuild = __webpack_require__(92156) const rsort = (list, loose) => list.sort((a, b) => compareBuild(b, a, loose)) module.exports = rsort /***/ }), /***/ 6055: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { const Range = __webpack_require__(9828) const satisfies = (version, range, options) => { try { range = new Range(range, options) } catch (er) { return false } return range.test(version) } module.exports = satisfies /***/ }), /***/ 61426: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { const compareBuild = __webpack_require__(92156) const sort = (list, loose) => list.sort((a, b) => compareBuild(a, b, loose)) module.exports = sort /***/ }), /***/ 19601: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { const parse = __webpack_require__(75925) const valid = (version, options) => { const v = parse(version, options) return v ? v.version : null } module.exports = valid /***/ }), /***/ 11383: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { // just pre-load all the stuff that index.js lazily exports const internalRe = __webpack_require__(9523) module.exports = { re: internalRe.re, src: internalRe.src, tokens: internalRe.t, SEMVER_SPEC_VERSION: __webpack_require__(42293).SEMVER_SPEC_VERSION, SemVer: __webpack_require__(48088), compareIdentifiers: __webpack_require__(92463).compareIdentifiers, rcompareIdentifiers: __webpack_require__(92463).rcompareIdentifiers, parse: __webpack_require__(75925), valid: __webpack_require__(19601), clean: __webpack_require__(48848), inc: __webpack_require__(30900), diff: __webpack_require__(64297), major: __webpack_require__(76688), minor: __webpack_require__(38447), patch: __webpack_require__(42866), prerelease: __webpack_require__(24016), compare: __webpack_require__(44309), rcompare: __webpack_require__(76417), compareLoose: __webpack_require__(62804), compareBuild: __webpack_require__(92156), sort: __webpack_require__(61426), rsort: __webpack_require__(8701), gt: __webpack_require__(84123), lt: __webpack_require__(80194), eq: __webpack_require__(91898), neq: __webpack_require__(6017), gte: __webpack_require__(15522), lte: __webpack_require__(77520), cmp: __webpack_require__(75098), coerce: __webpack_require__(13466), Comparator: __webpack_require__(91532), Range: __webpack_require__(9828), satisfies: __webpack_require__(6055), toComparators: __webpack_require__(52706), maxSatisfying: __webpack_require__(20579), minSatisfying: __webpack_require__(10832), minVersion: __webpack_require__(34179), validRange: __webpack_require__(2098), outside: __webpack_require__(60420), gtr: __webpack_require__(9380), ltr: __webpack_require__(33323), intersects: __webpack_require__(27008), simplifyRange: __webpack_require__(75297), subset: __webpack_require__(7863), } /***/ }), /***/ 42293: /***/ ((module) => { // Note: this is the semver.org version of the spec that it implements // Not necessarily the package version of this code. const SEMVER_SPEC_VERSION = '2.0.0' const MAX_LENGTH = 256 const MAX_SAFE_INTEGER = Number.MAX_SAFE_INTEGER || /* istanbul ignore next */ 9007199254740991 // Max safe segment length for coercion. const MAX_SAFE_COMPONENT_LENGTH = 16 module.exports = { SEMVER_SPEC_VERSION, MAX_LENGTH, MAX_SAFE_INTEGER, MAX_SAFE_COMPONENT_LENGTH } /***/ }), /***/ 50427: /***/ ((module) => { const debug = ( typeof process === 'object' && process.env && process.env.NODE_DEBUG && /\bsemver\b/i.test(process.env.NODE_DEBUG) ) ? (...args) => console.error('SEMVER', ...args) : () => {} module.exports = debug /***/ }), /***/ 92463: /***/ ((module) => { const numeric = /^[0-9]+$/ const compareIdentifiers = (a, b) => { const anum = numeric.test(a) const bnum = numeric.test(b) if (anum && bnum) { a = +a b = +b } return a === b ? 0 : (anum && !bnum) ? -1 : (bnum && !anum) ? 1 : a < b ? -1 : 1 } const rcompareIdentifiers = (a, b) => compareIdentifiers(b, a) module.exports = { compareIdentifiers, rcompareIdentifiers } /***/ }), /***/ 40785: /***/ ((module) => { // parse out just the options we care about so we always get a consistent // obj with keys in a consistent order. const opts = ['includePrerelease', 'loose', 'rtl'] const parseOptions = options => !options ? {} : typeof options !== 'object' ? { loose: true } : opts.filter(k => options[k]).reduce((options, k) => { options[k] = true return options }, {}) module.exports = parseOptions /***/ }), /***/ 9523: /***/ ((module, exports, __webpack_require__) => { const { MAX_SAFE_COMPONENT_LENGTH } = __webpack_require__(42293) const debug = __webpack_require__(50427) exports = module.exports = {} // The actual regexps go on exports.re const re = exports.re = [] const src = exports.src = [] const t = exports.t = {} let R = 0 const createToken = (name, value, isGlobal) => { const index = R++ debug(index, value) t[name] = index src[index] = value re[index] = new RegExp(value, isGlobal ? 'g' : undefined) } // The following Regular Expressions can be used for tokenizing, // validating, and parsing SemVer version strings. // ## Numeric Identifier // A single `0`, or a non-zero digit followed by zero or more digits. createToken('NUMERICIDENTIFIER', '0|[1-9]\\d*') createToken('NUMERICIDENTIFIERLOOSE', '[0-9]+') // ## Non-numeric Identifier // Zero or more digits, followed by a letter or hyphen, and then zero or // more letters, digits, or hyphens. createToken('NONNUMERICIDENTIFIER', '\\d*[a-zA-Z-][a-zA-Z0-9-]*') // ## Main Version // Three dot-separated numeric identifiers. createToken('MAINVERSION', `(${src[t.NUMERICIDENTIFIER]})\\.` + `(${src[t.NUMERICIDENTIFIER]})\\.` + `(${src[t.NUMERICIDENTIFIER]})`) createToken('MAINVERSIONLOOSE', `(${src[t.NUMERICIDENTIFIERLOOSE]})\\.` + `(${src[t.NUMERICIDENTIFIERLOOSE]})\\.` + `(${src[t.NUMERICIDENTIFIERLOOSE]})`) // ## Pre-release Version Identifier // A numeric identifier, or a non-numeric identifier. createToken('PRERELEASEIDENTIFIER', `(?:${src[t.NUMERICIDENTIFIER] }|${src[t.NONNUMERICIDENTIFIER]})`) createToken('PRERELEASEIDENTIFIERLOOSE', `(?:${src[t.NUMERICIDENTIFIERLOOSE] }|${src[t.NONNUMERICIDENTIFIER]})`) // ## Pre-release Version // Hyphen, followed by one or more dot-separated pre-release version // identifiers. createToken('PRERELEASE', `(?:-(${src[t.PRERELEASEIDENTIFIER] }(?:\\.${src[t.PRERELEASEIDENTIFIER]})*))`) createToken('PRERELEASELOOSE', `(?:-?(${src[t.PRERELEASEIDENTIFIERLOOSE] }(?:\\.${src[t.PRERELEASEIDENTIFIERLOOSE]})*))`) // ## Build Metadata Identifier // Any combination of digits, letters, or hyphens. createToken('BUILDIDENTIFIER', '[0-9A-Za-z-]+') // ## Build Metadata // Plus sign, followed by one or more period-separated build metadata // identifiers. createToken('BUILD', `(?:\\+(${src[t.BUILDIDENTIFIER] }(?:\\.${src[t.BUILDIDENTIFIER]})*))`) // ## Full Version String // A main version, followed optionally by a pre-release version and // build metadata. // Note that the only major, minor, patch, and pre-release sections of // the version string are capturing groups. The build metadata is not a // capturing group, because it should not ever be used in version // comparison. createToken('FULLPLAIN', `v?${src[t.MAINVERSION] }${src[t.PRERELEASE]}?${ src[t.BUILD]}?`) createToken('FULL', `^${src[t.FULLPLAIN]}$`) // like full, but allows v1.2.3 and =1.2.3, which people do sometimes. // also, 1.0.0alpha1 (prerelease without the hyphen) which is pretty // common in the npm registry. createToken('LOOSEPLAIN', `[v=\\s]*${src[t.MAINVERSIONLOOSE] }${src[t.PRERELEASELOOSE]}?${ src[t.BUILD]}?`) createToken('LOOSE', `^${src[t.LOOSEPLAIN]}$`) createToken('GTLT', '((?:<|>)?=?)') // Something like "2.*" or "1.2.x". // Note that "x.x" is a valid xRange identifer, meaning "any version" // Only the first item is strictly required. createToken('XRANGEIDENTIFIERLOOSE', `${src[t.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`) createToken('XRANGEIDENTIFIER', `${src[t.NUMERICIDENTIFIER]}|x|X|\\*`) createToken('XRANGEPLAIN', `[v=\\s]*(${src[t.XRANGEIDENTIFIER]})` + `(?:\\.(${src[t.XRANGEIDENTIFIER]})` + `(?:\\.(${src[t.XRANGEIDENTIFIER]})` + `(?:${src[t.PRERELEASE]})?${ src[t.BUILD]}?` + `)?)?`) createToken('XRANGEPLAINLOOSE', `[v=\\s]*(${src[t.XRANGEIDENTIFIERLOOSE]})` + `(?:\\.(${src[t.XRANGEIDENTIFIERLOOSE]})` + `(?:\\.(${src[t.XRANGEIDENTIFIERLOOSE]})` + `(?:${src[t.PRERELEASELOOSE]})?${ src[t.BUILD]}?` + `)?)?`) createToken('XRANGE', `^${src[t.GTLT]}\\s*${src[t.XRANGEPLAIN]}$`) createToken('XRANGELOOSE', `^${src[t.GTLT]}\\s*${src[t.XRANGEPLAINLOOSE]}$`) // Coercion. // Extract anything that could conceivably be a part of a valid semver createToken('COERCE', `${'(^|[^\\d])' + '(\\d{1,'}${MAX_SAFE_COMPONENT_LENGTH}})` + `(?:\\.(\\d{1,${MAX_SAFE_COMPONENT_LENGTH}}))?` + `(?:\\.(\\d{1,${MAX_SAFE_COMPONENT_LENGTH}}))?` + `(?:$|[^\\d])`) createToken('COERCERTL', src[t.COERCE], true) // Tilde ranges. // Meaning is "reasonably at or greater than" createToken('LONETILDE', '(?:~>?)') createToken('TILDETRIM', `(\\s*)${src[t.LONETILDE]}\\s+`, true) exports.tildeTrimReplace = '$1~' createToken('TILDE', `^${src[t.LONETILDE]}${src[t.XRANGEPLAIN]}$`) createToken('TILDELOOSE', `^${src[t.LONETILDE]}${src[t.XRANGEPLAINLOOSE]}$`) // Caret ranges. // Meaning is "at least and backwards compatible with" createToken('LONECARET', '(?:\\^)') createToken('CARETTRIM', `(\\s*)${src[t.LONECARET]}\\s+`, true) exports.caretTrimReplace = '$1^' createToken('CARET', `^${src[t.LONECARET]}${src[t.XRANGEPLAIN]}$`) createToken('CARETLOOSE', `^${src[t.LONECARET]}${src[t.XRANGEPLAINLOOSE]}$`) // A simple gt/lt/eq thing, or just "" to indicate "any version" createToken('COMPARATORLOOSE', `^${src[t.GTLT]}\\s*(${src[t.LOOSEPLAIN]})$|^$`) createToken('COMPARATOR', `^${src[t.GTLT]}\\s*(${src[t.FULLPLAIN]})$|^$`) // An expression to strip any whitespace between the gtlt and the thing // it modifies, so that `> 1.2.3` ==> `>1.2.3` createToken('COMPARATORTRIM', `(\\s*)${src[t.GTLT] }\\s*(${src[t.LOOSEPLAIN]}|${src[t.XRANGEPLAIN]})`, true) exports.comparatorTrimReplace = '$1$2$3' // Something like `1.2.3 - 1.2.4` // Note that these all use the loose form, because they'll be // checked against either the strict or loose comparator form // later. createToken('HYPHENRANGE', `^\\s*(${src[t.XRANGEPLAIN]})` + `\\s+-\\s+` + `(${src[t.XRANGEPLAIN]})` + `\\s*$`) createToken('HYPHENRANGELOOSE', `^\\s*(${src[t.XRANGEPLAINLOOSE]})` + `\\s+-\\s+` + `(${src[t.XRANGEPLAINLOOSE]})` + `\\s*$`) // Star ranges basically just allow anything at all. createToken('STAR', '(<|>)?=?\\s*\\*') // >=0.0.0 is like a star createToken('GTE0', '^\\s*>=\\s*0\.0\.0\\s*$') createToken('GTE0PRE', '^\\s*>=\\s*0\.0\.0-0\\s*$') /***/ }), /***/ 9380: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { // Determine if version is greater than all the versions possible in the range. const outside = __webpack_require__(60420) const gtr = (version, range, options) => outside(version, range, '>', options) module.exports = gtr /***/ }), /***/ 27008: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { const Range = __webpack_require__(9828) const intersects = (r1, r2, options) => { r1 = new Range(r1, options) r2 = new Range(r2, options) return r1.intersects(r2) } module.exports = intersects /***/ }), /***/ 33323: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { const outside = __webpack_require__(60420) // Determine if version is less than all the versions possible in the range const ltr = (version, range, options) => outside(version, range, '<', options) module.exports = ltr /***/ }), /***/ 20579: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { const SemVer = __webpack_require__(48088) const Range = __webpack_require__(9828) const maxSatisfying = (versions, range, options) => { let max = null let maxSV = null let rangeObj = null try { rangeObj = new Range(range, options) } catch (er) { return null } versions.forEach((v) => { if (rangeObj.test(v)) { // satisfies(v, range, options) if (!max || maxSV.compare(v) === -1) { // compare(max, v, true) max = v maxSV = new SemVer(max, options) } } }) return max } module.exports = maxSatisfying /***/ }), /***/ 10832: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { const SemVer = __webpack_require__(48088) const Range = __webpack_require__(9828) const minSatisfying = (versions, range, options) => { let min = null let minSV = null let rangeObj = null try { rangeObj = new Range(range, options) } catch (er) { return null } versions.forEach((v) => { if (rangeObj.test(v)) { // satisfies(v, range, options) if (!min || minSV.compare(v) === 1) { // compare(min, v, true) min = v minSV = new SemVer(min, options) } } }) return min } module.exports = minSatisfying /***/ }), /***/ 34179: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { const SemVer = __webpack_require__(48088) const Range = __webpack_require__(9828) const gt = __webpack_require__(84123) const minVersion = (range, loose) => { range = new Range(range, loose) let minver = new SemVer('0.0.0') if (range.test(minver)) { return minver } minver = new SemVer('0.0.0-0') if (range.test(minver)) { return minver } minver = null for (let i = 0; i < range.set.length; ++i) { const comparators = range.set[i] let setMin = null comparators.forEach((comparator) => { // Clone to avoid manipulating the comparator's semver object. const compver = new SemVer(comparator.semver.version) switch (comparator.operator) { case '>': if (compver.prerelease.length === 0) { compver.patch++ } else { compver.prerelease.push(0) } compver.raw = compver.format() /* fallthrough */ case '': case '>=': if (!setMin || gt(compver, setMin)) { setMin = compver } break case '<': case '<=': /* Ignore maximum versions */ break /* istanbul ignore next */ default: throw new Error(`Unexpected operation: ${comparator.operator}`) } }) if (setMin && (!minver || gt(minver, setMin))) minver = setMin } if (minver && range.test(minver)) { return minver } return null } module.exports = minVersion /***/ }), /***/ 60420: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { const SemVer = __webpack_require__(48088) const Comparator = __webpack_require__(91532) const {ANY} = Comparator const Range = __webpack_require__(9828) const satisfies = __webpack_require__(6055) const gt = __webpack_require__(84123) const lt = __webpack_require__(80194) const lte = __webpack_require__(77520) const gte = __webpack_require__(15522) const outside = (version, range, hilo, options) => { version = new SemVer(version, options) range = new Range(range, options) let gtfn, ltefn, ltfn, comp, ecomp switch (hilo) { case '>': gtfn = gt ltefn = lte ltfn = lt comp = '>' ecomp = '>=' break case '<': gtfn = lt ltefn = gte ltfn = gt comp = '<' ecomp = '<=' break default: throw new TypeError('Must provide a hilo val of "<" or ">"') } // If it satisfies the range it is not outside if (satisfies(version, range, options)) { return false } // From now on, variable terms are as if we're in "gtr" mode. // but note that everything is flipped for the "ltr" function. for (let i = 0; i < range.set.length; ++i) { const comparators = range.set[i] let high = null let low = null comparators.forEach((comparator) => { if (comparator.semver === ANY) { comparator = new Comparator('>=0.0.0') } high = high || comparator low = low || comparator if (gtfn(comparator.semver, high.semver, options)) { high = comparator } else if (ltfn(comparator.semver, low.semver, options)) { low = comparator } }) // If the edge version comparator has a operator then our version // isn't outside it if (high.operator === comp || high.operator === ecomp) { return false } // If the lowest version comparator has an operator and our version // is less than it then it isn't higher than the range if ((!low.operator || low.operator === comp) && ltefn(version, low.semver)) { return false } else if (low.operator === ecomp && ltfn(version, low.semver)) { return false } } return true } module.exports = outside /***/ }), /***/ 75297: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { // given a set of versions and a range, create a "simplified" range // that includes the same versions that the original range does // If the original range is shorter than the simplified one, return that. const satisfies = __webpack_require__(6055) const compare = __webpack_require__(44309) module.exports = (versions, range, options) => { const set = [] let min = null let prev = null const v = versions.sort((a, b) => compare(a, b, options)) for (const version of v) { const included = satisfies(version, range, options) if (included) { prev = version if (!min) min = version } else { if (prev) { set.push([min, prev]) } prev = null min = null } } if (min) set.push([min, null]) const ranges = [] for (const [min, max] of set) { if (min === max) ranges.push(min) else if (!max && min === v[0]) ranges.push('*') else if (!max) ranges.push(`>=${min}`) else if (min === v[0]) ranges.push(`<=${max}`) else ranges.push(`${min} - ${max}`) } const simplified = ranges.join(' || ') const original = typeof range.raw === 'string' ? range.raw : String(range) return simplified.length < original.length ? simplified : range } /***/ }), /***/ 7863: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { const Range = __webpack_require__(9828) const Comparator = __webpack_require__(91532) const { ANY } = Comparator const satisfies = __webpack_require__(6055) const compare = __webpack_require__(44309) // Complex range `r1 || r2 || ...` is a subset of `R1 || R2 || ...` iff: // - Every simple range `r1, r2, ...` is a null set, OR // - Every simple range `r1, r2, ...` which is not a null set is a subset of // some `R1, R2, ...` // // Simple range `c1 c2 ...` is a subset of simple range `C1 C2 ...` iff: // - If c is only the ANY comparator // - If C is only the ANY comparator, return true // - Else if in prerelease mode, return false // - else replace c with `[>=0.0.0]` // - If C is only the ANY comparator // - if in prerelease mode, return true // - else replace C with `[>=0.0.0]` // - Let EQ be the set of = comparators in c // - If EQ is more than one, return true (null set) // - Let GT be the highest > or >= comparator in c // - Let LT be the lowest < or <= comparator in c // - If GT and LT, and GT.semver > LT.semver, return true (null set) // - If any C is a = range, and GT or LT are set, return false // - If EQ // - If GT, and EQ does not satisfy GT, return true (null set) // - If LT, and EQ does not satisfy LT, return true (null set) // - If EQ satisfies every C, return true // - Else return false // - If GT // - If GT.semver is lower than any > or >= comp in C, return false // - If GT is >=, and GT.semver does not satisfy every C, return false // - If GT.semver has a prerelease, and not in prerelease mode // - If no C has a prerelease and the GT.semver tuple, return false // - If LT // - If LT.semver is greater than any < or <= comp in C, return false // - If LT is <=, and LT.semver does not satisfy every C, return false // - If GT.semver has a prerelease, and not in prerelease mode // - If no C has a prerelease and the LT.semver tuple, return false // - Else return true const subset = (sub, dom, options = {}) => { if (sub === dom) return true sub = new Range(sub, options) dom = new Range(dom, options) let sawNonNull = false OUTER: for (const simpleSub of sub.set) { for (const simpleDom of dom.set) { const isSub = simpleSubset(simpleSub, simpleDom, options) sawNonNull = sawNonNull || isSub !== null if (isSub) continue OUTER } // the null set is a subset of everything, but null simple ranges in // a complex range should be ignored. so if we saw a non-null range, // then we know this isn't a subset, but if EVERY simple range was null, // then it is a subset. if (sawNonNull) return false } return true } const simpleSubset = (sub, dom, options) => { if (sub === dom) return true if (sub.length === 1 && sub[0].semver === ANY) { if (dom.length === 1 && dom[0].semver === ANY) return true else if (options.includePrerelease) sub = [ new Comparator('>=0.0.0-0') ] else sub = [ new Comparator('>=0.0.0') ] } if (dom.length === 1 && dom[0].semver === ANY) { if (options.includePrerelease) return true else dom = [ new Comparator('>=0.0.0') ] } const eqSet = new Set() let gt, lt for (const c of sub) { if (c.operator === '>' || c.operator === '>=') gt = higherGT(gt, c, options) else if (c.operator === '<' || c.operator === '<=') lt = lowerLT(lt, c, options) else eqSet.add(c.semver) } if (eqSet.size > 1) return null let gtltComp if (gt && lt) { gtltComp = compare(gt.semver, lt.semver, options) if (gtltComp > 0) return null else if (gtltComp === 0 && (gt.operator !== '>=' || lt.operator !== '<=')) return null } // will iterate one or zero times for (const eq of eqSet) { if (gt && !satisfies(eq, String(gt), options)) return null if (lt && !satisfies(eq, String(lt), options)) return null for (const c of dom) { if (!satisfies(eq, String(c), options)) return false } return true } let higher, lower let hasDomLT, hasDomGT // if the subset has a prerelease, we need a comparator in the superset // with the same tuple and a prerelease, or it's not a subset let needDomLTPre = lt && !options.includePrerelease && lt.semver.prerelease.length ? lt.semver : false let needDomGTPre = gt && !options.includePrerelease && gt.semver.prerelease.length ? gt.semver : false // exception: <1.2.3-0 is the same as <1.2.3 if (needDomLTPre && needDomLTPre.prerelease.length === 1 && lt.operator === '<' && needDomLTPre.prerelease[0] === 0) { needDomLTPre = false } for (const c of dom) { hasDomGT = hasDomGT || c.operator === '>' || c.operator === '>=' hasDomLT = hasDomLT || c.operator === '<' || c.operator === '<=' if (gt) { if (needDomGTPre) { if (c.semver.prerelease && c.semver.prerelease.length && c.semver.major === needDomGTPre.major && c.semver.minor === needDomGTPre.minor && c.semver.patch === needDomGTPre.patch) { needDomGTPre = false } } if (c.operator === '>' || c.operator === '>=') { higher = higherGT(gt, c, options) if (higher === c && higher !== gt) return false } else if (gt.operator === '>=' && !satisfies(gt.semver, String(c), options)) return false } if (lt) { if (needDomLTPre) { if (c.semver.prerelease && c.semver.prerelease.length && c.semver.major === needDomLTPre.major && c.semver.minor === needDomLTPre.minor && c.semver.patch === needDomLTPre.patch) { needDomLTPre = false } } if (c.operator === '<' || c.operator === '<=') { lower = lowerLT(lt, c, options) if (lower === c && lower !== lt) return false } else if (lt.operator === '<=' && !satisfies(lt.semver, String(c), options)) return false } if (!c.operator && (lt || gt) && gtltComp !== 0) return false } // if there was a < or >, and nothing in the dom, then must be false // UNLESS it was limited by another range in the other direction. // Eg, >1.0.0 <1.0.1 is still a subset of <2.0.0 if (gt && hasDomLT && !lt && gtltComp !== 0) return false if (lt && hasDomGT && !gt && gtltComp !== 0) return false // we needed a prerelease range in a specific tuple, but didn't get one // then this isn't a subset. eg >=1.2.3-pre is not a subset of >=1.0.0, // because it includes prereleases in the 1.2.3 tuple if (needDomGTPre || needDomLTPre) return false return true } // >=1.2.3 is lower than >1.2.3 const higherGT = (a, b, options) => { if (!a) return b const comp = compare(a.semver, b.semver, options) return comp > 0 ? a : comp < 0 ? b : b.operator === '>' && a.operator === '>=' ? b : a } // <=1.2.3 is higher than <1.2.3 const lowerLT = (a, b, options) => { if (!a) return b const comp = compare(a.semver, b.semver, options) return comp < 0 ? a : comp > 0 ? b : b.operator === '<' && a.operator === '<=' ? b : a } module.exports = subset /***/ }), /***/ 52706: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { const Range = __webpack_require__(9828) // Mostly just for testing and legacy API reasons const toComparators = (range, options) => new Range(range, options).set .map(comp => comp.map(c => c.value).join(' ').trim().split(' ')) module.exports = toComparators /***/ }), /***/ 2098: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { const Range = __webpack_require__(9828) const validRange = (range, options) => { try { // Return '*' instead of '' so that truthiness works. // This will throw if it's invalid anyway return new Range(range, options).range || '*' } catch (er) { return null } } module.exports = validRange /***/ }), /***/ 45123: /***/ ((module) => { module.exports = [ 'cat', 'cd', 'chmod', 'cp', 'dirs', 'echo', 'exec', 'find', 'grep', 'head', 'ln', 'ls', 'mkdir', 'mv', 'pwd', 'rm', 'sed', 'set', 'sort', 'tail', 'tempdir', 'test', 'to', 'toEnd', 'touch', 'uniq', 'which', ]; /***/ }), /***/ 33516: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { // // ShellJS // Unix shell commands on top of Node's API // // Copyright (c) 2012 Artur Adib // http://github.com/shelljs/shelljs // function __ncc_wildcard$0 (arg) { if (arg === "cat.js" || arg === "cat") return __webpack_require__(30271); else if (arg === "cd.js" || arg === "cd") return __webpack_require__(42051); else if (arg === "chmod.js" || arg === "chmod") return __webpack_require__(24975); else if (arg === "common.js" || arg === "common") return __webpack_require__(53687); else if (arg === "cp.js" || arg === "cp") return __webpack_require__(34932); else if (arg === "dirs.js" || arg === "dirs") return __webpack_require__(41178); else if (arg === "echo.js" || arg === "echo") return __webpack_require__(10243); else if (arg === "error.js" || arg === "error") return __webpack_require__(10232); else if (arg === "exec-child.js" || arg === "exec-child") return __webpack_require__(69607); else if (arg === "exec.js" || arg === "exec") return __webpack_require__(10896); else if (arg === "find.js" || arg === "find") return __webpack_require__(47838); else if (arg === "grep.js" || arg === "grep") return __webpack_require__(17417); else if (arg === "head.js" || arg === "head") return __webpack_require__(6613); else if (arg === "ln.js" || arg === "ln") return __webpack_require__(15787); else if (arg === "ls.js" || arg === "ls") return __webpack_require__(35561); else if (arg === "mkdir.js" || arg === "mkdir") return __webpack_require__(72695); else if (arg === "mv.js" || arg === "mv") return __webpack_require__(39849); else if (arg === "popd.js" || arg === "popd") return __webpack_require__(50227); else if (arg === "pushd.js" || arg === "pushd") return __webpack_require__(44177); else if (arg === "pwd.js" || arg === "pwd") return __webpack_require__(58553); else if (arg === "rm.js" || arg === "rm") return __webpack_require__(22830); else if (arg === "sed.js" || arg === "sed") return __webpack_require__(25899); else if (arg === "set.js" || arg === "set") return __webpack_require__(11411); else if (arg === "sort.js" || arg === "sort") return __webpack_require__(72116); else if (arg === "tail.js" || arg === "tail") return __webpack_require__(42284); else if (arg === "tempdir.js" || arg === "tempdir") return __webpack_require__(76150); else if (arg === "test.js" || arg === "test") return __webpack_require__(79723); else if (arg === "to.js" || arg === "to") return __webpack_require__(71961); else if (arg === "toEnd.js" || arg === "toEnd") return __webpack_require__(33736); else if (arg === "touch.js" || arg === "touch") return __webpack_require__(28358); else if (arg === "uniq.js" || arg === "uniq") return __webpack_require__(77286); else if (arg === "which.js" || arg === "which") return __webpack_require__(64766); } var common = __webpack_require__(53687); //@ //@ All commands run synchronously, unless otherwise stated. //@ All commands accept standard bash globbing characters (`*`, `?`, etc.), //@ compatible with the [node `glob` module](https://github.com/isaacs/node-glob). //@ //@ For less-commonly used commands and features, please check out our [wiki //@ page](https://github.com/shelljs/shelljs/wiki). //@ // Include the docs for all the default commands //@commands // Load all default commands __webpack_require__(45123).forEach(function (command) { __ncc_wildcard$0(command); }); //@ //@ ### exit(code) //@ //@ Exits the current process with the given exit `code`. exports.exit = process.exit; //@include ./src/error exports.error = __webpack_require__(10232); //@include ./src/common exports.ShellString = common.ShellString; //@ //@ ### env['VAR_NAME'] //@ //@ Object containing environment variables (both getter and setter). Shortcut //@ to `process.env`. exports.env = process.env; //@ //@ ### Pipes //@ //@ Examples: //@ //@ ```javascript //@ grep('foo', 'file1.txt', 'file2.txt').sed(/o/g, 'a').to('output.txt'); //@ echo('files with o\'s in the name:\n' + ls().grep('o')); //@ cat('test.js').exec('node'); // pipe to exec() call //@ ``` //@ //@ Commands can send their output to another command in a pipe-like fashion. //@ `sed`, `grep`, `cat`, `exec`, `to`, and `toEnd` can appear on the right-hand //@ side of a pipe. Pipes can be chained. //@ //@ ## Configuration //@ exports.config = common.config; //@ //@ ### config.silent //@ //@ Example: //@ //@ ```javascript //@ var sh = require('shelljs'); //@ var silentState = sh.config.silent; // save old silent state //@ sh.config.silent = true; //@ /* ... */ //@ sh.config.silent = silentState; // restore old silent state //@ ``` //@ //@ Suppresses all command output if `true`, except for `echo()` calls. //@ Default is `false`. //@ //@ ### config.fatal //@ //@ Example: //@ //@ ```javascript //@ require('shelljs/global'); //@ config.fatal = true; // or set('-e'); //@ cp('this_file_does_not_exist', '/dev/null'); // throws Error here //@ /* more commands... */ //@ ``` //@ //@ If `true`, the script will throw a Javascript error when any shell.js //@ command encounters an error. Default is `false`. This is analogous to //@ Bash's `set -e`. //@ //@ ### config.verbose //@ //@ Example: //@ //@ ```javascript //@ config.verbose = true; // or set('-v'); //@ cd('dir/'); //@ rm('-rf', 'foo.txt', 'bar.txt'); //@ exec('echo hello'); //@ ``` //@ //@ Will print each command as follows: //@ //@ ``` //@ cd dir/ //@ rm -rf foo.txt bar.txt //@ exec echo hello //@ ``` //@ //@ ### config.globOptions //@ //@ Example: //@ //@ ```javascript //@ config.globOptions = {nodir: true}; //@ ``` //@ //@ Use this value for calls to `glob.sync()` instead of the default options. //@ //@ ### config.reset() //@ //@ Example: //@ //@ ```javascript //@ var shell = require('shelljs'); //@ // Make changes to shell.config, and do stuff... //@ /* ... */ //@ shell.config.reset(); // reset to original state //@ // Do more stuff, but with original settings //@ /* ... */ //@ ``` //@ //@ Reset `shell.config` to the defaults: //@ //@ ```javascript //@ { //@ fatal: false, //@ globOptions: {}, //@ maxdepth: 255, //@ noglob: false, //@ silent: false, //@ verbose: false, //@ } //@ ``` /***/ }), /***/ 30271: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { var common = __webpack_require__(53687); var fs = __webpack_require__(35747); common.register('cat', _cat, { canReceivePipe: true, cmdOptions: { 'n': 'number', }, }); //@ //@ ### cat([options,] file [, file ...]) //@ ### cat([options,] file_array) //@ //@ Available options: //@ //@ + `-n`: number all output lines //@ //@ Examples: //@ //@ ```javascript //@ var str = cat('file*.txt'); //@ var str = cat('file1', 'file2'); //@ var str = cat(['file1', 'file2']); // same as above //@ ``` //@ //@ Returns a string containing the given file, or a concatenated string //@ containing the files if more than one file is given (a new line character is //@ introduced between each file). function _cat(options, files) { var cat = common.readFromPipe(); if (!files && !cat) common.error('no paths given'); files = [].slice.call(arguments, 1); files.forEach(function (file) { if (!fs.existsSync(file)) { common.error('no such file or directory: ' + file); } else if (common.statFollowLinks(file).isDirectory()) { common.error(file + ': Is a directory'); } cat += fs.readFileSync(file, 'utf8'); }); if (options.number) { cat = addNumbers(cat); } return cat; } module.exports = _cat; function addNumbers(cat) { var lines = cat.split('\n'); var lastLine = lines.pop(); lines = lines.map(function (line, i) { return numberedLine(i + 1, line); }); if (lastLine.length) { lastLine = numberedLine(lines.length + 1, lastLine); } lines.push(lastLine); return lines.join('\n'); } function numberedLine(n, line) { // GNU cat use six pad start number + tab. See http://lingrok.org/xref/coreutils/src/cat.c#57 // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/padStart var number = (' ' + n).slice(-6) + '\t'; return number + line; } /***/ }), /***/ 42051: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { var os = __webpack_require__(12087); var common = __webpack_require__(53687); common.register('cd', _cd, {}); //@ //@ ### cd([dir]) //@ //@ Changes to directory `dir` for the duration of the script. Changes to home //@ directory if no argument is supplied. function _cd(options, dir) { if (!dir) dir = os.homedir(); if (dir === '-') { if (!process.env.OLDPWD) { common.error('could not find previous directory'); } else { dir = process.env.OLDPWD; } } try { var curDir = process.cwd(); process.chdir(dir); process.env.OLDPWD = curDir; } catch (e) { // something went wrong, let's figure out the error var err; try { common.statFollowLinks(dir); // if this succeeds, it must be some sort of file err = 'not a directory: ' + dir; } catch (e2) { err = 'no such file or directory: ' + dir; } if (err) common.error(err); } return ''; } module.exports = _cd; /***/ }), /***/ 24975: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { var common = __webpack_require__(53687); var fs = __webpack_require__(35747); var path = __webpack_require__(85622); var PERMS = (function (base) { return { OTHER_EXEC: base.EXEC, OTHER_WRITE: base.WRITE, OTHER_READ: base.READ, GROUP_EXEC: base.EXEC << 3, GROUP_WRITE: base.WRITE << 3, GROUP_READ: base.READ << 3, OWNER_EXEC: base.EXEC << 6, OWNER_WRITE: base.WRITE << 6, OWNER_READ: base.READ << 6, // Literal octal numbers are apparently not allowed in "strict" javascript. STICKY: parseInt('01000', 8), SETGID: parseInt('02000', 8), SETUID: parseInt('04000', 8), TYPE_MASK: parseInt('0770000', 8), }; }({ EXEC: 1, WRITE: 2, READ: 4, })); common.register('chmod', _chmod, { }); //@ //@ ### chmod([options,] octal_mode || octal_string, file) //@ ### chmod([options,] symbolic_mode, file) //@ //@ Available options: //@ //@ + `-v`: output a diagnostic for every file processed//@ //@ + `-c`: like verbose, but report only when a change is made//@ //@ + `-R`: change files and directories recursively//@ //@ //@ Examples: //@ //@ ```javascript //@ chmod(755, '/Users/brandon'); //@ chmod('755', '/Users/brandon'); // same as above //@ chmod('u+x', '/Users/brandon'); //@ chmod('-R', 'a-w', '/Users/brandon'); //@ ``` //@ //@ Alters the permissions of a file or directory by either specifying the //@ absolute permissions in octal form or expressing the changes in symbols. //@ This command tries to mimic the POSIX behavior as much as possible. //@ Notable exceptions: //@ //@ + In symbolic modes, `a-r` and `-r` are identical. No consideration is //@ given to the `umask`. //@ + There is no "quiet" option, since default behavior is to run silent. function _chmod(options, mode, filePattern) { if (!filePattern) { if (options.length > 0 && options.charAt(0) === '-') { // Special case where the specified file permissions started with - to subtract perms, which // get picked up by the option parser as command flags. // If we are down by one argument and options starts with -, shift everything over. [].unshift.call(arguments, ''); } else { common.error('You must specify a file.'); } } options = common.parseOptions(options, { 'R': 'recursive', 'c': 'changes', 'v': 'verbose', }); filePattern = [].slice.call(arguments, 2); var files; // TODO: replace this with a call to common.expand() if (options.recursive) { files = []; filePattern.forEach(function addFile(expandedFile) { var stat = common.statNoFollowLinks(expandedFile); if (!stat.isSymbolicLink()) { files.push(expandedFile); if (stat.isDirectory()) { // intentionally does not follow symlinks. fs.readdirSync(expandedFile).forEach(function (child) { addFile(expandedFile + '/' + child); }); } } }); } else { files = filePattern; } files.forEach(function innerChmod(file) { file = path.resolve(file); if (!fs.existsSync(file)) { common.error('File not found: ' + file); } // When recursing, don't follow symlinks. if (options.recursive && common.statNoFollowLinks(file).isSymbolicLink()) { return; } var stat = common.statFollowLinks(file); var isDir = stat.isDirectory(); var perms = stat.mode; var type = perms & PERMS.TYPE_MASK; var newPerms = perms; if (isNaN(parseInt(mode, 8))) { // parse options mode.split(',').forEach(function (symbolicMode) { var pattern = /([ugoa]*)([=\+-])([rwxXst]*)/i; var matches = pattern.exec(symbolicMode); if (matches) { var applyTo = matches[1]; var operator = matches[2]; var change = matches[3]; var changeOwner = applyTo.indexOf('u') !== -1 || applyTo === 'a' || applyTo === ''; var changeGroup = applyTo.indexOf('g') !== -1 || applyTo === 'a' || applyTo === ''; var changeOther = applyTo.indexOf('o') !== -1 || applyTo === 'a' || applyTo === ''; var changeRead = change.indexOf('r') !== -1; var changeWrite = change.indexOf('w') !== -1; var changeExec = change.indexOf('x') !== -1; var changeExecDir = change.indexOf('X') !== -1; var changeSticky = change.indexOf('t') !== -1; var changeSetuid = change.indexOf('s') !== -1; if (changeExecDir && isDir) { changeExec = true; } var mask = 0; if (changeOwner) { mask |= (changeRead ? PERMS.OWNER_READ : 0) + (changeWrite ? PERMS.OWNER_WRITE : 0) + (changeExec ? PERMS.OWNER_EXEC : 0) + (changeSetuid ? PERMS.SETUID : 0); } if (changeGroup) { mask |= (changeRead ? PERMS.GROUP_READ : 0) + (changeWrite ? PERMS.GROUP_WRITE : 0) + (changeExec ? PERMS.GROUP_EXEC : 0) + (changeSetuid ? PERMS.SETGID : 0); } if (changeOther) { mask |= (changeRead ? PERMS.OTHER_READ : 0) + (changeWrite ? PERMS.OTHER_WRITE : 0) + (changeExec ? PERMS.OTHER_EXEC : 0); } // Sticky bit is special - it's not tied to user, group or other. if (changeSticky) { mask |= PERMS.STICKY; } switch (operator) { case '+': newPerms |= mask; break; case '-': newPerms &= ~mask; break; case '=': newPerms = type + mask; // According to POSIX, when using = to explicitly set the // permissions, setuid and setgid can never be cleared. if (common.statFollowLinks(file).isDirectory()) { newPerms |= (PERMS.SETUID + PERMS.SETGID) & perms; } break; default: common.error('Could not recognize operator: `' + operator + '`'); } if (options.verbose) { console.log(file + ' -> ' + newPerms.toString(8)); } if (perms !== newPerms) { if (!options.verbose && options.changes) { console.log(file + ' -> ' + newPerms.toString(8)); } fs.chmodSync(file, newPerms); perms = newPerms; // for the next round of changes! } } else { common.error('Invalid symbolic mode change: ' + symbolicMode); } }); } else { // they gave us a full number newPerms = type + parseInt(mode, 8); // POSIX rules are that setuid and setgid can only be added using numeric // form, but not cleared. if (common.statFollowLinks(file).isDirectory()) { newPerms |= (PERMS.SETUID + PERMS.SETGID) & perms; } fs.chmodSync(file, newPerms); } }); return ''; } module.exports = _chmod; /***/ }), /***/ 53687: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; // Ignore warning about 'new String()' /* eslint no-new-wrappers: 0 */ var os = __webpack_require__(12087); var fs = __webpack_require__(35747); var glob = __webpack_require__(91957); var shell = __webpack_require__(33516); var shellMethods = Object.create(shell); exports.extend = Object.assign; // Check if we're running under electron var isElectron = Boolean(process.versions.electron); // Module globals (assume no execPath by default) var DEFAULT_CONFIG = { fatal: false, globOptions: {}, maxdepth: 255, noglob: false, silent: false, verbose: false, execPath: null, bufLength: 64 * 1024, // 64KB }; var config = { reset: function () { Object.assign(this, DEFAULT_CONFIG); if (!isElectron) { this.execPath = process.execPath; } }, resetForTesting: function () { this.reset(); this.silent = true; }, }; config.reset(); exports.config = config; // Note: commands should generally consider these as read-only values. var state = { error: null, errorCode: 0, currentCmd: 'shell.js', }; exports.state = state; delete process.env.OLDPWD; // initially, there's no previous directory // Reliably test if something is any sort of javascript object function isObject(a) { return typeof a === 'object' && a !== null; } exports.isObject = isObject; function log() { /* istanbul ignore next */ if (!config.silent) { console.error.apply(console, arguments); } } exports.log = log; // Converts strings to be equivalent across all platforms. Primarily responsible // for making sure we use '/' instead of '\' as path separators, but this may be // expanded in the future if necessary function convertErrorOutput(msg) { if (typeof msg !== 'string') { throw new TypeError('input must be a string'); } return msg.replace(/\\/g, '/'); } exports.convertErrorOutput = convertErrorOutput; // Shows error message. Throws if config.fatal is true function error(msg, _code, options) { // Validate input if (typeof msg !== 'string') throw new Error('msg must be a string'); var DEFAULT_OPTIONS = { continue: false, code: 1, prefix: state.currentCmd + ': ', silent: false, }; if (typeof _code === 'number' && isObject(options)) { options.code = _code; } else if (isObject(_code)) { // no 'code' options = _code; } else if (typeof _code === 'number') { // no 'options' options = { code: _code }; } else if (typeof _code !== 'number') { // only 'msg' options = {}; } options = Object.assign({}, DEFAULT_OPTIONS, options); if (!state.errorCode) state.errorCode = options.code; var logEntry = convertErrorOutput(options.prefix + msg); state.error = state.error ? state.error + '\n' : ''; state.error += logEntry; // Throw an error, or log the entry if (config.fatal) throw new Error(logEntry); if (msg.length > 0 && !options.silent) log(logEntry); if (!options.continue) { throw { msg: 'earlyExit', retValue: (new ShellString('', state.error, state.errorCode)), }; } } exports.error = error; //@ //@ ### ShellString(str) //@ //@ Examples: //@ //@ ```javascript //@ var foo = ShellString('hello world'); //@ ``` //@ //@ Turns a regular string into a string-like object similar to what each //@ command returns. This has special methods, like `.to()` and `.toEnd()`. function ShellString(stdout, stderr, code) { var that; if (stdout instanceof Array) { that = stdout; that.stdout = stdout.join('\n'); if (stdout.length > 0) that.stdout += '\n'; } else { that = new String(stdout); that.stdout = stdout; } that.stderr = stderr; that.code = code; // A list of all commands that can appear on the right-hand side of a pipe // (populated by calls to common.wrap()) pipeMethods.forEach(function (cmd) { that[cmd] = shellMethods[cmd].bind(that); }); return that; } exports.ShellString = ShellString; // Returns {'alice': true, 'bob': false} when passed a string and dictionary as follows: // parseOptions('-a', {'a':'alice', 'b':'bob'}); // Returns {'reference': 'string-value', 'bob': false} when passed two dictionaries of the form: // parseOptions({'-r': 'string-value'}, {'r':'reference', 'b':'bob'}); // Throws an error when passed a string that does not start with '-': // parseOptions('a', {'a':'alice'}); // throws function parseOptions(opt, map, errorOptions) { // Validate input if (typeof opt !== 'string' && !isObject(opt)) { throw new Error('options must be strings or key-value pairs'); } else if (!isObject(map)) { throw new Error('parseOptions() internal error: map must be an object'); } else if (errorOptions && !isObject(errorOptions)) { throw new Error('parseOptions() internal error: errorOptions must be object'); } if (opt === '--') { // This means there are no options. return {}; } // All options are false by default var options = {}; Object.keys(map).forEach(function (letter) { var optName = map[letter]; if (optName[0] !== '!') { options[optName] = false; } }); if (opt === '') return options; // defaults if (typeof opt === 'string') { if (opt[0] !== '-') { throw new Error("Options string must start with a '-'"); } // e.g. chars = ['R', 'f'] var chars = opt.slice(1).split(''); chars.forEach(function (c) { if (c in map) { var optionName = map[c]; if (optionName[0] === '!') { options[optionName.slice(1)] = false; } else { options[optionName] = true; } } else { error('option not recognized: ' + c, errorOptions || {}); } }); } else { // opt is an Object Object.keys(opt).forEach(function (key) { // key is a string of the form '-r', '-d', etc. var c = key[1]; if (c in map) { var optionName = map[c]; options[optionName] = opt[key]; // assign the given value } else { error('option not recognized: ' + c, errorOptions || {}); } }); } return options; } exports.parseOptions = parseOptions; // Expands wildcards with matching (ie. existing) file names. // For example: // expand(['file*.js']) = ['file1.js', 'file2.js', ...] // (if the files 'file1.js', 'file2.js', etc, exist in the current dir) function expand(list) { if (!Array.isArray(list)) { throw new TypeError('must be an array'); } var expanded = []; list.forEach(function (listEl) { // Don't expand non-strings if (typeof listEl !== 'string') { expanded.push(listEl); } else { var ret; try { ret = glob.sync(listEl, config.globOptions); // if nothing matched, interpret the string literally ret = ret.length > 0 ? ret : [listEl]; } catch (e) { // if glob fails, interpret the string literally ret = [listEl]; } expanded = expanded.concat(ret); } }); return expanded; } exports.expand = expand; // Normalizes Buffer creation, using Buffer.alloc if possible. // Also provides a good default buffer length for most use cases. var buffer = typeof Buffer.alloc === 'function' ? function (len) { return Buffer.alloc(len || config.bufLength); } : function (len) { return new Buffer(len || config.bufLength); }; exports.buffer = buffer; // Normalizes _unlinkSync() across platforms to match Unix behavior, i.e. // file can be unlinked even if it's read-only, see https://github.com/joyent/node/issues/3006 function unlinkSync(file) { try { fs.unlinkSync(file); } catch (e) { // Try to override file permission /* istanbul ignore next */ if (e.code === 'EPERM') { fs.chmodSync(file, '0666'); fs.unlinkSync(file); } else { throw e; } } } exports.unlinkSync = unlinkSync; // wrappers around common.statFollowLinks and common.statNoFollowLinks that clarify intent // and improve readability function statFollowLinks() { return fs.statSync.apply(fs, arguments); } exports.statFollowLinks = statFollowLinks; function statNoFollowLinks() { return fs.lstatSync.apply(fs, arguments); } exports.statNoFollowLinks = statNoFollowLinks; // e.g. 'shelljs_a5f185d0443ca...' function randomFileName() { function randomHash(count) { if (count === 1) { return parseInt(16 * Math.random(), 10).toString(16); } var hash = ''; for (var i = 0; i < count; i++) { hash += randomHash(1); } return hash; } return 'shelljs_' + randomHash(20); } exports.randomFileName = randomFileName; // Common wrapper for all Unix-like commands that performs glob expansion, // command-logging, and other nice things function wrap(cmd, fn, options) { options = options || {}; return function () { var retValue = null; state.currentCmd = cmd; state.error = null; state.errorCode = 0; try { var args = [].slice.call(arguments, 0); // Log the command to stderr, if appropriate if (config.verbose) { console.error.apply(console, [cmd].concat(args)); } // If this is coming from a pipe, let's set the pipedValue (otherwise, set // it to the empty string) state.pipedValue = (this && typeof this.stdout === 'string') ? this.stdout : ''; if (options.unix === false) { // this branch is for exec() retValue = fn.apply(this, args); } else { // and this branch is for everything else if (isObject(args[0]) && args[0].constructor.name === 'Object') { // a no-op, allowing the syntax `touch({'-r': file}, ...)` } else if (args.length === 0 || typeof args[0] !== 'string' || args[0].length <= 1 || args[0][0] !== '-') { args.unshift(''); // only add dummy option if '-option' not already present } // flatten out arrays that are arguments, to make the syntax: // `cp([file1, file2, file3], dest);` // equivalent to: // `cp(file1, file2, file3, dest);` args = args.reduce(function (accum, cur) { if (Array.isArray(cur)) { return accum.concat(cur); } accum.push(cur); return accum; }, []); // Convert ShellStrings (basically just String objects) to regular strings args = args.map(function (arg) { if (isObject(arg) && arg.constructor.name === 'String') { return arg.toString(); } return arg; }); // Expand the '~' if appropriate var homeDir = os.homedir(); args = args.map(function (arg) { if (typeof arg === 'string' && arg.slice(0, 2) === '~/' || arg === '~') { return arg.replace(/^~/, homeDir); } return arg; }); // Perform glob-expansion on all arguments after globStart, but preserve // the arguments before it (like regexes for sed and grep) if (!config.noglob && options.allowGlobbing === true) { args = args.slice(0, options.globStart).concat(expand(args.slice(options.globStart))); } try { // parse options if options are provided if (isObject(options.cmdOptions)) { args[0] = parseOptions(args[0], options.cmdOptions); } retValue = fn.apply(this, args); } catch (e) { /* istanbul ignore else */ if (e.msg === 'earlyExit') { retValue = e.retValue; } else { throw e; // this is probably a bug that should be thrown up the call stack } } } } catch (e) { /* istanbul ignore next */ if (!state.error) { // If state.error hasn't been set it's an error thrown by Node, not us - probably a bug... e.name = 'ShellJSInternalError'; throw e; } if (config.fatal) throw e; } if (options.wrapOutput && (typeof retValue === 'string' || Array.isArray(retValue))) { retValue = new ShellString(retValue, state.error, state.errorCode); } state.currentCmd = 'shell.js'; return retValue; }; } // wrap exports.wrap = wrap; // This returns all the input that is piped into the current command (or the // empty string, if this isn't on the right-hand side of a pipe function _readFromPipe() { return state.pipedValue; } exports.readFromPipe = _readFromPipe; var DEFAULT_WRAP_OPTIONS = { allowGlobbing: true, canReceivePipe: false, cmdOptions: null, globStart: 1, pipeOnly: false, wrapOutput: true, unix: true, }; // This is populated during plugin registration var pipeMethods = []; // Register a new ShellJS command function _register(name, implementation, wrapOptions) { wrapOptions = wrapOptions || {}; // Validate options Object.keys(wrapOptions).forEach(function (option) { if (!DEFAULT_WRAP_OPTIONS.hasOwnProperty(option)) { throw new Error("Unknown option '" + option + "'"); } if (typeof wrapOptions[option] !== typeof DEFAULT_WRAP_OPTIONS[option]) { throw new TypeError("Unsupported type '" + typeof wrapOptions[option] + "' for option '" + option + "'"); } }); // If an option isn't specified, use the default wrapOptions = Object.assign({}, DEFAULT_WRAP_OPTIONS, wrapOptions); if (shell.hasOwnProperty(name)) { throw new Error('Command `' + name + '` already exists'); } if (wrapOptions.pipeOnly) { wrapOptions.canReceivePipe = true; shellMethods[name] = wrap(name, implementation, wrapOptions); } else { shell[name] = wrap(name, implementation, wrapOptions); } if (wrapOptions.canReceivePipe) { pipeMethods.push(name); } } exports.register = _register; /***/ }), /***/ 34932: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { var fs = __webpack_require__(35747); var path = __webpack_require__(85622); var common = __webpack_require__(53687); common.register('cp', _cp, { cmdOptions: { 'f': '!no_force', 'n': 'no_force', 'u': 'update', 'R': 'recursive', 'r': 'recursive', 'L': 'followsymlink', 'P': 'noFollowsymlink', }, wrapOutput: false, }); // Buffered file copy, synchronous // (Using readFileSync() + writeFileSync() could easily cause a memory overflow // with large files) function copyFileSync(srcFile, destFile, options) { if (!fs.existsSync(srcFile)) { common.error('copyFileSync: no such file or directory: ' + srcFile); } var isWindows = process.platform === 'win32'; // Check the mtimes of the files if the '-u' flag is provided try { if (options.update && common.statFollowLinks(srcFile).mtime < fs.statSync(destFile).mtime) { return; } } catch (e) { // If we're here, destFile probably doesn't exist, so just do a normal copy } if (common.statNoFollowLinks(srcFile).isSymbolicLink() && !options.followsymlink) { try { common.statNoFollowLinks(destFile); common.unlinkSync(destFile); // re-link it } catch (e) { // it doesn't exist, so no work needs to be done } var symlinkFull = fs.readlinkSync(srcFile); fs.symlinkSync(symlinkFull, destFile, isWindows ? 'junction' : null); } else { var buf = common.buffer(); var bufLength = buf.length; var bytesRead = bufLength; var pos = 0; var fdr = null; var fdw = null; try { fdr = fs.openSync(srcFile, 'r'); } catch (e) { /* istanbul ignore next */ common.error('copyFileSync: could not read src file (' + srcFile + ')'); } try { fdw = fs.openSync(destFile, 'w'); } catch (e) { /* istanbul ignore next */ common.error('copyFileSync: could not write to dest file (code=' + e.code + '):' + destFile); } while (bytesRead === bufLength) { bytesRead = fs.readSync(fdr, buf, 0, bufLength, pos); fs.writeSync(fdw, buf, 0, bytesRead); pos += bytesRead; } fs.closeSync(fdr); fs.closeSync(fdw); fs.chmodSync(destFile, common.statFollowLinks(srcFile).mode); } } // Recursively copies 'sourceDir' into 'destDir' // Adapted from https://github.com/ryanmcgrath/wrench-js // // Copyright (c) 2010 Ryan McGrath // Copyright (c) 2012 Artur Adib // // Licensed under the MIT License // http://www.opensource.org/licenses/mit-license.php function cpdirSyncRecursive(sourceDir, destDir, currentDepth, opts) { if (!opts) opts = {}; // Ensure there is not a run away recursive copy if (currentDepth >= common.config.maxdepth) return; currentDepth++; var isWindows = process.platform === 'win32'; // Create the directory where all our junk is moving to; read the mode of the // source directory and mirror it try { fs.mkdirSync(destDir); } catch (e) { // if the directory already exists, that's okay if (e.code !== 'EEXIST') throw e; } var files = fs.readdirSync(sourceDir); for (var i = 0; i < files.length; i++) { var srcFile = sourceDir + '/' + files[i]; var destFile = destDir + '/' + files[i]; var srcFileStat = common.statNoFollowLinks(srcFile); var symlinkFull; if (opts.followsymlink) { if (cpcheckcycle(sourceDir, srcFile)) { // Cycle link found. console.error('Cycle link found.'); symlinkFull = fs.readlinkSync(srcFile); fs.symlinkSync(symlinkFull, destFile, isWindows ? 'junction' : null); continue; } } if (srcFileStat.isDirectory()) { /* recursion this thing right on back. */ cpdirSyncRecursive(srcFile, destFile, currentDepth, opts); } else if (srcFileStat.isSymbolicLink() && !opts.followsymlink) { symlinkFull = fs.readlinkSync(srcFile); try { common.statNoFollowLinks(destFile); common.unlinkSync(destFile); // re-link it } catch (e) { // it doesn't exist, so no work needs to be done } fs.symlinkSync(symlinkFull, destFile, isWindows ? 'junction' : null); } else if (srcFileStat.isSymbolicLink() && opts.followsymlink) { srcFileStat = common.statFollowLinks(srcFile); if (srcFileStat.isDirectory()) { cpdirSyncRecursive(srcFile, destFile, currentDepth, opts); } else { copyFileSync(srcFile, destFile, opts); } } else { /* At this point, we've hit a file actually worth copying... so copy it on over. */ if (fs.existsSync(destFile) && opts.no_force) { common.log('skipping existing file: ' + files[i]); } else { copyFileSync(srcFile, destFile, opts); } } } // for files // finally change the mode for the newly created directory (otherwise, we // couldn't add files to a read-only directory). var checkDir = common.statFollowLinks(sourceDir); fs.chmodSync(destDir, checkDir.mode); } // cpdirSyncRecursive // Checks if cureent file was created recently function checkRecentCreated(sources, index) { var lookedSource = sources[index]; return sources.slice(0, index).some(function (src) { return path.basename(src) === path.basename(lookedSource); }); } function cpcheckcycle(sourceDir, srcFile) { var srcFileStat = common.statNoFollowLinks(srcFile); if (srcFileStat.isSymbolicLink()) { // Do cycle check. For example: // $ mkdir -p 1/2/3/4 // $ cd 1/2/3/4 // $ ln -s ../../3 link // $ cd ../../../.. // $ cp -RL 1 copy var cyclecheck = common.statFollowLinks(srcFile); if (cyclecheck.isDirectory()) { var sourcerealpath = fs.realpathSync(sourceDir); var symlinkrealpath = fs.realpathSync(srcFile); var re = new RegExp(symlinkrealpath); if (re.test(sourcerealpath)) { return true; } } } return false; } //@ //@ ### cp([options,] source [, source ...], dest) //@ ### cp([options,] source_array, dest) //@ //@ Available options: //@ //@ + `-f`: force (default behavior) //@ + `-n`: no-clobber //@ + `-u`: only copy if `source` is newer than `dest` //@ + `-r`, `-R`: recursive //@ + `-L`: follow symlinks //@ + `-P`: don't follow symlinks //@ //@ Examples: //@ //@ ```javascript //@ cp('file1', 'dir1'); //@ cp('-R', 'path/to/dir/', '~/newCopy/'); //@ cp('-Rf', '/tmp/*', '/usr/local/*', '/home/tmp'); //@ cp('-Rf', ['/tmp/*', '/usr/local/*'], '/home/tmp'); // same as above //@ ``` //@ //@ Copies files. function _cp(options, sources, dest) { // If we're missing -R, it actually implies -L (unless -P is explicit) if (options.followsymlink) { options.noFollowsymlink = false; } if (!options.recursive && !options.noFollowsymlink) { options.followsymlink = true; } // Get sources, dest if (arguments.length < 3) { common.error('missing and/or '); } else { sources = [].slice.call(arguments, 1, arguments.length - 1); dest = arguments[arguments.length - 1]; } var destExists = fs.existsSync(dest); var destStat = destExists && common.statFollowLinks(dest); // Dest is not existing dir, but multiple sources given if ((!destExists || !destStat.isDirectory()) && sources.length > 1) { common.error('dest is not a directory (too many sources)'); } // Dest is an existing file, but -n is given if (destExists && destStat.isFile() && options.no_force) { return new common.ShellString('', '', 0); } sources.forEach(function (src, srcIndex) { if (!fs.existsSync(src)) { if (src === '') src = "''"; // if src was empty string, display empty string common.error('no such file or directory: ' + src, { continue: true }); return; // skip file } var srcStat = common.statFollowLinks(src); if (!options.noFollowsymlink && srcStat.isDirectory()) { if (!options.recursive) { // Non-Recursive common.error("omitting directory '" + src + "'", { continue: true }); } else { // Recursive // 'cp /a/source dest' should create 'source' in 'dest' var newDest = (destStat && destStat.isDirectory()) ? path.join(dest, path.basename(src)) : dest; try { common.statFollowLinks(path.dirname(dest)); cpdirSyncRecursive(src, newDest, 0, { no_force: options.no_force, followsymlink: options.followsymlink }); } catch (e) { /* istanbul ignore next */ common.error("cannot create directory '" + dest + "': No such file or directory"); } } } else { // If here, src is a file // When copying to '/path/dir': // thisDest = '/path/dir/file1' var thisDest = dest; if (destStat && destStat.isDirectory()) { thisDest = path.normalize(dest + '/' + path.basename(src)); } var thisDestExists = fs.existsSync(thisDest); if (thisDestExists && checkRecentCreated(sources, srcIndex)) { // cannot overwrite file created recently in current execution, but we want to continue copying other files if (!options.no_force) { common.error("will not overwrite just-created '" + thisDest + "' with '" + src + "'", { continue: true }); } return; } if (thisDestExists && options.no_force) { return; // skip file } if (path.relative(src, thisDest) === '') { // a file cannot be copied to itself, but we want to continue copying other files common.error("'" + thisDest + "' and '" + src + "' are the same file", { continue: true }); return; } copyFileSync(src, thisDest, options); } }); // forEach(src) return new common.ShellString('', common.state.error, common.state.errorCode); } module.exports = _cp; /***/ }), /***/ 41178: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { var common = __webpack_require__(53687); var _cd = __webpack_require__(42051); var path = __webpack_require__(85622); common.register('dirs', _dirs, { wrapOutput: false, }); common.register('pushd', _pushd, { wrapOutput: false, }); common.register('popd', _popd, { wrapOutput: false, }); // Pushd/popd/dirs internals var _dirStack = []; function _isStackIndex(index) { return (/^[\-+]\d+$/).test(index); } function _parseStackIndex(index) { if (_isStackIndex(index)) { if (Math.abs(index) < _dirStack.length + 1) { // +1 for pwd return (/^-/).test(index) ? Number(index) - 1 : Number(index); } common.error(index + ': directory stack index out of range'); } else { common.error(index + ': invalid number'); } } function _actualDirStack() { return [process.cwd()].concat(_dirStack); } //@ //@ ### pushd([options,] [dir | '-N' | '+N']) //@ //@ Available options: //@ //@ + `-n`: Suppresses the normal change of directory when adding directories to the stack, so that only the stack is manipulated. //@ + `-q`: Supresses output to the console. //@ //@ Arguments: //@ //@ + `dir`: Sets the current working directory to the top of the stack, then executes the equivalent of `cd dir`. //@ + `+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`: 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. //@ //@ Examples: //@ //@ ```javascript //@ // process.cwd() === '/usr' //@ pushd('/etc'); // Returns /etc /usr //@ pushd('+1'); // Returns /usr /etc //@ ``` //@ //@ 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. function _pushd(options, dir) { if (_isStackIndex(options)) { dir = options; options = ''; } options = common.parseOptions(options, { 'n': 'no-cd', 'q': 'quiet', }); var dirs = _actualDirStack(); if (dir === '+0') { return dirs; // +0 is a noop } else if (!dir) { if (dirs.length > 1) { dirs = dirs.splice(1, 1).concat(dirs); } else { return common.error('no other directory'); } } else if (_isStackIndex(dir)) { var n = _parseStackIndex(dir); dirs = dirs.slice(n).concat(dirs.slice(0, n)); } else { if (options['no-cd']) { dirs.splice(1, 0, dir); } else { dirs.unshift(dir); } } if (options['no-cd']) { dirs = dirs.slice(1); } else { dir = path.resolve(dirs.shift()); _cd('', dir); } _dirStack = dirs; return _dirs(options.quiet ? '-q' : ''); } exports.pushd = _pushd; //@ //@ //@ ### popd([options,] ['-N' | '+N']) //@ //@ Available options: //@ //@ + `-n`: Suppress the normal directory change when removing directories from the stack, so that only the stack is manipulated. //@ + `-q`: Supresses output to the console. //@ //@ Arguments: //@ //@ + `+N`: Removes the Nth directory (counting from the left of the list printed by dirs), starting with zero. //@ + `-N`: Removes the Nth directory (counting from the right of the list printed by dirs), starting with zero. //@ //@ Examples: //@ //@ ```javascript //@ echo(process.cwd()); // '/usr' //@ pushd('/etc'); // '/etc /usr' //@ echo(process.cwd()); // '/etc' //@ popd(); // '/usr' //@ echo(process.cwd()); // '/usr' //@ ``` //@ //@ 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. function _popd(options, index) { if (_isStackIndex(options)) { index = options; options = ''; } options = common.parseOptions(options, { 'n': 'no-cd', 'q': 'quiet', }); if (!_dirStack.length) { return common.error('directory stack empty'); } index = _parseStackIndex(index || '+0'); if (options['no-cd'] || index > 0 || _dirStack.length + index === 0) { index = index > 0 ? index - 1 : index; _dirStack.splice(index, 1); } else { var dir = path.resolve(_dirStack.shift()); _cd('', dir); } return _dirs(options.quiet ? '-q' : ''); } exports.popd = _popd; //@ //@ //@ ### dirs([options | '+N' | '-N']) //@ //@ Available options: //@ //@ + `-c`: Clears the directory stack by deleting all of the elements. //@ + `-q`: Supresses output to the console. //@ //@ Arguments: //@ //@ + `+N`: Displays the Nth directory (counting from the left of the list printed by dirs when invoked without options), starting with zero. //@ + `-N`: Displays the Nth directory (counting from the right of the list printed by dirs when invoked without options), starting with zero. //@ //@ 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. //@ //@ See also: `pushd`, `popd` function _dirs(options, index) { if (_isStackIndex(options)) { index = options; options = ''; } options = common.parseOptions(options, { 'c': 'clear', 'q': 'quiet', }); if (options.clear) { _dirStack = []; return _dirStack; } var stack = _actualDirStack(); if (index) { index = _parseStackIndex(index); if (index < 0) { index = stack.length + index; } if (!options.quiet) { common.log(stack[index]); } return stack[index]; } if (!options.quiet) { common.log(stack.join(' ')); } return stack; } exports.dirs = _dirs; /***/ }), /***/ 10243: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { var format = __webpack_require__(31669).format; var common = __webpack_require__(53687); common.register('echo', _echo, { allowGlobbing: false, }); //@ //@ ### echo([options,] string [, string ...]) //@ //@ Available options: //@ //@ + `-e`: interpret backslash escapes (default) //@ + `-n`: remove trailing newline from output //@ //@ Examples: //@ //@ ```javascript //@ echo('hello world'); //@ var str = echo('hello world'); //@ echo('-n', 'no newline at end'); //@ ``` //@ //@ Prints `string` to stdout, and returns string with additional utility methods //@ like `.to()`. function _echo(opts) { // allow strings starting with '-', see issue #20 var messages = [].slice.call(arguments, opts ? 0 : 1); var options = {}; // If the first argument starts with '-', parse it as options string. // If parseOptions throws, it wasn't an options string. try { options = common.parseOptions(messages[0], { 'e': 'escapes', 'n': 'no_newline', }, { silent: true, }); // Allow null to be echoed if (messages[0]) { messages.shift(); } } catch (_) { // Clear out error if an error occurred common.state.error = null; } var output = format.apply(null, messages); // Add newline if -n is not passed. if (!options.no_newline) { output += '\n'; } process.stdout.write(output); return output; } module.exports = _echo; /***/ }), /***/ 10232: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { var common = __webpack_require__(53687); //@ //@ ### error() //@ //@ Tests if error occurred in the last command. Returns a truthy value if an //@ error returned, or a falsy value otherwise. //@ //@ **Note**: do not rely on the //@ return value to be an error message. If you need the last error message, use //@ the `.stderr` attribute from the last command's return value instead. function error() { return common.state.error; } module.exports = error; /***/ }), /***/ 69607: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { /* module decorator */ module = __webpack_require__.nmd(module); if (require.main !== module) { throw new Error('This file should not be required'); } var childProcess = __webpack_require__(63129); var fs = __webpack_require__(35747); var paramFilePath = process.argv[2]; var serializedParams = fs.readFileSync(paramFilePath, 'utf8'); var params = JSON.parse(serializedParams); var cmd = params.command; var execOptions = params.execOptions; var pipe = params.pipe; var stdoutFile = params.stdoutFile; var stderrFile = params.stderrFile; var c = childProcess.exec(cmd, execOptions, function (err) { if (!err) { process.exitCode = 0; } else if (err.code === undefined) { process.exitCode = 1; } else { process.exitCode = err.code; } }); var stdoutStream = fs.createWriteStream(stdoutFile); var stderrStream = fs.createWriteStream(stderrFile); c.stdout.pipe(stdoutStream); c.stderr.pipe(stderrStream); c.stdout.pipe(process.stdout); c.stderr.pipe(process.stderr); if (pipe) { c.stdin.end(pipe); } /***/ }), /***/ 10896: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { var common = __webpack_require__(53687); var _tempDir = __webpack_require__(76150).tempDir; var _pwd = __webpack_require__(58553); var path = __webpack_require__(85622); var fs = __webpack_require__(35747); var child = __webpack_require__(63129); var DEFAULT_MAXBUFFER_SIZE = 20 * 1024 * 1024; var DEFAULT_ERROR_CODE = 1; common.register('exec', _exec, { unix: false, canReceivePipe: true, wrapOutput: false, }); // We use this function to run `exec` synchronously while also providing realtime // output. function execSync(cmd, opts, pipe) { if (!common.config.execPath) { common.error('Unable to find a path to the node binary. Please manually set config.execPath'); } var tempDir = _tempDir(); var paramsFile = path.resolve(tempDir + '/' + common.randomFileName()); var stderrFile = path.resolve(tempDir + '/' + common.randomFileName()); var stdoutFile = path.resolve(tempDir + '/' + common.randomFileName()); opts = common.extend({ silent: common.config.silent, cwd: _pwd().toString(), env: process.env, maxBuffer: DEFAULT_MAXBUFFER_SIZE, encoding: 'utf8', }, opts); if (fs.existsSync(paramsFile)) common.unlinkSync(paramsFile); if (fs.existsSync(stderrFile)) common.unlinkSync(stderrFile); if (fs.existsSync(stdoutFile)) common.unlinkSync(stdoutFile); opts.cwd = path.resolve(opts.cwd); var paramsToSerialize = { command: cmd, execOptions: opts, pipe: pipe, stdoutFile: stdoutFile, stderrFile: stderrFile, }; // Create the files and ensure these are locked down (for read and write) to // the current user. The main concerns here are: // // * If we execute a command which prints sensitive output, then // stdoutFile/stderrFile must not be readable by other users. // * paramsFile must not be readable by other users, or else they can read it // to figure out the path for stdoutFile/stderrFile and create these first // (locked down to their own access), which will crash exec() when it tries // to write to the files. function writeFileLockedDown(filePath, data) { fs.writeFileSync(filePath, data, { encoding: 'utf8', mode: parseInt('600', 8), }); } writeFileLockedDown(stdoutFile, ''); writeFileLockedDown(stderrFile, ''); writeFileLockedDown(paramsFile, JSON.stringify(paramsToSerialize)); var execArgs = [ __webpack_require__.ab + "exec-child.js", paramsFile, ]; /* istanbul ignore else */ if (opts.silent) { opts.stdio = 'ignore'; } else { opts.stdio = [0, 1, 2]; } var code = 0; // Welcome to the future try { // Bad things if we pass in a `shell` option to child_process.execFileSync, // so we need to explicitly remove it here. delete opts.shell; child.execFileSync(common.config.execPath, execArgs, opts); } catch (e) { // Commands with non-zero exit code raise an exception. code = e.status || DEFAULT_ERROR_CODE; } // fs.readFileSync uses buffer encoding by default, so call // it without the encoding option if the encoding is 'buffer'. // Also, if the exec timeout is too short for node to start up, // the files will not be created, so these calls will throw. var stdout = ''; var stderr = ''; if (opts.encoding === 'buffer') { stdout = fs.readFileSync(stdoutFile); stderr = fs.readFileSync(stderrFile); } else { stdout = fs.readFileSync(stdoutFile, opts.encoding); stderr = fs.readFileSync(stderrFile, opts.encoding); } // No biggie if we can't erase the files now -- they're in a temp dir anyway // and we locked down permissions (see the note above). try { common.unlinkSync(paramsFile); } catch (e) {} try { common.unlinkSync(stderrFile); } catch (e) {} try { common.unlinkSync(stdoutFile); } catch (e) {} if (code !== 0) { // Note: `silent` should be unconditionally true to avoid double-printing // the command's stderr, and to avoid printing any stderr when the user has // set `shell.config.silent`. common.error(stderr, code, { continue: true, silent: true }); } var obj = common.ShellString(stdout, stderr, code); return obj; } // execSync() // Wrapper around exec() to enable echoing output to console in real time function execAsync(cmd, opts, pipe, callback) { opts = common.extend({ silent: common.config.silent, cwd: _pwd().toString(), env: process.env, maxBuffer: DEFAULT_MAXBUFFER_SIZE, encoding: 'utf8', }, opts); var c = child.exec(cmd, opts, function (err, stdout, stderr) { if (callback) { if (!err) { callback(0, stdout, stderr); } else if (err.code === undefined) { // See issue #536 /* istanbul ignore next */ callback(1, stdout, stderr); } else { callback(err.code, stdout, stderr); } } }); if (pipe) c.stdin.end(pipe); if (!opts.silent) { c.stdout.pipe(process.stdout); c.stderr.pipe(process.stderr); } return c; } //@ //@ ### exec(command [, options] [, callback]) //@ //@ Available options: //@ //@ + `async`: Asynchronous execution. If a callback is provided, it will be set to //@ `true`, regardless of the passed value (default: `false`). //@ + `silent`: Do not echo program output to console (default: `false`). //@ + `encoding`: Character encoding to use. Affects the values returned to stdout and stderr, and //@ what is written to stdout and stderr when not in silent mode (default: `'utf8'`). //@ + and any option available to Node.js's //@ [`child_process.exec()`](https://nodejs.org/api/child_process.html#child_process_child_process_exec_command_options_callback) //@ //@ Examples: //@ //@ ```javascript //@ var version = exec('node --version', {silent:true}).stdout; //@ //@ var child = exec('some_long_running_process', {async:true}); //@ child.stdout.on('data', function(data) { //@ /* ... do something with data ... */ //@ }); //@ //@ exec('some_long_running_process', function(code, stdout, stderr) { //@ console.log('Exit code:', code); //@ console.log('Program output:', stdout); //@ console.log('Program stderr:', stderr); //@ }); //@ ``` //@ //@ Executes the given `command` _synchronously_, unless otherwise specified. When in synchronous //@ mode, this returns a `ShellString` (compatible with ShellJS v0.6.x, which returns an object //@ of the form `{ code:..., stdout:... , stderr:... }`). Otherwise, this returns the child process //@ object, and the `callback` receives the arguments `(code, stdout, stderr)`. //@ //@ Not seeing the behavior you want? `exec()` runs everything through `sh` //@ by default (or `cmd.exe` on Windows), which differs from `bash`. If you //@ need bash-specific behavior, try out the `{shell: 'path/to/bash'}` option. function _exec(command, options, callback) { options = options || {}; if (!command) common.error('must specify command'); var pipe = common.readFromPipe(); // Callback is defined instead of options. if (typeof options === 'function') { callback = options; options = { async: true }; } // Callback is defined with options. if (typeof options === 'object' && typeof callback === 'function') { options.async = true; } options = common.extend({ silent: common.config.silent, async: false, }, options); if (options.async) { return execAsync(command, options, pipe, callback); } else { return execSync(command, options, pipe); } } module.exports = _exec; /***/ }), /***/ 47838: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { var path = __webpack_require__(85622); var common = __webpack_require__(53687); var _ls = __webpack_require__(35561); common.register('find', _find, {}); //@ //@ ### find(path [, path ...]) //@ ### find(path_array) //@ //@ Examples: //@ //@ ```javascript //@ find('src', 'lib'); //@ find(['src', 'lib']); // same as above //@ find('.').filter(function(file) { return file.match(/\.js$/); }); //@ ``` //@ //@ Returns array of all files (however deep) in the given paths. //@ //@ The main difference from `ls('-R', path)` is that the resulting file names //@ include the base directories (e.g., `lib/resources/file1` instead of just `file1`). function _find(options, paths) { if (!paths) { common.error('no path specified'); } else if (typeof paths === 'string') { paths = [].slice.call(arguments, 1); } var list = []; function pushFile(file) { if (process.platform === 'win32') { file = file.replace(/\\/g, '/'); } list.push(file); } // why not simply do `ls('-R', paths)`? because the output wouldn't give the base dirs // to get the base dir in the output, we need instead `ls('-R', 'dir/*')` for every directory paths.forEach(function (file) { var stat; try { stat = common.statFollowLinks(file); } catch (e) { common.error('no such file or directory: ' + file); } pushFile(file); if (stat.isDirectory()) { _ls({ recursive: true, all: true }, file).forEach(function (subfile) { pushFile(path.join(file, subfile)); }); } }); return list; } module.exports = _find; /***/ }), /***/ 17417: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { var common = __webpack_require__(53687); var fs = __webpack_require__(35747); common.register('grep', _grep, { globStart: 2, // don't glob-expand the regex canReceivePipe: true, cmdOptions: { 'v': 'inverse', 'l': 'nameOnly', 'i': 'ignoreCase', }, }); //@ //@ ### grep([options,] regex_filter, file [, file ...]) //@ ### grep([options,] regex_filter, file_array) //@ //@ Available options: //@ //@ + `-v`: Invert `regex_filter` (only print non-matching lines). //@ + `-l`: Print only filenames of matching files. //@ + `-i`: Ignore case. //@ //@ Examples: //@ //@ ```javascript //@ grep('-v', 'GLOBAL_VARIABLE', '*.js'); //@ grep('GLOBAL_VARIABLE', '*.js'); //@ ``` //@ //@ Reads input string from given files and returns a string containing all lines of the //@ file that match the given `regex_filter`. function _grep(options, regex, files) { // Check if this is coming from a pipe var pipe = common.readFromPipe(); if (!files && !pipe) common.error('no paths given', 2); files = [].slice.call(arguments, 2); if (pipe) { files.unshift('-'); } var grep = []; if (options.ignoreCase) { regex = new RegExp(regex, 'i'); } files.forEach(function (file) { if (!fs.existsSync(file) && file !== '-') { common.error('no such file or directory: ' + file, 2, { continue: true }); return; } var contents = file === '-' ? pipe : fs.readFileSync(file, 'utf8'); if (options.nameOnly) { if (contents.match(regex)) { grep.push(file); } } else { var lines = contents.split('\n'); lines.forEach(function (line) { var matched = line.match(regex); if ((options.inverse && !matched) || (!options.inverse && matched)) { grep.push(line); } }); } }); return grep.join('\n') + '\n'; } module.exports = _grep; /***/ }), /***/ 6613: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { var common = __webpack_require__(53687); var fs = __webpack_require__(35747); common.register('head', _head, { canReceivePipe: true, cmdOptions: { 'n': 'numLines', }, }); // Reads |numLines| lines or the entire file, whichever is less. function readSomeLines(file, numLines) { var buf = common.buffer(); var bufLength = buf.length; var bytesRead = bufLength; var pos = 0; var fdr = fs.openSync(file, 'r'); var numLinesRead = 0; var ret = ''; while (bytesRead === bufLength && numLinesRead < numLines) { bytesRead = fs.readSync(fdr, buf, 0, bufLength, pos); var bufStr = buf.toString('utf8', 0, bytesRead); numLinesRead += bufStr.split('\n').length - 1; ret += bufStr; pos += bytesRead; } fs.closeSync(fdr); return ret; } //@ //@ ### head([{'-n': \},] file [, file ...]) //@ ### head([{'-n': \},] file_array) //@ //@ Available options: //@ //@ + `-n `: Show the first `` lines of the files //@ //@ Examples: //@ //@ ```javascript //@ var str = head({'-n': 1}, 'file*.txt'); //@ var str = head('file1', 'file2'); //@ var str = head(['file1', 'file2']); // same as above //@ ``` //@ //@ Read the start of a file. function _head(options, files) { var head = []; var pipe = common.readFromPipe(); if (!files && !pipe) common.error('no paths given'); var idx = 1; if (options.numLines === true) { idx = 2; options.numLines = Number(arguments[1]); } else if (options.numLines === false) { options.numLines = 10; } files = [].slice.call(arguments, idx); if (pipe) { files.unshift('-'); } var shouldAppendNewline = false; files.forEach(function (file) { if (file !== '-') { if (!fs.existsSync(file)) { common.error('no such file or directory: ' + file, { continue: true }); return; } else if (common.statFollowLinks(file).isDirectory()) { common.error("error reading '" + file + "': Is a directory", { continue: true, }); return; } } var contents; if (file === '-') { contents = pipe; } else if (options.numLines < 0) { contents = fs.readFileSync(file, 'utf8'); } else { contents = readSomeLines(file, options.numLines); } var lines = contents.split('\n'); var hasTrailingNewline = (lines[lines.length - 1] === ''); if (hasTrailingNewline) { lines.pop(); } shouldAppendNewline = (hasTrailingNewline || options.numLines < lines.length); head = head.concat(lines.slice(0, options.numLines)); }); if (shouldAppendNewline) { head.push(''); // to add a trailing newline once we join } return head.join('\n'); } module.exports = _head; /***/ }), /***/ 15787: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { var fs = __webpack_require__(35747); var path = __webpack_require__(85622); var common = __webpack_require__(53687); common.register('ln', _ln, { cmdOptions: { 's': 'symlink', 'f': 'force', }, }); //@ //@ ### ln([options,] source, dest) //@ //@ Available options: //@ //@ + `-s`: symlink //@ + `-f`: force //@ //@ Examples: //@ //@ ```javascript //@ ln('file', 'newlink'); //@ ln('-sf', 'file', 'existing'); //@ ``` //@ //@ Links `source` to `dest`. Use `-f` to force the link, should `dest` already exist. function _ln(options, source, dest) { if (!source || !dest) { common.error('Missing and/or '); } source = String(source); var sourcePath = path.normalize(source).replace(RegExp(path.sep + '$'), ''); var isAbsolute = (path.resolve(source) === sourcePath); dest = path.resolve(process.cwd(), String(dest)); if (fs.existsSync(dest)) { if (!options.force) { common.error('Destination file exists', { continue: true }); } fs.unlinkSync(dest); } if (options.symlink) { var isWindows = process.platform === 'win32'; var linkType = isWindows ? 'file' : null; var resolvedSourcePath = isAbsolute ? sourcePath : path.resolve(process.cwd(), path.dirname(dest), source); if (!fs.existsSync(resolvedSourcePath)) { common.error('Source file does not exist', { continue: true }); } else if (isWindows && common.statFollowLinks(resolvedSourcePath).isDirectory()) { linkType = 'junction'; } try { fs.symlinkSync(linkType === 'junction' ? resolvedSourcePath : source, dest, linkType); } catch (err) { common.error(err.message); } } else { if (!fs.existsSync(source)) { common.error('Source file does not exist', { continue: true }); } try { fs.linkSync(source, dest); } catch (err) { common.error(err.message); } } return ''; } module.exports = _ln; /***/ }), /***/ 35561: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { var path = __webpack_require__(85622); var fs = __webpack_require__(35747); var common = __webpack_require__(53687); var glob = __webpack_require__(91957); var globPatternRecursive = path.sep + '**'; common.register('ls', _ls, { cmdOptions: { 'R': 'recursive', 'A': 'all', 'L': 'link', 'a': 'all_deprecated', 'd': 'directory', 'l': 'long', }, }); //@ //@ ### ls([options,] [path, ...]) //@ ### ls([options,] path_array) //@ //@ Available options: //@ //@ + `-R`: recursive //@ + `-A`: all files (include files beginning with `.`, except for `.` and `..`) //@ + `-L`: follow symlinks //@ + `-d`: list directories themselves, not their contents //@ + `-l`: list objects representing each file, each with fields containing `ls //@ -l` output fields. See //@ [`fs.Stats`](https://nodejs.org/api/fs.html#fs_class_fs_stats) //@ for more info //@ //@ Examples: //@ //@ ```javascript //@ ls('projs/*.js'); //@ ls('-R', '/users/me', '/tmp'); //@ ls('-R', ['/users/me', '/tmp']); // same as above //@ ls('-l', 'file.txt'); // { name: 'file.txt', mode: 33188, nlink: 1, ...} //@ ``` //@ //@ Returns array of files in the given `path`, or files in //@ the current directory if no `path` is provided. function _ls(options, paths) { if (options.all_deprecated) { // We won't support the -a option as it's hard to image why it's useful // (it includes '.' and '..' in addition to '.*' files) // For backwards compatibility we'll dump a deprecated message and proceed as before common.log('ls: Option -a is deprecated. Use -A instead'); options.all = true; } if (!paths) { paths = ['.']; } else { paths = [].slice.call(arguments, 1); } var list = []; function pushFile(abs, relName, stat) { if (process.platform === 'win32') { relName = relName.replace(/\\/g, '/'); } if (options.long) { stat = stat || (options.link ? common.statFollowLinks(abs) : common.statNoFollowLinks(abs)); list.push(addLsAttributes(relName, stat)); } else { // list.push(path.relative(rel || '.', file)); list.push(relName); } } paths.forEach(function (p) { var stat; try { stat = options.link ? common.statFollowLinks(p) : common.statNoFollowLinks(p); // follow links to directories by default if (stat.isSymbolicLink()) { /* istanbul ignore next */ // workaround for https://github.com/shelljs/shelljs/issues/795 // codecov seems to have a bug that miscalculate this block as uncovered. // but according to nyc report this block does get covered. try { var _stat = common.statFollowLinks(p); if (_stat.isDirectory()) { stat = _stat; } } catch (_) {} // bad symlink, treat it like a file } } catch (e) { common.error('no such file or directory: ' + p, 2, { continue: true }); return; } // If the stat succeeded if (stat.isDirectory() && !options.directory) { if (options.recursive) { // use glob, because it's simple glob.sync(p + globPatternRecursive, { dot: options.all, follow: options.link }) .forEach(function (item) { // Glob pattern returns the directory itself and needs to be filtered out. if (path.relative(p, item)) { pushFile(item, path.relative(p, item)); } }); } else if (options.all) { // use fs.readdirSync, because it's fast fs.readdirSync(p).forEach(function (item) { pushFile(path.join(p, item), item); }); } else { // use fs.readdirSync and then filter out secret files fs.readdirSync(p).forEach(function (item) { if (item[0] !== '.') { pushFile(path.join(p, item), item); } }); } } else { pushFile(p, p, stat); } }); // Add methods, to make this more compatible with ShellStrings return list; } function addLsAttributes(pathName, stats) { // Note: this object will contain more information than .toString() returns stats.name = pathName; stats.toString = function () { // Return a string resembling unix's `ls -l` format return [this.mode, this.nlink, this.uid, this.gid, this.size, this.mtime, this.name].join(' '); }; return stats; } module.exports = _ls; /***/ }), /***/ 72695: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { var common = __webpack_require__(53687); var fs = __webpack_require__(35747); var path = __webpack_require__(85622); common.register('mkdir', _mkdir, { cmdOptions: { 'p': 'fullpath', }, }); // Recursively creates `dir` function mkdirSyncRecursive(dir) { var baseDir = path.dirname(dir); // Prevents some potential problems arising from malformed UNCs or // insufficient permissions. /* istanbul ignore next */ if (baseDir === dir) { common.error('dirname() failed: [' + dir + ']'); } // Base dir exists, no recursion necessary if (fs.existsSync(baseDir)) { fs.mkdirSync(dir, parseInt('0777', 8)); return; } // Base dir does not exist, go recursive mkdirSyncRecursive(baseDir); // Base dir created, can create dir fs.mkdirSync(dir, parseInt('0777', 8)); } //@ //@ ### mkdir([options,] dir [, dir ...]) //@ ### mkdir([options,] dir_array) //@ //@ Available options: //@ //@ + `-p`: full path (and create intermediate directories, if necessary) //@ //@ Examples: //@ //@ ```javascript //@ mkdir('-p', '/tmp/a/b/c/d', '/tmp/e/f/g'); //@ mkdir('-p', ['/tmp/a/b/c/d', '/tmp/e/f/g']); // same as above //@ ``` //@ //@ Creates directories. function _mkdir(options, dirs) { if (!dirs) common.error('no paths given'); if (typeof dirs === 'string') { dirs = [].slice.call(arguments, 1); } // if it's array leave it as it is dirs.forEach(function (dir) { try { var stat = common.statNoFollowLinks(dir); if (!options.fullpath) { common.error('path already exists: ' + dir, { continue: true }); } else if (stat.isFile()) { common.error('cannot create directory ' + dir + ': File exists', { continue: true }); } return; // skip dir } catch (e) { // do nothing } // Base dir does not exist, and no -p option given var baseDir = path.dirname(dir); if (!fs.existsSync(baseDir) && !options.fullpath) { common.error('no such file or directory: ' + baseDir, { continue: true }); return; // skip dir } try { if (options.fullpath) { mkdirSyncRecursive(path.resolve(dir)); } else { fs.mkdirSync(dir, parseInt('0777', 8)); } } catch (e) { var reason; if (e.code === 'EACCES') { reason = 'Permission denied'; } else if (e.code === 'ENOTDIR' || e.code === 'ENOENT') { reason = 'Not a directory'; } else { /* istanbul ignore next */ throw e; } common.error('cannot create directory ' + dir + ': ' + reason, { continue: true }); } }); return ''; } // mkdir module.exports = _mkdir; /***/ }), /***/ 39849: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { var fs = __webpack_require__(35747); var path = __webpack_require__(85622); var common = __webpack_require__(53687); var cp = __webpack_require__(34932); var rm = __webpack_require__(22830); common.register('mv', _mv, { cmdOptions: { 'f': '!no_force', 'n': 'no_force', }, }); // Checks if cureent file was created recently function checkRecentCreated(sources, index) { var lookedSource = sources[index]; return sources.slice(0, index).some(function (src) { return path.basename(src) === path.basename(lookedSource); }); } //@ //@ ### mv([options ,] source [, source ...], dest') //@ ### mv([options ,] source_array, dest') //@ //@ Available options: //@ //@ + `-f`: force (default behavior) //@ + `-n`: no-clobber //@ //@ Examples: //@ //@ ```javascript //@ mv('-n', 'file', 'dir/'); //@ mv('file1', 'file2', 'dir/'); //@ mv(['file1', 'file2'], 'dir/'); // same as above //@ ``` //@ //@ Moves `source` file(s) to `dest`. function _mv(options, sources, dest) { // Get sources, dest if (arguments.length < 3) { common.error('missing and/or '); } else if (arguments.length > 3) { sources = [].slice.call(arguments, 1, arguments.length - 1); dest = arguments[arguments.length - 1]; } else if (typeof sources === 'string') { sources = [sources]; } else { // TODO(nate): figure out if we actually need this line common.error('invalid arguments'); } var exists = fs.existsSync(dest); var stats = exists && common.statFollowLinks(dest); // Dest is not existing dir, but multiple sources given if ((!exists || !stats.isDirectory()) && sources.length > 1) { common.error('dest is not a directory (too many sources)'); } // Dest is an existing file, but no -f given if (exists && stats.isFile() && options.no_force) { common.error('dest file already exists: ' + dest); } sources.forEach(function (src, srcIndex) { if (!fs.existsSync(src)) { common.error('no such file or directory: ' + src, { continue: true }); return; // skip file } // If here, src exists // When copying to '/path/dir': // thisDest = '/path/dir/file1' var thisDest = dest; if (fs.existsSync(dest) && common.statFollowLinks(dest).isDirectory()) { thisDest = path.normalize(dest + '/' + path.basename(src)); } var thisDestExists = fs.existsSync(thisDest); if (thisDestExists && checkRecentCreated(sources, srcIndex)) { // cannot overwrite file created recently in current execution, but we want to continue copying other files if (!options.no_force) { common.error("will not overwrite just-created '" + thisDest + "' with '" + src + "'", { continue: true }); } return; } if (fs.existsSync(thisDest) && options.no_force) { common.error('dest file already exists: ' + thisDest, { continue: true }); return; // skip file } if (path.resolve(src) === path.dirname(path.resolve(thisDest))) { common.error('cannot move to self: ' + src, { continue: true }); return; // skip file } try { fs.renameSync(src, thisDest); } catch (e) { /* istanbul ignore next */ if (e.code === 'EXDEV') { // If we're trying to `mv` to an external partition, we'll actually need // to perform a copy and then clean up the original file. If either the // copy or the rm fails with an exception, we should allow this // exception to pass up to the top level. cp('-r', src, thisDest); rm('-rf', src); } } }); // forEach(src) return ''; } // mv module.exports = _mv; /***/ }), /***/ 50227: /***/ (() => { // see dirs.js /***/ }), /***/ 44177: /***/ (() => { // see dirs.js /***/ }), /***/ 58553: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { var path = __webpack_require__(85622); var common = __webpack_require__(53687); common.register('pwd', _pwd, { allowGlobbing: false, }); //@ //@ ### pwd() //@ //@ Returns the current directory. function _pwd() { var pwd = path.resolve(process.cwd()); return pwd; } module.exports = _pwd; /***/ }), /***/ 22830: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { var common = __webpack_require__(53687); var fs = __webpack_require__(35747); common.register('rm', _rm, { cmdOptions: { 'f': 'force', 'r': 'recursive', 'R': 'recursive', }, }); // Recursively removes 'dir' // Adapted from https://github.com/ryanmcgrath/wrench-js // // Copyright (c) 2010 Ryan McGrath // Copyright (c) 2012 Artur Adib // // Licensed under the MIT License // http://www.opensource.org/licenses/mit-license.php function rmdirSyncRecursive(dir, force, fromSymlink) { var files; files = fs.readdirSync(dir); // Loop through and delete everything in the sub-tree after checking it for (var i = 0; i < files.length; i++) { var file = dir + '/' + files[i]; var currFile = common.statNoFollowLinks(file); if (currFile.isDirectory()) { // Recursive function back to the beginning rmdirSyncRecursive(file, force); } else { // Assume it's a file - perhaps a try/catch belongs here? if (force || isWriteable(file)) { try { common.unlinkSync(file); } catch (e) { /* istanbul ignore next */ common.error('could not remove file (code ' + e.code + '): ' + file, { continue: true, }); } } } } // if was directory was referenced through a symbolic link, // the contents should be removed, but not the directory itself if (fromSymlink) return; // Now that we know everything in the sub-tree has been deleted, we can delete the main directory. // Huzzah for the shopkeep. var result; try { // Retry on windows, sometimes it takes a little time before all the files in the directory are gone var start = Date.now(); // TODO: replace this with a finite loop for (;;) { try { result = fs.rmdirSync(dir); if (fs.existsSync(dir)) throw { code: 'EAGAIN' }; break; } catch (er) { /* istanbul ignore next */ // In addition to error codes, also check if the directory still exists and loop again if true if (process.platform === 'win32' && (er.code === 'ENOTEMPTY' || er.code === 'EBUSY' || er.code === 'EPERM' || er.code === 'EAGAIN')) { if (Date.now() - start > 1000) throw er; } else if (er.code === 'ENOENT') { // Directory did not exist, deletion was successful break; } else { throw er; } } } } catch (e) { common.error('could not remove directory (code ' + e.code + '): ' + dir, { continue: true }); } return result; } // rmdirSyncRecursive // Hack to determine if file has write permissions for current user // Avoids having to check user, group, etc, but it's probably slow function isWriteable(file) { var writePermission = true; try { var __fd = fs.openSync(file, 'a'); fs.closeSync(__fd); } catch (e) { writePermission = false; } return writePermission; } function handleFile(file, options) { if (options.force || isWriteable(file)) { // -f was passed, or file is writable, so it can be removed common.unlinkSync(file); } else { common.error('permission denied: ' + file, { continue: true }); } } function handleDirectory(file, options) { if (options.recursive) { // -r was passed, so directory can be removed rmdirSyncRecursive(file, options.force); } else { common.error('path is a directory', { continue: true }); } } function handleSymbolicLink(file, options) { var stats; try { stats = common.statFollowLinks(file); } catch (e) { // symlink is broken, so remove the symlink itself common.unlinkSync(file); return; } if (stats.isFile()) { common.unlinkSync(file); } else if (stats.isDirectory()) { if (file[file.length - 1] === '/') { // trailing separator, so remove the contents, not the link if (options.recursive) { // -r was passed, so directory can be removed var fromSymlink = true; rmdirSyncRecursive(file, options.force, fromSymlink); } else { common.error('path is a directory', { continue: true }); } } else { // no trailing separator, so remove the link common.unlinkSync(file); } } } function handleFIFO(file) { common.unlinkSync(file); } //@ //@ ### rm([options,] file [, file ...]) //@ ### rm([options,] file_array) //@ //@ Available options: //@ //@ + `-f`: force //@ + `-r, -R`: recursive //@ //@ Examples: //@ //@ ```javascript //@ rm('-rf', '/tmp/*'); //@ rm('some_file.txt', 'another_file.txt'); //@ rm(['some_file.txt', 'another_file.txt']); // same as above //@ ``` //@ //@ Removes files. function _rm(options, files) { if (!files) common.error('no paths given'); // Convert to array files = [].slice.call(arguments, 1); files.forEach(function (file) { var lstats; try { var filepath = (file[file.length - 1] === '/') ? file.slice(0, -1) // remove the '/' so lstatSync can detect symlinks : file; lstats = common.statNoFollowLinks(filepath); // test for existence } catch (e) { // Path does not exist, no force flag given if (!options.force) { common.error('no such file or directory: ' + file, { continue: true }); } return; // skip file } // If here, path exists if (lstats.isFile()) { handleFile(file, options); } else if (lstats.isDirectory()) { handleDirectory(file, options); } else if (lstats.isSymbolicLink()) { handleSymbolicLink(file, options); } else if (lstats.isFIFO()) { handleFIFO(file); } }); // forEach(file) return ''; } // rm module.exports = _rm; /***/ }), /***/ 25899: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { var common = __webpack_require__(53687); var fs = __webpack_require__(35747); common.register('sed', _sed, { globStart: 3, // don't glob-expand regexes canReceivePipe: true, cmdOptions: { 'i': 'inplace', }, }); //@ //@ ### sed([options,] search_regex, replacement, file [, file ...]) //@ ### sed([options,] search_regex, replacement, file_array) //@ //@ Available options: //@ //@ + `-i`: Replace contents of `file` in-place. _Note that no backups will be created!_ //@ //@ Examples: //@ //@ ```javascript //@ sed('-i', 'PROGRAM_VERSION', 'v0.1.3', 'source.js'); //@ sed(/.*DELETE_THIS_LINE.*\n/, '', 'source.js'); //@ ``` //@ //@ Reads an input string from `file`s, and performs a JavaScript `replace()` on the input //@ using the given `search_regex` and `replacement` string or function. Returns the new string after replacement. //@ //@ Note: //@ //@ Like unix `sed`, ShellJS `sed` supports capture groups. Capture groups are specified //@ using the `$n` syntax: //@ //@ ```javascript //@ sed(/(\w+)\s(\w+)/, '$2, $1', 'file.txt'); //@ ``` function _sed(options, regex, replacement, files) { // Check if this is coming from a pipe var pipe = common.readFromPipe(); if (typeof replacement !== 'string' && typeof replacement !== 'function') { if (typeof replacement === 'number') { replacement = replacement.toString(); // fallback } else { common.error('invalid replacement string'); } } // Convert all search strings to RegExp if (typeof regex === 'string') { regex = RegExp(regex); } if (!files && !pipe) { common.error('no files given'); } files = [].slice.call(arguments, 3); if (pipe) { files.unshift('-'); } var sed = []; files.forEach(function (file) { if (!fs.existsSync(file) && file !== '-') { common.error('no such file or directory: ' + file, 2, { continue: true }); return; } var contents = file === '-' ? pipe : fs.readFileSync(file, 'utf8'); var lines = contents.split('\n'); var result = lines.map(function (line) { return line.replace(regex, replacement); }).join('\n'); sed.push(result); if (options.inplace) { fs.writeFileSync(file, result, 'utf8'); } }); return sed.join('\n'); } module.exports = _sed; /***/ }), /***/ 11411: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { var common = __webpack_require__(53687); common.register('set', _set, { allowGlobbing: false, wrapOutput: false, }); //@ //@ ### set(options) //@ //@ Available options: //@ //@ + `+/-e`: exit upon error (`config.fatal`) //@ + `+/-v`: verbose: show all commands (`config.verbose`) //@ + `+/-f`: disable filename expansion (globbing) //@ //@ Examples: //@ //@ ```javascript //@ set('-e'); // exit upon first error //@ set('+e'); // this undoes a "set('-e')" //@ ``` //@ //@ Sets global configuration variables. function _set(options) { if (!options) { var args = [].slice.call(arguments, 0); if (args.length < 2) common.error('must provide an argument'); options = args[1]; } var negate = (options[0] === '+'); if (negate) { options = '-' + options.slice(1); // parseOptions needs a '-' prefix } options = common.parseOptions(options, { 'e': 'fatal', 'v': 'verbose', 'f': 'noglob', }); if (negate) { Object.keys(options).forEach(function (key) { options[key] = !options[key]; }); } Object.keys(options).forEach(function (key) { // Only change the global config if `negate` is false and the option is true // or if `negate` is true and the option is false (aka negate !== option) if (negate !== options[key]) { common.config[key] = options[key]; } }); return; } module.exports = _set; /***/ }), /***/ 72116: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { var common = __webpack_require__(53687); var fs = __webpack_require__(35747); common.register('sort', _sort, { canReceivePipe: true, cmdOptions: { 'r': 'reverse', 'n': 'numerical', }, }); // parse out the number prefix of a line function parseNumber(str) { var match = str.match(/^\s*(\d*)\s*(.*)$/); return { num: Number(match[1]), value: match[2] }; } // compare two strings case-insensitively, but examine case for strings that are // case-insensitive equivalent function unixCmp(a, b) { var aLower = a.toLowerCase(); var bLower = b.toLowerCase(); return (aLower === bLower ? -1 * a.localeCompare(b) : // unix sort treats case opposite how javascript does aLower.localeCompare(bLower)); } // compare two strings in the fashion that unix sort's -n option works function numericalCmp(a, b) { var objA = parseNumber(a); var objB = parseNumber(b); if (objA.hasOwnProperty('num') && objB.hasOwnProperty('num')) { return ((objA.num !== objB.num) ? (objA.num - objB.num) : unixCmp(objA.value, objB.value)); } else { return unixCmp(objA.value, objB.value); } } //@ //@ ### sort([options,] file [, file ...]) //@ ### sort([options,] file_array) //@ //@ Available options: //@ //@ + `-r`: Reverse the results //@ + `-n`: Compare according to numerical value //@ //@ Examples: //@ //@ ```javascript //@ sort('foo.txt', 'bar.txt'); //@ sort('-r', 'foo.txt'); //@ ``` //@ //@ Return the contents of the `file`s, sorted line-by-line. Sorting multiple //@ files mixes their content (just as unix `sort` does). function _sort(options, files) { // Check if this is coming from a pipe var pipe = common.readFromPipe(); if (!files && !pipe) common.error('no files given'); files = [].slice.call(arguments, 1); if (pipe) { files.unshift('-'); } var lines = files.reduce(function (accum, file) { if (file !== '-') { if (!fs.existsSync(file)) { common.error('no such file or directory: ' + file, { continue: true }); return accum; } else if (common.statFollowLinks(file).isDirectory()) { common.error('read failed: ' + file + ': Is a directory', { continue: true, }); return accum; } } var contents = file === '-' ? pipe : fs.readFileSync(file, 'utf8'); return accum.concat(contents.trimRight().split('\n')); }, []); var sorted = lines.sort(options.numerical ? numericalCmp : unixCmp); if (options.reverse) { sorted = sorted.reverse(); } return sorted.join('\n') + '\n'; } module.exports = _sort; /***/ }), /***/ 42284: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { var common = __webpack_require__(53687); var fs = __webpack_require__(35747); common.register('tail', _tail, { canReceivePipe: true, cmdOptions: { 'n': 'numLines', }, }); //@ //@ ### tail([{'-n': \},] file [, file ...]) //@ ### tail([{'-n': \},] file_array) //@ //@ Available options: //@ //@ + `-n `: Show the last `` lines of `file`s //@ //@ Examples: //@ //@ ```javascript //@ var str = tail({'-n': 1}, 'file*.txt'); //@ var str = tail('file1', 'file2'); //@ var str = tail(['file1', 'file2']); // same as above //@ ``` //@ //@ Read the end of a `file`. function _tail(options, files) { var tail = []; var pipe = common.readFromPipe(); if (!files && !pipe) common.error('no paths given'); var idx = 1; if (options.numLines === true) { idx = 2; options.numLines = Number(arguments[1]); } else if (options.numLines === false) { options.numLines = 10; } options.numLines = -1 * Math.abs(options.numLines); files = [].slice.call(arguments, idx); if (pipe) { files.unshift('-'); } var shouldAppendNewline = false; files.forEach(function (file) { if (file !== '-') { if (!fs.existsSync(file)) { common.error('no such file or directory: ' + file, { continue: true }); return; } else if (common.statFollowLinks(file).isDirectory()) { common.error("error reading '" + file + "': Is a directory", { continue: true, }); return; } } var contents = file === '-' ? pipe : fs.readFileSync(file, 'utf8'); var lines = contents.split('\n'); if (lines[lines.length - 1] === '') { lines.pop(); shouldAppendNewline = true; } else { shouldAppendNewline = false; } tail = tail.concat(lines.slice(options.numLines)); }); if (shouldAppendNewline) { tail.push(''); // to add a trailing newline once we join } return tail.join('\n'); } module.exports = _tail; /***/ }), /***/ 76150: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { var common = __webpack_require__(53687); var os = __webpack_require__(12087); var fs = __webpack_require__(35747); common.register('tempdir', _tempDir, { allowGlobbing: false, wrapOutput: false, }); // Returns false if 'dir' is not a writeable directory, 'dir' otherwise function writeableDir(dir) { if (!dir || !fs.existsSync(dir)) return false; if (!common.statFollowLinks(dir).isDirectory()) return false; var testFile = dir + '/' + common.randomFileName(); try { fs.writeFileSync(testFile, ' '); common.unlinkSync(testFile); return dir; } catch (e) { /* istanbul ignore next */ return false; } } // Variable to cache the tempdir value for successive lookups. var cachedTempDir; //@ //@ ### tempdir() //@ //@ Examples: //@ //@ ```javascript //@ var tmp = tempdir(); // "/tmp" for most *nix platforms //@ ``` //@ //@ Searches and returns string containing a writeable, platform-dependent temporary directory. //@ Follows Python's [tempfile algorithm](http://docs.python.org/library/tempfile.html#tempfile.tempdir). function _tempDir() { if (cachedTempDir) return cachedTempDir; cachedTempDir = writeableDir(os.tmpdir()) || writeableDir(process.env.TMPDIR) || writeableDir(process.env.TEMP) || writeableDir(process.env.TMP) || writeableDir(process.env.Wimp$ScrapDir) || // RiscOS writeableDir('C:\\TEMP') || // Windows writeableDir('C:\\TMP') || // Windows writeableDir('\\TEMP') || // Windows writeableDir('\\TMP') || // Windows writeableDir('/tmp') || writeableDir('/var/tmp') || writeableDir('/usr/tmp') || writeableDir('.'); // last resort return cachedTempDir; } // Indicates if the tempdir value is currently cached. This is exposed for tests // only. The return value should only be tested for truthiness. function isCached() { return cachedTempDir; } // Clears the cached tempDir value, if one is cached. This is exposed for tests // only. function clearCache() { cachedTempDir = undefined; } module.exports.tempDir = _tempDir; module.exports.isCached = isCached; module.exports.clearCache = clearCache; /***/ }), /***/ 79723: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { var common = __webpack_require__(53687); var fs = __webpack_require__(35747); common.register('test', _test, { cmdOptions: { 'b': 'block', 'c': 'character', 'd': 'directory', 'e': 'exists', 'f': 'file', 'L': 'link', 'p': 'pipe', 'S': 'socket', }, wrapOutput: false, allowGlobbing: false, }); //@ //@ ### test(expression) //@ //@ Available expression primaries: //@ //@ + `'-b', 'path'`: true if path is a block device //@ + `'-c', 'path'`: true if path is a character device //@ + `'-d', 'path'`: true if path is a directory //@ + `'-e', 'path'`: true if path exists //@ + `'-f', 'path'`: true if path is a regular file //@ + `'-L', 'path'`: true if path is a symbolic link //@ + `'-p', 'path'`: true if path is a pipe (FIFO) //@ + `'-S', 'path'`: true if path is a socket //@ //@ Examples: //@ //@ ```javascript //@ if (test('-d', path)) { /* do something with dir */ }; //@ if (!test('-f', path)) continue; // skip if it's a regular file //@ ``` //@ //@ Evaluates `expression` using the available primaries and returns corresponding value. function _test(options, path) { if (!path) common.error('no path given'); var canInterpret = false; Object.keys(options).forEach(function (key) { if (options[key] === true) { canInterpret = true; } }); if (!canInterpret) common.error('could not interpret expression'); if (options.link) { try { return common.statNoFollowLinks(path).isSymbolicLink(); } catch (e) { return false; } } if (!fs.existsSync(path)) return false; if (options.exists) return true; var stats = common.statFollowLinks(path); if (options.block) return stats.isBlockDevice(); if (options.character) return stats.isCharacterDevice(); if (options.directory) return stats.isDirectory(); if (options.file) return stats.isFile(); /* istanbul ignore next */ if (options.pipe) return stats.isFIFO(); /* istanbul ignore next */ if (options.socket) return stats.isSocket(); /* istanbul ignore next */ return false; // fallback } // test module.exports = _test; /***/ }), /***/ 71961: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { var common = __webpack_require__(53687); var fs = __webpack_require__(35747); var path = __webpack_require__(85622); common.register('to', _to, { pipeOnly: true, wrapOutput: false, }); //@ //@ ### ShellString.prototype.to(file) //@ //@ Examples: //@ //@ ```javascript //@ cat('input.txt').to('output.txt'); //@ ``` //@ //@ Analogous to the redirection operator `>` in Unix, but works with //@ `ShellStrings` (such as those returned by `cat`, `grep`, etc.). _Like Unix //@ redirections, `to()` will overwrite any existing file!_ function _to(options, file) { if (!file) common.error('wrong arguments'); if (!fs.existsSync(path.dirname(file))) { common.error('no such file or directory: ' + path.dirname(file)); } try { fs.writeFileSync(file, this.stdout || this.toString(), 'utf8'); return this; } catch (e) { /* istanbul ignore next */ common.error('could not write to file (code ' + e.code + '): ' + file, { continue: true }); } } module.exports = _to; /***/ }), /***/ 33736: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { var common = __webpack_require__(53687); var fs = __webpack_require__(35747); var path = __webpack_require__(85622); common.register('toEnd', _toEnd, { pipeOnly: true, wrapOutput: false, }); //@ //@ ### ShellString.prototype.toEnd(file) //@ //@ Examples: //@ //@ ```javascript //@ cat('input.txt').toEnd('output.txt'); //@ ``` //@ //@ Analogous to the redirect-and-append operator `>>` in Unix, but works with //@ `ShellStrings` (such as those returned by `cat`, `grep`, etc.). function _toEnd(options, file) { if (!file) common.error('wrong arguments'); if (!fs.existsSync(path.dirname(file))) { common.error('no such file or directory: ' + path.dirname(file)); } try { fs.appendFileSync(file, this.stdout || this.toString(), 'utf8'); return this; } catch (e) { /* istanbul ignore next */ common.error('could not append to file (code ' + e.code + '): ' + file, { continue: true }); } } module.exports = _toEnd; /***/ }), /***/ 28358: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { var common = __webpack_require__(53687); var fs = __webpack_require__(35747); common.register('touch', _touch, { cmdOptions: { 'a': 'atime_only', 'c': 'no_create', 'd': 'date', 'm': 'mtime_only', 'r': 'reference', }, }); //@ //@ ### touch([options,] file [, file ...]) //@ ### touch([options,] file_array) //@ //@ Available options: //@ //@ + `-a`: Change only the access time //@ + `-c`: Do not create any files //@ + `-m`: Change only the modification time //@ + `-d DATE`: Parse `DATE` and use it instead of current time //@ + `-r FILE`: Use `FILE`'s times instead of current time //@ //@ Examples: //@ //@ ```javascript //@ touch('source.js'); //@ touch('-c', '/path/to/some/dir/source.js'); //@ touch({ '-r': FILE }, '/path/to/some/dir/source.js'); //@ ``` //@ //@ Update the access and modification times of each `FILE` to the current time. //@ A `FILE` argument that does not exist is created empty, unless `-c` is supplied. //@ This is a partial implementation of [`touch(1)`](http://linux.die.net/man/1/touch). function _touch(opts, files) { if (!files) { common.error('no files given'); } else if (typeof files === 'string') { files = [].slice.call(arguments, 1); } else { common.error('file arg should be a string file path or an Array of string file paths'); } files.forEach(function (f) { touchFile(opts, f); }); return ''; } function touchFile(opts, file) { var stat = tryStatFile(file); if (stat && stat.isDirectory()) { // don't error just exit return; } // if the file doesn't already exist and the user has specified --no-create then // this script is finished if (!stat && opts.no_create) { return; } // open the file and then close it. this will create it if it doesn't exist but will // not truncate the file fs.closeSync(fs.openSync(file, 'a')); // // Set timestamps // // setup some defaults var now = new Date(); var mtime = opts.date || now; var atime = opts.date || now; // use reference file if (opts.reference) { var refStat = tryStatFile(opts.reference); if (!refStat) { common.error('failed to get attributess of ' + opts.reference); } mtime = refStat.mtime; atime = refStat.atime; } else if (opts.date) { mtime = opts.date; atime = opts.date; } if (opts.atime_only && opts.mtime_only) { // keep the new values of mtime and atime like GNU } else if (opts.atime_only) { mtime = stat.mtime; } else if (opts.mtime_only) { atime = stat.atime; } fs.utimesSync(file, atime, mtime); } module.exports = _touch; function tryStatFile(filePath) { try { return common.statFollowLinks(filePath); } catch (e) { return null; } } /***/ }), /***/ 77286: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { var common = __webpack_require__(53687); var fs = __webpack_require__(35747); // add c spaces to the left of str function lpad(c, str) { var res = '' + str; if (res.length < c) { res = Array((c - res.length) + 1).join(' ') + res; } return res; } common.register('uniq', _uniq, { canReceivePipe: true, cmdOptions: { 'i': 'ignoreCase', 'c': 'count', 'd': 'duplicates', }, }); //@ //@ ### uniq([options,] [input, [output]]) //@ //@ Available options: //@ //@ + `-i`: Ignore case while comparing //@ + `-c`: Prefix lines by the number of occurrences //@ + `-d`: Only print duplicate lines, one for each group of identical lines //@ //@ Examples: //@ //@ ```javascript //@ uniq('foo.txt'); //@ uniq('-i', 'foo.txt'); //@ uniq('-cd', 'foo.txt', 'bar.txt'); //@ ``` //@ //@ Filter adjacent matching lines from `input`. function _uniq(options, input, output) { // Check if this is coming from a pipe var pipe = common.readFromPipe(); if (!pipe) { if (!input) common.error('no input given'); if (!fs.existsSync(input)) { common.error(input + ': No such file or directory'); } else if (common.statFollowLinks(input).isDirectory()) { common.error("error reading '" + input + "'"); } } if (output && fs.existsSync(output) && common.statFollowLinks(output).isDirectory()) { common.error(output + ': Is a directory'); } var lines = (input ? fs.readFileSync(input, 'utf8') : pipe). trimRight(). split('\n'); var compare = function (a, b) { return options.ignoreCase ? a.toLocaleLowerCase().localeCompare(b.toLocaleLowerCase()) : a.localeCompare(b); }; var uniqed = lines.reduceRight(function (res, e) { // Perform uniq -c on the input if (res.length === 0) { return [{ count: 1, ln: e }]; } else if (compare(res[0].ln, e) === 0) { return [{ count: res[0].count + 1, ln: e }].concat(res.slice(1)); } else { return [{ count: 1, ln: e }].concat(res); } }, []).filter(function (obj) { // Do we want only duplicated objects? return options.duplicates ? obj.count > 1 : true; }).map(function (obj) { // Are we tracking the counts of each line? return (options.count ? (lpad(7, obj.count) + ' ') : '') + obj.ln; }).join('\n') + '\n'; if (output) { (new common.ShellString(uniqed)).to(output); // if uniq writes to output, nothing is passed to the next command in the pipeline (if any) return ''; } else { return uniqed; } } module.exports = _uniq; /***/ }), /***/ 64766: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { var common = __webpack_require__(53687); var fs = __webpack_require__(35747); var path = __webpack_require__(85622); common.register('which', _which, { allowGlobbing: false, cmdOptions: { 'a': 'all', }, }); // XP's system default value for `PATHEXT` system variable, just in case it's not // set on Windows. var XP_DEFAULT_PATHEXT = '.com;.exe;.bat;.cmd;.vbs;.vbe;.js;.jse;.wsf;.wsh'; // For earlier versions of NodeJS that doesn't have a list of constants (< v6) var FILE_EXECUTABLE_MODE = 1; function isWindowsPlatform() { return process.platform === 'win32'; } // Cross-platform method for splitting environment `PATH` variables function splitPath(p) { return p ? p.split(path.delimiter) : []; } // Tests are running all cases for this func but it stays uncovered by codecov due to unknown reason /* istanbul ignore next */ function isExecutable(pathName) { try { // TODO(node-support): replace with fs.constants.X_OK once remove support for node < v6 fs.accessSync(pathName, FILE_EXECUTABLE_MODE); } catch (err) { return false; } return true; } function checkPath(pathName) { return fs.existsSync(pathName) && !common.statFollowLinks(pathName).isDirectory() && (isWindowsPlatform() || isExecutable(pathName)); } //@ //@ ### which(command) //@ //@ Examples: //@ //@ ```javascript //@ var nodeExec = which('node'); //@ ``` //@ //@ Searches for `command` in the system's `PATH`. On Windows, this uses the //@ `PATHEXT` variable to append the extension if it's not already executable. //@ Returns string containing the absolute path to `command`. function _which(options, cmd) { if (!cmd) common.error('must specify command'); var isWindows = isWindowsPlatform(); var pathArray = splitPath(process.env.PATH); var queryMatches = []; // No relative/absolute paths provided? if (cmd.indexOf('/') === -1) { // Assume that there are no extensions to append to queries (this is the // case for unix) var pathExtArray = ['']; if (isWindows) { // In case the PATHEXT variable is somehow not set (e.g. // child_process.spawn with an empty environment), use the XP default. var pathExtEnv = process.env.PATHEXT || XP_DEFAULT_PATHEXT; pathExtArray = splitPath(pathExtEnv.toUpperCase()); } // Search for command in PATH for (var k = 0; k < pathArray.length; k++) { // already found it if (queryMatches.length > 0 && !options.all) break; var attempt = path.resolve(pathArray[k], cmd); if (isWindows) { attempt = attempt.toUpperCase(); } var match = attempt.match(/\.[^<>:"/\|?*.]+$/); if (match && pathExtArray.indexOf(match[0]) >= 0) { // this is Windows-only // The user typed a query with the file extension, like // `which('node.exe')` if (checkPath(attempt)) { queryMatches.push(attempt); break; } } else { // All-platforms // Cycle through the PATHEXT array, and check each extension // Note: the array is always [''] on Unix for (var i = 0; i < pathExtArray.length; i++) { var ext = pathExtArray[i]; var newAttempt = attempt + ext; if (checkPath(newAttempt)) { queryMatches.push(newAttempt); break; } } } } } else if (checkPath(cmd)) { // a valid absolute or relative path queryMatches.push(path.resolve(cmd)); } if (queryMatches.length > 0) { return options.all ? queryMatches : queryMatches[0]; } return options.all ? [] : null; } module.exports = _which; /***/ }), /***/ 14334: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; var GetIntrinsic = __webpack_require__(74538); var callBound = __webpack_require__(28803); var inspect = __webpack_require__(20504); var $TypeError = GetIntrinsic('%TypeError%'); var $WeakMap = GetIntrinsic('%WeakMap%', true); var $Map = GetIntrinsic('%Map%', true); var $weakMapGet = callBound('WeakMap.prototype.get', true); var $weakMapSet = callBound('WeakMap.prototype.set', true); var $weakMapHas = callBound('WeakMap.prototype.has', true); var $mapGet = callBound('Map.prototype.get', true); var $mapSet = callBound('Map.prototype.set', true); var $mapHas = callBound('Map.prototype.has', true); /* * This function traverses the list returning the node corresponding to the * given key. * * That node is also moved to the head of the list, so that if it's accessed * again we don't need to traverse the whole list. By doing so, all the recently * used nodes can be accessed relatively quickly. */ var listGetNode = function (list, key) { // eslint-disable-line consistent-return for (var prev = list, curr; (curr = prev.next) !== null; prev = curr) { if (curr.key === key) { prev.next = curr.next; curr.next = list.next; list.next = curr; // eslint-disable-line no-param-reassign return curr; } } }; var listGet = function (objects, key) { var node = listGetNode(objects, key); return node && node.value; }; var listSet = function (objects, key, value) { var node = listGetNode(objects, key); if (node) { node.value = value; } else { // Prepend the new node to the beginning of the list objects.next = { // eslint-disable-line no-param-reassign key: key, next: objects.next, value: value }; } }; var listHas = function (objects, key) { return !!listGetNode(objects, key); }; module.exports = function getSideChannel() { var $wm; var $m; var $o; var channel = { assert: function (key) { if (!channel.has(key)) { throw new $TypeError('Side channel does not contain ' + inspect(key)); } }, get: function (key) { // eslint-disable-line consistent-return if ($WeakMap && key && (typeof key === 'object' || typeof key === 'function')) { if ($wm) { return $weakMapGet($wm, key); } } else if ($Map) { if ($m) { return $mapGet($m, key); } } else { if ($o) { // eslint-disable-line no-lonely-if return listGet($o, key); } } }, has: function (key) { if ($WeakMap && key && (typeof key === 'object' || typeof key === 'function')) { if ($wm) { return $weakMapHas($wm, key); } } else if ($Map) { if ($m) { return $mapHas($m, key); } } else { if ($o) { // eslint-disable-line no-lonely-if return listHas($o, key); } } return false; }, set: function (key, value) { if ($WeakMap && key && (typeof key === 'object' || typeof key === 'function')) { if (!$wm) { $wm = new $WeakMap(); } $weakMapSet($wm, key, value); } else if ($Map) { if (!$m) { $m = new $Map(); } $mapSet($m, key, value); } else { if (!$o) { /* * Initialize the linked list as an empty node, so that we don't have * to special-case handling of the first node: we can always refer to * it as (previous node).next, instead of something like (list).head */ $o = { key: {}, next: null }; } listSet($o, key, value); } } }; return channel; }; /***/ }), /***/ 66126: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { // Copyright 2015 Joyent, Inc. var Buffer = __webpack_require__(15118).Buffer; var algInfo = { 'dsa': { parts: ['p', 'q', 'g', 'y'], sizePart: 'p' }, 'rsa': { parts: ['e', 'n'], sizePart: 'n' }, 'ecdsa': { parts: ['curve', 'Q'], sizePart: 'Q' }, 'ed25519': { parts: ['A'], sizePart: 'A' } }; algInfo['curve25519'] = algInfo['ed25519']; var algPrivInfo = { 'dsa': { parts: ['p', 'q', 'g', 'y', 'x'] }, 'rsa': { parts: ['n', 'e', 'd', 'iqmp', 'p', 'q'] }, 'ecdsa': { parts: ['curve', 'Q', 'd'] }, 'ed25519': { parts: ['A', 'k'] } }; algPrivInfo['curve25519'] = algPrivInfo['ed25519']; var hashAlgs = { 'md5': true, 'sha1': true, 'sha256': true, 'sha384': true, 'sha512': true }; /* * Taken from * http://csrc.nist.gov/groups/ST/toolkit/documents/dss/NISTReCur.pdf */ var curves = { 'nistp256': { size: 256, pkcs8oid: '1.2.840.10045.3.1.7', p: Buffer.from(('00' + 'ffffffff 00000001 00000000 00000000' + '00000000 ffffffff ffffffff ffffffff'). replace(/ /g, ''), 'hex'), a: Buffer.from(('00' + 'FFFFFFFF 00000001 00000000 00000000' + '00000000 FFFFFFFF FFFFFFFF FFFFFFFC'). replace(/ /g, ''), 'hex'), b: Buffer.from(( '5ac635d8 aa3a93e7 b3ebbd55 769886bc' + '651d06b0 cc53b0f6 3bce3c3e 27d2604b'). replace(/ /g, ''), 'hex'), s: Buffer.from(('00' + 'c49d3608 86e70493 6a6678e1 139d26b7' + '819f7e90'). replace(/ /g, ''), 'hex'), n: Buffer.from(('00' + 'ffffffff 00000000 ffffffff ffffffff' + 'bce6faad a7179e84 f3b9cac2 fc632551'). replace(/ /g, ''), 'hex'), G: Buffer.from(('04' + '6b17d1f2 e12c4247 f8bce6e5 63a440f2' + '77037d81 2deb33a0 f4a13945 d898c296' + '4fe342e2 fe1a7f9b 8ee7eb4a 7c0f9e16' + '2bce3357 6b315ece cbb64068 37bf51f5'). replace(/ /g, ''), 'hex') }, 'nistp384': { size: 384, pkcs8oid: '1.3.132.0.34', p: Buffer.from(('00' + 'ffffffff ffffffff ffffffff ffffffff' + 'ffffffff ffffffff ffffffff fffffffe' + 'ffffffff 00000000 00000000 ffffffff'). replace(/ /g, ''), 'hex'), a: Buffer.from(('00' + 'FFFFFFFF FFFFFFFF FFFFFFFF FFFFFFFF' + 'FFFFFFFF FFFFFFFF FFFFFFFF FFFFFFFE' + 'FFFFFFFF 00000000 00000000 FFFFFFFC'). replace(/ /g, ''), 'hex'), b: Buffer.from(( 'b3312fa7 e23ee7e4 988e056b e3f82d19' + '181d9c6e fe814112 0314088f 5013875a' + 'c656398d 8a2ed19d 2a85c8ed d3ec2aef'). replace(/ /g, ''), 'hex'), s: Buffer.from(('00' + 'a335926a a319a27a 1d00896a 6773a482' + '7acdac73'). replace(/ /g, ''), 'hex'), n: Buffer.from(('00' + 'ffffffff ffffffff ffffffff ffffffff' + 'ffffffff ffffffff c7634d81 f4372ddf' + '581a0db2 48b0a77a ecec196a ccc52973'). replace(/ /g, ''), 'hex'), G: Buffer.from(('04' + 'aa87ca22 be8b0537 8eb1c71e f320ad74' + '6e1d3b62 8ba79b98 59f741e0 82542a38' + '5502f25d bf55296c 3a545e38 72760ab7' + '3617de4a 96262c6f 5d9e98bf 9292dc29' + 'f8f41dbd 289a147c e9da3113 b5f0b8c0' + '0a60b1ce 1d7e819d 7a431d7c 90ea0e5f'). replace(/ /g, ''), 'hex') }, 'nistp521': { size: 521, pkcs8oid: '1.3.132.0.35', p: Buffer.from(( '01ffffff ffffffff ffffffff ffffffff' + 'ffffffff ffffffff ffffffff ffffffff' + 'ffffffff ffffffff ffffffff ffffffff' + 'ffffffff ffffffff ffffffff ffffffff' + 'ffff').replace(/ /g, ''), 'hex'), a: Buffer.from(('01FF' + 'FFFFFFFF FFFFFFFF FFFFFFFF FFFFFFFF' + 'FFFFFFFF FFFFFFFF FFFFFFFF FFFFFFFF' + 'FFFFFFFF FFFFFFFF FFFFFFFF FFFFFFFF' + 'FFFFFFFF FFFFFFFF FFFFFFFF FFFFFFFC'). replace(/ /g, ''), 'hex'), b: Buffer.from(('51' + '953eb961 8e1c9a1f 929a21a0 b68540ee' + 'a2da725b 99b315f3 b8b48991 8ef109e1' + '56193951 ec7e937b 1652c0bd 3bb1bf07' + '3573df88 3d2c34f1 ef451fd4 6b503f00'). replace(/ /g, ''), 'hex'), s: Buffer.from(('00' + 'd09e8800 291cb853 96cc6717 393284aa' + 'a0da64ba').replace(/ /g, ''), 'hex'), n: Buffer.from(('01ff' + 'ffffffff ffffffff ffffffff ffffffff' + 'ffffffff ffffffff ffffffff fffffffa' + '51868783 bf2f966b 7fcc0148 f709a5d0' + '3bb5c9b8 899c47ae bb6fb71e 91386409'). replace(/ /g, ''), 'hex'), G: Buffer.from(('04' + '00c6 858e06b7 0404e9cd 9e3ecb66 2395b442' + '9c648139 053fb521 f828af60 6b4d3dba' + 'a14b5e77 efe75928 fe1dc127 a2ffa8de' + '3348b3c1 856a429b f97e7e31 c2e5bd66' + '0118 39296a78 9a3bc004 5c8a5fb4 2c7d1bd9' + '98f54449 579b4468 17afbd17 273e662c' + '97ee7299 5ef42640 c550b901 3fad0761' + '353c7086 a272c240 88be9476 9fd16650'). replace(/ /g, ''), 'hex') } }; module.exports = { info: algInfo, privInfo: algPrivInfo, hashAlgs: hashAlgs, curves: curves }; /***/ }), /***/ 7406: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { // Copyright 2016 Joyent, Inc. module.exports = Certificate; var assert = __webpack_require__(66631); var Buffer = __webpack_require__(15118).Buffer; var algs = __webpack_require__(66126); var crypto = __webpack_require__(33373); var Fingerprint = __webpack_require__(13079); var Signature = __webpack_require__(91394); var errs = __webpack_require__(27979); var util = __webpack_require__(31669); var utils = __webpack_require__(80575); var Key = __webpack_require__(36814); var PrivateKey = __webpack_require__(29602); var Identity = __webpack_require__(70508); var formats = {}; formats['openssh'] = __webpack_require__(94033); formats['x509'] = __webpack_require__(10267); formats['pem'] = __webpack_require__(30217); var CertificateParseError = errs.CertificateParseError; var InvalidAlgorithmError = errs.InvalidAlgorithmError; function Certificate(opts) { assert.object(opts, 'options'); assert.arrayOfObject(opts.subjects, 'options.subjects'); utils.assertCompatible(opts.subjects[0], Identity, [1, 0], 'options.subjects'); utils.assertCompatible(opts.subjectKey, Key, [1, 0], 'options.subjectKey'); utils.assertCompatible(opts.issuer, Identity, [1, 0], 'options.issuer'); if (opts.issuerKey !== undefined) { utils.assertCompatible(opts.issuerKey, Key, [1, 0], 'options.issuerKey'); } assert.object(opts.signatures, 'options.signatures'); assert.buffer(opts.serial, 'options.serial'); assert.date(opts.validFrom, 'options.validFrom'); assert.date(opts.validUntil, 'optons.validUntil'); assert.optionalArrayOfString(opts.purposes, 'options.purposes'); this._hashCache = {}; this.subjects = opts.subjects; this.issuer = opts.issuer; this.subjectKey = opts.subjectKey; this.issuerKey = opts.issuerKey; this.signatures = opts.signatures; this.serial = opts.serial; this.validFrom = opts.validFrom; this.validUntil = opts.validUntil; this.purposes = opts.purposes; } Certificate.formats = formats; Certificate.prototype.toBuffer = function (format, options) { if (format === undefined) format = 'x509'; assert.string(format, 'format'); assert.object(formats[format], 'formats[format]'); assert.optionalObject(options, 'options'); return (formats[format].write(this, options)); }; Certificate.prototype.toString = function (format, options) { if (format === undefined) format = 'pem'; return (this.toBuffer(format, options).toString()); }; Certificate.prototype.fingerprint = function (algo) { if (algo === undefined) algo = 'sha256'; assert.string(algo, 'algorithm'); var opts = { type: 'certificate', hash: this.hash(algo), algorithm: algo }; return (new Fingerprint(opts)); }; Certificate.prototype.hash = function (algo) { assert.string(algo, 'algorithm'); algo = algo.toLowerCase(); if (algs.hashAlgs[algo] === undefined) throw (new InvalidAlgorithmError(algo)); if (this._hashCache[algo]) return (this._hashCache[algo]); var hash = crypto.createHash(algo). update(this.toBuffer('x509')).digest(); this._hashCache[algo] = hash; return (hash); }; Certificate.prototype.isExpired = function (when) { if (when === undefined) when = new Date(); return (!((when.getTime() >= this.validFrom.getTime()) && (when.getTime() < this.validUntil.getTime()))); }; Certificate.prototype.isSignedBy = function (issuerCert) { utils.assertCompatible(issuerCert, Certificate, [1, 0], 'issuer'); if (!this.issuer.equals(issuerCert.subjects[0])) return (false); if (this.issuer.purposes && this.issuer.purposes.length > 0 && this.issuer.purposes.indexOf('ca') === -1) { return (false); } return (this.isSignedByKey(issuerCert.subjectKey)); }; Certificate.prototype.getExtension = function (keyOrOid) { assert.string(keyOrOid, 'keyOrOid'); var ext = this.getExtensions().filter(function (maybeExt) { if (maybeExt.format === 'x509') return (maybeExt.oid === keyOrOid); if (maybeExt.format === 'openssh') return (maybeExt.name === keyOrOid); return (false); })[0]; return (ext); }; Certificate.prototype.getExtensions = function () { var exts = []; var x509 = this.signatures.x509; if (x509 && x509.extras && x509.extras.exts) { x509.extras.exts.forEach(function (ext) { ext.format = 'x509'; exts.push(ext); }); } var openssh = this.signatures.openssh; if (openssh && openssh.exts) { openssh.exts.forEach(function (ext) { ext.format = 'openssh'; exts.push(ext); }); } return (exts); }; Certificate.prototype.isSignedByKey = function (issuerKey) { utils.assertCompatible(issuerKey, Key, [1, 2], 'issuerKey'); if (this.issuerKey !== undefined) { return (this.issuerKey. fingerprint('sha512').matches(issuerKey)); } var fmt = Object.keys(this.signatures)[0]; var valid = formats[fmt].verify(this, issuerKey); if (valid) this.issuerKey = issuerKey; return (valid); }; Certificate.prototype.signWith = function (key) { utils.assertCompatible(key, PrivateKey, [1, 2], 'key'); var fmts = Object.keys(formats); var didOne = false; for (var i = 0; i < fmts.length; ++i) { if (fmts[i] !== 'pem') { var ret = formats[fmts[i]].sign(this, key); if (ret === true) didOne = true; } } if (!didOne) { throw (new Error('Failed to sign the certificate for any ' + 'available certificate formats')); } }; Certificate.createSelfSigned = function (subjectOrSubjects, key, options) { var subjects; if (Array.isArray(subjectOrSubjects)) subjects = subjectOrSubjects; else subjects = [subjectOrSubjects]; assert.arrayOfObject(subjects); subjects.forEach(function (subject) { utils.assertCompatible(subject, Identity, [1, 0], 'subject'); }); utils.assertCompatible(key, PrivateKey, [1, 2], 'private key'); assert.optionalObject(options, 'options'); if (options === undefined) options = {}; assert.optionalObject(options.validFrom, 'options.validFrom'); assert.optionalObject(options.validUntil, 'options.validUntil'); var validFrom = options.validFrom; var validUntil = options.validUntil; if (validFrom === undefined) validFrom = new Date(); if (validUntil === undefined) { assert.optionalNumber(options.lifetime, 'options.lifetime'); var lifetime = options.lifetime; if (lifetime === undefined) lifetime = 10*365*24*3600; validUntil = new Date(); validUntil.setTime(validUntil.getTime() + lifetime*1000); } assert.optionalBuffer(options.serial, 'options.serial'); var serial = options.serial; if (serial === undefined) serial = Buffer.from('0000000000000001', 'hex'); var purposes = options.purposes; if (purposes === undefined) purposes = []; if (purposes.indexOf('signature') === -1) purposes.push('signature'); /* Self-signed certs are always CAs. */ if (purposes.indexOf('ca') === -1) purposes.push('ca'); if (purposes.indexOf('crl') === -1) purposes.push('crl'); /* * If we weren't explicitly given any other purposes, do the sensible * thing and add some basic ones depending on the subject type. */ if (purposes.length <= 3) { var hostSubjects = subjects.filter(function (subject) { return (subject.type === 'host'); }); var userSubjects = subjects.filter(function (subject) { return (subject.type === 'user'); }); if (hostSubjects.length > 0) { if (purposes.indexOf('serverAuth') === -1) purposes.push('serverAuth'); } if (userSubjects.length > 0) { if (purposes.indexOf('clientAuth') === -1) purposes.push('clientAuth'); } if (userSubjects.length > 0 || hostSubjects.length > 0) { if (purposes.indexOf('keyAgreement') === -1) purposes.push('keyAgreement'); if (key.type === 'rsa' && purposes.indexOf('encryption') === -1) purposes.push('encryption'); } } var cert = new Certificate({ subjects: subjects, issuer: subjects[0], subjectKey: key.toPublic(), issuerKey: key.toPublic(), signatures: {}, serial: serial, validFrom: validFrom, validUntil: validUntil, purposes: purposes }); cert.signWith(key); return (cert); }; Certificate.create = function (subjectOrSubjects, key, issuer, issuerKey, options) { var subjects; if (Array.isArray(subjectOrSubjects)) subjects = subjectOrSubjects; else subjects = [subjectOrSubjects]; assert.arrayOfObject(subjects); subjects.forEach(function (subject) { utils.assertCompatible(subject, Identity, [1, 0], 'subject'); }); utils.assertCompatible(key, Key, [1, 0], 'key'); if (PrivateKey.isPrivateKey(key)) key = key.toPublic(); utils.assertCompatible(issuer, Identity, [1, 0], 'issuer'); utils.assertCompatible(issuerKey, PrivateKey, [1, 2], 'issuer key'); assert.optionalObject(options, 'options'); if (options === undefined) options = {}; assert.optionalObject(options.validFrom, 'options.validFrom'); assert.optionalObject(options.validUntil, 'options.validUntil'); var validFrom = options.validFrom; var validUntil = options.validUntil; if (validFrom === undefined) validFrom = new Date(); if (validUntil === undefined) { assert.optionalNumber(options.lifetime, 'options.lifetime'); var lifetime = options.lifetime; if (lifetime === undefined) lifetime = 10*365*24*3600; validUntil = new Date(); validUntil.setTime(validUntil.getTime() + lifetime*1000); } assert.optionalBuffer(options.serial, 'options.serial'); var serial = options.serial; if (serial === undefined) serial = Buffer.from('0000000000000001', 'hex'); var purposes = options.purposes; if (purposes === undefined) purposes = []; if (purposes.indexOf('signature') === -1) purposes.push('signature'); if (options.ca === true) { if (purposes.indexOf('ca') === -1) purposes.push('ca'); if (purposes.indexOf('crl') === -1) purposes.push('crl'); } var hostSubjects = subjects.filter(function (subject) { return (subject.type === 'host'); }); var userSubjects = subjects.filter(function (subject) { return (subject.type === 'user'); }); if (hostSubjects.length > 0) { if (purposes.indexOf('serverAuth') === -1) purposes.push('serverAuth'); } if (userSubjects.length > 0) { if (purposes.indexOf('clientAuth') === -1) purposes.push('clientAuth'); } if (userSubjects.length > 0 || hostSubjects.length > 0) { if (purposes.indexOf('keyAgreement') === -1) purposes.push('keyAgreement'); if (key.type === 'rsa' && purposes.indexOf('encryption') === -1) purposes.push('encryption'); } var cert = new Certificate({ subjects: subjects, issuer: issuer, subjectKey: key, issuerKey: issuerKey.toPublic(), signatures: {}, serial: serial, validFrom: validFrom, validUntil: validUntil, purposes: purposes }); cert.signWith(issuerKey); return (cert); }; Certificate.parse = function (data, format, options) { if (typeof (data) !== 'string') assert.buffer(data, 'data'); if (format === undefined) format = 'auto'; assert.string(format, 'format'); if (typeof (options) === 'string') options = { filename: options }; assert.optionalObject(options, 'options'); if (options === undefined) options = {}; assert.optionalString(options.filename, 'options.filename'); if (options.filename === undefined) options.filename = '(unnamed)'; assert.object(formats[format], 'formats[format]'); try { var k = formats[format].read(data, options); return (k); } catch (e) { throw (new CertificateParseError(options.filename, format, e)); } }; Certificate.isCertificate = function (obj, ver) { return (utils.isCompatible(obj, Certificate, ver)); }; /* * API versions for Certificate: * [1,0] -- initial ver * [1,1] -- openssh format now unpacks extensions */ Certificate.prototype._sshpkApiVersion = [1, 1]; Certificate._oldVersionDetect = function (obj) { return ([1, 0]); }; /***/ }), /***/ 57602: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { // Copyright 2017 Joyent, Inc. module.exports = { DiffieHellman: DiffieHellman, generateECDSA: generateECDSA, generateED25519: generateED25519 }; var assert = __webpack_require__(66631); var crypto = __webpack_require__(33373); var Buffer = __webpack_require__(15118).Buffer; var algs = __webpack_require__(66126); var utils = __webpack_require__(80575); var nacl = __webpack_require__(68729); var Key = __webpack_require__(36814); var PrivateKey = __webpack_require__(29602); var CRYPTO_HAVE_ECDH = (crypto.createECDH !== undefined); var ecdh = __webpack_require__(49865); var ec = __webpack_require__(3943); var jsbn = __webpack_require__(85587).BigInteger; function DiffieHellman(key) { utils.assertCompatible(key, Key, [1, 4], 'key'); this._isPriv = PrivateKey.isPrivateKey(key, [1, 3]); this._algo = key.type; this._curve = key.curve; this._key = key; if (key.type === 'dsa') { if (!CRYPTO_HAVE_ECDH) { throw (new Error('Due to bugs in the node 0.10 ' + 'crypto API, node 0.12.x or later is required ' + 'to use DH')); } this._dh = crypto.createDiffieHellman( key.part.p.data, undefined, key.part.g.data, undefined); this._p = key.part.p; this._g = key.part.g; if (this._isPriv) this._dh.setPrivateKey(key.part.x.data); this._dh.setPublicKey(key.part.y.data); } else if (key.type === 'ecdsa') { if (!CRYPTO_HAVE_ECDH) { this._ecParams = new X9ECParameters(this._curve); if (this._isPriv) { this._priv = new ECPrivate( this._ecParams, key.part.d.data); } return; } var curve = { 'nistp256': 'prime256v1', 'nistp384': 'secp384r1', 'nistp521': 'secp521r1' }[key.curve]; this._dh = crypto.createECDH(curve); if (typeof (this._dh) !== 'object' || typeof (this._dh.setPrivateKey) !== 'function') { CRYPTO_HAVE_ECDH = false; DiffieHellman.call(this, key); return; } if (this._isPriv) this._dh.setPrivateKey(key.part.d.data); this._dh.setPublicKey(key.part.Q.data); } else if (key.type === 'curve25519') { if (this._isPriv) { utils.assertCompatible(key, PrivateKey, [1, 5], 'key'); this._priv = key.part.k.data; } } else { throw (new Error('DH not supported for ' + key.type + ' keys')); } } DiffieHellman.prototype.getPublicKey = function () { if (this._isPriv) return (this._key.toPublic()); return (this._key); }; DiffieHellman.prototype.getPrivateKey = function () { if (this._isPriv) return (this._key); else return (undefined); }; DiffieHellman.prototype.getKey = DiffieHellman.prototype.getPrivateKey; DiffieHellman.prototype._keyCheck = function (pk, isPub) { assert.object(pk, 'key'); if (!isPub) utils.assertCompatible(pk, PrivateKey, [1, 3], 'key'); utils.assertCompatible(pk, Key, [1, 4], 'key'); if (pk.type !== this._algo) { throw (new Error('A ' + pk.type + ' key cannot be used in ' + this._algo + ' Diffie-Hellman')); } if (pk.curve !== this._curve) { throw (new Error('A key from the ' + pk.curve + ' curve ' + 'cannot be used with a ' + this._curve + ' Diffie-Hellman')); } if (pk.type === 'dsa') { assert.deepEqual(pk.part.p, this._p, 'DSA key prime does not match'); assert.deepEqual(pk.part.g, this._g, 'DSA key generator does not match'); } }; DiffieHellman.prototype.setKey = function (pk) { this._keyCheck(pk); if (pk.type === 'dsa') { this._dh.setPrivateKey(pk.part.x.data); this._dh.setPublicKey(pk.part.y.data); } else if (pk.type === 'ecdsa') { if (CRYPTO_HAVE_ECDH) { this._dh.setPrivateKey(pk.part.d.data); this._dh.setPublicKey(pk.part.Q.data); } else { this._priv = new ECPrivate( this._ecParams, pk.part.d.data); } } else if (pk.type === 'curve25519') { var k = pk.part.k; if (!pk.part.k) k = pk.part.r; this._priv = k.data; if (this._priv[0] === 0x00) this._priv = this._priv.slice(1); this._priv = this._priv.slice(0, 32); } this._key = pk; this._isPriv = true; }; DiffieHellman.prototype.setPrivateKey = DiffieHellman.prototype.setKey; DiffieHellman.prototype.computeSecret = function (otherpk) { this._keyCheck(otherpk, true); if (!this._isPriv) throw (new Error('DH exchange has not been initialized with ' + 'a private key yet')); var pub; if (this._algo === 'dsa') { return (this._dh.computeSecret( otherpk.part.y.data)); } else if (this._algo === 'ecdsa') { if (CRYPTO_HAVE_ECDH) { return (this._dh.computeSecret( otherpk.part.Q.data)); } else { pub = new ECPublic( this._ecParams, otherpk.part.Q.data); return (this._priv.deriveSharedSecret(pub)); } } else if (this._algo === 'curve25519') { pub = otherpk.part.A.data; while (pub[0] === 0x00 && pub.length > 32) pub = pub.slice(1); var priv = this._priv; assert.strictEqual(pub.length, 32); assert.strictEqual(priv.length, 32); var secret = nacl.box.before(new Uint8Array(pub), new Uint8Array(priv)); return (Buffer.from(secret)); } throw (new Error('Invalid algorithm: ' + this._algo)); }; DiffieHellman.prototype.generateKey = function () { var parts = []; var priv, pub; if (this._algo === 'dsa') { this._dh.generateKeys(); parts.push({name: 'p', data: this._p.data}); parts.push({name: 'q', data: this._key.part.q.data}); parts.push({name: 'g', data: this._g.data}); parts.push({name: 'y', data: this._dh.getPublicKey()}); parts.push({name: 'x', data: this._dh.getPrivateKey()}); this._key = new PrivateKey({ type: 'dsa', parts: parts }); this._isPriv = true; return (this._key); } else if (this._algo === 'ecdsa') { if (CRYPTO_HAVE_ECDH) { this._dh.generateKeys(); parts.push({name: 'curve', data: Buffer.from(this._curve)}); parts.push({name: 'Q', data: this._dh.getPublicKey()}); parts.push({name: 'd', data: this._dh.getPrivateKey()}); this._key = new PrivateKey({ type: 'ecdsa', curve: this._curve, parts: parts }); this._isPriv = true; return (this._key); } else { var n = this._ecParams.getN(); var r = new jsbn(crypto.randomBytes(n.bitLength())); var n1 = n.subtract(jsbn.ONE); priv = r.mod(n1).add(jsbn.ONE); pub = this._ecParams.getG().multiply(priv); priv = Buffer.from(priv.toByteArray()); pub = Buffer.from(this._ecParams.getCurve(). encodePointHex(pub), 'hex'); this._priv = new ECPrivate(this._ecParams, priv); parts.push({name: 'curve', data: Buffer.from(this._curve)}); parts.push({name: 'Q', data: pub}); parts.push({name: 'd', data: priv}); this._key = new PrivateKey({ type: 'ecdsa', curve: this._curve, parts: parts }); this._isPriv = true; return (this._key); } } else if (this._algo === 'curve25519') { var pair = nacl.box.keyPair(); priv = Buffer.from(pair.secretKey); pub = Buffer.from(pair.publicKey); priv = Buffer.concat([priv, pub]); assert.strictEqual(priv.length, 64); assert.strictEqual(pub.length, 32); parts.push({name: 'A', data: pub}); parts.push({name: 'k', data: priv}); this._key = new PrivateKey({ type: 'curve25519', parts: parts }); this._isPriv = true; return (this._key); } throw (new Error('Invalid algorithm: ' + this._algo)); }; DiffieHellman.prototype.generateKeys = DiffieHellman.prototype.generateKey; /* These are helpers for using ecc-jsbn (for node 0.10 compatibility). */ function X9ECParameters(name) { var params = algs.curves[name]; assert.object(params); var p = new jsbn(params.p); var a = new jsbn(params.a); var b = new jsbn(params.b); var n = new jsbn(params.n); var h = jsbn.ONE; var curve = new ec.ECCurveFp(p, a, b); var G = curve.decodePointHex(params.G.toString('hex')); this.curve = curve; this.g = G; this.n = n; this.h = h; } X9ECParameters.prototype.getCurve = function () { return (this.curve); }; X9ECParameters.prototype.getG = function () { return (this.g); }; X9ECParameters.prototype.getN = function () { return (this.n); }; X9ECParameters.prototype.getH = function () { return (this.h); }; function ECPublic(params, buffer) { this._params = params; if (buffer[0] === 0x00) buffer = buffer.slice(1); this._pub = params.getCurve().decodePointHex(buffer.toString('hex')); } function ECPrivate(params, buffer) { this._params = params; this._priv = new jsbn(utils.mpNormalize(buffer)); } ECPrivate.prototype.deriveSharedSecret = function (pubKey) { assert.ok(pubKey instanceof ECPublic); var S = pubKey._pub.multiply(this._priv); return (Buffer.from(S.getX().toBigInteger().toByteArray())); }; function generateED25519() { var pair = nacl.sign.keyPair(); var priv = Buffer.from(pair.secretKey); var pub = Buffer.from(pair.publicKey); assert.strictEqual(priv.length, 64); assert.strictEqual(pub.length, 32); var parts = []; parts.push({name: 'A', data: pub}); parts.push({name: 'k', data: priv.slice(0, 32)}); var key = new PrivateKey({ type: 'ed25519', parts: parts }); return (key); } /* Generates a new ECDSA private key on a given curve. */ function generateECDSA(curve) { var parts = []; var key; if (CRYPTO_HAVE_ECDH) { /* * Node crypto doesn't expose key generation directly, but the * ECDH instances can generate keys. It turns out this just * calls into the OpenSSL generic key generator, and we can * read its output happily without doing an actual DH. So we * use that here. */ var osCurve = { 'nistp256': 'prime256v1', 'nistp384': 'secp384r1', 'nistp521': 'secp521r1' }[curve]; var dh = crypto.createECDH(osCurve); dh.generateKeys(); parts.push({name: 'curve', data: Buffer.from(curve)}); parts.push({name: 'Q', data: dh.getPublicKey()}); parts.push({name: 'd', data: dh.getPrivateKey()}); key = new PrivateKey({ type: 'ecdsa', curve: curve, parts: parts }); return (key); } else { var ecParams = new X9ECParameters(curve); /* This algorithm taken from FIPS PUB 186-4 (section B.4.1) */ var n = ecParams.getN(); /* * The crypto.randomBytes() function can only give us whole * bytes, so taking a nod from X9.62, we round up. */ var cByteLen = Math.ceil((n.bitLength() + 64) / 8); var c = new jsbn(crypto.randomBytes(cByteLen)); var n1 = n.subtract(jsbn.ONE); var priv = c.mod(n1).add(jsbn.ONE); var pub = ecParams.getG().multiply(priv); priv = Buffer.from(priv.toByteArray()); pub = Buffer.from(ecParams.getCurve(). encodePointHex(pub), 'hex'); parts.push({name: 'curve', data: Buffer.from(curve)}); parts.push({name: 'Q', data: pub}); parts.push({name: 'd', data: priv}); key = new PrivateKey({ type: 'ecdsa', curve: curve, parts: parts }); return (key); } } /***/ }), /***/ 14694: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { // Copyright 2015 Joyent, Inc. module.exports = { Verifier: Verifier, Signer: Signer }; var nacl = __webpack_require__(68729); var stream = __webpack_require__(92413); var util = __webpack_require__(31669); var assert = __webpack_require__(66631); var Buffer = __webpack_require__(15118).Buffer; var Signature = __webpack_require__(91394); function Verifier(key, hashAlgo) { if (hashAlgo.toLowerCase() !== 'sha512') throw (new Error('ED25519 only supports the use of ' + 'SHA-512 hashes')); this.key = key; this.chunks = []; stream.Writable.call(this, {}); } util.inherits(Verifier, stream.Writable); Verifier.prototype._write = function (chunk, enc, cb) { this.chunks.push(chunk); cb(); }; Verifier.prototype.update = function (chunk) { if (typeof (chunk) === 'string') chunk = Buffer.from(chunk, 'binary'); this.chunks.push(chunk); }; Verifier.prototype.verify = function (signature, fmt) { var sig; if (Signature.isSignature(signature, [2, 0])) { if (signature.type !== 'ed25519') return (false); sig = signature.toBuffer('raw'); } else if (typeof (signature) === 'string') { sig = Buffer.from(signature, 'base64'); } else if (Signature.isSignature(signature, [1, 0])) { throw (new Error('signature was created by too old ' + 'a version of sshpk and cannot be verified')); } assert.buffer(sig); return (nacl.sign.detached.verify( new Uint8Array(Buffer.concat(this.chunks)), new Uint8Array(sig), new Uint8Array(this.key.part.A.data))); }; function Signer(key, hashAlgo) { if (hashAlgo.toLowerCase() !== 'sha512') throw (new Error('ED25519 only supports the use of ' + 'SHA-512 hashes')); this.key = key; this.chunks = []; stream.Writable.call(this, {}); } util.inherits(Signer, stream.Writable); Signer.prototype._write = function (chunk, enc, cb) { this.chunks.push(chunk); cb(); }; Signer.prototype.update = function (chunk) { if (typeof (chunk) === 'string') chunk = Buffer.from(chunk, 'binary'); this.chunks.push(chunk); }; Signer.prototype.sign = function () { var sig = nacl.sign.detached( new Uint8Array(Buffer.concat(this.chunks)), new Uint8Array(Buffer.concat([ this.key.part.k.data, this.key.part.A.data]))); var sigBuf = Buffer.from(sig); var sigObj = Signature.parse(sigBuf, 'ed25519', 'raw'); sigObj.hashAlgorithm = 'sha512'; return (sigObj); }; /***/ }), /***/ 27979: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { // Copyright 2015 Joyent, Inc. var assert = __webpack_require__(66631); var util = __webpack_require__(31669); function FingerprintFormatError(fp, format) { if (Error.captureStackTrace) Error.captureStackTrace(this, FingerprintFormatError); this.name = 'FingerprintFormatError'; this.fingerprint = fp; this.format = format; this.message = 'Fingerprint format is not supported, or is invalid: '; if (fp !== undefined) this.message += ' fingerprint = ' + fp; if (format !== undefined) this.message += ' format = ' + format; } util.inherits(FingerprintFormatError, Error); function InvalidAlgorithmError(alg) { if (Error.captureStackTrace) Error.captureStackTrace(this, InvalidAlgorithmError); this.name = 'InvalidAlgorithmError'; this.algorithm = alg; this.message = 'Algorithm "' + alg + '" is not supported'; } util.inherits(InvalidAlgorithmError, Error); function KeyParseError(name, format, innerErr) { if (Error.captureStackTrace) Error.captureStackTrace(this, KeyParseError); this.name = 'KeyParseError'; this.format = format; this.keyName = name; this.innerErr = innerErr; this.message = 'Failed to parse ' + name + ' as a valid ' + format + ' format key: ' + innerErr.message; } util.inherits(KeyParseError, Error); function SignatureParseError(type, format, innerErr) { if (Error.captureStackTrace) Error.captureStackTrace(this, SignatureParseError); this.name = 'SignatureParseError'; this.type = type; this.format = format; this.innerErr = innerErr; this.message = 'Failed to parse the given data as a ' + type + ' signature in ' + format + ' format: ' + innerErr.message; } util.inherits(SignatureParseError, Error); function CertificateParseError(name, format, innerErr) { if (Error.captureStackTrace) Error.captureStackTrace(this, CertificateParseError); this.name = 'CertificateParseError'; this.format = format; this.certName = name; this.innerErr = innerErr; this.message = 'Failed to parse ' + name + ' as a valid ' + format + ' format certificate: ' + innerErr.message; } util.inherits(CertificateParseError, Error); function KeyEncryptedError(name, format) { if (Error.captureStackTrace) Error.captureStackTrace(this, KeyEncryptedError); this.name = 'KeyEncryptedError'; this.format = format; this.keyName = name; this.message = 'The ' + format + ' format key ' + name + ' is ' + 'encrypted (password-protected), and no passphrase was ' + 'provided in `options`'; } util.inherits(KeyEncryptedError, Error); module.exports = { FingerprintFormatError: FingerprintFormatError, InvalidAlgorithmError: InvalidAlgorithmError, KeyParseError: KeyParseError, SignatureParseError: SignatureParseError, KeyEncryptedError: KeyEncryptedError, CertificateParseError: CertificateParseError }; /***/ }), /***/ 13079: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { // Copyright 2018 Joyent, Inc. module.exports = Fingerprint; var assert = __webpack_require__(66631); var Buffer = __webpack_require__(15118).Buffer; var algs = __webpack_require__(66126); var crypto = __webpack_require__(33373); var errs = __webpack_require__(27979); var Key = __webpack_require__(36814); var PrivateKey = __webpack_require__(29602); var Certificate = __webpack_require__(7406); var utils = __webpack_require__(80575); var FingerprintFormatError = errs.FingerprintFormatError; var InvalidAlgorithmError = errs.InvalidAlgorithmError; function Fingerprint(opts) { assert.object(opts, 'options'); assert.string(opts.type, 'options.type'); assert.buffer(opts.hash, 'options.hash'); assert.string(opts.algorithm, 'options.algorithm'); this.algorithm = opts.algorithm.toLowerCase(); if (algs.hashAlgs[this.algorithm] !== true) throw (new InvalidAlgorithmError(this.algorithm)); this.hash = opts.hash; this.type = opts.type; this.hashType = opts.hashType; } Fingerprint.prototype.toString = function (format) { if (format === undefined) { if (this.algorithm === 'md5' || this.hashType === 'spki') format = 'hex'; else format = 'base64'; } assert.string(format); switch (format) { case 'hex': if (this.hashType === 'spki') return (this.hash.toString('hex')); return (addColons(this.hash.toString('hex'))); case 'base64': if (this.hashType === 'spki') return (this.hash.toString('base64')); return (sshBase64Format(this.algorithm, this.hash.toString('base64'))); default: throw (new FingerprintFormatError(undefined, format)); } }; Fingerprint.prototype.matches = function (other) { assert.object(other, 'key or certificate'); if (this.type === 'key' && this.hashType !== 'ssh') { utils.assertCompatible(other, Key, [1, 7], 'key with spki'); if (PrivateKey.isPrivateKey(other)) { utils.assertCompatible(other, PrivateKey, [1, 6], 'privatekey with spki support'); } } else if (this.type === 'key') { utils.assertCompatible(other, Key, [1, 0], 'key'); } else { utils.assertCompatible(other, Certificate, [1, 0], 'certificate'); } var theirHash = other.hash(this.algorithm, this.hashType); var theirHash2 = crypto.createHash(this.algorithm). update(theirHash).digest('base64'); if (this.hash2 === undefined) this.hash2 = crypto.createHash(this.algorithm). update(this.hash).digest('base64'); return (this.hash2 === theirHash2); }; /*JSSTYLED*/ var base64RE = /^[A-Za-z0-9+\/=]+$/; /*JSSTYLED*/ var hexRE = /^[a-fA-F0-9]+$/; Fingerprint.parse = function (fp, options) { assert.string(fp, 'fingerprint'); var alg, hash, enAlgs; if (Array.isArray(options)) { enAlgs = options; options = {}; } assert.optionalObject(options, 'options'); if (options === undefined) options = {}; if (options.enAlgs !== undefined) enAlgs = options.enAlgs; if (options.algorithms !== undefined) enAlgs = options.algorithms; assert.optionalArrayOfString(enAlgs, 'algorithms'); var hashType = 'ssh'; if (options.hashType !== undefined) hashType = options.hashType; assert.string(hashType, 'options.hashType'); var parts = fp.split(':'); if (parts.length == 2) { alg = parts[0].toLowerCase(); if (!base64RE.test(parts[1])) throw (new FingerprintFormatError(fp)); try { hash = Buffer.from(parts[1], 'base64'); } catch (e) { throw (new FingerprintFormatError(fp)); } } else if (parts.length > 2) { alg = 'md5'; if (parts[0].toLowerCase() === 'md5') parts = parts.slice(1); parts = parts.map(function (p) { while (p.length < 2) p = '0' + p; if (p.length > 2) throw (new FingerprintFormatError(fp)); return (p); }); parts = parts.join(''); if (!hexRE.test(parts) || parts.length % 2 !== 0) throw (new FingerprintFormatError(fp)); try { hash = Buffer.from(parts, 'hex'); } catch (e) { throw (new FingerprintFormatError(fp)); } } else { if (hexRE.test(fp)) { hash = Buffer.from(fp, 'hex'); } else if (base64RE.test(fp)) { hash = Buffer.from(fp, 'base64'); } else { throw (new FingerprintFormatError(fp)); } switch (hash.length) { case 32: alg = 'sha256'; break; case 16: alg = 'md5'; break; case 20: alg = 'sha1'; break; case 64: alg = 'sha512'; break; default: throw (new FingerprintFormatError(fp)); } /* Plain hex/base64: guess it's probably SPKI unless told. */ if (options.hashType === undefined) hashType = 'spki'; } if (alg === undefined) throw (new FingerprintFormatError(fp)); if (algs.hashAlgs[alg] === undefined) throw (new InvalidAlgorithmError(alg)); if (enAlgs !== undefined) { enAlgs = enAlgs.map(function (a) { return a.toLowerCase(); }); if (enAlgs.indexOf(alg) === -1) throw (new InvalidAlgorithmError(alg)); } return (new Fingerprint({ algorithm: alg, hash: hash, type: options.type || 'key', hashType: hashType })); }; function addColons(s) { /*JSSTYLED*/ return (s.replace(/(.{2})(?=.)/g, '$1:')); } function base64Strip(s) { /*JSSTYLED*/ return (s.replace(/=*$/, '')); } function sshBase64Format(alg, h) { return (alg.toUpperCase() + ':' + base64Strip(h)); } Fingerprint.isFingerprint = function (obj, ver) { return (utils.isCompatible(obj, Fingerprint, ver)); }; /* * API versions for Fingerprint: * [1,0] -- initial ver * [1,1] -- first tagged ver * [1,2] -- hashType and spki support */ Fingerprint.prototype._sshpkApiVersion = [1, 2]; Fingerprint._oldVersionDetect = function (obj) { assert.func(obj.toString); assert.func(obj.matches); return ([1, 0]); }; /***/ }), /***/ 8243: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { // Copyright 2018 Joyent, Inc. module.exports = { read: read, write: write }; var assert = __webpack_require__(66631); var Buffer = __webpack_require__(15118).Buffer; var utils = __webpack_require__(80575); var Key = __webpack_require__(36814); var PrivateKey = __webpack_require__(29602); var pem = __webpack_require__(14324); var ssh = __webpack_require__(68927); var rfc4253 = __webpack_require__(88688); var dnssec = __webpack_require__(63561); var putty = __webpack_require__(80974); var DNSSEC_PRIVKEY_HEADER_PREFIX = 'Private-key-format: v1'; function read(buf, options) { if (typeof (buf) === 'string') { if (buf.trim().match(/^[-]+[ ]*BEGIN/)) return (pem.read(buf, options)); if (buf.match(/^\s*ssh-[a-z]/)) return (ssh.read(buf, options)); if (buf.match(/^\s*ecdsa-/)) return (ssh.read(buf, options)); if (buf.match(/^putty-user-key-file-2:/i)) return (putty.read(buf, options)); if (findDNSSECHeader(buf)) return (dnssec.read(buf, options)); buf = Buffer.from(buf, 'binary'); } else { assert.buffer(buf); if (findPEMHeader(buf)) return (pem.read(buf, options)); if (findSSHHeader(buf)) return (ssh.read(buf, options)); if (findPuTTYHeader(buf)) return (putty.read(buf, options)); if (findDNSSECHeader(buf)) return (dnssec.read(buf, options)); } if (buf.readUInt32BE(0) < buf.length) return (rfc4253.read(buf, options)); throw (new Error('Failed to auto-detect format of key')); } function findPuTTYHeader(buf) { var offset = 0; while (offset < buf.length && (buf[offset] === 32 || buf[offset] === 10 || buf[offset] === 9)) ++offset; if (offset + 22 <= buf.length && buf.slice(offset, offset + 22).toString('ascii').toLowerCase() === 'putty-user-key-file-2:') return (true); return (false); } function findSSHHeader(buf) { var offset = 0; while (offset < buf.length && (buf[offset] === 32 || buf[offset] === 10 || buf[offset] === 9)) ++offset; if (offset + 4 <= buf.length && buf.slice(offset, offset + 4).toString('ascii') === 'ssh-') return (true); if (offset + 6 <= buf.length && buf.slice(offset, offset + 6).toString('ascii') === 'ecdsa-') return (true); return (false); } function findPEMHeader(buf) { var offset = 0; while (offset < buf.length && (buf[offset] === 32 || buf[offset] === 10)) ++offset; if (buf[offset] !== 45) return (false); while (offset < buf.length && (buf[offset] === 45)) ++offset; while (offset < buf.length && (buf[offset] === 32)) ++offset; if (offset + 5 > buf.length || buf.slice(offset, offset + 5).toString('ascii') !== 'BEGIN') return (false); return (true); } function findDNSSECHeader(buf) { // private case first if (buf.length <= DNSSEC_PRIVKEY_HEADER_PREFIX.length) return (false); var headerCheck = buf.slice(0, DNSSEC_PRIVKEY_HEADER_PREFIX.length); if (headerCheck.toString('ascii') === DNSSEC_PRIVKEY_HEADER_PREFIX) return (true); // public-key RFC3110 ? // 'domain.com. IN KEY ...' or 'domain.com. IN DNSKEY ...' // skip any comment-lines if (typeof (buf) !== 'string') { buf = buf.toString('ascii'); } var lines = buf.split('\n'); var line = 0; /* JSSTYLED */ while (lines[line].match(/^\;/)) line++; if (lines[line].toString('ascii').match(/\. IN KEY /)) return (true); if (lines[line].toString('ascii').match(/\. IN DNSKEY /)) return (true); return (false); } function write(key, options) { throw (new Error('"auto" format cannot be used for writing')); } /***/ }), /***/ 63561: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { // Copyright 2017 Joyent, Inc. module.exports = { read: read, write: write }; var assert = __webpack_require__(66631); var Buffer = __webpack_require__(15118).Buffer; var Key = __webpack_require__(36814); var PrivateKey = __webpack_require__(29602); var utils = __webpack_require__(80575); var SSHBuffer = __webpack_require__(25621); var Dhe = __webpack_require__(57602); var supportedAlgos = { 'rsa-sha1' : 5, 'rsa-sha256' : 8, 'rsa-sha512' : 10, 'ecdsa-p256-sha256' : 13, 'ecdsa-p384-sha384' : 14 /* * ed25519 is hypothetically supported with id 15 * but the common tools available don't appear to be * capable of generating/using ed25519 keys */ }; var supportedAlgosById = {}; Object.keys(supportedAlgos).forEach(function (k) { supportedAlgosById[supportedAlgos[k]] = k.toUpperCase(); }); function read(buf, options) { if (typeof (buf) !== 'string') { assert.buffer(buf, 'buf'); buf = buf.toString('ascii'); } var lines = buf.split('\n'); if (lines[0].match(/^Private-key-format\: v1/)) { var algElems = lines[1].split(' '); var algoNum = parseInt(algElems[1], 10); var algoName = algElems[2]; if (!supportedAlgosById[algoNum]) throw (new Error('Unsupported algorithm: ' + algoName)); return (readDNSSECPrivateKey(algoNum, lines.slice(2))); } // skip any comment-lines var line = 0; /* JSSTYLED */ while (lines[line].match(/^\;/)) line++; // we should now have *one single* line left with our KEY on it. if ((lines[line].match(/\. IN KEY /) || lines[line].match(/\. IN DNSKEY /)) && lines[line+1].length === 0) { return (readRFC3110(lines[line])); } throw (new Error('Cannot parse dnssec key')); } function readRFC3110(keyString) { var elems = keyString.split(' '); //unused var flags = parseInt(elems[3], 10); //unused var protocol = parseInt(elems[4], 10); var algorithm = parseInt(elems[5], 10); if (!supportedAlgosById[algorithm]) throw (new Error('Unsupported algorithm: ' + algorithm)); var base64key = elems.slice(6, elems.length).join(); var keyBuffer = Buffer.from(base64key, 'base64'); if (supportedAlgosById[algorithm].match(/^RSA-/)) { // join the rest of the body into a single base64-blob var publicExponentLen = keyBuffer.readUInt8(0); if (publicExponentLen != 3 && publicExponentLen != 1) throw (new Error('Cannot parse dnssec key: ' + 'unsupported exponent length')); var publicExponent = keyBuffer.slice(1, publicExponentLen+1); publicExponent = utils.mpNormalize(publicExponent); var modulus = keyBuffer.slice(1+publicExponentLen); modulus = utils.mpNormalize(modulus); // now, make the key var rsaKey = { type: 'rsa', parts: [] }; rsaKey.parts.push({ name: 'e', data: publicExponent}); rsaKey.parts.push({ name: 'n', data: modulus}); return (new Key(rsaKey)); } if (supportedAlgosById[algorithm] === 'ECDSA-P384-SHA384' || supportedAlgosById[algorithm] === 'ECDSA-P256-SHA256') { var curve = 'nistp384'; var size = 384; if (supportedAlgosById[algorithm].match(/^ECDSA-P256-SHA256/)) { curve = 'nistp256'; size = 256; } var ecdsaKey = { type: 'ecdsa', curve: curve, size: size, parts: [ {name: 'curve', data: Buffer.from(curve) }, {name: 'Q', data: utils.ecNormalize(keyBuffer) } ] }; return (new Key(ecdsaKey)); } throw (new Error('Unsupported algorithm: ' + supportedAlgosById[algorithm])); } function elementToBuf(e) { return (Buffer.from(e.split(' ')[1], 'base64')); } function readDNSSECRSAPrivateKey(elements) { var rsaParams = {}; elements.forEach(function (element) { if (element.split(' ')[0] === 'Modulus:') rsaParams['n'] = elementToBuf(element); else if (element.split(' ')[0] === 'PublicExponent:') rsaParams['e'] = elementToBuf(element); else if (element.split(' ')[0] === 'PrivateExponent:') rsaParams['d'] = elementToBuf(element); else if (element.split(' ')[0] === 'Prime1:') rsaParams['p'] = elementToBuf(element); else if (element.split(' ')[0] === 'Prime2:') rsaParams['q'] = elementToBuf(element); else if (element.split(' ')[0] === 'Exponent1:') rsaParams['dmodp'] = elementToBuf(element); else if (element.split(' ')[0] === 'Exponent2:') rsaParams['dmodq'] = elementToBuf(element); else if (element.split(' ')[0] === 'Coefficient:') rsaParams['iqmp'] = elementToBuf(element); }); // now, make the key var key = { type: 'rsa', parts: [ { name: 'e', data: utils.mpNormalize(rsaParams['e'])}, { name: 'n', data: utils.mpNormalize(rsaParams['n'])}, { name: 'd', data: utils.mpNormalize(rsaParams['d'])}, { name: 'p', data: utils.mpNormalize(rsaParams['p'])}, { name: 'q', data: utils.mpNormalize(rsaParams['q'])}, { name: 'dmodp', data: utils.mpNormalize(rsaParams['dmodp'])}, { name: 'dmodq', data: utils.mpNormalize(rsaParams['dmodq'])}, { name: 'iqmp', data: utils.mpNormalize(rsaParams['iqmp'])} ] }; return (new PrivateKey(key)); } function readDNSSECPrivateKey(alg, elements) { if (supportedAlgosById[alg].match(/^RSA-/)) { return (readDNSSECRSAPrivateKey(elements)); } if (supportedAlgosById[alg] === 'ECDSA-P384-SHA384' || supportedAlgosById[alg] === 'ECDSA-P256-SHA256') { var d = Buffer.from(elements[0].split(' ')[1], 'base64'); var curve = 'nistp384'; var size = 384; if (supportedAlgosById[alg] === 'ECDSA-P256-SHA256') { curve = 'nistp256'; size = 256; } // DNSSEC generates the public-key on the fly (go calculate it) var publicKey = utils.publicFromPrivateECDSA(curve, d); var Q = publicKey.part['Q'].data; var ecdsaKey = { type: 'ecdsa', curve: curve, size: size, parts: [ {name: 'curve', data: Buffer.from(curve) }, {name: 'd', data: d }, {name: 'Q', data: Q } ] }; return (new PrivateKey(ecdsaKey)); } throw (new Error('Unsupported algorithm: ' + supportedAlgosById[alg])); } function dnssecTimestamp(date) { var year = date.getFullYear() + ''; //stringify var month = (date.getMonth() + 1); var timestampStr = year + month + date.getUTCDate(); timestampStr += '' + date.getUTCHours() + date.getUTCMinutes(); timestampStr += date.getUTCSeconds(); return (timestampStr); } function rsaAlgFromOptions(opts) { if (!opts || !opts.hashAlgo || opts.hashAlgo === 'sha1') return ('5 (RSASHA1)'); else if (opts.hashAlgo === 'sha256') return ('8 (RSASHA256)'); else if (opts.hashAlgo === 'sha512') return ('10 (RSASHA512)'); else throw (new Error('Unknown or unsupported hash: ' + opts.hashAlgo)); } function writeRSA(key, options) { // if we're missing parts, add them. if (!key.part.dmodp || !key.part.dmodq) { utils.addRSAMissing(key); } var out = ''; out += 'Private-key-format: v1.3\n'; out += 'Algorithm: ' + rsaAlgFromOptions(options) + '\n'; var n = utils.mpDenormalize(key.part['n'].data); out += 'Modulus: ' + n.toString('base64') + '\n'; var e = utils.mpDenormalize(key.part['e'].data); out += 'PublicExponent: ' + e.toString('base64') + '\n'; var d = utils.mpDenormalize(key.part['d'].data); out += 'PrivateExponent: ' + d.toString('base64') + '\n'; var p = utils.mpDenormalize(key.part['p'].data); out += 'Prime1: ' + p.toString('base64') + '\n'; var q = utils.mpDenormalize(key.part['q'].data); out += 'Prime2: ' + q.toString('base64') + '\n'; var dmodp = utils.mpDenormalize(key.part['dmodp'].data); out += 'Exponent1: ' + dmodp.toString('base64') + '\n'; var dmodq = utils.mpDenormalize(key.part['dmodq'].data); out += 'Exponent2: ' + dmodq.toString('base64') + '\n'; var iqmp = utils.mpDenormalize(key.part['iqmp'].data); out += 'Coefficient: ' + iqmp.toString('base64') + '\n'; // Assume that we're valid as-of now var timestamp = new Date(); out += 'Created: ' + dnssecTimestamp(timestamp) + '\n'; out += 'Publish: ' + dnssecTimestamp(timestamp) + '\n'; out += 'Activate: ' + dnssecTimestamp(timestamp) + '\n'; return (Buffer.from(out, 'ascii')); } function writeECDSA(key, options) { var out = ''; out += 'Private-key-format: v1.3\n'; if (key.curve === 'nistp256') { out += 'Algorithm: 13 (ECDSAP256SHA256)\n'; } else if (key.curve === 'nistp384') { out += 'Algorithm: 14 (ECDSAP384SHA384)\n'; } else { throw (new Error('Unsupported curve')); } var base64Key = key.part['d'].data.toString('base64'); out += 'PrivateKey: ' + base64Key + '\n'; // Assume that we're valid as-of now var timestamp = new Date(); out += 'Created: ' + dnssecTimestamp(timestamp) + '\n'; out += 'Publish: ' + dnssecTimestamp(timestamp) + '\n'; out += 'Activate: ' + dnssecTimestamp(timestamp) + '\n'; return (Buffer.from(out, 'ascii')); } function write(key, options) { if (PrivateKey.isPrivateKey(key)) { if (key.type === 'rsa') { return (writeRSA(key, options)); } else if (key.type === 'ecdsa') { return (writeECDSA(key, options)); } else { throw (new Error('Unsupported algorithm: ' + key.type)); } } else if (Key.isKey(key)) { /* * RFC3110 requires a keyname, and a keytype, which we * don't really have a mechanism for specifying such * additional metadata. */ throw (new Error('Format "dnssec" only supports ' + 'writing private keys')); } else { throw (new Error('key is not a Key or PrivateKey')); } } /***/ }), /***/ 94033: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { // Copyright 2017 Joyent, Inc. module.exports = { read: read, verify: verify, sign: sign, signAsync: signAsync, write: write, /* Internal private API */ fromBuffer: fromBuffer, toBuffer: toBuffer }; var assert = __webpack_require__(66631); var SSHBuffer = __webpack_require__(25621); var crypto = __webpack_require__(33373); var Buffer = __webpack_require__(15118).Buffer; var algs = __webpack_require__(66126); var Key = __webpack_require__(36814); var PrivateKey = __webpack_require__(29602); var Identity = __webpack_require__(70508); var rfc4253 = __webpack_require__(88688); var Signature = __webpack_require__(91394); var utils = __webpack_require__(80575); var Certificate = __webpack_require__(7406); function verify(cert, key) { /* * We always give an issuerKey, so if our verify() is being called then * there was no signature. Return false. */ return (false); } var TYPES = { 'user': 1, 'host': 2 }; Object.keys(TYPES).forEach(function (k) { TYPES[TYPES[k]] = k; }); var ECDSA_ALGO = /^ecdsa-sha2-([^@-]+)-cert-v01@openssh.com$/; function read(buf, options) { if (Buffer.isBuffer(buf)) buf = buf.toString('ascii'); var parts = buf.trim().split(/[ \t\n]+/g); if (parts.length < 2 || parts.length > 3) throw (new Error('Not a valid SSH certificate line')); var algo = parts[0]; var data = parts[1]; data = Buffer.from(data, 'base64'); return (fromBuffer(data, algo)); } function fromBuffer(data, algo, partial) { var sshbuf = new SSHBuffer({ buffer: data }); var innerAlgo = sshbuf.readString(); if (algo !== undefined && innerAlgo !== algo) throw (new Error('SSH certificate algorithm mismatch')); if (algo === undefined) algo = innerAlgo; var cert = {}; cert.signatures = {}; cert.signatures.openssh = {}; cert.signatures.openssh.nonce = sshbuf.readBuffer(); var key = {}; var parts = (key.parts = []); key.type = getAlg(algo); var partCount = algs.info[key.type].parts.length; while (parts.length < partCount) parts.push(sshbuf.readPart()); assert.ok(parts.length >= 1, 'key must have at least one part'); var algInfo = algs.info[key.type]; if (key.type === 'ecdsa') { var res = ECDSA_ALGO.exec(algo); assert.ok(res !== null); assert.strictEqual(res[1], parts[0].data.toString()); } for (var i = 0; i < algInfo.parts.length; ++i) { parts[i].name = algInfo.parts[i]; if (parts[i].name !== 'curve' && algInfo.normalize !== false) { var p = parts[i]; p.data = utils.mpNormalize(p.data); } } cert.subjectKey = new Key(key); cert.serial = sshbuf.readInt64(); var type = TYPES[sshbuf.readInt()]; assert.string(type, 'valid cert type'); cert.signatures.openssh.keyId = sshbuf.readString(); var principals = []; var pbuf = sshbuf.readBuffer(); var psshbuf = new SSHBuffer({ buffer: pbuf }); while (!psshbuf.atEnd()) principals.push(psshbuf.readString()); if (principals.length === 0) principals = ['*']; cert.subjects = principals.map(function (pr) { if (type === 'user') return (Identity.forUser(pr)); else if (type === 'host') return (Identity.forHost(pr)); throw (new Error('Unknown identity type ' + type)); }); cert.validFrom = int64ToDate(sshbuf.readInt64()); cert.validUntil = int64ToDate(sshbuf.readInt64()); var exts = []; var extbuf = new SSHBuffer({ buffer: sshbuf.readBuffer() }); var ext; while (!extbuf.atEnd()) { ext = { critical: true }; ext.name = extbuf.readString(); ext.data = extbuf.readBuffer(); exts.push(ext); } extbuf = new SSHBuffer({ buffer: sshbuf.readBuffer() }); while (!extbuf.atEnd()) { ext = { critical: false }; ext.name = extbuf.readString(); ext.data = extbuf.readBuffer(); exts.push(ext); } cert.signatures.openssh.exts = exts; /* reserved */ sshbuf.readBuffer(); var signingKeyBuf = sshbuf.readBuffer(); cert.issuerKey = rfc4253.read(signingKeyBuf); /* * OpenSSH certs don't give the identity of the issuer, just their * public key. So, we use an Identity that matches anything. The * isSignedBy() function will later tell you if the key matches. */ cert.issuer = Identity.forHost('**'); var sigBuf = sshbuf.readBuffer(); cert.signatures.openssh.signature = Signature.parse(sigBuf, cert.issuerKey.type, 'ssh'); if (partial !== undefined) { partial.remainder = sshbuf.remainder(); partial.consumed = sshbuf._offset; } return (new Certificate(cert)); } function int64ToDate(buf) { var i = buf.readUInt32BE(0) * 4294967296; i += buf.readUInt32BE(4); var d = new Date(); d.setTime(i * 1000); d.sourceInt64 = buf; return (d); } function dateToInt64(date) { if (date.sourceInt64 !== undefined) return (date.sourceInt64); var i = Math.round(date.getTime() / 1000); var upper = Math.floor(i / 4294967296); var lower = Math.floor(i % 4294967296); var buf = Buffer.alloc(8); buf.writeUInt32BE(upper, 0); buf.writeUInt32BE(lower, 4); return (buf); } function sign(cert, key) { if (cert.signatures.openssh === undefined) cert.signatures.openssh = {}; try { var blob = toBuffer(cert, true); } catch (e) { delete (cert.signatures.openssh); return (false); } var sig = cert.signatures.openssh; var hashAlgo = undefined; if (key.type === 'rsa' || key.type === 'dsa') hashAlgo = 'sha1'; var signer = key.createSign(hashAlgo); signer.write(blob); sig.signature = signer.sign(); return (true); } function signAsync(cert, signer, done) { if (cert.signatures.openssh === undefined) cert.signatures.openssh = {}; try { var blob = toBuffer(cert, true); } catch (e) { delete (cert.signatures.openssh); done(e); return; } var sig = cert.signatures.openssh; signer(blob, function (err, signature) { if (err) { done(err); return; } try { /* * This will throw if the signature isn't of a * type/algo that can be used for SSH. */ signature.toBuffer('ssh'); } catch (e) { done(e); return; } sig.signature = signature; done(); }); } function write(cert, options) { if (options === undefined) options = {}; var blob = toBuffer(cert); var out = getCertType(cert.subjectKey) + ' ' + blob.toString('base64'); if (options.comment) out = out + ' ' + options.comment; return (out); } function toBuffer(cert, noSig) { assert.object(cert.signatures.openssh, 'signature for openssh format'); var sig = cert.signatures.openssh; if (sig.nonce === undefined) sig.nonce = crypto.randomBytes(16); var buf = new SSHBuffer({}); buf.writeString(getCertType(cert.subjectKey)); buf.writeBuffer(sig.nonce); var key = cert.subjectKey; var algInfo = algs.info[key.type]; algInfo.parts.forEach(function (part) { buf.writePart(key.part[part]); }); buf.writeInt64(cert.serial); var type = cert.subjects[0].type; assert.notStrictEqual(type, 'unknown'); cert.subjects.forEach(function (id) { assert.strictEqual(id.type, type); }); type = TYPES[type]; buf.writeInt(type); if (sig.keyId === undefined) { sig.keyId = cert.subjects[0].type + '_' + (cert.subjects[0].uid || cert.subjects[0].hostname); } buf.writeString(sig.keyId); var sub = new SSHBuffer({}); cert.subjects.forEach(function (id) { if (type === TYPES.host) sub.writeString(id.hostname); else if (type === TYPES.user) sub.writeString(id.uid); }); buf.writeBuffer(sub.toBuffer()); buf.writeInt64(dateToInt64(cert.validFrom)); buf.writeInt64(dateToInt64(cert.validUntil)); var exts = sig.exts; if (exts === undefined) exts = []; var extbuf = new SSHBuffer({}); exts.forEach(function (ext) { if (ext.critical !== true) return; extbuf.writeString(ext.name); extbuf.writeBuffer(ext.data); }); buf.writeBuffer(extbuf.toBuffer()); extbuf = new SSHBuffer({}); exts.forEach(function (ext) { if (ext.critical === true) return; extbuf.writeString(ext.name); extbuf.writeBuffer(ext.data); }); buf.writeBuffer(extbuf.toBuffer()); /* reserved */ buf.writeBuffer(Buffer.alloc(0)); sub = rfc4253.write(cert.issuerKey); buf.writeBuffer(sub); if (!noSig) buf.writeBuffer(sig.signature.toBuffer('ssh')); return (buf.toBuffer()); } function getAlg(certType) { if (certType === 'ssh-rsa-cert-v01@openssh.com') return ('rsa'); if (certType === 'ssh-dss-cert-v01@openssh.com') return ('dsa'); if (certType.match(ECDSA_ALGO)) return ('ecdsa'); if (certType === 'ssh-ed25519-cert-v01@openssh.com') return ('ed25519'); throw (new Error('Unsupported cert type ' + certType)); } function getCertType(key) { if (key.type === 'rsa') return ('ssh-rsa-cert-v01@openssh.com'); if (key.type === 'dsa') return ('ssh-dss-cert-v01@openssh.com'); if (key.type === 'ecdsa') return ('ecdsa-sha2-' + key.curve + '-cert-v01@openssh.com'); if (key.type === 'ed25519') return ('ssh-ed25519-cert-v01@openssh.com'); throw (new Error('Unsupported key type ' + key.type)); } /***/ }), /***/ 14324: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { // Copyright 2018 Joyent, Inc. module.exports = { read: read, write: write }; var assert = __webpack_require__(66631); var asn1 = __webpack_require__(80970); var crypto = __webpack_require__(33373); var Buffer = __webpack_require__(15118).Buffer; var algs = __webpack_require__(66126); var utils = __webpack_require__(80575); var Key = __webpack_require__(36814); var PrivateKey = __webpack_require__(29602); var pkcs1 = __webpack_require__(69367); var pkcs8 = __webpack_require__(4173); var sshpriv = __webpack_require__(3923); var rfc4253 = __webpack_require__(88688); var errors = __webpack_require__(27979); var OID_PBES2 = '1.2.840.113549.1.5.13'; var OID_PBKDF2 = '1.2.840.113549.1.5.12'; var OID_TO_CIPHER = { '1.2.840.113549.3.7': '3des-cbc', '2.16.840.1.101.3.4.1.2': 'aes128-cbc', '2.16.840.1.101.3.4.1.42': 'aes256-cbc' }; var CIPHER_TO_OID = {}; Object.keys(OID_TO_CIPHER).forEach(function (k) { CIPHER_TO_OID[OID_TO_CIPHER[k]] = k; }); var OID_TO_HASH = { '1.2.840.113549.2.7': 'sha1', '1.2.840.113549.2.9': 'sha256', '1.2.840.113549.2.11': 'sha512' }; var HASH_TO_OID = {}; Object.keys(OID_TO_HASH).forEach(function (k) { HASH_TO_OID[OID_TO_HASH[k]] = k; }); /* * For reading we support both PKCS#1 and PKCS#8. If we find a private key, * we just take the public component of it and use that. */ function read(buf, options, forceType) { var input = buf; if (typeof (buf) !== 'string') { assert.buffer(buf, 'buf'); buf = buf.toString('ascii'); } var lines = buf.trim().split(/[\r\n]+/g); var m; var si = -1; while (!m && si < lines.length) { m = lines[++si].match(/*JSSTYLED*/ /[-]+[ ]*BEGIN ([A-Z0-9][A-Za-z0-9]+ )?(PUBLIC|PRIVATE) KEY[ ]*[-]+/); } assert.ok(m, 'invalid PEM header'); var m2; var ei = lines.length; while (!m2 && ei > 0) { m2 = lines[--ei].match(/*JSSTYLED*/ /[-]+[ ]*END ([A-Z0-9][A-Za-z0-9]+ )?(PUBLIC|PRIVATE) KEY[ ]*[-]+/); } assert.ok(m2, 'invalid PEM footer'); /* Begin and end banners must match key type */ assert.equal(m[2], m2[2]); var type = m[2].toLowerCase(); var alg; if (m[1]) { /* They also must match algorithms, if given */ assert.equal(m[1], m2[1], 'PEM header and footer mismatch'); alg = m[1].trim(); } lines = lines.slice(si, ei + 1); var headers = {}; while (true) { lines = lines.slice(1); m = lines[0].match(/*JSSTYLED*/ /^([A-Za-z0-9-]+): (.+)$/); if (!m) break; headers[m[1].toLowerCase()] = m[2]; } /* Chop off the first and last lines */ lines = lines.slice(0, -1).join(''); buf = Buffer.from(lines, 'base64'); var cipher, key, iv; if (headers['proc-type']) { var parts = headers['proc-type'].split(','); if (parts[0] === '4' && parts[1] === 'ENCRYPTED') { if (typeof (options.passphrase) === 'string') { options.passphrase = Buffer.from( options.passphrase, 'utf-8'); } if (!Buffer.isBuffer(options.passphrase)) { throw (new errors.KeyEncryptedError( options.filename, 'PEM')); } else { parts = headers['dek-info'].split(','); assert.ok(parts.length === 2); cipher = parts[0].toLowerCase(); iv = Buffer.from(parts[1], 'hex'); key = utils.opensslKeyDeriv(cipher, iv, options.passphrase, 1).key; } } } if (alg && alg.toLowerCase() === 'encrypted') { var eder = new asn1.BerReader(buf); var pbesEnd; eder.readSequence(); eder.readSequence(); pbesEnd = eder.offset + eder.length; var method = eder.readOID(); if (method !== OID_PBES2) { throw (new Error('Unsupported PEM/PKCS8 encryption ' + 'scheme: ' + method)); } eder.readSequence(); /* PBES2-params */ eder.readSequence(); /* keyDerivationFunc */ var kdfEnd = eder.offset + eder.length; var kdfOid = eder.readOID(); if (kdfOid !== OID_PBKDF2) throw (new Error('Unsupported PBES2 KDF: ' + kdfOid)); eder.readSequence(); var salt = eder.readString(asn1.Ber.OctetString, true); var iterations = eder.readInt(); var hashAlg = 'sha1'; if (eder.offset < kdfEnd) { eder.readSequence(); var hashAlgOid = eder.readOID(); hashAlg = OID_TO_HASH[hashAlgOid]; if (hashAlg === undefined) { throw (new Error('Unsupported PBKDF2 hash: ' + hashAlgOid)); } } eder._offset = kdfEnd; eder.readSequence(); /* encryptionScheme */ var cipherOid = eder.readOID(); cipher = OID_TO_CIPHER[cipherOid]; if (cipher === undefined) { throw (new Error('Unsupported PBES2 cipher: ' + cipherOid)); } iv = eder.readString(asn1.Ber.OctetString, true); eder._offset = pbesEnd; buf = eder.readString(asn1.Ber.OctetString, true); if (typeof (options.passphrase) === 'string') { options.passphrase = Buffer.from( options.passphrase, 'utf-8'); } if (!Buffer.isBuffer(options.passphrase)) { throw (new errors.KeyEncryptedError( options.filename, 'PEM')); } var cinfo = utils.opensshCipherInfo(cipher); cipher = cinfo.opensslName; key = utils.pbkdf2(hashAlg, salt, iterations, cinfo.keySize, options.passphrase); alg = undefined; } if (cipher && key && iv) { var cipherStream = crypto.createDecipheriv(cipher, key, iv); var chunk, chunks = []; cipherStream.once('error', function (e) { if (e.toString().indexOf('bad decrypt') !== -1) { throw (new Error('Incorrect passphrase ' + 'supplied, could not decrypt key')); } throw (e); }); cipherStream.write(buf); cipherStream.end(); while ((chunk = cipherStream.read()) !== null) chunks.push(chunk); buf = Buffer.concat(chunks); } /* The new OpenSSH internal format abuses PEM headers */ if (alg && alg.toLowerCase() === 'openssh') return (sshpriv.readSSHPrivate(type, buf, options)); if (alg && alg.toLowerCase() === 'ssh2') return (rfc4253.readType(type, buf, options)); var der = new asn1.BerReader(buf); der.originalInput = input; /* * All of the PEM file types start with a sequence tag, so chop it * off here */ der.readSequence(); /* PKCS#1 type keys name an algorithm in the banner explicitly */ if (alg) { if (forceType) assert.strictEqual(forceType, 'pkcs1'); return (pkcs1.readPkcs1(alg, type, der)); } else { if (forceType) assert.strictEqual(forceType, 'pkcs8'); return (pkcs8.readPkcs8(alg, type, der)); } } function write(key, options, type) { assert.object(key); var alg = { 'ecdsa': 'EC', 'rsa': 'RSA', 'dsa': 'DSA', 'ed25519': 'EdDSA' }[key.type]; var header; var der = new asn1.BerWriter(); if (PrivateKey.isPrivateKey(key)) { if (type && type === 'pkcs8') { header = 'PRIVATE KEY'; pkcs8.writePkcs8(der, key); } else { if (type) assert.strictEqual(type, 'pkcs1'); header = alg + ' PRIVATE KEY'; pkcs1.writePkcs1(der, key); } } else if (Key.isKey(key)) { if (type && type === 'pkcs1') { header = alg + ' PUBLIC KEY'; pkcs1.writePkcs1(der, key); } else { if (type) assert.strictEqual(type, 'pkcs8'); header = 'PUBLIC KEY'; pkcs8.writePkcs8(der, key); } } else { throw (new Error('key is not a Key or PrivateKey')); } var tmp = der.buffer.toString('base64'); var len = tmp.length + (tmp.length / 64) + 18 + 16 + header.length*2 + 10; var buf = Buffer.alloc(len); var o = 0; o += buf.write('-----BEGIN ' + header + '-----\n', o); for (var i = 0; i < tmp.length; ) { var limit = i + 64; if (limit > tmp.length) limit = tmp.length; o += buf.write(tmp.slice(i, limit), o); buf[o++] = 10; i = limit; } o += buf.write('-----END ' + header + '-----\n', o); return (buf.slice(0, o)); } /***/ }), /***/ 69367: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { // Copyright 2015 Joyent, Inc. module.exports = { read: read, readPkcs1: readPkcs1, write: write, writePkcs1: writePkcs1 }; var assert = __webpack_require__(66631); var asn1 = __webpack_require__(80970); var Buffer = __webpack_require__(15118).Buffer; var algs = __webpack_require__(66126); var utils = __webpack_require__(80575); var Key = __webpack_require__(36814); var PrivateKey = __webpack_require__(29602); var pem = __webpack_require__(14324); var pkcs8 = __webpack_require__(4173); var readECDSACurve = pkcs8.readECDSACurve; function read(buf, options) { return (pem.read(buf, options, 'pkcs1')); } function write(key, options) { return (pem.write(key, options, 'pkcs1')); } /* Helper to read in a single mpint */ function readMPInt(der, nm) { assert.strictEqual(der.peek(), asn1.Ber.Integer, nm + ' is not an Integer'); return (utils.mpNormalize(der.readString(asn1.Ber.Integer, true))); } function readPkcs1(alg, type, der) { switch (alg) { case 'RSA': if (type === 'public') return (readPkcs1RSAPublic(der)); else if (type === 'private') return (readPkcs1RSAPrivate(der)); throw (new Error('Unknown key type: ' + type)); case 'DSA': if (type === 'public') return (readPkcs1DSAPublic(der)); else if (type === 'private') return (readPkcs1DSAPrivate(der)); throw (new Error('Unknown key type: ' + type)); case 'EC': case 'ECDSA': if (type === 'private') return (readPkcs1ECDSAPrivate(der)); else if (type === 'public') return (readPkcs1ECDSAPublic(der)); throw (new Error('Unknown key type: ' + type)); case 'EDDSA': case 'EdDSA': if (type === 'private') return (readPkcs1EdDSAPrivate(der)); throw (new Error(type + ' keys not supported with EdDSA')); default: throw (new Error('Unknown key algo: ' + alg)); } } function readPkcs1RSAPublic(der) { // modulus and exponent var n = readMPInt(der, 'modulus'); var e = readMPInt(der, 'exponent'); // now, make the key var key = { type: 'rsa', parts: [ { name: 'e', data: e }, { name: 'n', data: n } ] }; return (new Key(key)); } function readPkcs1RSAPrivate(der) { var version = readMPInt(der, 'version'); assert.strictEqual(version[0], 0); // modulus then public exponent var n = readMPInt(der, 'modulus'); var e = readMPInt(der, 'public exponent'); var d = readMPInt(der, 'private exponent'); var p = readMPInt(der, 'prime1'); var q = readMPInt(der, 'prime2'); var dmodp = readMPInt(der, 'exponent1'); var dmodq = readMPInt(der, 'exponent2'); var iqmp = readMPInt(der, 'iqmp'); // now, make the key var key = { type: 'rsa', parts: [ { name: 'n', data: n }, { name: 'e', data: e }, { name: 'd', data: d }, { name: 'iqmp', data: iqmp }, { name: 'p', data: p }, { name: 'q', data: q }, { name: 'dmodp', data: dmodp }, { name: 'dmodq', data: dmodq } ] }; return (new PrivateKey(key)); } function readPkcs1DSAPrivate(der) { var version = readMPInt(der, 'version'); assert.strictEqual(version.readUInt8(0), 0); var p = readMPInt(der, 'p'); var q = readMPInt(der, 'q'); var g = readMPInt(der, 'g'); var y = readMPInt(der, 'y'); var x = readMPInt(der, 'x'); // now, make the key var key = { type: 'dsa', parts: [ { name: 'p', data: p }, { name: 'q', data: q }, { name: 'g', data: g }, { name: 'y', data: y }, { name: 'x', data: x } ] }; return (new PrivateKey(key)); } function readPkcs1EdDSAPrivate(der) { var version = readMPInt(der, 'version'); assert.strictEqual(version.readUInt8(0), 1); // private key var k = der.readString(asn1.Ber.OctetString, true); der.readSequence(0xa0); var oid = der.readOID(); assert.strictEqual(oid, '1.3.101.112', 'the ed25519 curve identifier'); der.readSequence(0xa1); var A = utils.readBitString(der); var key = { type: 'ed25519', parts: [ { name: 'A', data: utils.zeroPadToLength(A, 32) }, { name: 'k', data: k } ] }; return (new PrivateKey(key)); } function readPkcs1DSAPublic(der) { var y = readMPInt(der, 'y'); var p = readMPInt(der, 'p'); var q = readMPInt(der, 'q'); var g = readMPInt(der, 'g'); var key = { type: 'dsa', parts: [ { name: 'y', data: y }, { name: 'p', data: p }, { name: 'q', data: q }, { name: 'g', data: g } ] }; return (new Key(key)); } function readPkcs1ECDSAPublic(der) { der.readSequence(); var oid = der.readOID(); assert.strictEqual(oid, '1.2.840.10045.2.1', 'must be ecPublicKey'); var curveOid = der.readOID(); var curve; var curves = Object.keys(algs.curves); for (var j = 0; j < curves.length; ++j) { var c = curves[j]; var cd = algs.curves[c]; if (cd.pkcs8oid === curveOid) { curve = c; break; } } assert.string(curve, 'a known ECDSA named curve'); var Q = der.readString(asn1.Ber.BitString, true); Q = utils.ecNormalize(Q); var key = { type: 'ecdsa', parts: [ { name: 'curve', data: Buffer.from(curve) }, { name: 'Q', data: Q } ] }; return (new Key(key)); } function readPkcs1ECDSAPrivate(der) { var version = readMPInt(der, 'version'); assert.strictEqual(version.readUInt8(0), 1); // private key var d = der.readString(asn1.Ber.OctetString, true); der.readSequence(0xa0); var curve = readECDSACurve(der); assert.string(curve, 'a known elliptic curve'); der.readSequence(0xa1); var Q = der.readString(asn1.Ber.BitString, true); Q = utils.ecNormalize(Q); var key = { type: 'ecdsa', parts: [ { name: 'curve', data: Buffer.from(curve) }, { name: 'Q', data: Q }, { name: 'd', data: d } ] }; return (new PrivateKey(key)); } function writePkcs1(der, key) { der.startSequence(); switch (key.type) { case 'rsa': if (PrivateKey.isPrivateKey(key)) writePkcs1RSAPrivate(der, key); else writePkcs1RSAPublic(der, key); break; case 'dsa': if (PrivateKey.isPrivateKey(key)) writePkcs1DSAPrivate(der, key); else writePkcs1DSAPublic(der, key); break; case 'ecdsa': if (PrivateKey.isPrivateKey(key)) writePkcs1ECDSAPrivate(der, key); else writePkcs1ECDSAPublic(der, key); break; case 'ed25519': if (PrivateKey.isPrivateKey(key)) writePkcs1EdDSAPrivate(der, key); else writePkcs1EdDSAPublic(der, key); break; default: throw (new Error('Unknown key algo: ' + key.type)); } der.endSequence(); } function writePkcs1RSAPublic(der, key) { der.writeBuffer(key.part.n.data, asn1.Ber.Integer); der.writeBuffer(key.part.e.data, asn1.Ber.Integer); } function writePkcs1RSAPrivate(der, key) { var ver = Buffer.from([0]); der.writeBuffer(ver, asn1.Ber.Integer); der.writeBuffer(key.part.n.data, asn1.Ber.Integer); der.writeBuffer(key.part.e.data, asn1.Ber.Integer); der.writeBuffer(key.part.d.data, asn1.Ber.Integer); der.writeBuffer(key.part.p.data, asn1.Ber.Integer); der.writeBuffer(key.part.q.data, asn1.Ber.Integer); if (!key.part.dmodp || !key.part.dmodq) utils.addRSAMissing(key); der.writeBuffer(key.part.dmodp.data, asn1.Ber.Integer); der.writeBuffer(key.part.dmodq.data, asn1.Ber.Integer); der.writeBuffer(key.part.iqmp.data, asn1.Ber.Integer); } function writePkcs1DSAPrivate(der, key) { var ver = Buffer.from([0]); der.writeBuffer(ver, asn1.Ber.Integer); der.writeBuffer(key.part.p.data, asn1.Ber.Integer); der.writeBuffer(key.part.q.data, asn1.Ber.Integer); der.writeBuffer(key.part.g.data, asn1.Ber.Integer); der.writeBuffer(key.part.y.data, asn1.Ber.Integer); der.writeBuffer(key.part.x.data, asn1.Ber.Integer); } function writePkcs1DSAPublic(der, key) { der.writeBuffer(key.part.y.data, asn1.Ber.Integer); der.writeBuffer(key.part.p.data, asn1.Ber.Integer); der.writeBuffer(key.part.q.data, asn1.Ber.Integer); der.writeBuffer(key.part.g.data, asn1.Ber.Integer); } function writePkcs1ECDSAPublic(der, key) { der.startSequence(); der.writeOID('1.2.840.10045.2.1'); /* ecPublicKey */ var curve = key.part.curve.data.toString(); var curveOid = algs.curves[curve].pkcs8oid; assert.string(curveOid, 'a known ECDSA named curve'); der.writeOID(curveOid); der.endSequence(); var Q = utils.ecNormalize(key.part.Q.data, true); der.writeBuffer(Q, asn1.Ber.BitString); } function writePkcs1ECDSAPrivate(der, key) { var ver = Buffer.from([1]); der.writeBuffer(ver, asn1.Ber.Integer); der.writeBuffer(key.part.d.data, asn1.Ber.OctetString); der.startSequence(0xa0); var curve = key.part.curve.data.toString(); var curveOid = algs.curves[curve].pkcs8oid; assert.string(curveOid, 'a known ECDSA named curve'); der.writeOID(curveOid); der.endSequence(); der.startSequence(0xa1); var Q = utils.ecNormalize(key.part.Q.data, true); der.writeBuffer(Q, asn1.Ber.BitString); der.endSequence(); } function writePkcs1EdDSAPrivate(der, key) { var ver = Buffer.from([1]); der.writeBuffer(ver, asn1.Ber.Integer); der.writeBuffer(key.part.k.data, asn1.Ber.OctetString); der.startSequence(0xa0); der.writeOID('1.3.101.112'); der.endSequence(); der.startSequence(0xa1); utils.writeBitString(der, key.part.A.data); der.endSequence(); } function writePkcs1EdDSAPublic(der, key) { throw (new Error('Public keys are not supported for EdDSA PKCS#1')); } /***/ }), /***/ 4173: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { // Copyright 2018 Joyent, Inc. module.exports = { read: read, readPkcs8: readPkcs8, write: write, writePkcs8: writePkcs8, pkcs8ToBuffer: pkcs8ToBuffer, readECDSACurve: readECDSACurve, writeECDSACurve: writeECDSACurve }; var assert = __webpack_require__(66631); var asn1 = __webpack_require__(80970); var Buffer = __webpack_require__(15118).Buffer; var algs = __webpack_require__(66126); var utils = __webpack_require__(80575); var Key = __webpack_require__(36814); var PrivateKey = __webpack_require__(29602); var pem = __webpack_require__(14324); function read(buf, options) { return (pem.read(buf, options, 'pkcs8')); } function write(key, options) { return (pem.write(key, options, 'pkcs8')); } /* Helper to read in a single mpint */ function readMPInt(der, nm) { assert.strictEqual(der.peek(), asn1.Ber.Integer, nm + ' is not an Integer'); return (utils.mpNormalize(der.readString(asn1.Ber.Integer, true))); } function readPkcs8(alg, type, der) { /* Private keys in pkcs#8 format have a weird extra int */ if (der.peek() === asn1.Ber.Integer) { assert.strictEqual(type, 'private', 'unexpected Integer at start of public key'); der.readString(asn1.Ber.Integer, true); } der.readSequence(); var next = der.offset + der.length; var oid = der.readOID(); switch (oid) { case '1.2.840.113549.1.1.1': der._offset = next; if (type === 'public') return (readPkcs8RSAPublic(der)); else return (readPkcs8RSAPrivate(der)); case '1.2.840.10040.4.1': if (type === 'public') return (readPkcs8DSAPublic(der)); else return (readPkcs8DSAPrivate(der)); case '1.2.840.10045.2.1': if (type === 'public') return (readPkcs8ECDSAPublic(der)); else return (readPkcs8ECDSAPrivate(der)); case '1.3.101.112': if (type === 'public') { return (readPkcs8EdDSAPublic(der)); } else { return (readPkcs8EdDSAPrivate(der)); } case '1.3.101.110': if (type === 'public') { return (readPkcs8X25519Public(der)); } else { return (readPkcs8X25519Private(der)); } default: throw (new Error('Unknown key type OID ' + oid)); } } function readPkcs8RSAPublic(der) { // bit string sequence der.readSequence(asn1.Ber.BitString); der.readByte(); der.readSequence(); // modulus var n = readMPInt(der, 'modulus'); var e = readMPInt(der, 'exponent'); // now, make the key var key = { type: 'rsa', source: der.originalInput, parts: [ { name: 'e', data: e }, { name: 'n', data: n } ] }; return (new Key(key)); } function readPkcs8RSAPrivate(der) { der.readSequence(asn1.Ber.OctetString); der.readSequence(); var ver = readMPInt(der, 'version'); assert.equal(ver[0], 0x0, 'unknown RSA private key version'); // modulus then public exponent var n = readMPInt(der, 'modulus'); var e = readMPInt(der, 'public exponent'); var d = readMPInt(der, 'private exponent'); var p = readMPInt(der, 'prime1'); var q = readMPInt(der, 'prime2'); var dmodp = readMPInt(der, 'exponent1'); var dmodq = readMPInt(der, 'exponent2'); var iqmp = readMPInt(der, 'iqmp'); // now, make the key var key = { type: 'rsa', parts: [ { name: 'n', data: n }, { name: 'e', data: e }, { name: 'd', data: d }, { name: 'iqmp', data: iqmp }, { name: 'p', data: p }, { name: 'q', data: q }, { name: 'dmodp', data: dmodp }, { name: 'dmodq', data: dmodq } ] }; return (new PrivateKey(key)); } function readPkcs8DSAPublic(der) { der.readSequence(); var p = readMPInt(der, 'p'); var q = readMPInt(der, 'q'); var g = readMPInt(der, 'g'); // bit string sequence der.readSequence(asn1.Ber.BitString); der.readByte(); var y = readMPInt(der, 'y'); // now, make the key var key = { type: 'dsa', parts: [ { name: 'p', data: p }, { name: 'q', data: q }, { name: 'g', data: g }, { name: 'y', data: y } ] }; return (new Key(key)); } function readPkcs8DSAPrivate(der) { der.readSequence(); var p = readMPInt(der, 'p'); var q = readMPInt(der, 'q'); var g = readMPInt(der, 'g'); der.readSequence(asn1.Ber.OctetString); var x = readMPInt(der, 'x'); /* The pkcs#8 format does not include the public key */ var y = utils.calculateDSAPublic(g, p, x); var key = { type: 'dsa', parts: [ { name: 'p', data: p }, { name: 'q', data: q }, { name: 'g', data: g }, { name: 'y', data: y }, { name: 'x', data: x } ] }; return (new PrivateKey(key)); } function readECDSACurve(der) { var curveName, curveNames; var j, c, cd; if (der.peek() === asn1.Ber.OID) { var oid = der.readOID(); curveNames = Object.keys(algs.curves); for (j = 0; j < curveNames.length; ++j) { c = curveNames[j]; cd = algs.curves[c]; if (cd.pkcs8oid === oid) { curveName = c; break; } } } else { // ECParameters sequence der.readSequence(); var version = der.readString(asn1.Ber.Integer, true); assert.strictEqual(version[0], 1, 'ECDSA key not version 1'); var curve = {}; // FieldID sequence der.readSequence(); var fieldTypeOid = der.readOID(); assert.strictEqual(fieldTypeOid, '1.2.840.10045.1.1', 'ECDSA key is not from a prime-field'); var p = curve.p = utils.mpNormalize( der.readString(asn1.Ber.Integer, true)); /* * p always starts with a 1 bit, so count the zeros to get its * real size. */ curve.size = p.length * 8 - utils.countZeros(p); // Curve sequence der.readSequence(); curve.a = utils.mpNormalize( der.readString(asn1.Ber.OctetString, true)); curve.b = utils.mpNormalize( der.readString(asn1.Ber.OctetString, true)); if (der.peek() === asn1.Ber.BitString) curve.s = der.readString(asn1.Ber.BitString, true); // Combined Gx and Gy curve.G = der.readString(asn1.Ber.OctetString, true); assert.strictEqual(curve.G[0], 0x4, 'uncompressed G is required'); curve.n = utils.mpNormalize( der.readString(asn1.Ber.Integer, true)); curve.h = utils.mpNormalize( der.readString(asn1.Ber.Integer, true)); assert.strictEqual(curve.h[0], 0x1, 'a cofactor=1 curve is ' + 'required'); curveNames = Object.keys(algs.curves); var ks = Object.keys(curve); for (j = 0; j < curveNames.length; ++j) { c = curveNames[j]; cd = algs.curves[c]; var equal = true; for (var i = 0; i < ks.length; ++i) { var k = ks[i]; if (cd[k] === undefined) continue; if (typeof (cd[k]) === 'object' && cd[k].equals !== undefined) { if (!cd[k].equals(curve[k])) { equal = false; break; } } else if (Buffer.isBuffer(cd[k])) { if (cd[k].toString('binary') !== curve[k].toString('binary')) { equal = false; break; } } else { if (cd[k] !== curve[k]) { equal = false; break; } } } if (equal) { curveName = c; break; } } } return (curveName); } function readPkcs8ECDSAPrivate(der) { var curveName = readECDSACurve(der); assert.string(curveName, 'a known elliptic curve'); der.readSequence(asn1.Ber.OctetString); der.readSequence(); var version = readMPInt(der, 'version'); assert.equal(version[0], 1, 'unknown version of ECDSA key'); var d = der.readString(asn1.Ber.OctetString, true); var Q; if (der.peek() == 0xa0) { der.readSequence(0xa0); der._offset += der.length; } if (der.peek() == 0xa1) { der.readSequence(0xa1); Q = der.readString(asn1.Ber.BitString, true); Q = utils.ecNormalize(Q); } if (Q === undefined) { var pub = utils.publicFromPrivateECDSA(curveName, d); Q = pub.part.Q.data; } var key = { type: 'ecdsa', parts: [ { name: 'curve', data: Buffer.from(curveName) }, { name: 'Q', data: Q }, { name: 'd', data: d } ] }; return (new PrivateKey(key)); } function readPkcs8ECDSAPublic(der) { var curveName = readECDSACurve(der); assert.string(curveName, 'a known elliptic curve'); var Q = der.readString(asn1.Ber.BitString, true); Q = utils.ecNormalize(Q); var key = { type: 'ecdsa', parts: [ { name: 'curve', data: Buffer.from(curveName) }, { name: 'Q', data: Q } ] }; return (new Key(key)); } function readPkcs8EdDSAPublic(der) { if (der.peek() === 0x00) der.readByte(); var A = utils.readBitString(der); var key = { type: 'ed25519', parts: [ { name: 'A', data: utils.zeroPadToLength(A, 32) } ] }; return (new Key(key)); } function readPkcs8X25519Public(der) { var A = utils.readBitString(der); var key = { type: 'curve25519', parts: [ { name: 'A', data: utils.zeroPadToLength(A, 32) } ] }; return (new Key(key)); } function readPkcs8EdDSAPrivate(der) { if (der.peek() === 0x00) der.readByte(); der.readSequence(asn1.Ber.OctetString); var k = der.readString(asn1.Ber.OctetString, true); k = utils.zeroPadToLength(k, 32); var A; if (der.peek() === asn1.Ber.BitString) { A = utils.readBitString(der); A = utils.zeroPadToLength(A, 32); } else { A = utils.calculateED25519Public(k); } var key = { type: 'ed25519', parts: [ { name: 'A', data: utils.zeroPadToLength(A, 32) }, { name: 'k', data: utils.zeroPadToLength(k, 32) } ] }; return (new PrivateKey(key)); } function readPkcs8X25519Private(der) { if (der.peek() === 0x00) der.readByte(); der.readSequence(asn1.Ber.OctetString); var k = der.readString(asn1.Ber.OctetString, true); k = utils.zeroPadToLength(k, 32); var A = utils.calculateX25519Public(k); var key = { type: 'curve25519', parts: [ { name: 'A', data: utils.zeroPadToLength(A, 32) }, { name: 'k', data: utils.zeroPadToLength(k, 32) } ] }; return (new PrivateKey(key)); } function pkcs8ToBuffer(key) { var der = new asn1.BerWriter(); writePkcs8(der, key); return (der.buffer); } function writePkcs8(der, key) { der.startSequence(); if (PrivateKey.isPrivateKey(key)) { var sillyInt = Buffer.from([0]); der.writeBuffer(sillyInt, asn1.Ber.Integer); } der.startSequence(); switch (key.type) { case 'rsa': der.writeOID('1.2.840.113549.1.1.1'); if (PrivateKey.isPrivateKey(key)) writePkcs8RSAPrivate(key, der); else writePkcs8RSAPublic(key, der); break; case 'dsa': der.writeOID('1.2.840.10040.4.1'); if (PrivateKey.isPrivateKey(key)) writePkcs8DSAPrivate(key, der); else writePkcs8DSAPublic(key, der); break; case 'ecdsa': der.writeOID('1.2.840.10045.2.1'); if (PrivateKey.isPrivateKey(key)) writePkcs8ECDSAPrivate(key, der); else writePkcs8ECDSAPublic(key, der); break; case 'ed25519': der.writeOID('1.3.101.112'); if (PrivateKey.isPrivateKey(key)) throw (new Error('Ed25519 private keys in pkcs8 ' + 'format are not supported')); writePkcs8EdDSAPublic(key, der); break; default: throw (new Error('Unsupported key type: ' + key.type)); } der.endSequence(); } function writePkcs8RSAPrivate(key, der) { der.writeNull(); der.endSequence(); der.startSequence(asn1.Ber.OctetString); der.startSequence(); var version = Buffer.from([0]); der.writeBuffer(version, asn1.Ber.Integer); der.writeBuffer(key.part.n.data, asn1.Ber.Integer); der.writeBuffer(key.part.e.data, asn1.Ber.Integer); der.writeBuffer(key.part.d.data, asn1.Ber.Integer); der.writeBuffer(key.part.p.data, asn1.Ber.Integer); der.writeBuffer(key.part.q.data, asn1.Ber.Integer); if (!key.part.dmodp || !key.part.dmodq) utils.addRSAMissing(key); der.writeBuffer(key.part.dmodp.data, asn1.Ber.Integer); der.writeBuffer(key.part.dmodq.data, asn1.Ber.Integer); der.writeBuffer(key.part.iqmp.data, asn1.Ber.Integer); der.endSequence(); der.endSequence(); } function writePkcs8RSAPublic(key, der) { der.writeNull(); der.endSequence(); der.startSequence(asn1.Ber.BitString); der.writeByte(0x00); der.startSequence(); der.writeBuffer(key.part.n.data, asn1.Ber.Integer); der.writeBuffer(key.part.e.data, asn1.Ber.Integer); der.endSequence(); der.endSequence(); } function writePkcs8DSAPrivate(key, der) { der.startSequence(); der.writeBuffer(key.part.p.data, asn1.Ber.Integer); der.writeBuffer(key.part.q.data, asn1.Ber.Integer); der.writeBuffer(key.part.g.data, asn1.Ber.Integer); der.endSequence(); der.endSequence(); der.startSequence(asn1.Ber.OctetString); der.writeBuffer(key.part.x.data, asn1.Ber.Integer); der.endSequence(); } function writePkcs8DSAPublic(key, der) { der.startSequence(); der.writeBuffer(key.part.p.data, asn1.Ber.Integer); der.writeBuffer(key.part.q.data, asn1.Ber.Integer); der.writeBuffer(key.part.g.data, asn1.Ber.Integer); der.endSequence(); der.endSequence(); der.startSequence(asn1.Ber.BitString); der.writeByte(0x00); der.writeBuffer(key.part.y.data, asn1.Ber.Integer); der.endSequence(); } function writeECDSACurve(key, der) { var curve = algs.curves[key.curve]; if (curve.pkcs8oid) { /* This one has a name in pkcs#8, so just write the oid */ der.writeOID(curve.pkcs8oid); } else { // ECParameters sequence der.startSequence(); var version = Buffer.from([1]); der.writeBuffer(version, asn1.Ber.Integer); // FieldID sequence der.startSequence(); der.writeOID('1.2.840.10045.1.1'); // prime-field der.writeBuffer(curve.p, asn1.Ber.Integer); der.endSequence(); // Curve sequence der.startSequence(); var a = curve.p; if (a[0] === 0x0) a = a.slice(1); der.writeBuffer(a, asn1.Ber.OctetString); der.writeBuffer(curve.b, asn1.Ber.OctetString); der.writeBuffer(curve.s, asn1.Ber.BitString); der.endSequence(); der.writeBuffer(curve.G, asn1.Ber.OctetString); der.writeBuffer(curve.n, asn1.Ber.Integer); var h = curve.h; if (!h) { h = Buffer.from([1]); } der.writeBuffer(h, asn1.Ber.Integer); // ECParameters der.endSequence(); } } function writePkcs8ECDSAPublic(key, der) { writeECDSACurve(key, der); der.endSequence(); var Q = utils.ecNormalize(key.part.Q.data, true); der.writeBuffer(Q, asn1.Ber.BitString); } function writePkcs8ECDSAPrivate(key, der) { writeECDSACurve(key, der); der.endSequence(); der.startSequence(asn1.Ber.OctetString); der.startSequence(); var version = Buffer.from([1]); der.writeBuffer(version, asn1.Ber.Integer); der.writeBuffer(key.part.d.data, asn1.Ber.OctetString); der.startSequence(0xa1); var Q = utils.ecNormalize(key.part.Q.data, true); der.writeBuffer(Q, asn1.Ber.BitString); der.endSequence(); der.endSequence(); der.endSequence(); } function writePkcs8EdDSAPublic(key, der) { der.endSequence(); utils.writeBitString(der, key.part.A.data); } function writePkcs8EdDSAPrivate(key, der) { der.endSequence(); var k = utils.mpNormalize(key.part.k.data, true); der.startSequence(asn1.Ber.OctetString); der.writeBuffer(k, asn1.Ber.OctetString); der.endSequence(); } /***/ }), /***/ 80974: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { // Copyright 2018 Joyent, Inc. module.exports = { read: read, write: write }; var assert = __webpack_require__(66631); var Buffer = __webpack_require__(15118).Buffer; var rfc4253 = __webpack_require__(88688); var Key = __webpack_require__(36814); var errors = __webpack_require__(27979); function read(buf, options) { var lines = buf.toString('ascii').split(/[\r\n]+/); var found = false; var parts; var si = 0; while (si < lines.length) { parts = splitHeader(lines[si++]); if (parts && parts[0].toLowerCase() === 'putty-user-key-file-2') { found = true; break; } } if (!found) { throw (new Error('No PuTTY format first line found')); } var alg = parts[1]; parts = splitHeader(lines[si++]); assert.equal(parts[0].toLowerCase(), 'encryption'); parts = splitHeader(lines[si++]); assert.equal(parts[0].toLowerCase(), 'comment'); var comment = parts[1]; parts = splitHeader(lines[si++]); assert.equal(parts[0].toLowerCase(), 'public-lines'); var publicLines = parseInt(parts[1], 10); if (!isFinite(publicLines) || publicLines < 0 || publicLines > lines.length) { throw (new Error('Invalid public-lines count')); } var publicBuf = Buffer.from( lines.slice(si, si + publicLines).join(''), 'base64'); var keyType = rfc4253.algToKeyType(alg); var key = rfc4253.read(publicBuf); if (key.type !== keyType) { throw (new Error('Outer key algorithm mismatch')); } key.comment = comment; return (key); } function splitHeader(line) { var idx = line.indexOf(':'); if (idx === -1) return (null); var header = line.slice(0, idx); ++idx; while (line[idx] === ' ') ++idx; var rest = line.slice(idx); return ([header, rest]); } function write(key, options) { assert.object(key); if (!Key.isKey(key)) throw (new Error('Must be a public key')); var alg = rfc4253.keyTypeToAlg(key); var buf = rfc4253.write(key); var comment = key.comment || ''; var b64 = buf.toString('base64'); var lines = wrap(b64, 64); lines.unshift('Public-Lines: ' + lines.length); lines.unshift('Comment: ' + comment); lines.unshift('Encryption: none'); lines.unshift('PuTTY-User-Key-File-2: ' + alg); return (Buffer.from(lines.join('\n') + '\n')); } function wrap(txt, len) { var lines = []; var pos = 0; while (pos < txt.length) { lines.push(txt.slice(pos, pos + 64)); pos += 64; } return (lines); } /***/ }), /***/ 88688: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { // Copyright 2015 Joyent, Inc. module.exports = { read: read.bind(undefined, false, undefined), readType: read.bind(undefined, false), write: write, /* semi-private api, used by sshpk-agent */ readPartial: read.bind(undefined, true), /* shared with ssh format */ readInternal: read, keyTypeToAlg: keyTypeToAlg, algToKeyType: algToKeyType }; var assert = __webpack_require__(66631); var Buffer = __webpack_require__(15118).Buffer; var algs = __webpack_require__(66126); var utils = __webpack_require__(80575); var Key = __webpack_require__(36814); var PrivateKey = __webpack_require__(29602); var SSHBuffer = __webpack_require__(25621); function algToKeyType(alg) { assert.string(alg); if (alg === 'ssh-dss') return ('dsa'); else if (alg === 'ssh-rsa') return ('rsa'); else if (alg === 'ssh-ed25519') return ('ed25519'); else if (alg === 'ssh-curve25519') return ('curve25519'); else if (alg.match(/^ecdsa-sha2-/)) return ('ecdsa'); else throw (new Error('Unknown algorithm ' + alg)); } function keyTypeToAlg(key) { assert.object(key); if (key.type === 'dsa') return ('ssh-dss'); else if (key.type === 'rsa') return ('ssh-rsa'); else if (key.type === 'ed25519') return ('ssh-ed25519'); else if (key.type === 'curve25519') return ('ssh-curve25519'); else if (key.type === 'ecdsa') return ('ecdsa-sha2-' + key.part.curve.data.toString()); else throw (new Error('Unknown key type ' + key.type)); } function read(partial, type, buf, options) { if (typeof (buf) === 'string') buf = Buffer.from(buf); assert.buffer(buf, 'buf'); var key = {}; var parts = key.parts = []; var sshbuf = new SSHBuffer({buffer: buf}); var alg = sshbuf.readString(); assert.ok(!sshbuf.atEnd(), 'key must have at least one part'); key.type = algToKeyType(alg); var partCount = algs.info[key.type].parts.length; if (type && type === 'private') partCount = algs.privInfo[key.type].parts.length; while (!sshbuf.atEnd() && parts.length < partCount) parts.push(sshbuf.readPart()); while (!partial && !sshbuf.atEnd()) parts.push(sshbuf.readPart()); assert.ok(parts.length >= 1, 'key must have at least one part'); assert.ok(partial || sshbuf.atEnd(), 'leftover bytes at end of key'); var Constructor = Key; var algInfo = algs.info[key.type]; if (type === 'private' || algInfo.parts.length !== parts.length) { algInfo = algs.privInfo[key.type]; Constructor = PrivateKey; } assert.strictEqual(algInfo.parts.length, parts.length); if (key.type === 'ecdsa') { var res = /^ecdsa-sha2-(.+)$/.exec(alg); assert.ok(res !== null); assert.strictEqual(res[1], parts[0].data.toString()); } var normalized = true; for (var i = 0; i < algInfo.parts.length; ++i) { var p = parts[i]; p.name = algInfo.parts[i]; /* * OpenSSH stores ed25519 "private" keys as seed + public key * concat'd together (k followed by A). We want to keep them * separate for other formats that don't do this. */ if (key.type === 'ed25519' && p.name === 'k') p.data = p.data.slice(0, 32); if (p.name !== 'curve' && algInfo.normalize !== false) { var nd; if (key.type === 'ed25519') { nd = utils.zeroPadToLength(p.data, 32); } else { nd = utils.mpNormalize(p.data); } if (nd.toString('binary') !== p.data.toString('binary')) { p.data = nd; normalized = false; } } } if (normalized) key._rfc4253Cache = sshbuf.toBuffer(); if (partial && typeof (partial) === 'object') { partial.remainder = sshbuf.remainder(); partial.consumed = sshbuf._offset; } return (new Constructor(key)); } function write(key, options) { assert.object(key); var alg = keyTypeToAlg(key); var i; var algInfo = algs.info[key.type]; if (PrivateKey.isPrivateKey(key)) algInfo = algs.privInfo[key.type]; var parts = algInfo.parts; var buf = new SSHBuffer({}); buf.writeString(alg); for (i = 0; i < parts.length; ++i) { var data = key.part[parts[i]].data; if (algInfo.normalize !== false) { if (key.type === 'ed25519') data = utils.zeroPadToLength(data, 32); else data = utils.mpNormalize(data); } if (key.type === 'ed25519' && parts[i] === 'k') data = Buffer.concat([data, key.part.A.data]); buf.writeBuffer(data); } return (buf.toBuffer()); } /***/ }), /***/ 3923: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { // Copyright 2015 Joyent, Inc. module.exports = { read: read, readSSHPrivate: readSSHPrivate, write: write }; var assert = __webpack_require__(66631); var asn1 = __webpack_require__(80970); var Buffer = __webpack_require__(15118).Buffer; var algs = __webpack_require__(66126); var utils = __webpack_require__(80575); var crypto = __webpack_require__(33373); var Key = __webpack_require__(36814); var PrivateKey = __webpack_require__(29602); var pem = __webpack_require__(14324); var rfc4253 = __webpack_require__(88688); var SSHBuffer = __webpack_require__(25621); var errors = __webpack_require__(27979); var bcrypt; function read(buf, options) { return (pem.read(buf, options)); } var MAGIC = 'openssh-key-v1'; function readSSHPrivate(type, buf, options) { buf = new SSHBuffer({buffer: buf}); var magic = buf.readCString(); assert.strictEqual(magic, MAGIC, 'bad magic string'); var cipher = buf.readString(); var kdf = buf.readString(); var kdfOpts = buf.readBuffer(); var nkeys = buf.readInt(); if (nkeys !== 1) { throw (new Error('OpenSSH-format key file contains ' + 'multiple keys: this is unsupported.')); } var pubKey = buf.readBuffer(); if (type === 'public') { assert.ok(buf.atEnd(), 'excess bytes left after key'); return (rfc4253.read(pubKey)); } var privKeyBlob = buf.readBuffer(); assert.ok(buf.atEnd(), 'excess bytes left after key'); var kdfOptsBuf = new SSHBuffer({ buffer: kdfOpts }); switch (kdf) { case 'none': if (cipher !== 'none') { throw (new Error('OpenSSH-format key uses KDF "none" ' + 'but specifies a cipher other than "none"')); } break; case 'bcrypt': var salt = kdfOptsBuf.readBuffer(); var rounds = kdfOptsBuf.readInt(); var cinf = utils.opensshCipherInfo(cipher); if (bcrypt === undefined) { bcrypt = __webpack_require__(45447); } if (typeof (options.passphrase) === 'string') { options.passphrase = Buffer.from(options.passphrase, 'utf-8'); } if (!Buffer.isBuffer(options.passphrase)) { throw (new errors.KeyEncryptedError( options.filename, 'OpenSSH')); } var pass = new Uint8Array(options.passphrase); var salti = new Uint8Array(salt); /* Use the pbkdf to derive both the key and the IV. */ var out = new Uint8Array(cinf.keySize + cinf.blockSize); var res = bcrypt.pbkdf(pass, pass.length, salti, salti.length, out, out.length, rounds); if (res !== 0) { throw (new Error('bcrypt_pbkdf function returned ' + 'failure, parameters invalid')); } out = Buffer.from(out); var ckey = out.slice(0, cinf.keySize); var iv = out.slice(cinf.keySize, cinf.keySize + cinf.blockSize); var cipherStream = crypto.createDecipheriv(cinf.opensslName, ckey, iv); cipherStream.setAutoPadding(false); var chunk, chunks = []; cipherStream.once('error', function (e) { if (e.toString().indexOf('bad decrypt') !== -1) { throw (new Error('Incorrect passphrase ' + 'supplied, could not decrypt key')); } throw (e); }); cipherStream.write(privKeyBlob); cipherStream.end(); while ((chunk = cipherStream.read()) !== null) chunks.push(chunk); privKeyBlob = Buffer.concat(chunks); break; default: throw (new Error( 'OpenSSH-format key uses unknown KDF "' + kdf + '"')); } buf = new SSHBuffer({buffer: privKeyBlob}); var checkInt1 = buf.readInt(); var checkInt2 = buf.readInt(); if (checkInt1 !== checkInt2) { throw (new Error('Incorrect passphrase supplied, could not ' + 'decrypt key')); } var ret = {}; var key = rfc4253.readInternal(ret, 'private', buf.remainder()); buf.skip(ret.consumed); var comment = buf.readString(); key.comment = comment; return (key); } function write(key, options) { var pubKey; if (PrivateKey.isPrivateKey(key)) pubKey = key.toPublic(); else pubKey = key; var cipher = 'none'; var kdf = 'none'; var kdfopts = Buffer.alloc(0); var cinf = { blockSize: 8 }; var passphrase; if (options !== undefined) { passphrase = options.passphrase; if (typeof (passphrase) === 'string') passphrase = Buffer.from(passphrase, 'utf-8'); if (passphrase !== undefined) { assert.buffer(passphrase, 'options.passphrase'); assert.optionalString(options.cipher, 'options.cipher'); cipher = options.cipher; if (cipher === undefined) cipher = 'aes128-ctr'; cinf = utils.opensshCipherInfo(cipher); kdf = 'bcrypt'; } } var privBuf; if (PrivateKey.isPrivateKey(key)) { privBuf = new SSHBuffer({}); var checkInt = crypto.randomBytes(4).readUInt32BE(0); privBuf.writeInt(checkInt); privBuf.writeInt(checkInt); privBuf.write(key.toBuffer('rfc4253')); privBuf.writeString(key.comment || ''); var n = 1; while (privBuf._offset % cinf.blockSize !== 0) privBuf.writeChar(n++); privBuf = privBuf.toBuffer(); } switch (kdf) { case 'none': break; case 'bcrypt': var salt = crypto.randomBytes(16); var rounds = 16; var kdfssh = new SSHBuffer({}); kdfssh.writeBuffer(salt); kdfssh.writeInt(rounds); kdfopts = kdfssh.toBuffer(); if (bcrypt === undefined) { bcrypt = __webpack_require__(45447); } var pass = new Uint8Array(passphrase); var salti = new Uint8Array(salt); /* Use the pbkdf to derive both the key and the IV. */ var out = new Uint8Array(cinf.keySize + cinf.blockSize); var res = bcrypt.pbkdf(pass, pass.length, salti, salti.length, out, out.length, rounds); if (res !== 0) { throw (new Error('bcrypt_pbkdf function returned ' + 'failure, parameters invalid')); } out = Buffer.from(out); var ckey = out.slice(0, cinf.keySize); var iv = out.slice(cinf.keySize, cinf.keySize + cinf.blockSize); var cipherStream = crypto.createCipheriv(cinf.opensslName, ckey, iv); cipherStream.setAutoPadding(false); var chunk, chunks = []; cipherStream.once('error', function (e) { throw (e); }); cipherStream.write(privBuf); cipherStream.end(); while ((chunk = cipherStream.read()) !== null) chunks.push(chunk); privBuf = Buffer.concat(chunks); break; default: throw (new Error('Unsupported kdf ' + kdf)); } var buf = new SSHBuffer({}); buf.writeCString(MAGIC); buf.writeString(cipher); /* cipher */ buf.writeString(kdf); /* kdf */ buf.writeBuffer(kdfopts); /* kdfoptions */ buf.writeInt(1); /* nkeys */ buf.writeBuffer(pubKey.toBuffer('rfc4253')); if (privBuf) buf.writeBuffer(privBuf); buf = buf.toBuffer(); var header; if (PrivateKey.isPrivateKey(key)) header = 'OPENSSH PRIVATE KEY'; else header = 'OPENSSH PUBLIC KEY'; var tmp = buf.toString('base64'); var len = tmp.length + (tmp.length / 70) + 18 + 16 + header.length*2 + 10; buf = Buffer.alloc(len); var o = 0; o += buf.write('-----BEGIN ' + header + '-----\n', o); for (var i = 0; i < tmp.length; ) { var limit = i + 70; if (limit > tmp.length) limit = tmp.length; o += buf.write(tmp.slice(i, limit), o); buf[o++] = 10; i = limit; } o += buf.write('-----END ' + header + '-----\n', o); return (buf.slice(0, o)); } /***/ }), /***/ 68927: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { // Copyright 2015 Joyent, Inc. module.exports = { read: read, write: write }; var assert = __webpack_require__(66631); var Buffer = __webpack_require__(15118).Buffer; var rfc4253 = __webpack_require__(88688); var utils = __webpack_require__(80575); var Key = __webpack_require__(36814); var PrivateKey = __webpack_require__(29602); var sshpriv = __webpack_require__(3923); /*JSSTYLED*/ var SSHKEY_RE = /^([a-z0-9-]+)[ \t]+([a-zA-Z0-9+\/]+[=]*)([ \t]+([^ \t][^\n]*[\n]*)?)?$/; /*JSSTYLED*/ var SSHKEY_RE2 = /^([a-z0-9-]+)[ \t\n]+([a-zA-Z0-9+\/][a-zA-Z0-9+\/ \t\n=]*)([^a-zA-Z0-9+\/ \t\n=].*)?$/; function read(buf, options) { if (typeof (buf) !== 'string') { assert.buffer(buf, 'buf'); buf = buf.toString('ascii'); } var trimmed = buf.trim().replace(/[\\\r]/g, ''); var m = trimmed.match(SSHKEY_RE); if (!m) m = trimmed.match(SSHKEY_RE2); assert.ok(m, 'key must match regex'); var type = rfc4253.algToKeyType(m[1]); var kbuf = Buffer.from(m[2], 'base64'); /* * This is a bit tricky. If we managed to parse the key and locate the * key comment with the regex, then do a non-partial read and assert * that we have consumed all bytes. If we couldn't locate the key * comment, though, there may be whitespace shenanigans going on that * have conjoined the comment to the rest of the key. We do a partial * read in this case to try to make the best out of a sorry situation. */ var key; var ret = {}; if (m[4]) { try { key = rfc4253.read(kbuf); } catch (e) { m = trimmed.match(SSHKEY_RE2); assert.ok(m, 'key must match regex'); kbuf = Buffer.from(m[2], 'base64'); key = rfc4253.readInternal(ret, 'public', kbuf); } } else { key = rfc4253.readInternal(ret, 'public', kbuf); } assert.strictEqual(type, key.type); if (m[4] && m[4].length > 0) { key.comment = m[4]; } else if (ret.consumed) { /* * Now the magic: trying to recover the key comment when it's * gotten conjoined to the key or otherwise shenanigan'd. * * Work out how much base64 we used, then drop all non-base64 * chars from the beginning up to this point in the the string. * Then offset in this and try to make up for missing = chars. */ var data = m[2] + (m[3] ? m[3] : ''); var realOffset = Math.ceil(ret.consumed / 3) * 4; data = data.slice(0, realOffset - 2). /*JSSTYLED*/ replace(/[^a-zA-Z0-9+\/=]/g, '') + data.slice(realOffset - 2); var padding = ret.consumed % 3; if (padding > 0 && data.slice(realOffset - 1, realOffset) !== '=') realOffset--; while (data.slice(realOffset, realOffset + 1) === '=') realOffset++; /* Finally, grab what we think is the comment & clean it up. */ var trailer = data.slice(realOffset); trailer = trailer.replace(/[\r\n]/g, ' '). replace(/^\s+/, ''); if (trailer.match(/^[a-zA-Z0-9]/)) key.comment = trailer; } return (key); } function write(key, options) { assert.object(key); if (!Key.isKey(key)) throw (new Error('Must be a public key')); var parts = []; var alg = rfc4253.keyTypeToAlg(key); parts.push(alg); var buf = rfc4253.write(key); parts.push(buf.toString('base64')); if (key.comment) parts.push(key.comment); return (Buffer.from(parts.join(' '))); } /***/ }), /***/ 30217: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { // Copyright 2016 Joyent, Inc. var x509 = __webpack_require__(10267); module.exports = { read: read, verify: x509.verify, sign: x509.sign, write: write }; var assert = __webpack_require__(66631); var asn1 = __webpack_require__(80970); var Buffer = __webpack_require__(15118).Buffer; var algs = __webpack_require__(66126); var utils = __webpack_require__(80575); var Key = __webpack_require__(36814); var PrivateKey = __webpack_require__(29602); var pem = __webpack_require__(14324); var Identity = __webpack_require__(70508); var Signature = __webpack_require__(91394); var Certificate = __webpack_require__(7406); function read(buf, options) { if (typeof (buf) !== 'string') { assert.buffer(buf, 'buf'); buf = buf.toString('ascii'); } var lines = buf.trim().split(/[\r\n]+/g); var m; var si = -1; while (!m && si < lines.length) { m = lines[++si].match(/*JSSTYLED*/ /[-]+[ ]*BEGIN CERTIFICATE[ ]*[-]+/); } assert.ok(m, 'invalid PEM header'); var m2; var ei = lines.length; while (!m2 && ei > 0) { m2 = lines[--ei].match(/*JSSTYLED*/ /[-]+[ ]*END CERTIFICATE[ ]*[-]+/); } assert.ok(m2, 'invalid PEM footer'); lines = lines.slice(si, ei + 1); var headers = {}; while (true) { lines = lines.slice(1); m = lines[0].match(/*JSSTYLED*/ /^([A-Za-z0-9-]+): (.+)$/); if (!m) break; headers[m[1].toLowerCase()] = m[2]; } /* Chop off the first and last lines */ lines = lines.slice(0, -1).join(''); buf = Buffer.from(lines, 'base64'); return (x509.read(buf, options)); } function write(cert, options) { var dbuf = x509.write(cert, options); var header = 'CERTIFICATE'; var tmp = dbuf.toString('base64'); var len = tmp.length + (tmp.length / 64) + 18 + 16 + header.length*2 + 10; var buf = Buffer.alloc(len); var o = 0; o += buf.write('-----BEGIN ' + header + '-----\n', o); for (var i = 0; i < tmp.length; ) { var limit = i + 64; if (limit > tmp.length) limit = tmp.length; o += buf.write(tmp.slice(i, limit), o); buf[o++] = 10; i = limit; } o += buf.write('-----END ' + header + '-----\n', o); return (buf.slice(0, o)); } /***/ }), /***/ 10267: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { // Copyright 2017 Joyent, Inc. module.exports = { read: read, verify: verify, sign: sign, signAsync: signAsync, write: write }; var assert = __webpack_require__(66631); var asn1 = __webpack_require__(80970); var Buffer = __webpack_require__(15118).Buffer; var algs = __webpack_require__(66126); var utils = __webpack_require__(80575); var Key = __webpack_require__(36814); var PrivateKey = __webpack_require__(29602); var pem = __webpack_require__(14324); var Identity = __webpack_require__(70508); var Signature = __webpack_require__(91394); var Certificate = __webpack_require__(7406); var pkcs8 = __webpack_require__(4173); /* * This file is based on RFC5280 (X.509). */ /* Helper to read in a single mpint */ function readMPInt(der, nm) { assert.strictEqual(der.peek(), asn1.Ber.Integer, nm + ' is not an Integer'); return (utils.mpNormalize(der.readString(asn1.Ber.Integer, true))); } function verify(cert, key) { var sig = cert.signatures.x509; assert.object(sig, 'x509 signature'); var algParts = sig.algo.split('-'); if (algParts[0] !== key.type) return (false); var blob = sig.cache; if (blob === undefined) { var der = new asn1.BerWriter(); writeTBSCert(cert, der); blob = der.buffer; } var verifier = key.createVerify(algParts[1]); verifier.write(blob); return (verifier.verify(sig.signature)); } function Local(i) { return (asn1.Ber.Context | asn1.Ber.Constructor | i); } function Context(i) { return (asn1.Ber.Context | i); } var SIGN_ALGS = { 'rsa-md5': '1.2.840.113549.1.1.4', 'rsa-sha1': '1.2.840.113549.1.1.5', 'rsa-sha256': '1.2.840.113549.1.1.11', 'rsa-sha384': '1.2.840.113549.1.1.12', 'rsa-sha512': '1.2.840.113549.1.1.13', 'dsa-sha1': '1.2.840.10040.4.3', 'dsa-sha256': '2.16.840.1.101.3.4.3.2', 'ecdsa-sha1': '1.2.840.10045.4.1', 'ecdsa-sha256': '1.2.840.10045.4.3.2', 'ecdsa-sha384': '1.2.840.10045.4.3.3', 'ecdsa-sha512': '1.2.840.10045.4.3.4', 'ed25519-sha512': '1.3.101.112' }; Object.keys(SIGN_ALGS).forEach(function (k) { SIGN_ALGS[SIGN_ALGS[k]] = k; }); SIGN_ALGS['1.3.14.3.2.3'] = 'rsa-md5'; SIGN_ALGS['1.3.14.3.2.29'] = 'rsa-sha1'; var EXTS = { 'issuerKeyId': '2.5.29.35', 'altName': '2.5.29.17', 'basicConstraints': '2.5.29.19', 'keyUsage': '2.5.29.15', 'extKeyUsage': '2.5.29.37' }; function read(buf, options) { if (typeof (buf) === 'string') { buf = Buffer.from(buf, 'binary'); } assert.buffer(buf, 'buf'); var der = new asn1.BerReader(buf); der.readSequence(); if (Math.abs(der.length - der.remain) > 1) { throw (new Error('DER sequence does not contain whole byte ' + 'stream')); } var tbsStart = der.offset; der.readSequence(); var sigOffset = der.offset + der.length; var tbsEnd = sigOffset; if (der.peek() === Local(0)) { der.readSequence(Local(0)); var version = der.readInt(); assert.ok(version <= 3, 'only x.509 versions up to v3 supported'); } var cert = {}; cert.signatures = {}; var sig = (cert.signatures.x509 = {}); sig.extras = {}; cert.serial = readMPInt(der, 'serial'); der.readSequence(); var after = der.offset + der.length; var certAlgOid = der.readOID(); var certAlg = SIGN_ALGS[certAlgOid]; if (certAlg === undefined) throw (new Error('unknown signature algorithm ' + certAlgOid)); der._offset = after; cert.issuer = Identity.parseAsn1(der); der.readSequence(); cert.validFrom = readDate(der); cert.validUntil = readDate(der); cert.subjects = [Identity.parseAsn1(der)]; der.readSequence(); after = der.offset + der.length; cert.subjectKey = pkcs8.readPkcs8(undefined, 'public', der); der._offset = after; /* issuerUniqueID */ if (der.peek() === Local(1)) { der.readSequence(Local(1)); sig.extras.issuerUniqueID = buf.slice(der.offset, der.offset + der.length); der._offset += der.length; } /* subjectUniqueID */ if (der.peek() === Local(2)) { der.readSequence(Local(2)); sig.extras.subjectUniqueID = buf.slice(der.offset, der.offset + der.length); der._offset += der.length; } /* extensions */ if (der.peek() === Local(3)) { der.readSequence(Local(3)); var extEnd = der.offset + der.length; der.readSequence(); while (der.offset < extEnd) readExtension(cert, buf, der); assert.strictEqual(der.offset, extEnd); } assert.strictEqual(der.offset, sigOffset); der.readSequence(); after = der.offset + der.length; var sigAlgOid = der.readOID(); var sigAlg = SIGN_ALGS[sigAlgOid]; if (sigAlg === undefined) throw (new Error('unknown signature algorithm ' + sigAlgOid)); der._offset = after; var sigData = der.readString(asn1.Ber.BitString, true); if (sigData[0] === 0) sigData = sigData.slice(1); var algParts = sigAlg.split('-'); sig.signature = Signature.parse(sigData, algParts[0], 'asn1'); sig.signature.hashAlgorithm = algParts[1]; sig.algo = sigAlg; sig.cache = buf.slice(tbsStart, tbsEnd); return (new Certificate(cert)); } function readDate(der) { if (der.peek() === asn1.Ber.UTCTime) { return (utcTimeToDate(der.readString(asn1.Ber.UTCTime))); } else if (der.peek() === asn1.Ber.GeneralizedTime) { return (gTimeToDate(der.readString(asn1.Ber.GeneralizedTime))); } else { throw (new Error('Unsupported date format')); } } function writeDate(der, date) { if (date.getUTCFullYear() >= 2050 || date.getUTCFullYear() < 1950) { der.writeString(dateToGTime(date), asn1.Ber.GeneralizedTime); } else { der.writeString(dateToUTCTime(date), asn1.Ber.UTCTime); } } /* RFC5280, section 4.2.1.6 (GeneralName type) */ var ALTNAME = { OtherName: Local(0), RFC822Name: Context(1), DNSName: Context(2), X400Address: Local(3), DirectoryName: Local(4), EDIPartyName: Local(5), URI: Context(6), IPAddress: Context(7), OID: Context(8) }; /* RFC5280, section 4.2.1.12 (KeyPurposeId) */ var EXTPURPOSE = { 'serverAuth': '1.3.6.1.5.5.7.3.1', 'clientAuth': '1.3.6.1.5.5.7.3.2', 'codeSigning': '1.3.6.1.5.5.7.3.3', /* See https://github.com/joyent/oid-docs/blob/master/root.md */ 'joyentDocker': '1.3.6.1.4.1.38678.1.4.1', 'joyentCmon': '1.3.6.1.4.1.38678.1.4.2' }; var EXTPURPOSE_REV = {}; Object.keys(EXTPURPOSE).forEach(function (k) { EXTPURPOSE_REV[EXTPURPOSE[k]] = k; }); var KEYUSEBITS = [ 'signature', 'identity', 'keyEncryption', 'encryption', 'keyAgreement', 'ca', 'crl' ]; function readExtension(cert, buf, der) { der.readSequence(); var after = der.offset + der.length; var extId = der.readOID(); var id; var sig = cert.signatures.x509; if (!sig.extras.exts) sig.extras.exts = []; var critical; if (der.peek() === asn1.Ber.Boolean) critical = der.readBoolean(); switch (extId) { case (EXTS.basicConstraints): der.readSequence(asn1.Ber.OctetString); der.readSequence(); var bcEnd = der.offset + der.length; var ca = false; if (der.peek() === asn1.Ber.Boolean) ca = der.readBoolean(); if (cert.purposes === undefined) cert.purposes = []; if (ca === true) cert.purposes.push('ca'); var bc = { oid: extId, critical: critical }; if (der.offset < bcEnd && der.peek() === asn1.Ber.Integer) bc.pathLen = der.readInt(); sig.extras.exts.push(bc); break; case (EXTS.extKeyUsage): der.readSequence(asn1.Ber.OctetString); der.readSequence(); if (cert.purposes === undefined) cert.purposes = []; var ekEnd = der.offset + der.length; while (der.offset < ekEnd) { var oid = der.readOID(); cert.purposes.push(EXTPURPOSE_REV[oid] || oid); } /* * This is a bit of a hack: in the case where we have a cert * that's only allowed to do serverAuth or clientAuth (and not * the other), we want to make sure all our Subjects are of * the right type. But we already parsed our Subjects and * decided if they were hosts or users earlier (since it appears * first in the cert). * * So we go through and mutate them into the right kind here if * it doesn't match. This might not be hugely beneficial, as it * seems that single-purpose certs are not often seen in the * wild. */ if (cert.purposes.indexOf('serverAuth') !== -1 && cert.purposes.indexOf('clientAuth') === -1) { cert.subjects.forEach(function (ide) { if (ide.type !== 'host') { ide.type = 'host'; ide.hostname = ide.uid || ide.email || ide.components[0].value; } }); } else if (cert.purposes.indexOf('clientAuth') !== -1 && cert.purposes.indexOf('serverAuth') === -1) { cert.subjects.forEach(function (ide) { if (ide.type !== 'user') { ide.type = 'user'; ide.uid = ide.hostname || ide.email || ide.components[0].value; } }); } sig.extras.exts.push({ oid: extId, critical: critical }); break; case (EXTS.keyUsage): der.readSequence(asn1.Ber.OctetString); var bits = der.readString(asn1.Ber.BitString, true); var setBits = readBitField(bits, KEYUSEBITS); setBits.forEach(function (bit) { if (cert.purposes === undefined) cert.purposes = []; if (cert.purposes.indexOf(bit) === -1) cert.purposes.push(bit); }); sig.extras.exts.push({ oid: extId, critical: critical, bits: bits }); break; case (EXTS.altName): der.readSequence(asn1.Ber.OctetString); der.readSequence(); var aeEnd = der.offset + der.length; while (der.offset < aeEnd) { switch (der.peek()) { case ALTNAME.OtherName: case ALTNAME.EDIPartyName: der.readSequence(); der._offset += der.length; break; case ALTNAME.OID: der.readOID(ALTNAME.OID); break; case ALTNAME.RFC822Name: /* RFC822 specifies email addresses */ var email = der.readString(ALTNAME.RFC822Name); id = Identity.forEmail(email); if (!cert.subjects[0].equals(id)) cert.subjects.push(id); break; case ALTNAME.DirectoryName: der.readSequence(ALTNAME.DirectoryName); id = Identity.parseAsn1(der); if (!cert.subjects[0].equals(id)) cert.subjects.push(id); break; case ALTNAME.DNSName: var host = der.readString( ALTNAME.DNSName); id = Identity.forHost(host); if (!cert.subjects[0].equals(id)) cert.subjects.push(id); break; default: der.readString(der.peek()); break; } } sig.extras.exts.push({ oid: extId, critical: critical }); break; default: sig.extras.exts.push({ oid: extId, critical: critical, data: der.readString(asn1.Ber.OctetString, true) }); break; } der._offset = after; } var UTCTIME_RE = /^([0-9]{2})([0-9]{2})([0-9]{2})([0-9]{2})([0-9]{2})([0-9]{2})?Z$/; function utcTimeToDate(t) { var m = t.match(UTCTIME_RE); assert.ok(m, 'timestamps must be in UTC'); var d = new Date(); var thisYear = d.getUTCFullYear(); var century = Math.floor(thisYear / 100) * 100; var year = parseInt(m[1], 10); if (thisYear % 100 < 50 && year >= 60) year += (century - 1); else year += century; d.setUTCFullYear(year, parseInt(m[2], 10) - 1, parseInt(m[3], 10)); d.setUTCHours(parseInt(m[4], 10), parseInt(m[5], 10)); if (m[6] && m[6].length > 0) d.setUTCSeconds(parseInt(m[6], 10)); return (d); } var GTIME_RE = /^([0-9]{4})([0-9]{2})([0-9]{2})([0-9]{2})([0-9]{2})([0-9]{2})?Z$/; function gTimeToDate(t) { var m = t.match(GTIME_RE); assert.ok(m); var d = new Date(); d.setUTCFullYear(parseInt(m[1], 10), parseInt(m[2], 10) - 1, parseInt(m[3], 10)); d.setUTCHours(parseInt(m[4], 10), parseInt(m[5], 10)); if (m[6] && m[6].length > 0) d.setUTCSeconds(parseInt(m[6], 10)); return (d); } function zeroPad(n, m) { if (m === undefined) m = 2; var s = '' + n; while (s.length < m) s = '0' + s; return (s); } function dateToUTCTime(d) { var s = ''; s += zeroPad(d.getUTCFullYear() % 100); s += zeroPad(d.getUTCMonth() + 1); s += zeroPad(d.getUTCDate()); s += zeroPad(d.getUTCHours()); s += zeroPad(d.getUTCMinutes()); s += zeroPad(d.getUTCSeconds()); s += 'Z'; return (s); } function dateToGTime(d) { var s = ''; s += zeroPad(d.getUTCFullYear(), 4); s += zeroPad(d.getUTCMonth() + 1); s += zeroPad(d.getUTCDate()); s += zeroPad(d.getUTCHours()); s += zeroPad(d.getUTCMinutes()); s += zeroPad(d.getUTCSeconds()); s += 'Z'; return (s); } function sign(cert, key) { if (cert.signatures.x509 === undefined) cert.signatures.x509 = {}; var sig = cert.signatures.x509; sig.algo = key.type + '-' + key.defaultHashAlgorithm(); if (SIGN_ALGS[sig.algo] === undefined) return (false); var der = new asn1.BerWriter(); writeTBSCert(cert, der); var blob = der.buffer; sig.cache = blob; var signer = key.createSign(); signer.write(blob); cert.signatures.x509.signature = signer.sign(); return (true); } function signAsync(cert, signer, done) { if (cert.signatures.x509 === undefined) cert.signatures.x509 = {}; var sig = cert.signatures.x509; var der = new asn1.BerWriter(); writeTBSCert(cert, der); var blob = der.buffer; sig.cache = blob; signer(blob, function (err, signature) { if (err) { done(err); return; } sig.algo = signature.type + '-' + signature.hashAlgorithm; if (SIGN_ALGS[sig.algo] === undefined) { done(new Error('Invalid signing algorithm "' + sig.algo + '"')); return; } sig.signature = signature; done(); }); } function write(cert, options) { var sig = cert.signatures.x509; assert.object(sig, 'x509 signature'); var der = new asn1.BerWriter(); der.startSequence(); if (sig.cache) { der._ensure(sig.cache.length); sig.cache.copy(der._buf, der._offset); der._offset += sig.cache.length; } else { writeTBSCert(cert, der); } der.startSequence(); der.writeOID(SIGN_ALGS[sig.algo]); if (sig.algo.match(/^rsa-/)) der.writeNull(); der.endSequence(); var sigData = sig.signature.toBuffer('asn1'); var data = Buffer.alloc(sigData.length + 1); data[0] = 0; sigData.copy(data, 1); der.writeBuffer(data, asn1.Ber.BitString); der.endSequence(); return (der.buffer); } function writeTBSCert(cert, der) { var sig = cert.signatures.x509; assert.object(sig, 'x509 signature'); der.startSequence(); der.startSequence(Local(0)); der.writeInt(2); der.endSequence(); der.writeBuffer(utils.mpNormalize(cert.serial), asn1.Ber.Integer); der.startSequence(); der.writeOID(SIGN_ALGS[sig.algo]); if (sig.algo.match(/^rsa-/)) der.writeNull(); der.endSequence(); cert.issuer.toAsn1(der); der.startSequence(); writeDate(der, cert.validFrom); writeDate(der, cert.validUntil); der.endSequence(); var subject = cert.subjects[0]; var altNames = cert.subjects.slice(1); subject.toAsn1(der); pkcs8.writePkcs8(der, cert.subjectKey); if (sig.extras && sig.extras.issuerUniqueID) { der.writeBuffer(sig.extras.issuerUniqueID, Local(1)); } if (sig.extras && sig.extras.subjectUniqueID) { der.writeBuffer(sig.extras.subjectUniqueID, Local(2)); } if (altNames.length > 0 || subject.type === 'host' || (cert.purposes !== undefined && cert.purposes.length > 0) || (sig.extras && sig.extras.exts)) { der.startSequence(Local(3)); der.startSequence(); var exts = []; if (cert.purposes !== undefined && cert.purposes.length > 0) { exts.push({ oid: EXTS.basicConstraints, critical: true }); exts.push({ oid: EXTS.keyUsage, critical: true }); exts.push({ oid: EXTS.extKeyUsage, critical: true }); } exts.push({ oid: EXTS.altName }); if (sig.extras && sig.extras.exts) exts = sig.extras.exts; for (var i = 0; i < exts.length; ++i) { der.startSequence(); der.writeOID(exts[i].oid); if (exts[i].critical !== undefined) der.writeBoolean(exts[i].critical); if (exts[i].oid === EXTS.altName) { der.startSequence(asn1.Ber.OctetString); der.startSequence(); if (subject.type === 'host') { der.writeString(subject.hostname, Context(2)); } for (var j = 0; j < altNames.length; ++j) { if (altNames[j].type === 'host') { der.writeString( altNames[j].hostname, ALTNAME.DNSName); } else if (altNames[j].type === 'email') { der.writeString( altNames[j].email, ALTNAME.RFC822Name); } else { /* * Encode anything else as a * DN style name for now. */ der.startSequence( ALTNAME.DirectoryName); altNames[j].toAsn1(der); der.endSequence(); } } der.endSequence(); der.endSequence(); } else if (exts[i].oid === EXTS.basicConstraints) { der.startSequence(asn1.Ber.OctetString); der.startSequence(); var ca = (cert.purposes.indexOf('ca') !== -1); var pathLen = exts[i].pathLen; der.writeBoolean(ca); if (pathLen !== undefined) der.writeInt(pathLen); der.endSequence(); der.endSequence(); } else if (exts[i].oid === EXTS.extKeyUsage) { der.startSequence(asn1.Ber.OctetString); der.startSequence(); cert.purposes.forEach(function (purpose) { if (purpose === 'ca') return; if (KEYUSEBITS.indexOf(purpose) !== -1) return; var oid = purpose; if (EXTPURPOSE[purpose] !== undefined) oid = EXTPURPOSE[purpose]; der.writeOID(oid); }); der.endSequence(); der.endSequence(); } else if (exts[i].oid === EXTS.keyUsage) { der.startSequence(asn1.Ber.OctetString); /* * If we parsed this certificate from a byte * stream (i.e. we didn't generate it in sshpk) * then we'll have a ".bits" property on the * ext with the original raw byte contents. * * If we have this, use it here instead of * regenerating it. This guarantees we output * the same data we parsed, so signatures still * validate. */ if (exts[i].bits !== undefined) { der.writeBuffer(exts[i].bits, asn1.Ber.BitString); } else { var bits = writeBitField(cert.purposes, KEYUSEBITS); der.writeBuffer(bits, asn1.Ber.BitString); } der.endSequence(); } else { der.writeBuffer(exts[i].data, asn1.Ber.OctetString); } der.endSequence(); } der.endSequence(); der.endSequence(); } der.endSequence(); } /* * Reads an ASN.1 BER bitfield out of the Buffer produced by doing * `BerReader#readString(asn1.Ber.BitString)`. That function gives us the raw * contents of the BitString tag, which is a count of unused bits followed by * the bits as a right-padded byte string. * * `bits` is the Buffer, `bitIndex` should contain an array of string names * for the bits in the string, ordered starting with bit #0 in the ASN.1 spec. * * Returns an array of Strings, the names of the bits that were set to 1. */ function readBitField(bits, bitIndex) { var bitLen = 8 * (bits.length - 1) - bits[0]; var setBits = {}; for (var i = 0; i < bitLen; ++i) { var byteN = 1 + Math.floor(i / 8); var bit = 7 - (i % 8); var mask = 1 << bit; var bitVal = ((bits[byteN] & mask) !== 0); var name = bitIndex[i]; if (bitVal && typeof (name) === 'string') { setBits[name] = true; } } return (Object.keys(setBits)); } /* * `setBits` is an array of strings, containing the names for each bit that * sould be set to 1. `bitIndex` is same as in `readBitField()`. * * Returns a Buffer, ready to be written out with `BerWriter#writeString()`. */ function writeBitField(setBits, bitIndex) { var bitLen = bitIndex.length; var blen = Math.ceil(bitLen / 8); var unused = blen * 8 - bitLen; var bits = Buffer.alloc(1 + blen); // zero-filled bits[0] = unused; for (var i = 0; i < bitLen; ++i) { var byteN = 1 + Math.floor(i / 8); var bit = 7 - (i % 8); var mask = 1 << bit; var name = bitIndex[i]; if (name === undefined) continue; var bitVal = (setBits.indexOf(name) !== -1); if (bitVal) { bits[byteN] |= mask; } } return (bits); } /***/ }), /***/ 70508: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { // Copyright 2017 Joyent, Inc. module.exports = Identity; var assert = __webpack_require__(66631); var algs = __webpack_require__(66126); var crypto = __webpack_require__(33373); var Fingerprint = __webpack_require__(13079); var Signature = __webpack_require__(91394); var errs = __webpack_require__(27979); var util = __webpack_require__(31669); var utils = __webpack_require__(80575); var asn1 = __webpack_require__(80970); var Buffer = __webpack_require__(15118).Buffer; /*JSSTYLED*/ var DNS_NAME_RE = /^([*]|[a-z0-9][a-z0-9\-]{0,62})(?:\.([*]|[a-z0-9][a-z0-9\-]{0,62}))*$/i; var oids = {}; oids.cn = '2.5.4.3'; oids.o = '2.5.4.10'; oids.ou = '2.5.4.11'; oids.l = '2.5.4.7'; oids.s = '2.5.4.8'; oids.c = '2.5.4.6'; oids.sn = '2.5.4.4'; oids.postalCode = '2.5.4.17'; oids.serialNumber = '2.5.4.5'; oids.street = '2.5.4.9'; oids.x500UniqueIdentifier = '2.5.4.45'; oids.role = '2.5.4.72'; oids.telephoneNumber = '2.5.4.20'; oids.description = '2.5.4.13'; oids.dc = '0.9.2342.19200300.100.1.25'; oids.uid = '0.9.2342.19200300.100.1.1'; oids.mail = '0.9.2342.19200300.100.1.3'; oids.title = '2.5.4.12'; oids.gn = '2.5.4.42'; oids.initials = '2.5.4.43'; oids.pseudonym = '2.5.4.65'; oids.emailAddress = '1.2.840.113549.1.9.1'; var unoids = {}; Object.keys(oids).forEach(function (k) { unoids[oids[k]] = k; }); function Identity(opts) { var self = this; assert.object(opts, 'options'); assert.arrayOfObject(opts.components, 'options.components'); this.components = opts.components; this.componentLookup = {}; this.components.forEach(function (c) { if (c.name && !c.oid) c.oid = oids[c.name]; if (c.oid && !c.name) c.name = unoids[c.oid]; if (self.componentLookup[c.name] === undefined) self.componentLookup[c.name] = []; self.componentLookup[c.name].push(c); }); if (this.componentLookup.cn && this.componentLookup.cn.length > 0) { this.cn = this.componentLookup.cn[0].value; } assert.optionalString(opts.type, 'options.type'); if (opts.type === undefined) { if (this.components.length === 1 && this.componentLookup.cn && this.componentLookup.cn.length === 1 && this.componentLookup.cn[0].value.match(DNS_NAME_RE)) { this.type = 'host'; this.hostname = this.componentLookup.cn[0].value; } else if (this.componentLookup.dc && this.components.length === this.componentLookup.dc.length) { this.type = 'host'; this.hostname = this.componentLookup.dc.map( function (c) { return (c.value); }).join('.'); } else if (this.componentLookup.uid && this.components.length === this.componentLookup.uid.length) { this.type = 'user'; this.uid = this.componentLookup.uid[0].value; } else if (this.componentLookup.cn && this.componentLookup.cn.length === 1 && this.componentLookup.cn[0].value.match(DNS_NAME_RE)) { this.type = 'host'; this.hostname = this.componentLookup.cn[0].value; } else if (this.componentLookup.uid && this.componentLookup.uid.length === 1) { this.type = 'user'; this.uid = this.componentLookup.uid[0].value; } else if (this.componentLookup.mail && this.componentLookup.mail.length === 1) { this.type = 'email'; this.email = this.componentLookup.mail[0].value; } else if (this.componentLookup.cn && this.componentLookup.cn.length === 1) { this.type = 'user'; this.uid = this.componentLookup.cn[0].value; } else { this.type = 'unknown'; } } else { this.type = opts.type; if (this.type === 'host') this.hostname = opts.hostname; else if (this.type === 'user') this.uid = opts.uid; else if (this.type === 'email') this.email = opts.email; else throw (new Error('Unknown type ' + this.type)); } } Identity.prototype.toString = function () { return (this.components.map(function (c) { var n = c.name.toUpperCase(); /*JSSTYLED*/ n = n.replace(/=/g, '\\='); var v = c.value; /*JSSTYLED*/ v = v.replace(/,/g, '\\,'); return (n + '=' + v); }).join(', ')); }; Identity.prototype.get = function (name, asArray) { assert.string(name, 'name'); var arr = this.componentLookup[name]; if (arr === undefined || arr.length === 0) return (undefined); if (!asArray && arr.length > 1) throw (new Error('Multiple values for attribute ' + name)); if (!asArray) return (arr[0].value); return (arr.map(function (c) { return (c.value); })); }; Identity.prototype.toArray = function (idx) { return (this.components.map(function (c) { return ({ name: c.name, value: c.value }); })); }; /* * These are from X.680 -- PrintableString allowed chars are in section 37.4 * table 8. Spec for IA5Strings is "1,6 + SPACE + DEL" where 1 refers to * ISO IR #001 (standard ASCII control characters) and 6 refers to ISO IR #006 * (the basic ASCII character set). */ /* JSSTYLED */ var NOT_PRINTABLE = /[^a-zA-Z0-9 '(),+.\/:=?-]/; /* JSSTYLED */ var NOT_IA5 = /[^\x00-\x7f]/; Identity.prototype.toAsn1 = function (der, tag) { der.startSequence(tag); this.components.forEach(function (c) { der.startSequence(asn1.Ber.Constructor | asn1.Ber.Set); der.startSequence(); der.writeOID(c.oid); /* * If we fit in a PrintableString, use that. Otherwise use an * IA5String or UTF8String. * * If this identity was parsed from a DN, use the ASN.1 types * from the original representation (otherwise this might not * be a full match for the original in some validators). */ if (c.asn1type === asn1.Ber.Utf8String || c.value.match(NOT_IA5)) { var v = Buffer.from(c.value, 'utf8'); der.writeBuffer(v, asn1.Ber.Utf8String); } else if (c.asn1type === asn1.Ber.IA5String || c.value.match(NOT_PRINTABLE)) { der.writeString(c.value, asn1.Ber.IA5String); } else { var type = asn1.Ber.PrintableString; if (c.asn1type !== undefined) type = c.asn1type; der.writeString(c.value, type); } der.endSequence(); der.endSequence(); }); der.endSequence(); }; function globMatch(a, b) { if (a === '**' || b === '**') return (true); var aParts = a.split('.'); var bParts = b.split('.'); if (aParts.length !== bParts.length) return (false); for (var i = 0; i < aParts.length; ++i) { if (aParts[i] === '*' || bParts[i] === '*') continue; if (aParts[i] !== bParts[i]) return (false); } return (true); } Identity.prototype.equals = function (other) { if (!Identity.isIdentity(other, [1, 0])) return (false); if (other.components.length !== this.components.length) return (false); for (var i = 0; i < this.components.length; ++i) { if (this.components[i].oid !== other.components[i].oid) return (false); if (!globMatch(this.components[i].value, other.components[i].value)) { return (false); } } return (true); }; Identity.forHost = function (hostname) { assert.string(hostname, 'hostname'); return (new Identity({ type: 'host', hostname: hostname, components: [ { name: 'cn', value: hostname } ] })); }; Identity.forUser = function (uid) { assert.string(uid, 'uid'); return (new Identity({ type: 'user', uid: uid, components: [ { name: 'uid', value: uid } ] })); }; Identity.forEmail = function (email) { assert.string(email, 'email'); return (new Identity({ type: 'email', email: email, components: [ { name: 'mail', value: email } ] })); }; Identity.parseDN = function (dn) { assert.string(dn, 'dn'); var parts = ['']; var idx = 0; var rem = dn; while (rem.length > 0) { var m; /*JSSTYLED*/ if ((m = /^,/.exec(rem)) !== null) { parts[++idx] = ''; rem = rem.slice(m[0].length); /*JSSTYLED*/ } else if ((m = /^\\,/.exec(rem)) !== null) { parts[idx] += ','; rem = rem.slice(m[0].length); /*JSSTYLED*/ } else if ((m = /^\\./.exec(rem)) !== null) { parts[idx] += m[0]; rem = rem.slice(m[0].length); /*JSSTYLED*/ } else if ((m = /^[^\\,]+/.exec(rem)) !== null) { parts[idx] += m[0]; rem = rem.slice(m[0].length); } else { throw (new Error('Failed to parse DN')); } } var cmps = parts.map(function (c) { c = c.trim(); var eqPos = c.indexOf('='); while (eqPos > 0 && c.charAt(eqPos - 1) === '\\') eqPos = c.indexOf('=', eqPos + 1); if (eqPos === -1) { throw (new Error('Failed to parse DN')); } /*JSSTYLED*/ var name = c.slice(0, eqPos).toLowerCase().replace(/\\=/g, '='); var value = c.slice(eqPos + 1); return ({ name: name, value: value }); }); return (new Identity({ components: cmps })); }; Identity.fromArray = function (components) { assert.arrayOfObject(components, 'components'); components.forEach(function (cmp) { assert.object(cmp, 'component'); assert.string(cmp.name, 'component.name'); if (!Buffer.isBuffer(cmp.value) && !(typeof (cmp.value) === 'string')) { throw (new Error('Invalid component value')); } }); return (new Identity({ components: components })); }; Identity.parseAsn1 = function (der, top) { var components = []; der.readSequence(top); var end = der.offset + der.length; while (der.offset < end) { der.readSequence(asn1.Ber.Constructor | asn1.Ber.Set); var after = der.offset + der.length; der.readSequence(); var oid = der.readOID(); var type = der.peek(); var value; switch (type) { case asn1.Ber.PrintableString: case asn1.Ber.IA5String: case asn1.Ber.OctetString: case asn1.Ber.T61String: value = der.readString(type); break; case asn1.Ber.Utf8String: value = der.readString(type, true); value = value.toString('utf8'); break; case asn1.Ber.CharacterString: case asn1.Ber.BMPString: value = der.readString(type, true); value = value.toString('utf16le'); break; default: throw (new Error('Unknown asn1 type ' + type)); } components.push({ oid: oid, asn1type: type, value: value }); der._offset = after; } der._offset = end; return (new Identity({ components: components })); }; Identity.isIdentity = function (obj, ver) { return (utils.isCompatible(obj, Identity, ver)); }; /* * API versions for Identity: * [1,0] -- initial ver */ Identity.prototype._sshpkApiVersion = [1, 0]; Identity._oldVersionDetect = function (obj) { return ([1, 0]); }; /***/ }), /***/ 87022: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { // Copyright 2015 Joyent, Inc. var Key = __webpack_require__(36814); var Fingerprint = __webpack_require__(13079); var Signature = __webpack_require__(91394); var PrivateKey = __webpack_require__(29602); var Certificate = __webpack_require__(7406); var Identity = __webpack_require__(70508); var errs = __webpack_require__(27979); module.exports = { /* top-level classes */ Key: Key, parseKey: Key.parse, Fingerprint: Fingerprint, parseFingerprint: Fingerprint.parse, Signature: Signature, parseSignature: Signature.parse, PrivateKey: PrivateKey, parsePrivateKey: PrivateKey.parse, generatePrivateKey: PrivateKey.generate, Certificate: Certificate, parseCertificate: Certificate.parse, createSelfSignedCertificate: Certificate.createSelfSigned, createCertificate: Certificate.create, Identity: Identity, identityFromDN: Identity.parseDN, identityForHost: Identity.forHost, identityForUser: Identity.forUser, identityForEmail: Identity.forEmail, identityFromArray: Identity.fromArray, /* errors */ FingerprintFormatError: errs.FingerprintFormatError, InvalidAlgorithmError: errs.InvalidAlgorithmError, KeyParseError: errs.KeyParseError, SignatureParseError: errs.SignatureParseError, KeyEncryptedError: errs.KeyEncryptedError, CertificateParseError: errs.CertificateParseError }; /***/ }), /***/ 36814: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { // Copyright 2018 Joyent, Inc. module.exports = Key; var assert = __webpack_require__(66631); var algs = __webpack_require__(66126); var crypto = __webpack_require__(33373); var Fingerprint = __webpack_require__(13079); var Signature = __webpack_require__(91394); var DiffieHellman = __webpack_require__(57602).DiffieHellman; var errs = __webpack_require__(27979); var utils = __webpack_require__(80575); var PrivateKey = __webpack_require__(29602); var edCompat; try { edCompat = __webpack_require__(14694); } catch (e) { /* Just continue through, and bail out if we try to use it. */ } var InvalidAlgorithmError = errs.InvalidAlgorithmError; var KeyParseError = errs.KeyParseError; var formats = {}; formats['auto'] = __webpack_require__(8243); formats['pem'] = __webpack_require__(14324); formats['pkcs1'] = __webpack_require__(69367); formats['pkcs8'] = __webpack_require__(4173); formats['rfc4253'] = __webpack_require__(88688); formats['ssh'] = __webpack_require__(68927); formats['ssh-private'] = __webpack_require__(3923); formats['openssh'] = formats['ssh-private']; formats['dnssec'] = __webpack_require__(63561); formats['putty'] = __webpack_require__(80974); formats['ppk'] = formats['putty']; function Key(opts) { assert.object(opts, 'options'); assert.arrayOfObject(opts.parts, 'options.parts'); assert.string(opts.type, 'options.type'); assert.optionalString(opts.comment, 'options.comment'); var algInfo = algs.info[opts.type]; if (typeof (algInfo) !== 'object') throw (new InvalidAlgorithmError(opts.type)); var partLookup = {}; for (var i = 0; i < opts.parts.length; ++i) { var part = opts.parts[i]; partLookup[part.name] = part; } this.type = opts.type; this.parts = opts.parts; this.part = partLookup; this.comment = undefined; this.source = opts.source; /* for speeding up hashing/fingerprint operations */ this._rfc4253Cache = opts._rfc4253Cache; this._hashCache = {}; var sz; this.curve = undefined; if (this.type === 'ecdsa') { var curve = this.part.curve.data.toString(); this.curve = curve; sz = algs.curves[curve].size; } else if (this.type === 'ed25519' || this.type === 'curve25519') { sz = 256; this.curve = 'curve25519'; } else { var szPart = this.part[algInfo.sizePart]; sz = szPart.data.length; sz = sz * 8 - utils.countZeros(szPart.data); } this.size = sz; } Key.formats = formats; Key.prototype.toBuffer = function (format, options) { if (format === undefined) format = 'ssh'; assert.string(format, 'format'); assert.object(formats[format], 'formats[format]'); assert.optionalObject(options, 'options'); if (format === 'rfc4253') { if (this._rfc4253Cache === undefined) this._rfc4253Cache = formats['rfc4253'].write(this); return (this._rfc4253Cache); } return (formats[format].write(this, options)); }; Key.prototype.toString = function (format, options) { return (this.toBuffer(format, options).toString()); }; Key.prototype.hash = function (algo, type) { assert.string(algo, 'algorithm'); assert.optionalString(type, 'type'); if (type === undefined) type = 'ssh'; algo = algo.toLowerCase(); if (algs.hashAlgs[algo] === undefined) throw (new InvalidAlgorithmError(algo)); var cacheKey = algo + '||' + type; if (this._hashCache[cacheKey]) return (this._hashCache[cacheKey]); var buf; if (type === 'ssh') { buf = this.toBuffer('rfc4253'); } else if (type === 'spki') { buf = formats.pkcs8.pkcs8ToBuffer(this); } else { throw (new Error('Hash type ' + type + ' not supported')); } var hash = crypto.createHash(algo).update(buf).digest(); this._hashCache[cacheKey] = hash; return (hash); }; Key.prototype.fingerprint = function (algo, type) { if (algo === undefined) algo = 'sha256'; if (type === undefined) type = 'ssh'; assert.string(algo, 'algorithm'); assert.string(type, 'type'); var opts = { type: 'key', hash: this.hash(algo, type), algorithm: algo, hashType: type }; return (new Fingerprint(opts)); }; Key.prototype.defaultHashAlgorithm = function () { var hashAlgo = 'sha1'; if (this.type === 'rsa') hashAlgo = 'sha256'; if (this.type === 'dsa' && this.size > 1024) hashAlgo = 'sha256'; if (this.type === 'ed25519') hashAlgo = 'sha512'; if (this.type === 'ecdsa') { if (this.size <= 256) hashAlgo = 'sha256'; else if (this.size <= 384) hashAlgo = 'sha384'; else hashAlgo = 'sha512'; } return (hashAlgo); }; Key.prototype.createVerify = function (hashAlgo) { if (hashAlgo === undefined) hashAlgo = this.defaultHashAlgorithm(); assert.string(hashAlgo, 'hash algorithm'); /* ED25519 is not supported by OpenSSL, use a javascript impl. */ if (this.type === 'ed25519' && edCompat !== undefined) return (new edCompat.Verifier(this, hashAlgo)); if (this.type === 'curve25519') throw (new Error('Curve25519 keys are not suitable for ' + 'signing or verification')); var v, nm, err; try { nm = hashAlgo.toUpperCase(); v = crypto.createVerify(nm); } catch (e) { err = e; } if (v === undefined || (err instanceof Error && err.message.match(/Unknown message digest/))) { nm = 'RSA-'; nm += hashAlgo.toUpperCase(); v = crypto.createVerify(nm); } assert.ok(v, 'failed to create verifier'); var oldVerify = v.verify.bind(v); var key = this.toBuffer('pkcs8'); var curve = this.curve; var self = this; v.verify = function (signature, fmt) { if (Signature.isSignature(signature, [2, 0])) { if (signature.type !== self.type) return (false); if (signature.hashAlgorithm && signature.hashAlgorithm !== hashAlgo) return (false); if (signature.curve && self.type === 'ecdsa' && signature.curve !== curve) return (false); return (oldVerify(key, signature.toBuffer('asn1'))); } else if (typeof (signature) === 'string' || Buffer.isBuffer(signature)) { return (oldVerify(key, signature, fmt)); /* * Avoid doing this on valid arguments, walking the prototype * chain can be quite slow. */ } else if (Signature.isSignature(signature, [1, 0])) { throw (new Error('signature was created by too old ' + 'a version of sshpk and cannot be verified')); } else { throw (new TypeError('signature must be a string, ' + 'Buffer, or Signature object')); } }; return (v); }; Key.prototype.createDiffieHellman = function () { if (this.type === 'rsa') throw (new Error('RSA keys do not support Diffie-Hellman')); return (new DiffieHellman(this)); }; Key.prototype.createDH = Key.prototype.createDiffieHellman; Key.parse = function (data, format, options) { if (typeof (data) !== 'string') assert.buffer(data, 'data'); if (format === undefined) format = 'auto'; assert.string(format, 'format'); if (typeof (options) === 'string') options = { filename: options }; assert.optionalObject(options, 'options'); if (options === undefined) options = {}; assert.optionalString(options.filename, 'options.filename'); if (options.filename === undefined) options.filename = '(unnamed)'; assert.object(formats[format], 'formats[format]'); try { var k = formats[format].read(data, options); if (k instanceof PrivateKey) k = k.toPublic(); if (!k.comment) k.comment = options.filename; return (k); } catch (e) { if (e.name === 'KeyEncryptedError') throw (e); throw (new KeyParseError(options.filename, format, e)); } }; Key.isKey = function (obj, ver) { return (utils.isCompatible(obj, Key, ver)); }; /* * API versions for Key: * [1,0] -- initial ver, may take Signature for createVerify or may not * [1,1] -- added pkcs1, pkcs8 formats * [1,2] -- added auto, ssh-private, openssh formats * [1,3] -- added defaultHashAlgorithm * [1,4] -- added ed support, createDH * [1,5] -- first explicitly tagged version * [1,6] -- changed ed25519 part names * [1,7] -- spki hash types */ Key.prototype._sshpkApiVersion = [1, 7]; Key._oldVersionDetect = function (obj) { assert.func(obj.toBuffer); assert.func(obj.fingerprint); if (obj.createDH) return ([1, 4]); if (obj.defaultHashAlgorithm) return ([1, 3]); if (obj.formats['auto']) return ([1, 2]); if (obj.formats['pkcs1']) return ([1, 1]); return ([1, 0]); }; /***/ }), /***/ 29602: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { // Copyright 2017 Joyent, Inc. module.exports = PrivateKey; var assert = __webpack_require__(66631); var Buffer = __webpack_require__(15118).Buffer; var algs = __webpack_require__(66126); var crypto = __webpack_require__(33373); var Fingerprint = __webpack_require__(13079); var Signature = __webpack_require__(91394); var errs = __webpack_require__(27979); var util = __webpack_require__(31669); var utils = __webpack_require__(80575); var dhe = __webpack_require__(57602); var generateECDSA = dhe.generateECDSA; var generateED25519 = dhe.generateED25519; var edCompat = __webpack_require__(14694); var nacl = __webpack_require__(68729); var Key = __webpack_require__(36814); var InvalidAlgorithmError = errs.InvalidAlgorithmError; var KeyParseError = errs.KeyParseError; var KeyEncryptedError = errs.KeyEncryptedError; var formats = {}; formats['auto'] = __webpack_require__(8243); formats['pem'] = __webpack_require__(14324); formats['pkcs1'] = __webpack_require__(69367); formats['pkcs8'] = __webpack_require__(4173); formats['rfc4253'] = __webpack_require__(88688); formats['ssh-private'] = __webpack_require__(3923); formats['openssh'] = formats['ssh-private']; formats['ssh'] = formats['ssh-private']; formats['dnssec'] = __webpack_require__(63561); function PrivateKey(opts) { assert.object(opts, 'options'); Key.call(this, opts); this._pubCache = undefined; } util.inherits(PrivateKey, Key); PrivateKey.formats = formats; PrivateKey.prototype.toBuffer = function (format, options) { if (format === undefined) format = 'pkcs1'; assert.string(format, 'format'); assert.object(formats[format], 'formats[format]'); assert.optionalObject(options, 'options'); return (formats[format].write(this, options)); }; PrivateKey.prototype.hash = function (algo, type) { return (this.toPublic().hash(algo, type)); }; PrivateKey.prototype.fingerprint = function (algo, type) { return (this.toPublic().fingerprint(algo, type)); }; PrivateKey.prototype.toPublic = function () { if (this._pubCache) return (this._pubCache); var algInfo = algs.info[this.type]; var pubParts = []; for (var i = 0; i < algInfo.parts.length; ++i) { var p = algInfo.parts[i]; pubParts.push(this.part[p]); } this._pubCache = new Key({ type: this.type, source: this, parts: pubParts }); if (this.comment) this._pubCache.comment = this.comment; return (this._pubCache); }; PrivateKey.prototype.derive = function (newType) { assert.string(newType, 'type'); var priv, pub, pair; if (this.type === 'ed25519' && newType === 'curve25519') { priv = this.part.k.data; if (priv[0] === 0x00) priv = priv.slice(1); pair = nacl.box.keyPair.fromSecretKey(new Uint8Array(priv)); pub = Buffer.from(pair.publicKey); return (new PrivateKey({ type: 'curve25519', parts: [ { name: 'A', data: utils.mpNormalize(pub) }, { name: 'k', data: utils.mpNormalize(priv) } ] })); } else if (this.type === 'curve25519' && newType === 'ed25519') { priv = this.part.k.data; if (priv[0] === 0x00) priv = priv.slice(1); pair = nacl.sign.keyPair.fromSeed(new Uint8Array(priv)); pub = Buffer.from(pair.publicKey); return (new PrivateKey({ type: 'ed25519', parts: [ { name: 'A', data: utils.mpNormalize(pub) }, { name: 'k', data: utils.mpNormalize(priv) } ] })); } throw (new Error('Key derivation not supported from ' + this.type + ' to ' + newType)); }; PrivateKey.prototype.createVerify = function (hashAlgo) { return (this.toPublic().createVerify(hashAlgo)); }; PrivateKey.prototype.createSign = function (hashAlgo) { if (hashAlgo === undefined) hashAlgo = this.defaultHashAlgorithm(); assert.string(hashAlgo, 'hash algorithm'); /* ED25519 is not supported by OpenSSL, use a javascript impl. */ if (this.type === 'ed25519' && edCompat !== undefined) return (new edCompat.Signer(this, hashAlgo)); if (this.type === 'curve25519') throw (new Error('Curve25519 keys are not suitable for ' + 'signing or verification')); var v, nm, err; try { nm = hashAlgo.toUpperCase(); v = crypto.createSign(nm); } catch (e) { err = e; } if (v === undefined || (err instanceof Error && err.message.match(/Unknown message digest/))) { nm = 'RSA-'; nm += hashAlgo.toUpperCase(); v = crypto.createSign(nm); } assert.ok(v, 'failed to create verifier'); var oldSign = v.sign.bind(v); var key = this.toBuffer('pkcs1'); var type = this.type; var curve = this.curve; v.sign = function () { var sig = oldSign(key); if (typeof (sig) === 'string') sig = Buffer.from(sig, 'binary'); sig = Signature.parse(sig, type, 'asn1'); sig.hashAlgorithm = hashAlgo; sig.curve = curve; return (sig); }; return (v); }; PrivateKey.parse = function (data, format, options) { if (typeof (data) !== 'string') assert.buffer(data, 'data'); if (format === undefined) format = 'auto'; assert.string(format, 'format'); if (typeof (options) === 'string') options = { filename: options }; assert.optionalObject(options, 'options'); if (options === undefined) options = {}; assert.optionalString(options.filename, 'options.filename'); if (options.filename === undefined) options.filename = '(unnamed)'; assert.object(formats[format], 'formats[format]'); try { var k = formats[format].read(data, options); assert.ok(k instanceof PrivateKey, 'key is not a private key'); if (!k.comment) k.comment = options.filename; return (k); } catch (e) { if (e.name === 'KeyEncryptedError') throw (e); throw (new KeyParseError(options.filename, format, e)); } }; PrivateKey.isPrivateKey = function (obj, ver) { return (utils.isCompatible(obj, PrivateKey, ver)); }; PrivateKey.generate = function (type, options) { if (options === undefined) options = {}; assert.object(options, 'options'); switch (type) { case 'ecdsa': if (options.curve === undefined) options.curve = 'nistp256'; assert.string(options.curve, 'options.curve'); return (generateECDSA(options.curve)); case 'ed25519': return (generateED25519()); default: throw (new Error('Key generation not supported with key ' + 'type "' + type + '"')); } }; /* * API versions for PrivateKey: * [1,0] -- initial ver * [1,1] -- added auto, pkcs[18], openssh/ssh-private formats * [1,2] -- added defaultHashAlgorithm * [1,3] -- added derive, ed, createDH * [1,4] -- first tagged version * [1,5] -- changed ed25519 part names and format * [1,6] -- type arguments for hash() and fingerprint() */ PrivateKey.prototype._sshpkApiVersion = [1, 6]; PrivateKey._oldVersionDetect = function (obj) { assert.func(obj.toPublic); assert.func(obj.createSign); if (obj.derive) return ([1, 3]); if (obj.defaultHashAlgorithm) return ([1, 2]); if (obj.formats['auto']) return ([1, 1]); return ([1, 0]); }; /***/ }), /***/ 91394: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { // Copyright 2015 Joyent, Inc. module.exports = Signature; var assert = __webpack_require__(66631); var Buffer = __webpack_require__(15118).Buffer; var algs = __webpack_require__(66126); var crypto = __webpack_require__(33373); var errs = __webpack_require__(27979); var utils = __webpack_require__(80575); var asn1 = __webpack_require__(80970); var SSHBuffer = __webpack_require__(25621); var InvalidAlgorithmError = errs.InvalidAlgorithmError; var SignatureParseError = errs.SignatureParseError; function Signature(opts) { assert.object(opts, 'options'); assert.arrayOfObject(opts.parts, 'options.parts'); assert.string(opts.type, 'options.type'); var partLookup = {}; for (var i = 0; i < opts.parts.length; ++i) { var part = opts.parts[i]; partLookup[part.name] = part; } this.type = opts.type; this.hashAlgorithm = opts.hashAlgo; this.curve = opts.curve; this.parts = opts.parts; this.part = partLookup; } Signature.prototype.toBuffer = function (format) { if (format === undefined) format = 'asn1'; assert.string(format, 'format'); var buf; var stype = 'ssh-' + this.type; switch (this.type) { case 'rsa': switch (this.hashAlgorithm) { case 'sha256': stype = 'rsa-sha2-256'; break; case 'sha512': stype = 'rsa-sha2-512'; break; case 'sha1': case undefined: break; default: throw (new Error('SSH signature ' + 'format does not support hash ' + 'algorithm ' + this.hashAlgorithm)); } if (format === 'ssh') { buf = new SSHBuffer({}); buf.writeString(stype); buf.writePart(this.part.sig); return (buf.toBuffer()); } else { return (this.part.sig.data); } break; case 'ed25519': if (format === 'ssh') { buf = new SSHBuffer({}); buf.writeString(stype); buf.writePart(this.part.sig); return (buf.toBuffer()); } else { return (this.part.sig.data); } break; case 'dsa': case 'ecdsa': var r, s; if (format === 'asn1') { var der = new asn1.BerWriter(); der.startSequence(); r = utils.mpNormalize(this.part.r.data); s = utils.mpNormalize(this.part.s.data); der.writeBuffer(r, asn1.Ber.Integer); der.writeBuffer(s, asn1.Ber.Integer); der.endSequence(); return (der.buffer); } else if (format === 'ssh' && this.type === 'dsa') { buf = new SSHBuffer({}); buf.writeString('ssh-dss'); r = this.part.r.data; if (r.length > 20 && r[0] === 0x00) r = r.slice(1); s = this.part.s.data; if (s.length > 20 && s[0] === 0x00) s = s.slice(1); if ((this.hashAlgorithm && this.hashAlgorithm !== 'sha1') || r.length + s.length !== 40) { throw (new Error('OpenSSH only supports ' + 'DSA signatures with SHA1 hash')); } buf.writeBuffer(Buffer.concat([r, s])); return (buf.toBuffer()); } else if (format === 'ssh' && this.type === 'ecdsa') { var inner = new SSHBuffer({}); r = this.part.r.data; inner.writeBuffer(r); inner.writePart(this.part.s); buf = new SSHBuffer({}); /* XXX: find a more proper way to do this? */ var curve; if (r[0] === 0x00) r = r.slice(1); var sz = r.length * 8; if (sz === 256) curve = 'nistp256'; else if (sz === 384) curve = 'nistp384'; else if (sz === 528) curve = 'nistp521'; buf.writeString('ecdsa-sha2-' + curve); buf.writeBuffer(inner.toBuffer()); return (buf.toBuffer()); } throw (new Error('Invalid signature format')); default: throw (new Error('Invalid signature data')); } }; Signature.prototype.toString = function (format) { assert.optionalString(format, 'format'); return (this.toBuffer(format).toString('base64')); }; Signature.parse = function (data, type, format) { if (typeof (data) === 'string') data = Buffer.from(data, 'base64'); assert.buffer(data, 'data'); assert.string(format, 'format'); assert.string(type, 'type'); var opts = {}; opts.type = type.toLowerCase(); opts.parts = []; try { assert.ok(data.length > 0, 'signature must not be empty'); switch (opts.type) { case 'rsa': return (parseOneNum(data, type, format, opts)); case 'ed25519': return (parseOneNum(data, type, format, opts)); case 'dsa': case 'ecdsa': if (format === 'asn1') return (parseDSAasn1(data, type, format, opts)); else if (opts.type === 'dsa') return (parseDSA(data, type, format, opts)); else return (parseECDSA(data, type, format, opts)); default: throw (new InvalidAlgorithmError(type)); } } catch (e) { if (e instanceof InvalidAlgorithmError) throw (e); throw (new SignatureParseError(type, format, e)); } }; function parseOneNum(data, type, format, opts) { if (format === 'ssh') { try { var buf = new SSHBuffer({buffer: data}); var head = buf.readString(); } catch (e) { /* fall through */ } if (buf !== undefined) { var msg = 'SSH signature does not match expected ' + 'type (expected ' + type + ', got ' + head + ')'; switch (head) { case 'ssh-rsa': assert.strictEqual(type, 'rsa', msg); opts.hashAlgo = 'sha1'; break; case 'rsa-sha2-256': assert.strictEqual(type, 'rsa', msg); opts.hashAlgo = 'sha256'; break; case 'rsa-sha2-512': assert.strictEqual(type, 'rsa', msg); opts.hashAlgo = 'sha512'; break; case 'ssh-ed25519': assert.strictEqual(type, 'ed25519', msg); opts.hashAlgo = 'sha512'; break; default: throw (new Error('Unknown SSH signature ' + 'type: ' + head)); } var sig = buf.readPart(); assert.ok(buf.atEnd(), 'extra trailing bytes'); sig.name = 'sig'; opts.parts.push(sig); return (new Signature(opts)); } } opts.parts.push({name: 'sig', data: data}); return (new Signature(opts)); } function parseDSAasn1(data, type, format, opts) { var der = new asn1.BerReader(data); der.readSequence(); var r = der.readString(asn1.Ber.Integer, true); var s = der.readString(asn1.Ber.Integer, true); opts.parts.push({name: 'r', data: utils.mpNormalize(r)}); opts.parts.push({name: 's', data: utils.mpNormalize(s)}); return (new Signature(opts)); } function parseDSA(data, type, format, opts) { if (data.length != 40) { var buf = new SSHBuffer({buffer: data}); var d = buf.readBuffer(); if (d.toString('ascii') === 'ssh-dss') d = buf.readBuffer(); assert.ok(buf.atEnd(), 'extra trailing bytes'); assert.strictEqual(d.length, 40, 'invalid inner length'); data = d; } opts.parts.push({name: 'r', data: data.slice(0, 20)}); opts.parts.push({name: 's', data: data.slice(20, 40)}); return (new Signature(opts)); } function parseECDSA(data, type, format, opts) { var buf = new SSHBuffer({buffer: data}); var r, s; var inner = buf.readBuffer(); var stype = inner.toString('ascii'); if (stype.slice(0, 6) === 'ecdsa-') { var parts = stype.split('-'); assert.strictEqual(parts[0], 'ecdsa'); assert.strictEqual(parts[1], 'sha2'); opts.curve = parts[2]; switch (opts.curve) { case 'nistp256': opts.hashAlgo = 'sha256'; break; case 'nistp384': opts.hashAlgo = 'sha384'; break; case 'nistp521': opts.hashAlgo = 'sha512'; break; default: throw (new Error('Unsupported ECDSA curve: ' + opts.curve)); } inner = buf.readBuffer(); assert.ok(buf.atEnd(), 'extra trailing bytes on outer'); buf = new SSHBuffer({buffer: inner}); r = buf.readPart(); } else { r = {data: inner}; } s = buf.readPart(); assert.ok(buf.atEnd(), 'extra trailing bytes'); r.name = 'r'; s.name = 's'; opts.parts.push(r); opts.parts.push(s); return (new Signature(opts)); } Signature.isSignature = function (obj, ver) { return (utils.isCompatible(obj, Signature, ver)); }; /* * API versions for Signature: * [1,0] -- initial ver * [2,0] -- support for rsa in full ssh format, compat with sshpk-agent * hashAlgorithm property * [2,1] -- first tagged version */ Signature.prototype._sshpkApiVersion = [2, 1]; Signature._oldVersionDetect = function (obj) { assert.func(obj.toBuffer); if (obj.hasOwnProperty('hashAlgorithm')) return ([2, 0]); return ([1, 0]); }; /***/ }), /***/ 25621: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { // Copyright 2015 Joyent, Inc. module.exports = SSHBuffer; var assert = __webpack_require__(66631); var Buffer = __webpack_require__(15118).Buffer; function SSHBuffer(opts) { assert.object(opts, 'options'); if (opts.buffer !== undefined) assert.buffer(opts.buffer, 'options.buffer'); this._size = opts.buffer ? opts.buffer.length : 1024; this._buffer = opts.buffer || Buffer.alloc(this._size); this._offset = 0; } SSHBuffer.prototype.toBuffer = function () { return (this._buffer.slice(0, this._offset)); }; SSHBuffer.prototype.atEnd = function () { return (this._offset >= this._buffer.length); }; SSHBuffer.prototype.remainder = function () { return (this._buffer.slice(this._offset)); }; SSHBuffer.prototype.skip = function (n) { this._offset += n; }; SSHBuffer.prototype.expand = function () { this._size *= 2; var buf = Buffer.alloc(this._size); this._buffer.copy(buf, 0); this._buffer = buf; }; SSHBuffer.prototype.readPart = function () { return ({data: this.readBuffer()}); }; SSHBuffer.prototype.readBuffer = function () { var len = this._buffer.readUInt32BE(this._offset); this._offset += 4; assert.ok(this._offset + len <= this._buffer.length, 'length out of bounds at +0x' + this._offset.toString(16) + ' (data truncated?)'); var buf = this._buffer.slice(this._offset, this._offset + len); this._offset += len; return (buf); }; SSHBuffer.prototype.readString = function () { return (this.readBuffer().toString()); }; SSHBuffer.prototype.readCString = function () { var offset = this._offset; while (offset < this._buffer.length && this._buffer[offset] !== 0x00) offset++; assert.ok(offset < this._buffer.length, 'c string does not terminate'); var str = this._buffer.slice(this._offset, offset).toString(); this._offset = offset + 1; return (str); }; SSHBuffer.prototype.readInt = function () { var v = this._buffer.readUInt32BE(this._offset); this._offset += 4; return (v); }; SSHBuffer.prototype.readInt64 = function () { assert.ok(this._offset + 8 < this._buffer.length, 'buffer not long enough to read Int64'); var v = this._buffer.slice(this._offset, this._offset + 8); this._offset += 8; return (v); }; SSHBuffer.prototype.readChar = function () { var v = this._buffer[this._offset++]; return (v); }; SSHBuffer.prototype.writeBuffer = function (buf) { while (this._offset + 4 + buf.length > this._size) this.expand(); this._buffer.writeUInt32BE(buf.length, this._offset); this._offset += 4; buf.copy(this._buffer, this._offset); this._offset += buf.length; }; SSHBuffer.prototype.writeString = function (str) { this.writeBuffer(Buffer.from(str, 'utf8')); }; SSHBuffer.prototype.writeCString = function (str) { while (this._offset + 1 + str.length > this._size) this.expand(); this._buffer.write(str, this._offset); this._offset += str.length; this._buffer[this._offset++] = 0; }; SSHBuffer.prototype.writeInt = function (v) { while (this._offset + 4 > this._size) this.expand(); this._buffer.writeUInt32BE(v, this._offset); this._offset += 4; }; SSHBuffer.prototype.writeInt64 = function (v) { assert.buffer(v, 'value'); if (v.length > 8) { var lead = v.slice(0, v.length - 8); for (var i = 0; i < lead.length; ++i) { assert.strictEqual(lead[i], 0, 'must fit in 64 bits of precision'); } v = v.slice(v.length - 8, v.length); } while (this._offset + 8 > this._size) this.expand(); v.copy(this._buffer, this._offset); this._offset += 8; }; SSHBuffer.prototype.writeChar = function (v) { while (this._offset + 1 > this._size) this.expand(); this._buffer[this._offset++] = v; }; SSHBuffer.prototype.writePart = function (p) { this.writeBuffer(p.data); }; SSHBuffer.prototype.write = function (buf) { while (this._offset + buf.length > this._size) this.expand(); buf.copy(this._buffer, this._offset); this._offset += buf.length; }; /***/ }), /***/ 80575: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { // Copyright 2015 Joyent, Inc. module.exports = { bufferSplit: bufferSplit, addRSAMissing: addRSAMissing, calculateDSAPublic: calculateDSAPublic, calculateED25519Public: calculateED25519Public, calculateX25519Public: calculateX25519Public, mpNormalize: mpNormalize, mpDenormalize: mpDenormalize, ecNormalize: ecNormalize, countZeros: countZeros, assertCompatible: assertCompatible, isCompatible: isCompatible, opensslKeyDeriv: opensslKeyDeriv, opensshCipherInfo: opensshCipherInfo, publicFromPrivateECDSA: publicFromPrivateECDSA, zeroPadToLength: zeroPadToLength, writeBitString: writeBitString, readBitString: readBitString, pbkdf2: pbkdf2 }; var assert = __webpack_require__(66631); var Buffer = __webpack_require__(15118).Buffer; var PrivateKey = __webpack_require__(29602); var Key = __webpack_require__(36814); var crypto = __webpack_require__(33373); var algs = __webpack_require__(66126); var asn1 = __webpack_require__(80970); var ec = __webpack_require__(3943); var jsbn = __webpack_require__(85587).BigInteger; var nacl = __webpack_require__(68729); var MAX_CLASS_DEPTH = 3; function isCompatible(obj, klass, needVer) { if (obj === null || typeof (obj) !== 'object') return (false); if (needVer === undefined) needVer = klass.prototype._sshpkApiVersion; if (obj instanceof klass && klass.prototype._sshpkApiVersion[0] == needVer[0]) return (true); var proto = Object.getPrototypeOf(obj); var depth = 0; while (proto.constructor.name !== klass.name) { proto = Object.getPrototypeOf(proto); if (!proto || ++depth > MAX_CLASS_DEPTH) return (false); } if (proto.constructor.name !== klass.name) return (false); var ver = proto._sshpkApiVersion; if (ver === undefined) ver = klass._oldVersionDetect(obj); if (ver[0] != needVer[0] || ver[1] < needVer[1]) return (false); return (true); } function assertCompatible(obj, klass, needVer, name) { if (name === undefined) name = 'object'; assert.ok(obj, name + ' must not be null'); assert.object(obj, name + ' must be an object'); if (needVer === undefined) needVer = klass.prototype._sshpkApiVersion; if (obj instanceof klass && klass.prototype._sshpkApiVersion[0] == needVer[0]) return; var proto = Object.getPrototypeOf(obj); var depth = 0; while (proto.constructor.name !== klass.name) { proto = Object.getPrototypeOf(proto); assert.ok(proto && ++depth <= MAX_CLASS_DEPTH, name + ' must be a ' + klass.name + ' instance'); } assert.strictEqual(proto.constructor.name, klass.name, name + ' must be a ' + klass.name + ' instance'); var ver = proto._sshpkApiVersion; if (ver === undefined) ver = klass._oldVersionDetect(obj); assert.ok(ver[0] == needVer[0] && ver[1] >= needVer[1], name + ' must be compatible with ' + klass.name + ' klass ' + 'version ' + needVer[0] + '.' + needVer[1]); } var CIPHER_LEN = { 'des-ede3-cbc': { key: 24, iv: 8 }, 'aes-128-cbc': { key: 16, iv: 16 }, 'aes-256-cbc': { key: 32, iv: 16 } }; var PKCS5_SALT_LEN = 8; function opensslKeyDeriv(cipher, salt, passphrase, count) { assert.buffer(salt, 'salt'); assert.buffer(passphrase, 'passphrase'); assert.number(count, 'iteration count'); var clen = CIPHER_LEN[cipher]; assert.object(clen, 'supported cipher'); salt = salt.slice(0, PKCS5_SALT_LEN); var D, D_prev, bufs; var material = Buffer.alloc(0); while (material.length < clen.key + clen.iv) { bufs = []; if (D_prev) bufs.push(D_prev); bufs.push(passphrase); bufs.push(salt); D = Buffer.concat(bufs); for (var j = 0; j < count; ++j) D = crypto.createHash('md5').update(D).digest(); material = Buffer.concat([material, D]); D_prev = D; } return ({ key: material.slice(0, clen.key), iv: material.slice(clen.key, clen.key + clen.iv) }); } /* See: RFC2898 */ function pbkdf2(hashAlg, salt, iterations, size, passphrase) { var hkey = Buffer.alloc(salt.length + 4); salt.copy(hkey); var gen = 0, ts = []; var i = 1; while (gen < size) { var t = T(i++); gen += t.length; ts.push(t); } return (Buffer.concat(ts).slice(0, size)); function T(I) { hkey.writeUInt32BE(I, hkey.length - 4); var hmac = crypto.createHmac(hashAlg, passphrase); hmac.update(hkey); var Ti = hmac.digest(); var Uc = Ti; var c = 1; while (c++ < iterations) { hmac = crypto.createHmac(hashAlg, passphrase); hmac.update(Uc); Uc = hmac.digest(); for (var x = 0; x < Ti.length; ++x) Ti[x] ^= Uc[x]; } return (Ti); } } /* Count leading zero bits on a buffer */ function countZeros(buf) { var o = 0, obit = 8; while (o < buf.length) { var mask = (1 << obit); if ((buf[o] & mask) === mask) break; obit--; if (obit < 0) { o++; obit = 8; } } return (o*8 + (8 - obit) - 1); } function bufferSplit(buf, chr) { assert.buffer(buf); assert.string(chr); var parts = []; var lastPart = 0; var matches = 0; for (var i = 0; i < buf.length; ++i) { if (buf[i] === chr.charCodeAt(matches)) ++matches; else if (buf[i] === chr.charCodeAt(0)) matches = 1; else matches = 0; if (matches >= chr.length) { var newPart = i + 1; parts.push(buf.slice(lastPart, newPart - matches)); lastPart = newPart; matches = 0; } } if (lastPart <= buf.length) parts.push(buf.slice(lastPart, buf.length)); return (parts); } function ecNormalize(buf, addZero) { assert.buffer(buf); if (buf[0] === 0x00 && buf[1] === 0x04) { if (addZero) return (buf); return (buf.slice(1)); } else if (buf[0] === 0x04) { if (!addZero) return (buf); } else { while (buf[0] === 0x00) buf = buf.slice(1); if (buf[0] === 0x02 || buf[0] === 0x03) throw (new Error('Compressed elliptic curve points ' + 'are not supported')); if (buf[0] !== 0x04) throw (new Error('Not a valid elliptic curve point')); if (!addZero) return (buf); } var b = Buffer.alloc(buf.length + 1); b[0] = 0x0; buf.copy(b, 1); return (b); } function readBitString(der, tag) { if (tag === undefined) tag = asn1.Ber.BitString; var buf = der.readString(tag, true); assert.strictEqual(buf[0], 0x00, 'bit strings with unused bits are ' + 'not supported (0x' + buf[0].toString(16) + ')'); return (buf.slice(1)); } function writeBitString(der, buf, tag) { if (tag === undefined) tag = asn1.Ber.BitString; var b = Buffer.alloc(buf.length + 1); b[0] = 0x00; buf.copy(b, 1); der.writeBuffer(b, tag); } function mpNormalize(buf) { assert.buffer(buf); while (buf.length > 1 && buf[0] === 0x00 && (buf[1] & 0x80) === 0x00) buf = buf.slice(1); if ((buf[0] & 0x80) === 0x80) { var b = Buffer.alloc(buf.length + 1); b[0] = 0x00; buf.copy(b, 1); buf = b; } return (buf); } function mpDenormalize(buf) { assert.buffer(buf); while (buf.length > 1 && buf[0] === 0x00) buf = buf.slice(1); return (buf); } function zeroPadToLength(buf, len) { assert.buffer(buf); assert.number(len); while (buf.length > len) { assert.equal(buf[0], 0x00); buf = buf.slice(1); } while (buf.length < len) { var b = Buffer.alloc(buf.length + 1); b[0] = 0x00; buf.copy(b, 1); buf = b; } return (buf); } function bigintToMpBuf(bigint) { var buf = Buffer.from(bigint.toByteArray()); buf = mpNormalize(buf); return (buf); } function calculateDSAPublic(g, p, x) { assert.buffer(g); assert.buffer(p); assert.buffer(x); g = new jsbn(g); p = new jsbn(p); x = new jsbn(x); var y = g.modPow(x, p); var ybuf = bigintToMpBuf(y); return (ybuf); } function calculateED25519Public(k) { assert.buffer(k); var kp = nacl.sign.keyPair.fromSeed(new Uint8Array(k)); return (Buffer.from(kp.publicKey)); } function calculateX25519Public(k) { assert.buffer(k); var kp = nacl.box.keyPair.fromSeed(new Uint8Array(k)); return (Buffer.from(kp.publicKey)); } function addRSAMissing(key) { assert.object(key); assertCompatible(key, PrivateKey, [1, 1]); var d = new jsbn(key.part.d.data); var buf; if (!key.part.dmodp) { var p = new jsbn(key.part.p.data); var dmodp = d.mod(p.subtract(1)); buf = bigintToMpBuf(dmodp); key.part.dmodp = {name: 'dmodp', data: buf}; key.parts.push(key.part.dmodp); } if (!key.part.dmodq) { var q = new jsbn(key.part.q.data); var dmodq = d.mod(q.subtract(1)); buf = bigintToMpBuf(dmodq); key.part.dmodq = {name: 'dmodq', data: buf}; key.parts.push(key.part.dmodq); } } function publicFromPrivateECDSA(curveName, priv) { assert.string(curveName, 'curveName'); assert.buffer(priv); var params = algs.curves[curveName]; var p = new jsbn(params.p); var a = new jsbn(params.a); var b = new jsbn(params.b); var curve = new ec.ECCurveFp(p, a, b); var G = curve.decodePointHex(params.G.toString('hex')); var d = new jsbn(mpNormalize(priv)); var pub = G.multiply(d); pub = Buffer.from(curve.encodePointHex(pub), 'hex'); var parts = []; parts.push({name: 'curve', data: Buffer.from(curveName)}); parts.push({name: 'Q', data: pub}); var key = new Key({type: 'ecdsa', curve: curve, parts: parts}); return (key); } function opensshCipherInfo(cipher) { var inf = {}; switch (cipher) { case '3des-cbc': inf.keySize = 24; inf.blockSize = 8; inf.opensslName = 'des-ede3-cbc'; break; case 'blowfish-cbc': inf.keySize = 16; inf.blockSize = 8; inf.opensslName = 'bf-cbc'; break; case 'aes128-cbc': case 'aes128-ctr': case 'aes128-gcm@openssh.com': inf.keySize = 16; inf.blockSize = 16; inf.opensslName = 'aes-128-' + cipher.slice(7, 10); break; case 'aes192-cbc': case 'aes192-ctr': case 'aes192-gcm@openssh.com': inf.keySize = 24; inf.blockSize = 16; inf.opensslName = 'aes-192-' + cipher.slice(7, 10); break; case 'aes256-cbc': case 'aes256-ctr': case 'aes256-gcm@openssh.com': inf.keySize = 32; inf.blockSize = 16; inf.opensslName = 'aes-256-' + cipher.slice(7, 10); break; default: throw (new Error( 'Unsupported openssl cipher "' + cipher + '"')); } return (inf); } /***/ }), /***/ 91860: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { const Component = __webpack_require__(33314) class Client { constructor (options) { const backend = options.backend if (!backend) throw new Error('expected "backend"') const root = new Component({ splits: [], backend, getNames: options.getNames }) if (options.spec) root._addSpec(options.spec) return root } } module.exports = Client /***/ }), /***/ 96789: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { const Client = __webpack_require__(91860) const Component = __webpack_require__(33314) module.exports = { Client, Component } /***/ }), /***/ 33314: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { /* eslint-disable no-sync */ /** * @file Convert a OpenAPI/Swagger specification into a API client. * * Represent Swagger a Path Item Object [1] with chains of objects: * * /api/v1/namespaces -> api.v1.namespaces * * Associate operations on a Path Item Object with functions: * * GET /api/v1/namespaces -> api.v1.namespaces.get() * * Represent Path Templating [2] with function calls: * * /api/v1/namespaces/{namespace}/pods -> api.v1.namespaces(namespace).pods * * Iterate over a Paths Object [3] to generate whole API client. * * [1]: https://swagger.io/specification/#pathItemObject * [2]: https://swagger.io/specification/#pathTemplating * [3]: https://swagger.io/specification/#pathsObject */ const merge = __webpack_require__(56323) const isPlainObject = __webpack_require__(69257) class Endpoint { /** * Internal representation of a Swagger Path Item Object. * @param {object} options - Options object * @param {string} options.name - Path Item Object name * @param {array} options.splits - Pathname pieces split in '/' * @param {object} options.pathItem - Swagger Path Item Object. */ constructor (options) { this.name = options.name this.splits = options.splits this.pathItem = options.pathItem } } class Component { /** * Represents a single path split, child Components, and potentially a Path * Item Object. * @param {object} options - Options object * @param {object} options.http - Request object * @param {array} options.splits - Absolute pathname (split on '/') * @param {string} options.parameters - Path Template values for parents * @param {string} options.template - Optional Path Template (e.g., {name}) */ constructor (options) { options = Object.assign({ splits: [], parameters: [] }, options) let component // // Support Path Templating: use a function to create a a Component-like // object if required. Otherwise use a vanilla object (that isn't callable). // if (options.templated) { component = name => { const splits = component.splits.concat([name]) // // Assume that we'll never have a path with adjacent templates. // E.g., assume `/foo/{name}/{property}` cannot exist. // const namedComponent = new this.constructor({ backend: component.backend, getNames: options.getNames, splits: splits, parameters: options.parameters.concat([name]) }) component.templatedEndpoints.forEach(child => { namedComponent._addEndpoint(child) }) return namedComponent } component.templatedEndpoints = [] // // Attach methods // Object.setPrototypeOf(component, this.constructor.prototype) } else { component = this component.templatedEndpoints = null } component.parameters = options.parameters component.templated = options.templated component.splits = options.splits.slice() component.backend = options.backend component.getNames = options.getNames || (split => [split]) component.children = [] return component } /** * Get the path. * @returns {string} path with '/' as the separator. */ getPath () { return `/${this.splits.join('/')}` } /** * Return an object of pathname parameters. * @returns {object} object mapping each parameter name to its value. */ getPathnameParameters () { const pathnameParameterNames = this.swaggerName .split('/') .filter(component => component.startsWith('{')) .map(component => component.slice(1, -1)) return pathnameParameterNames.reduce((acc, value, index) => { acc[value] = this.parameters[index] return acc }, {}) } /** * Add endpoints defined by a swagger spec to this component. You would * typically call this only on the root component to add API resources. For * example, during client initialization, to extend the client with CRDs. * @param {object} spec - Swagger specification */ _addSpec (spec) { // // TODO(sbw): It's important to add endpoints with templating before adding // any endpoints with paths that are subpaths of templated paths. // // E.g., add /api/v1/namepaces/{namespace} before adding /api/v1/namepaces // // This is important because ._addEndpoint constructs Component objects on // demand, and Component requires specifying if it's templated or not. If we // cause ._addEndpoint to construct a un-templated Component, templated // operations that share the Components subpath will not work. // Object.keys(spec.paths) .map(name => { const leadingAndTrailingSlashes = /(^\/)|(\/$)/g const splits = name.replace(leadingAndTrailingSlashes, '').split('/') return new Endpoint({ name, splits, pathItem: spec.paths[name] }) }) .sort((endpoint0, endpoint1) => { return endpoint1.splits.length - endpoint0.splits.length }).forEach(endpoint => { this._addEndpoint(endpoint) }) } _addChild (split, component) { this.getNames(split, this.splits).forEach(name => { this[name] = component this.children.push(name) }) } _walkSplits (endpoint) { const splits = this.splits.slice() const nextSplits = endpoint.splits.slice() let parent = this while (nextSplits.length) { const split = nextSplits.shift() splits.push(split) let template = null if (nextSplits.length && nextSplits[0].startsWith('{')) { template = nextSplits.shift().slice(1, -1) } if (!(split in parent)) { const component = new this.constructor({ getNames: this.getNames, backend: this.backend, parameters: this.parameters, templated: Boolean(template), splits }) parent._addChild(split, component) } parent = parent[split] // // Path Template: save it and walk it once the user specifies // the value. // if (template) { if (!parent.templated) { throw new Error('Created Component, but require templated one. ' + 'This is a bug. Please report: ' + 'https://github.com/silasbw/fluent-openapi/issues') } parent.templatedEndpoints.push(new Endpoint({ name: endpoint.name, splits: nextSplits, pathItem: endpoint.pathItem })) return null } } return parent } /** * Add an Endpoint by creating an object chain according to its pathname * splits; and adding operations according to the pathItem. * @param {Endpoint} endpoint - Endpoint object. * @returns {Component} Component object endpoint was added to. */ _addEndpoint (endpoint) { const component = this._walkSplits(endpoint) if (!component) return null component.pathItemObject = endpoint.pathItem component.swaggerName = endpoint.name // // "Expose" operations by omitting the leading _ from the method name. // const supportedMethods = ['get', 'put', 'post', 'delete', 'patch'] supportedMethods .filter(method => endpoint.pathItem[method]) .forEach(method => { component[method] = component['_' + method] if (method === 'get') component.getStream = component._getStream }) return component } /** * Invoke a REST method * @param {string} method - HTTP method * @param {ApiRequestOptions} options - Options object * @returns {(Promise|Stream)} Promise */ _requestAsync (method, options) { return this.backend.http(Object.assign({ method, pathItemObject: this.pathItemObject, pathname: this.getPath(), pathnameParameters: this.getPathnameParameters() }, options)) } // // Supported operations. // /** * Invoke a GET request against the API server * @param {ApiRequestOptions} options - Options object. * @returns {Stream} Stream */ _getStream (options) { return this._requestAsync('GET', Object.assign({ stream: true }, options)) } /** * Invoke a GET request against the API server * @param {ApiRequestOptions} options - Options object. * @returns {Promise} Promise */ _get (options) { return this._requestAsync('GET', options) } /** * Invoke a DELETE request against the API server * @param {ApiRequestOptions} options - Options object. * @returns {Promise} Promise */ _delete (options) { return this._requestAsync('DELETE', options) } /** * Invoke a PATCH request against the API server * @param {ApiRequestOptions} options - Options object * @returns {Promise} Promise */ _patch (options) { return this._requestAsync('PATCH', merge({ headers: { 'content-type': 'application/strategic-merge-patch+json' } }, options, { isMergeableObject: isPlainObject })) } /** * Invoke a POST request against the API server * @param {ApiRequestOptions} options - Options object * @returns {Promise} Promise */ _post (options) { return this._requestAsync('POST', merge({ headers: { 'content-type': 'application/json' } }, options, { isMergeableObject: isPlainObject })) } /** * Invoke a PUT request against the API server * @param {ApiRequestOptions} options - Options object * @returns {Promise} Promise */ _put (options) { return this._requestAsync('PUT', merge({ headers: { 'content-type': 'application/json' } }, options, { isMergeableObject: isPlainObject })) } } module.exports = Component /***/ }), /***/ 69257: /***/ ((module) => { "use strict"; /*! * isobject * * Copyright (c) 2014-2017, Jon Schlinkert. * Released under the MIT License. */ function isObject(val) { return val != null && typeof val === 'object' && Array.isArray(val) === false; } /*! * is-plain-object * * Copyright (c) 2014-2017, Jon Schlinkert. * Released under the MIT License. */ function isObjectObject(o) { return isObject(o) === true && Object.prototype.toString.call(o) === '[object Object]'; } function isPlainObject(o) { var ctor,prot; if (isObjectObject(o) === false) return false; // If has modified constructor ctor = o.constructor; if (typeof ctor !== 'function') return false; // If has modified prototype prot = ctor.prototype; if (isObjectObject(prot) === false) return false; // If constructor does not have an Object-specific method if (prot.hasOwnProperty('isPrototypeOf') === false) { return false; } // Most likely a plain Object return true; } module.exports = isPlainObject; /***/ }), /***/ 53158: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; const {Readable} = __webpack_require__(92413); module.exports = input => ( new Readable({ read() { this.push(input); this.push(null); } }) ); /***/ }), /***/ 47372: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; /*! * Copyright (c) 2015, Salesforce.com, Inc. * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: * * 1. Redistributions of source code must retain the above copyright notice, * this list of conditions and the following disclaimer. * * 2. Redistributions in binary form must reproduce the above copyright notice, * this list of conditions and the following disclaimer in the documentation * and/or other materials provided with the distribution. * * 3. Neither the name of Salesforce.com nor the names of its contributors may * be used to endorse or promote products derived from this software without * specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. */ var net = __webpack_require__(11631); var urlParse = __webpack_require__(78835).parse; var util = __webpack_require__(31669); var pubsuffix = __webpack_require__(94401); var Store = __webpack_require__(460)/* .Store */ .y; var MemoryCookieStore = __webpack_require__(52640)/* .MemoryCookieStore */ .m; var pathMatch = __webpack_require__(54336)/* .pathMatch */ .U; var VERSION = __webpack_require__(93199); var punycode; try { punycode = __webpack_require__(94213); } catch(e) { console.warn("tough-cookie: can't load punycode; won't use punycode for domain normalization"); } // From RFC6265 S4.1.1 // note that it excludes \x3B ";" var COOKIE_OCTETS = /^[\x21\x23-\x2B\x2D-\x3A\x3C-\x5B\x5D-\x7E]+$/; var CONTROL_CHARS = /[\x00-\x1F]/; // From Chromium // '\r', '\n' and '\0' should be treated as a terminator in // the "relaxed" mode, see: // https://github.com/ChromiumWebApps/chromium/blob/b3d3b4da8bb94c1b2e061600df106d590fda3620/net/cookies/parsed_cookie.cc#L60 var TERMINATORS = ['\n', '\r', '\0']; // RFC6265 S4.1.1 defines path value as 'any CHAR except CTLs or ";"' // Note ';' is \x3B var PATH_VALUE = /[\x20-\x3A\x3C-\x7E]+/; // date-time parsing constants (RFC6265 S5.1.1) var DATE_DELIM = /[\x09\x20-\x2F\x3B-\x40\x5B-\x60\x7B-\x7E]/; var MONTH_TO_NUM = { jan:0, feb:1, mar:2, apr:3, may:4, jun:5, jul:6, aug:7, sep:8, oct:9, nov:10, dec:11 }; var NUM_TO_MONTH = [ 'Jan','Feb','Mar','Apr','May','Jun','Jul','Aug','Sep','Oct','Nov','Dec' ]; var NUM_TO_DAY = [ 'Sun','Mon','Tue','Wed','Thu','Fri','Sat' ]; var MAX_TIME = 2147483647000; // 31-bit max var MIN_TIME = 0; // 31-bit min /* * Parses a Natural number (i.e., non-negative integer) with either the * *DIGIT ( non-digit *OCTET ) * or * *DIGIT * grammar (RFC6265 S5.1.1). * * The "trailingOK" boolean controls if the grammar accepts a * "( non-digit *OCTET )" trailer. */ function parseDigits(token, minDigits, maxDigits, trailingOK) { var count = 0; while (count < token.length) { var c = token.charCodeAt(count); // "non-digit = %x00-2F / %x3A-FF" if (c <= 0x2F || c >= 0x3A) { break; } count++; } // constrain to a minimum and maximum number of digits. if (count < minDigits || count > maxDigits) { return null; } if (!trailingOK && count != token.length) { return null; } return parseInt(token.substr(0,count), 10); } function parseTime(token) { var parts = token.split(':'); var result = [0,0,0]; /* RF6256 S5.1.1: * time = hms-time ( non-digit *OCTET ) * hms-time = time-field ":" time-field ":" time-field * time-field = 1*2DIGIT */ if (parts.length !== 3) { return null; } for (var i = 0; i < 3; i++) { // "time-field" must be strictly "1*2DIGIT", HOWEVER, "hms-time" can be // followed by "( non-digit *OCTET )" so therefore the last time-field can // have a trailer var trailingOK = (i == 2); var num = parseDigits(parts[i], 1, 2, trailingOK); if (num === null) { return null; } result[i] = num; } return result; } function parseMonth(token) { token = String(token).substr(0,3).toLowerCase(); var num = MONTH_TO_NUM[token]; return num >= 0 ? num : null; } /* * RFC6265 S5.1.1 date parser (see RFC for full grammar) */ function parseDate(str) { if (!str) { return; } /* RFC6265 S5.1.1: * 2. Process each date-token sequentially in the order the date-tokens * appear in the cookie-date */ var tokens = str.split(DATE_DELIM); if (!tokens) { return; } var hour = null; var minute = null; var second = null; var dayOfMonth = null; var month = null; var year = null; for (var i=0; i= 70 && year <= 99) { year += 1900; } else if (year >= 0 && year <= 69) { year += 2000; } } } } /* RFC 6265 S5.1.1 * "5. Abort these steps and fail to parse the cookie-date if: * * at least one of the found-day-of-month, found-month, found- * year, or found-time flags is not set, * * the day-of-month-value is less than 1 or greater than 31, * * the year-value is less than 1601, * * the hour-value is greater than 23, * * the minute-value is greater than 59, or * * the second-value is greater than 59. * (Note that leap seconds cannot be represented in this syntax.)" * * So, in order as above: */ if ( dayOfMonth === null || month === null || year === null || second === null || dayOfMonth < 1 || dayOfMonth > 31 || year < 1601 || hour > 23 || minute > 59 || second > 59 ) { return; } return new Date(Date.UTC(year, month, dayOfMonth, hour, minute, second)); } function formatDate(date) { var d = date.getUTCDate(); d = d >= 10 ? d : '0'+d; var h = date.getUTCHours(); h = h >= 10 ? h : '0'+h; var m = date.getUTCMinutes(); m = m >= 10 ? m : '0'+m; var s = date.getUTCSeconds(); s = s >= 10 ? s : '0'+s; return NUM_TO_DAY[date.getUTCDay()] + ', ' + d+' '+ NUM_TO_MONTH[date.getUTCMonth()] +' '+ date.getUTCFullYear() +' '+ h+':'+m+':'+s+' GMT'; } // S5.1.2 Canonicalized Host Names function canonicalDomain(str) { if (str == null) { return null; } str = str.trim().replace(/^\./,''); // S4.1.2.3 & S5.2.3: ignore leading . // convert to IDN if any non-ASCII characters if (punycode && /[^\u0001-\u007f]/.test(str)) { str = punycode.toASCII(str); } return str.toLowerCase(); } // S5.1.3 Domain Matching function domainMatch(str, domStr, canonicalize) { if (str == null || domStr == null) { return null; } if (canonicalize !== false) { str = canonicalDomain(str); domStr = canonicalDomain(domStr); } /* * "The domain string and the string are identical. (Note that both the * domain string and the string will have been canonicalized to lower case at * this point)" */ if (str == domStr) { return true; } /* "All of the following [three] conditions hold:" (order adjusted from the RFC) */ /* "* The string is a host name (i.e., not an IP address)." */ if (net.isIP(str)) { return false; } /* "* The domain string is a suffix of the string" */ var idx = str.indexOf(domStr); if (idx <= 0) { return false; // it's a non-match (-1) or prefix (0) } // e.g "a.b.c".indexOf("b.c") === 2 // 5 === 3+2 if (str.length !== domStr.length + idx) { // it's not a suffix return false; } /* "* The last character of the string that is not included in the domain * string is a %x2E (".") character." */ if (str.substr(idx-1,1) !== '.') { return false; } return true; } // RFC6265 S5.1.4 Paths and Path-Match /* * "The user agent MUST use an algorithm equivalent to the following algorithm * to compute the default-path of a cookie:" * * Assumption: the path (and not query part or absolute uri) is passed in. */ function defaultPath(path) { // "2. If the uri-path is empty or if the first character of the uri-path is not // a %x2F ("/") character, output %x2F ("/") and skip the remaining steps. if (!path || path.substr(0,1) !== "/") { return "/"; } // "3. If the uri-path contains no more than one %x2F ("/") character, output // %x2F ("/") and skip the remaining step." if (path === "/") { return path; } var rightSlash = path.lastIndexOf("/"); if (rightSlash === 0) { return "/"; } // "4. Output the characters of the uri-path from the first character up to, // but not including, the right-most %x2F ("/")." return path.slice(0, rightSlash); } function trimTerminator(str) { for (var t = 0; t < TERMINATORS.length; t++) { var terminatorIdx = str.indexOf(TERMINATORS[t]); if (terminatorIdx !== -1) { str = str.substr(0,terminatorIdx); } } return str; } function parseCookiePair(cookiePair, looseMode) { cookiePair = trimTerminator(cookiePair); var firstEq = cookiePair.indexOf('='); if (looseMode) { if (firstEq === 0) { // '=' is immediately at start cookiePair = cookiePair.substr(1); firstEq = cookiePair.indexOf('='); // might still need to split on '=' } } else { // non-loose mode if (firstEq <= 0) { // no '=' or is at start return; // needs to have non-empty "cookie-name" } } var cookieName, cookieValue; if (firstEq <= 0) { cookieName = ""; cookieValue = cookiePair.trim(); } else { cookieName = cookiePair.substr(0, firstEq).trim(); cookieValue = cookiePair.substr(firstEq+1).trim(); } if (CONTROL_CHARS.test(cookieName) || CONTROL_CHARS.test(cookieValue)) { return; } var c = new Cookie(); c.key = cookieName; c.value = cookieValue; return c; } function parse(str, options) { if (!options || typeof options !== 'object') { options = {}; } str = str.trim(); // We use a regex to parse the "name-value-pair" part of S5.2 var firstSemi = str.indexOf(';'); // S5.2 step 1 var cookiePair = (firstSemi === -1) ? str : str.substr(0, firstSemi); var c = parseCookiePair(cookiePair, !!options.loose); if (!c) { return; } if (firstSemi === -1) { return c; } // S5.2.3 "unparsed-attributes consist of the remainder of the set-cookie-string // (including the %x3B (";") in question)." plus later on in the same section // "discard the first ";" and trim". var unparsed = str.slice(firstSemi + 1).trim(); // "If the unparsed-attributes string is empty, skip the rest of these // steps." if (unparsed.length === 0) { return c; } /* * S5.2 says that when looping over the items "[p]rocess the attribute-name * and attribute-value according to the requirements in the following * subsections" for every item. Plus, for many of the individual attributes * in S5.3 it says to use the "attribute-value of the last attribute in the * cookie-attribute-list". Therefore, in this implementation, we overwrite * the previous value. */ var cookie_avs = unparsed.split(';'); while (cookie_avs.length) { var av = cookie_avs.shift().trim(); if (av.length === 0) { // happens if ";;" appears continue; } var av_sep = av.indexOf('='); var av_key, av_value; if (av_sep === -1) { av_key = av; av_value = null; } else { av_key = av.substr(0,av_sep); av_value = av.substr(av_sep+1); } av_key = av_key.trim().toLowerCase(); if (av_value) { av_value = av_value.trim(); } switch(av_key) { case 'expires': // S5.2.1 if (av_value) { var exp = parseDate(av_value); // "If the attribute-value failed to parse as a cookie date, ignore the // cookie-av." if (exp) { // over and underflow not realistically a concern: V8's getTime() seems to // store something larger than a 32-bit time_t (even with 32-bit node) c.expires = exp; } } break; case 'max-age': // S5.2.2 if (av_value) { // "If the first character of the attribute-value is not a DIGIT or a "-" // character ...[or]... If the remainder of attribute-value contains a // non-DIGIT character, ignore the cookie-av." if (/^-?[0-9]+$/.test(av_value)) { var delta = parseInt(av_value, 10); // "If delta-seconds is less than or equal to zero (0), let expiry-time // be the earliest representable date and time." c.setMaxAge(delta); } } break; case 'domain': // S5.2.3 // "If the attribute-value is empty, the behavior is undefined. However, // the user agent SHOULD ignore the cookie-av entirely." if (av_value) { // S5.2.3 "Let cookie-domain be the attribute-value without the leading %x2E // (".") character." var domain = av_value.trim().replace(/^\./, ''); if (domain) { // "Convert the cookie-domain to lower case." c.domain = domain.toLowerCase(); } } break; case 'path': // S5.2.4 /* * "If the attribute-value is empty or if the first character of the * attribute-value is not %x2F ("/"): * Let cookie-path be the default-path. * Otherwise: * Let cookie-path be the attribute-value." * * We'll represent the default-path as null since it depends on the * context of the parsing. */ c.path = av_value && av_value[0] === "/" ? av_value : null; break; case 'secure': // S5.2.5 /* * "If the attribute-name case-insensitively matches the string "Secure", * the user agent MUST append an attribute to the cookie-attribute-list * with an attribute-name of Secure and an empty attribute-value." */ c.secure = true; break; case 'httponly': // S5.2.6 -- effectively the same as 'secure' c.httpOnly = true; break; default: c.extensions = c.extensions || []; c.extensions.push(av); break; } } return c; } // avoid the V8 deoptimization monster! function jsonParse(str) { var obj; try { obj = JSON.parse(str); } catch (e) { return e; } return obj; } function fromJSON(str) { if (!str) { return null; } var obj; if (typeof str === 'string') { obj = jsonParse(str); if (obj instanceof Error) { return null; } } else { // assume it's an Object obj = str; } var c = new Cookie(); for (var i=0; i 1) { var lindex = path.lastIndexOf('/'); if (lindex === 0) { break; } path = path.substr(0,lindex); permutations.push(path); } permutations.push('/'); return permutations; } function getCookieContext(url) { if (url instanceof Object) { return url; } // NOTE: decodeURI will throw on malformed URIs (see GH-32). // Therefore, we will just skip decoding for such URIs. try { url = decodeURI(url); } catch(err) { // Silently swallow error } return urlParse(url); } function Cookie(options) { options = options || {}; Object.keys(options).forEach(function(prop) { if (Cookie.prototype.hasOwnProperty(prop) && Cookie.prototype[prop] !== options[prop] && prop.substr(0,1) !== '_') { this[prop] = options[prop]; } }, this); this.creation = this.creation || new Date(); // used to break creation ties in cookieCompare(): Object.defineProperty(this, 'creationIndex', { configurable: false, enumerable: false, // important for assert.deepEqual checks writable: true, value: ++Cookie.cookiesCreated }); } Cookie.cookiesCreated = 0; // incremented each time a cookie is created Cookie.parse = parse; Cookie.fromJSON = fromJSON; Cookie.prototype.key = ""; Cookie.prototype.value = ""; // the order in which the RFC has them: Cookie.prototype.expires = "Infinity"; // coerces to literal Infinity Cookie.prototype.maxAge = null; // takes precedence over expires for TTL Cookie.prototype.domain = null; Cookie.prototype.path = null; Cookie.prototype.secure = false; Cookie.prototype.httpOnly = false; Cookie.prototype.extensions = null; // set by the CookieJar: Cookie.prototype.hostOnly = null; // boolean when set Cookie.prototype.pathIsDefault = null; // boolean when set Cookie.prototype.creation = null; // Date when set; defaulted by Cookie.parse Cookie.prototype.lastAccessed = null; // Date when set Object.defineProperty(Cookie.prototype, 'creationIndex', { configurable: true, enumerable: false, writable: true, value: 0 }); Cookie.serializableProperties = Object.keys(Cookie.prototype) .filter(function(prop) { return !( Cookie.prototype[prop] instanceof Function || prop === 'creationIndex' || prop.substr(0,1) === '_' ); }); Cookie.prototype.inspect = function inspect() { var now = Date.now(); return 'Cookie="'+this.toString() + '; hostOnly='+(this.hostOnly != null ? this.hostOnly : '?') + '; aAge='+(this.lastAccessed ? (now-this.lastAccessed.getTime())+'ms' : '?') + '; cAge='+(this.creation ? (now-this.creation.getTime())+'ms' : '?') + '"'; }; // Use the new custom inspection symbol to add the custom inspect function if // available. if (util.inspect.custom) { Cookie.prototype[util.inspect.custom] = Cookie.prototype.inspect; } Cookie.prototype.toJSON = function() { var obj = {}; var props = Cookie.serializableProperties; for (var i=0; i { "use strict"; /*! * Copyright (c) 2015, Salesforce.com, Inc. * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: * * 1. Redistributions of source code must retain the above copyright notice, * this list of conditions and the following disclaimer. * * 2. Redistributions in binary form must reproduce the above copyright notice, * this list of conditions and the following disclaimer in the documentation * and/or other materials provided with the distribution. * * 3. Neither the name of Salesforce.com nor the names of its contributors may * be used to endorse or promote products derived from this software without * specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. */ var Store = __webpack_require__(460)/* .Store */ .y; var permuteDomain = __webpack_require__(55986).permuteDomain; var pathMatch = __webpack_require__(54336)/* .pathMatch */ .U; var util = __webpack_require__(31669); function MemoryCookieStore() { Store.call(this); this.idx = {}; } util.inherits(MemoryCookieStore, Store); exports.m = MemoryCookieStore; MemoryCookieStore.prototype.idx = null; // Since it's just a struct in RAM, this Store is synchronous MemoryCookieStore.prototype.synchronous = true; // force a default depth: MemoryCookieStore.prototype.inspect = function() { return "{ idx: "+util.inspect(this.idx, false, 2)+' }'; }; // Use the new custom inspection symbol to add the custom inspect function if // available. if (util.inspect.custom) { MemoryCookieStore.prototype[util.inspect.custom] = MemoryCookieStore.prototype.inspect; } MemoryCookieStore.prototype.findCookie = function(domain, path, key, cb) { if (!this.idx[domain]) { return cb(null,undefined); } if (!this.idx[domain][path]) { return cb(null,undefined); } return cb(null,this.idx[domain][path][key]||null); }; MemoryCookieStore.prototype.findCookies = function(domain, path, cb) { var results = []; if (!domain) { return cb(null,[]); } var pathMatcher; if (!path) { // null means "all paths" pathMatcher = function matchAll(domainIndex) { for (var curPath in domainIndex) { var pathIndex = domainIndex[curPath]; for (var key in pathIndex) { results.push(pathIndex[key]); } } }; } else { pathMatcher = function matchRFC(domainIndex) { //NOTE: we should use path-match algorithm from S5.1.4 here //(see : https://github.com/ChromiumWebApps/chromium/blob/b3d3b4da8bb94c1b2e061600df106d590fda3620/net/cookies/canonical_cookie.cc#L299) Object.keys(domainIndex).forEach(function (cookiePath) { if (pathMatch(path, cookiePath)) { var pathIndex = domainIndex[cookiePath]; for (var key in pathIndex) { results.push(pathIndex[key]); } } }); }; } var domains = permuteDomain(domain) || [domain]; var idx = this.idx; domains.forEach(function(curDomain) { var domainIndex = idx[curDomain]; if (!domainIndex) { return; } pathMatcher(domainIndex); }); cb(null,results); }; MemoryCookieStore.prototype.putCookie = function(cookie, cb) { if (!this.idx[cookie.domain]) { this.idx[cookie.domain] = {}; } if (!this.idx[cookie.domain][cookie.path]) { this.idx[cookie.domain][cookie.path] = {}; } this.idx[cookie.domain][cookie.path][cookie.key] = cookie; cb(null); }; MemoryCookieStore.prototype.updateCookie = function(oldCookie, newCookie, cb) { // updateCookie() may avoid updating cookies that are identical. For example, // lastAccessed may not be important to some stores and an equality // comparison could exclude that field. this.putCookie(newCookie,cb); }; MemoryCookieStore.prototype.removeCookie = function(domain, path, key, cb) { if (this.idx[domain] && this.idx[domain][path] && this.idx[domain][path][key]) { delete this.idx[domain][path][key]; } cb(null); }; MemoryCookieStore.prototype.removeCookies = function(domain, path, cb) { if (this.idx[domain]) { if (path) { delete this.idx[domain][path]; } else { delete this.idx[domain]; } } return cb(null); }; MemoryCookieStore.prototype.removeAllCookies = function(cb) { this.idx = {}; return cb(null); } MemoryCookieStore.prototype.getAllCookies = function(cb) { var cookies = []; var idx = this.idx; var domains = Object.keys(idx); domains.forEach(function(domain) { var paths = Object.keys(idx[domain]); paths.forEach(function(path) { var keys = Object.keys(idx[domain][path]); keys.forEach(function(key) { if (key !== null) { cookies.push(idx[domain][path][key]); } }); }); }); // Sort by creationIndex so deserializing retains the creation order. // When implementing your own store, this SHOULD retain the order too cookies.sort(function(a,b) { return (a.creationIndex||0) - (b.creationIndex||0); }); cb(null, cookies); }; /***/ }), /***/ 54336: /***/ ((__unused_webpack_module, exports) => { "use strict"; /*! * Copyright (c) 2015, Salesforce.com, Inc. * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: * * 1. Redistributions of source code must retain the above copyright notice, * this list of conditions and the following disclaimer. * * 2. Redistributions in binary form must reproduce the above copyright notice, * this list of conditions and the following disclaimer in the documentation * and/or other materials provided with the distribution. * * 3. Neither the name of Salesforce.com nor the names of its contributors may * be used to endorse or promote products derived from this software without * specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. */ /* * "A request-path path-matches a given cookie-path if at least one of the * following conditions holds:" */ function pathMatch (reqPath, cookiePath) { // "o The cookie-path and the request-path are identical." if (cookiePath === reqPath) { return true; } var idx = reqPath.indexOf(cookiePath); if (idx === 0) { // "o The cookie-path is a prefix of the request-path, and the last // character of the cookie-path is %x2F ("/")." if (cookiePath.substr(-1) === "/") { return true; } // " o The cookie-path is a prefix of the request-path, and the first // character of the request-path that is not included in the cookie- path // is a %x2F ("/") character." if (reqPath.substr(cookiePath.length, 1) === "/") { return true; } } return false; } exports.U = pathMatch; /***/ }), /***/ 55986: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; /*! * Copyright (c) 2015, Salesforce.com, Inc. * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: * * 1. Redistributions of source code must retain the above copyright notice, * this list of conditions and the following disclaimer. * * 2. Redistributions in binary form must reproduce the above copyright notice, * this list of conditions and the following disclaimer in the documentation * and/or other materials provided with the distribution. * * 3. Neither the name of Salesforce.com nor the names of its contributors may * be used to endorse or promote products derived from this software without * specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. */ var pubsuffix = __webpack_require__(94401); // Gives the permutation of all possible domainMatch()es of a given domain. The // array is in shortest-to-longest order. Handy for indexing. function permuteDomain (domain) { var pubSuf = pubsuffix.getPublicSuffix(domain); if (!pubSuf) { return null; } if (pubSuf == domain) { return [domain]; } var prefix = domain.slice(0, -(pubSuf.length + 1)); // ".example.com" var parts = prefix.split('.').reverse(); var cur = pubSuf; var permutations = [cur]; while (parts.length) { cur = parts.shift() + '.' + cur; permutations.push(cur); } return permutations; } exports.permuteDomain = permuteDomain; /***/ }), /***/ 94401: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; /*! * Copyright (c) 2018, Salesforce.com, Inc. * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: * * 1. Redistributions of source code must retain the above copyright notice, * this list of conditions and the following disclaimer. * * 2. Redistributions in binary form must reproduce the above copyright notice, * this list of conditions and the following disclaimer in the documentation * and/or other materials provided with the distribution. * * 3. Neither the name of Salesforce.com nor the names of its contributors may * be used to endorse or promote products derived from this software without * specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. */ var psl = __webpack_require__(29975); function getPublicSuffix(domain) { return psl.get(domain); } exports.getPublicSuffix = getPublicSuffix; /***/ }), /***/ 460: /***/ ((__unused_webpack_module, exports) => { "use strict"; /*! * Copyright (c) 2015, Salesforce.com, Inc. * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: * * 1. Redistributions of source code must retain the above copyright notice, * this list of conditions and the following disclaimer. * * 2. Redistributions in binary form must reproduce the above copyright notice, * this list of conditions and the following disclaimer in the documentation * and/or other materials provided with the distribution. * * 3. Neither the name of Salesforce.com nor the names of its contributors may * be used to endorse or promote products derived from this software without * specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. */ /*jshint unused:false */ function Store() { } exports.y = Store; // Stores may be synchronous, but are still required to use a // Continuation-Passing Style API. The CookieJar itself will expose a "*Sync" // API that converts from synchronous-callbacks to imperative style. Store.prototype.synchronous = false; Store.prototype.findCookie = function(domain, path, key, cb) { throw new Error('findCookie is not implemented'); }; Store.prototype.findCookies = function(domain, path, cb) { throw new Error('findCookies is not implemented'); }; Store.prototype.putCookie = function(cookie, cb) { throw new Error('putCookie is not implemented'); }; Store.prototype.updateCookie = function(oldCookie, newCookie, cb) { // recommended default implementation: // return this.putCookie(newCookie, cb); throw new Error('updateCookie is not implemented'); }; Store.prototype.removeCookie = function(domain, path, key, cb) { throw new Error('removeCookie is not implemented'); }; Store.prototype.removeCookies = function(domain, path, cb) { throw new Error('removeCookies is not implemented'); }; Store.prototype.removeAllCookies = function(cb) { throw new Error('removeAllCookies is not implemented'); } Store.prototype.getAllCookies = function(cb) { throw new Error('getAllCookies is not implemented (therefore jar cannot be serialized)'); }; /***/ }), /***/ 93199: /***/ ((module) => { // generated by genversion module.exports = '2.5.0' /***/ }), /***/ 75636: /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "__extends": () => /* binding */ __extends, /* harmony export */ "__assign": () => /* binding */ __assign, /* harmony export */ "__rest": () => /* binding */ __rest, /* harmony export */ "__decorate": () => /* binding */ __decorate, /* harmony export */ "__param": () => /* binding */ __param, /* harmony export */ "__metadata": () => /* binding */ __metadata, /* harmony export */ "__awaiter": () => /* binding */ __awaiter, /* harmony export */ "__generator": () => /* binding */ __generator, /* harmony export */ "__createBinding": () => /* binding */ __createBinding, /* harmony export */ "__exportStar": () => /* binding */ __exportStar, /* harmony export */ "__values": () => /* binding */ __values, /* harmony export */ "__read": () => /* binding */ __read, /* harmony export */ "__spread": () => /* binding */ __spread, /* harmony export */ "__spreadArrays": () => /* binding */ __spreadArrays, /* harmony export */ "__await": () => /* binding */ __await, /* harmony export */ "__asyncGenerator": () => /* binding */ __asyncGenerator, /* harmony export */ "__asyncDelegator": () => /* binding */ __asyncDelegator, /* harmony export */ "__asyncValues": () => /* binding */ __asyncValues, /* harmony export */ "__makeTemplateObject": () => /* binding */ __makeTemplateObject, /* harmony export */ "__importStar": () => /* binding */ __importStar, /* harmony export */ "__importDefault": () => /* binding */ __importDefault, /* harmony export */ "__classPrivateFieldGet": () => /* binding */ __classPrivateFieldGet, /* harmony export */ "__classPrivateFieldSet": () => /* binding */ __classPrivateFieldSet /* harmony export */ }); /*! ***************************************************************************** Copyright (c) Microsoft Corporation. Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ***************************************************************************** */ /* global Reflect, Promise */ var extendStatics = function(d, b) { extendStatics = Object.setPrototypeOf || ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; return extendStatics(d, b); }; function __extends(d, b) { extendStatics(d, b); function __() { this.constructor = d; } d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); } var __assign = function() { __assign = Object.assign || function __assign(t) { for (var s, i = 1, n = arguments.length; i < n; i++) { s = arguments[i]; for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p]; } return t; } return __assign.apply(this, arguments); } function __rest(s, e) { var t = {}; for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p]; if (s != null && typeof Object.getOwnPropertySymbols === "function") for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) { if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) t[p[i]] = s[p[i]]; } return t; } function __decorate(decorators, target, key, desc) { var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); 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; return c > 3 && r && Object.defineProperty(target, key, r), r; } function __param(paramIndex, decorator) { return function (target, key) { decorator(target, key, paramIndex); } } function __metadata(metadataKey, metadataValue) { if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(metadataKey, metadataValue); } function __awaiter(thisArg, _arguments, P, generator) { function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } return new (P || (P = Promise))(function (resolve, reject) { function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } step((generator = generator.apply(thisArg, _arguments || [])).next()); }); } function __generator(thisArg, body) { var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g; return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g; function verb(n) { return function (v) { return step([n, v]); }; } function step(op) { if (f) throw new TypeError("Generator is already executing."); while (_) try { 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; if (y = 0, t) op = [op[0] & 2, t.value]; switch (op[0]) { case 0: case 1: t = op; break; case 4: _.label++; return { value: op[1], done: false }; case 5: _.label++; y = op[1]; op = [0]; continue; case 7: op = _.ops.pop(); _.trys.pop(); continue; default: if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; } if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; } if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; } if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; } if (t[2]) _.ops.pop(); _.trys.pop(); continue; } op = body.call(thisArg, _); } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; } if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true }; } } function __createBinding(o, m, k, k2) { if (k2 === undefined) k2 = k; o[k2] = m[k]; } function __exportStar(m, exports) { for (var p in m) if (p !== "default" && !exports.hasOwnProperty(p)) exports[p] = m[p]; } function __values(o) { var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0; if (m) return m.call(o); if (o && typeof o.length === "number") return { next: function () { if (o && i >= o.length) o = void 0; return { value: o && o[i++], done: !o }; } }; throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined."); } function __read(o, n) { var m = typeof Symbol === "function" && o[Symbol.iterator]; if (!m) return o; var i = m.call(o), r, ar = [], e; try { while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value); } catch (error) { e = { error: error }; } finally { try { if (r && !r.done && (m = i["return"])) m.call(i); } finally { if (e) throw e.error; } } return ar; } function __spread() { for (var ar = [], i = 0; i < arguments.length; i++) ar = ar.concat(__read(arguments[i])); return ar; } function __spreadArrays() { for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length; for (var r = Array(s), k = 0, i = 0; i < il; i++) for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++) r[k] = a[j]; return r; }; function __await(v) { return this instanceof __await ? (this.v = v, this) : new __await(v); } function __asyncGenerator(thisArg, _arguments, generator) { if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined."); var g = generator.apply(thisArg, _arguments || []), i, q = []; return i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i; 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); }); }; } function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } } function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); } function fulfill(value) { resume("next", value); } function reject(value) { resume("throw", value); } function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); } } function __asyncDelegator(o) { var i, p; return i = {}, verb("next"), verb("throw", function (e) { throw e; }), verb("return"), i[Symbol.iterator] = function () { return this; }, i; 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; } } function __asyncValues(o) { if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined."); var m = o[Symbol.asyncIterator], i; 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); function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; } function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); } } function __makeTemplateObject(cooked, raw) { if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; } return cooked; }; function __importStar(mod) { if (mod && mod.__esModule) return mod; var result = {}; if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k]; result.default = mod; return result; } function __importDefault(mod) { return (mod && mod.__esModule) ? mod : { default: mod }; } function __classPrivateFieldGet(receiver, privateMap) { if (!privateMap.has(receiver)) { throw new TypeError("attempted to get private field on non-instance"); } return privateMap.get(receiver); } function __classPrivateFieldSet(receiver, privateMap, value) { if (!privateMap.has(receiver)) { throw new TypeError("attempted to set private field on non-instance"); } privateMap.set(receiver, value); return value; } /***/ }), /***/ 11137: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; var net = __webpack_require__(11631) , tls = __webpack_require__(4016) , http = __webpack_require__(98605) , https = __webpack_require__(57211) , events = __webpack_require__(28614) , assert = __webpack_require__(42357) , util = __webpack_require__(31669) , Buffer = __webpack_require__(21867).Buffer ; exports.httpOverHttp = httpOverHttp exports.httpsOverHttp = httpsOverHttp exports.httpOverHttps = httpOverHttps exports.httpsOverHttps = httpsOverHttps function httpOverHttp(options) { var agent = new TunnelingAgent(options) agent.request = http.request return agent } function httpsOverHttp(options) { var agent = new TunnelingAgent(options) agent.request = http.request agent.createSocket = createSecureSocket agent.defaultPort = 443 return agent } function httpOverHttps(options) { var agent = new TunnelingAgent(options) agent.request = https.request return agent } function httpsOverHttps(options) { var agent = new TunnelingAgent(options) agent.request = https.request agent.createSocket = createSecureSocket agent.defaultPort = 443 return agent } function TunnelingAgent(options) { var self = this self.options = options || {} self.proxyOptions = self.options.proxy || {} self.maxSockets = self.options.maxSockets || http.Agent.defaultMaxSockets self.requests = [] self.sockets = [] self.on('free', function onFree(socket, host, port) { for (var i = 0, len = self.requests.length; i < len; ++i) { var pending = self.requests[i] if (pending.host === host && pending.port === port) { // Detect the request to connect same origin server, // reuse the connection. self.requests.splice(i, 1) pending.request.onSocket(socket) return } } socket.destroy() self.removeSocket(socket) }) } util.inherits(TunnelingAgent, events.EventEmitter) TunnelingAgent.prototype.addRequest = function addRequest(req, options) { var self = this // Legacy API: addRequest(req, host, port, path) if (typeof options === 'string') { options = { host: options, port: arguments[2], path: arguments[3] }; } if (self.sockets.length >= this.maxSockets) { // We are over limit so we'll add it to the queue. self.requests.push({host: options.host, port: options.port, request: req}) return } // If we are under maxSockets create a new one. self.createConnection({host: options.host, port: options.port, request: req}) } TunnelingAgent.prototype.createConnection = function createConnection(pending) { var self = this self.createSocket(pending, function(socket) { socket.on('free', onFree) socket.on('close', onCloseOrRemove) socket.on('agentRemove', onCloseOrRemove) pending.request.onSocket(socket) function onFree() { self.emit('free', socket, pending.host, pending.port) } function onCloseOrRemove(err) { self.removeSocket(socket) socket.removeListener('free', onFree) socket.removeListener('close', onCloseOrRemove) socket.removeListener('agentRemove', onCloseOrRemove) } }) } TunnelingAgent.prototype.createSocket = function createSocket(options, cb) { var self = this var placeholder = {} self.sockets.push(placeholder) var connectOptions = mergeOptions({}, self.proxyOptions, { method: 'CONNECT' , path: options.host + ':' + options.port , agent: false } ) if (connectOptions.proxyAuth) { connectOptions.headers = connectOptions.headers || {} connectOptions.headers['Proxy-Authorization'] = 'Basic ' + Buffer.from(connectOptions.proxyAuth).toString('base64') } debug('making CONNECT request') var connectReq = self.request(connectOptions) connectReq.useChunkedEncodingByDefault = false // for v0.6 connectReq.once('response', onResponse) // for v0.6 connectReq.once('upgrade', onUpgrade) // for v0.6 connectReq.once('connect', onConnect) // for v0.7 or later connectReq.once('error', onError) connectReq.end() function onResponse(res) { // Very hacky. This is necessary to avoid http-parser leaks. res.upgrade = true } function onUpgrade(res, socket, head) { // Hacky. process.nextTick(function() { onConnect(res, socket, head) }) } function onConnect(res, socket, head) { connectReq.removeAllListeners() socket.removeAllListeners() if (res.statusCode === 200) { assert.equal(head.length, 0) debug('tunneling connection has established') self.sockets[self.sockets.indexOf(placeholder)] = socket cb(socket) } else { debug('tunneling socket could not be established, statusCode=%d', res.statusCode) var error = new Error('tunneling socket could not be established, ' + 'statusCode=' + res.statusCode) error.code = 'ECONNRESET' options.request.emit('error', error) self.removeSocket(placeholder) } } function onError(cause) { connectReq.removeAllListeners() debug('tunneling socket could not be established, cause=%s\n', cause.message, cause.stack) var error = new Error('tunneling socket could not be established, ' + 'cause=' + cause.message) error.code = 'ECONNRESET' options.request.emit('error', error) self.removeSocket(placeholder) } } TunnelingAgent.prototype.removeSocket = function removeSocket(socket) { var pos = this.sockets.indexOf(socket) if (pos === -1) return this.sockets.splice(pos, 1) var pending = this.requests.shift() if (pending) { // If we have pending requests and a socket gets closed a new one // needs to be created to take over in the pool for the one that closed. this.createConnection(pending) } } function createSecureSocket(options, cb) { var self = this TunnelingAgent.prototype.createSocket.call(self, options, function(socket) { // 0 is dummy port for v0.6 var secureSocket = tls.connect(0, mergeOptions({}, self.options, { servername: options.host , socket: socket } )) self.sockets[self.sockets.indexOf(socket)] = secureSocket cb(secureSocket) }) } function mergeOptions(target) { for (var i = 1, len = arguments.length; i < len; ++i) { var overrides = arguments[i] if (typeof overrides === 'object') { var keys = Object.keys(overrides) for (var j = 0, keyLen = keys.length; j < keyLen; ++j) { var k = keys[j] if (overrides[k] !== undefined) { target[k] = overrides[k] } } } } return target } var debug if (process.env.NODE_DEBUG && /\btunnel\b/.test(process.env.NODE_DEBUG)) { debug = function() { var args = Array.prototype.slice.call(arguments) if (typeof args[0] === 'string') { args[0] = 'TUNNEL: ' + args[0] } else { args.unshift('TUNNEL:') } console.error.apply(console, args) } } else { debug = function() {} } exports.debug = debug // for test /***/ }), /***/ 68729: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { (function(nacl) { 'use strict'; // Ported in 2014 by Dmitry Chestnykh and Devi Mandiri. // Public domain. // // Implementation derived from TweetNaCl version 20140427. // See for details: http://tweetnacl.cr.yp.to/ var gf = function(init) { var i, r = new Float64Array(16); if (init) for (i = 0; i < init.length; i++) r[i] = init[i]; return r; }; // Pluggable, initialized in high-level API below. var randombytes = function(/* x, n */) { throw new Error('no PRNG'); }; var _0 = new Uint8Array(16); var _9 = new Uint8Array(32); _9[0] = 9; var gf0 = gf(), gf1 = gf([1]), _121665 = gf([0xdb41, 1]), D = gf([0x78a3, 0x1359, 0x4dca, 0x75eb, 0xd8ab, 0x4141, 0x0a4d, 0x0070, 0xe898, 0x7779, 0x4079, 0x8cc7, 0xfe73, 0x2b6f, 0x6cee, 0x5203]), D2 = gf([0xf159, 0x26b2, 0x9b94, 0xebd6, 0xb156, 0x8283, 0x149a, 0x00e0, 0xd130, 0xeef3, 0x80f2, 0x198e, 0xfce7, 0x56df, 0xd9dc, 0x2406]), X = gf([0xd51a, 0x8f25, 0x2d60, 0xc956, 0xa7b2, 0x9525, 0xc760, 0x692c, 0xdc5c, 0xfdd6, 0xe231, 0xc0a4, 0x53fe, 0xcd6e, 0x36d3, 0x2169]), Y = gf([0x6658, 0x6666, 0x6666, 0x6666, 0x6666, 0x6666, 0x6666, 0x6666, 0x6666, 0x6666, 0x6666, 0x6666, 0x6666, 0x6666, 0x6666, 0x6666]), I = gf([0xa0b0, 0x4a0e, 0x1b27, 0xc4ee, 0xe478, 0xad2f, 0x1806, 0x2f43, 0xd7a7, 0x3dfb, 0x0099, 0x2b4d, 0xdf0b, 0x4fc1, 0x2480, 0x2b83]); function ts64(x, i, h, l) { x[i] = (h >> 24) & 0xff; x[i+1] = (h >> 16) & 0xff; x[i+2] = (h >> 8) & 0xff; x[i+3] = h & 0xff; x[i+4] = (l >> 24) & 0xff; x[i+5] = (l >> 16) & 0xff; x[i+6] = (l >> 8) & 0xff; x[i+7] = l & 0xff; } function vn(x, xi, y, yi, n) { var i,d = 0; for (i = 0; i < n; i++) d |= x[xi+i]^y[yi+i]; return (1 & ((d - 1) >>> 8)) - 1; } function crypto_verify_16(x, xi, y, yi) { return vn(x,xi,y,yi,16); } function crypto_verify_32(x, xi, y, yi) { return vn(x,xi,y,yi,32); } function core_salsa20(o, p, k, c) { var j0 = c[ 0] & 0xff | (c[ 1] & 0xff)<<8 | (c[ 2] & 0xff)<<16 | (c[ 3] & 0xff)<<24, j1 = k[ 0] & 0xff | (k[ 1] & 0xff)<<8 | (k[ 2] & 0xff)<<16 | (k[ 3] & 0xff)<<24, j2 = k[ 4] & 0xff | (k[ 5] & 0xff)<<8 | (k[ 6] & 0xff)<<16 | (k[ 7] & 0xff)<<24, j3 = k[ 8] & 0xff | (k[ 9] & 0xff)<<8 | (k[10] & 0xff)<<16 | (k[11] & 0xff)<<24, j4 = k[12] & 0xff | (k[13] & 0xff)<<8 | (k[14] & 0xff)<<16 | (k[15] & 0xff)<<24, j5 = c[ 4] & 0xff | (c[ 5] & 0xff)<<8 | (c[ 6] & 0xff)<<16 | (c[ 7] & 0xff)<<24, j6 = p[ 0] & 0xff | (p[ 1] & 0xff)<<8 | (p[ 2] & 0xff)<<16 | (p[ 3] & 0xff)<<24, j7 = p[ 4] & 0xff | (p[ 5] & 0xff)<<8 | (p[ 6] & 0xff)<<16 | (p[ 7] & 0xff)<<24, j8 = p[ 8] & 0xff | (p[ 9] & 0xff)<<8 | (p[10] & 0xff)<<16 | (p[11] & 0xff)<<24, j9 = p[12] & 0xff | (p[13] & 0xff)<<8 | (p[14] & 0xff)<<16 | (p[15] & 0xff)<<24, j10 = c[ 8] & 0xff | (c[ 9] & 0xff)<<8 | (c[10] & 0xff)<<16 | (c[11] & 0xff)<<24, j11 = k[16] & 0xff | (k[17] & 0xff)<<8 | (k[18] & 0xff)<<16 | (k[19] & 0xff)<<24, j12 = k[20] & 0xff | (k[21] & 0xff)<<8 | (k[22] & 0xff)<<16 | (k[23] & 0xff)<<24, j13 = k[24] & 0xff | (k[25] & 0xff)<<8 | (k[26] & 0xff)<<16 | (k[27] & 0xff)<<24, j14 = k[28] & 0xff | (k[29] & 0xff)<<8 | (k[30] & 0xff)<<16 | (k[31] & 0xff)<<24, j15 = c[12] & 0xff | (c[13] & 0xff)<<8 | (c[14] & 0xff)<<16 | (c[15] & 0xff)<<24; var x0 = j0, x1 = j1, x2 = j2, x3 = j3, x4 = j4, x5 = j5, x6 = j6, x7 = j7, x8 = j8, x9 = j9, x10 = j10, x11 = j11, x12 = j12, x13 = j13, x14 = j14, x15 = j15, u; for (var i = 0; i < 20; i += 2) { u = x0 + x12 | 0; x4 ^= u<<7 | u>>>(32-7); u = x4 + x0 | 0; x8 ^= u<<9 | u>>>(32-9); u = x8 + x4 | 0; x12 ^= u<<13 | u>>>(32-13); u = x12 + x8 | 0; x0 ^= u<<18 | u>>>(32-18); u = x5 + x1 | 0; x9 ^= u<<7 | u>>>(32-7); u = x9 + x5 | 0; x13 ^= u<<9 | u>>>(32-9); u = x13 + x9 | 0; x1 ^= u<<13 | u>>>(32-13); u = x1 + x13 | 0; x5 ^= u<<18 | u>>>(32-18); u = x10 + x6 | 0; x14 ^= u<<7 | u>>>(32-7); u = x14 + x10 | 0; x2 ^= u<<9 | u>>>(32-9); u = x2 + x14 | 0; x6 ^= u<<13 | u>>>(32-13); u = x6 + x2 | 0; x10 ^= u<<18 | u>>>(32-18); u = x15 + x11 | 0; x3 ^= u<<7 | u>>>(32-7); u = x3 + x15 | 0; x7 ^= u<<9 | u>>>(32-9); u = x7 + x3 | 0; x11 ^= u<<13 | u>>>(32-13); u = x11 + x7 | 0; x15 ^= u<<18 | u>>>(32-18); u = x0 + x3 | 0; x1 ^= u<<7 | u>>>(32-7); u = x1 + x0 | 0; x2 ^= u<<9 | u>>>(32-9); u = x2 + x1 | 0; x3 ^= u<<13 | u>>>(32-13); u = x3 + x2 | 0; x0 ^= u<<18 | u>>>(32-18); u = x5 + x4 | 0; x6 ^= u<<7 | u>>>(32-7); u = x6 + x5 | 0; x7 ^= u<<9 | u>>>(32-9); u = x7 + x6 | 0; x4 ^= u<<13 | u>>>(32-13); u = x4 + x7 | 0; x5 ^= u<<18 | u>>>(32-18); u = x10 + x9 | 0; x11 ^= u<<7 | u>>>(32-7); u = x11 + x10 | 0; x8 ^= u<<9 | u>>>(32-9); u = x8 + x11 | 0; x9 ^= u<<13 | u>>>(32-13); u = x9 + x8 | 0; x10 ^= u<<18 | u>>>(32-18); u = x15 + x14 | 0; x12 ^= u<<7 | u>>>(32-7); u = x12 + x15 | 0; x13 ^= u<<9 | u>>>(32-9); u = x13 + x12 | 0; x14 ^= u<<13 | u>>>(32-13); u = x14 + x13 | 0; x15 ^= u<<18 | u>>>(32-18); } x0 = x0 + j0 | 0; x1 = x1 + j1 | 0; x2 = x2 + j2 | 0; x3 = x3 + j3 | 0; x4 = x4 + j4 | 0; x5 = x5 + j5 | 0; x6 = x6 + j6 | 0; x7 = x7 + j7 | 0; x8 = x8 + j8 | 0; x9 = x9 + j9 | 0; x10 = x10 + j10 | 0; x11 = x11 + j11 | 0; x12 = x12 + j12 | 0; x13 = x13 + j13 | 0; x14 = x14 + j14 | 0; x15 = x15 + j15 | 0; o[ 0] = x0 >>> 0 & 0xff; o[ 1] = x0 >>> 8 & 0xff; o[ 2] = x0 >>> 16 & 0xff; o[ 3] = x0 >>> 24 & 0xff; o[ 4] = x1 >>> 0 & 0xff; o[ 5] = x1 >>> 8 & 0xff; o[ 6] = x1 >>> 16 & 0xff; o[ 7] = x1 >>> 24 & 0xff; o[ 8] = x2 >>> 0 & 0xff; o[ 9] = x2 >>> 8 & 0xff; o[10] = x2 >>> 16 & 0xff; o[11] = x2 >>> 24 & 0xff; o[12] = x3 >>> 0 & 0xff; o[13] = x3 >>> 8 & 0xff; o[14] = x3 >>> 16 & 0xff; o[15] = x3 >>> 24 & 0xff; o[16] = x4 >>> 0 & 0xff; o[17] = x4 >>> 8 & 0xff; o[18] = x4 >>> 16 & 0xff; o[19] = x4 >>> 24 & 0xff; o[20] = x5 >>> 0 & 0xff; o[21] = x5 >>> 8 & 0xff; o[22] = x5 >>> 16 & 0xff; o[23] = x5 >>> 24 & 0xff; o[24] = x6 >>> 0 & 0xff; o[25] = x6 >>> 8 & 0xff; o[26] = x6 >>> 16 & 0xff; o[27] = x6 >>> 24 & 0xff; o[28] = x7 >>> 0 & 0xff; o[29] = x7 >>> 8 & 0xff; o[30] = x7 >>> 16 & 0xff; o[31] = x7 >>> 24 & 0xff; o[32] = x8 >>> 0 & 0xff; o[33] = x8 >>> 8 & 0xff; o[34] = x8 >>> 16 & 0xff; o[35] = x8 >>> 24 & 0xff; o[36] = x9 >>> 0 & 0xff; o[37] = x9 >>> 8 & 0xff; o[38] = x9 >>> 16 & 0xff; o[39] = x9 >>> 24 & 0xff; o[40] = x10 >>> 0 & 0xff; o[41] = x10 >>> 8 & 0xff; o[42] = x10 >>> 16 & 0xff; o[43] = x10 >>> 24 & 0xff; o[44] = x11 >>> 0 & 0xff; o[45] = x11 >>> 8 & 0xff; o[46] = x11 >>> 16 & 0xff; o[47] = x11 >>> 24 & 0xff; o[48] = x12 >>> 0 & 0xff; o[49] = x12 >>> 8 & 0xff; o[50] = x12 >>> 16 & 0xff; o[51] = x12 >>> 24 & 0xff; o[52] = x13 >>> 0 & 0xff; o[53] = x13 >>> 8 & 0xff; o[54] = x13 >>> 16 & 0xff; o[55] = x13 >>> 24 & 0xff; o[56] = x14 >>> 0 & 0xff; o[57] = x14 >>> 8 & 0xff; o[58] = x14 >>> 16 & 0xff; o[59] = x14 >>> 24 & 0xff; o[60] = x15 >>> 0 & 0xff; o[61] = x15 >>> 8 & 0xff; o[62] = x15 >>> 16 & 0xff; o[63] = x15 >>> 24 & 0xff; } function core_hsalsa20(o,p,k,c) { var j0 = c[ 0] & 0xff | (c[ 1] & 0xff)<<8 | (c[ 2] & 0xff)<<16 | (c[ 3] & 0xff)<<24, j1 = k[ 0] & 0xff | (k[ 1] & 0xff)<<8 | (k[ 2] & 0xff)<<16 | (k[ 3] & 0xff)<<24, j2 = k[ 4] & 0xff | (k[ 5] & 0xff)<<8 | (k[ 6] & 0xff)<<16 | (k[ 7] & 0xff)<<24, j3 = k[ 8] & 0xff | (k[ 9] & 0xff)<<8 | (k[10] & 0xff)<<16 | (k[11] & 0xff)<<24, j4 = k[12] & 0xff | (k[13] & 0xff)<<8 | (k[14] & 0xff)<<16 | (k[15] & 0xff)<<24, j5 = c[ 4] & 0xff | (c[ 5] & 0xff)<<8 | (c[ 6] & 0xff)<<16 | (c[ 7] & 0xff)<<24, j6 = p[ 0] & 0xff | (p[ 1] & 0xff)<<8 | (p[ 2] & 0xff)<<16 | (p[ 3] & 0xff)<<24, j7 = p[ 4] & 0xff | (p[ 5] & 0xff)<<8 | (p[ 6] & 0xff)<<16 | (p[ 7] & 0xff)<<24, j8 = p[ 8] & 0xff | (p[ 9] & 0xff)<<8 | (p[10] & 0xff)<<16 | (p[11] & 0xff)<<24, j9 = p[12] & 0xff | (p[13] & 0xff)<<8 | (p[14] & 0xff)<<16 | (p[15] & 0xff)<<24, j10 = c[ 8] & 0xff | (c[ 9] & 0xff)<<8 | (c[10] & 0xff)<<16 | (c[11] & 0xff)<<24, j11 = k[16] & 0xff | (k[17] & 0xff)<<8 | (k[18] & 0xff)<<16 | (k[19] & 0xff)<<24, j12 = k[20] & 0xff | (k[21] & 0xff)<<8 | (k[22] & 0xff)<<16 | (k[23] & 0xff)<<24, j13 = k[24] & 0xff | (k[25] & 0xff)<<8 | (k[26] & 0xff)<<16 | (k[27] & 0xff)<<24, j14 = k[28] & 0xff | (k[29] & 0xff)<<8 | (k[30] & 0xff)<<16 | (k[31] & 0xff)<<24, j15 = c[12] & 0xff | (c[13] & 0xff)<<8 | (c[14] & 0xff)<<16 | (c[15] & 0xff)<<24; var x0 = j0, x1 = j1, x2 = j2, x3 = j3, x4 = j4, x5 = j5, x6 = j6, x7 = j7, x8 = j8, x9 = j9, x10 = j10, x11 = j11, x12 = j12, x13 = j13, x14 = j14, x15 = j15, u; for (var i = 0; i < 20; i += 2) { u = x0 + x12 | 0; x4 ^= u<<7 | u>>>(32-7); u = x4 + x0 | 0; x8 ^= u<<9 | u>>>(32-9); u = x8 + x4 | 0; x12 ^= u<<13 | u>>>(32-13); u = x12 + x8 | 0; x0 ^= u<<18 | u>>>(32-18); u = x5 + x1 | 0; x9 ^= u<<7 | u>>>(32-7); u = x9 + x5 | 0; x13 ^= u<<9 | u>>>(32-9); u = x13 + x9 | 0; x1 ^= u<<13 | u>>>(32-13); u = x1 + x13 | 0; x5 ^= u<<18 | u>>>(32-18); u = x10 + x6 | 0; x14 ^= u<<7 | u>>>(32-7); u = x14 + x10 | 0; x2 ^= u<<9 | u>>>(32-9); u = x2 + x14 | 0; x6 ^= u<<13 | u>>>(32-13); u = x6 + x2 | 0; x10 ^= u<<18 | u>>>(32-18); u = x15 + x11 | 0; x3 ^= u<<7 | u>>>(32-7); u = x3 + x15 | 0; x7 ^= u<<9 | u>>>(32-9); u = x7 + x3 | 0; x11 ^= u<<13 | u>>>(32-13); u = x11 + x7 | 0; x15 ^= u<<18 | u>>>(32-18); u = x0 + x3 | 0; x1 ^= u<<7 | u>>>(32-7); u = x1 + x0 | 0; x2 ^= u<<9 | u>>>(32-9); u = x2 + x1 | 0; x3 ^= u<<13 | u>>>(32-13); u = x3 + x2 | 0; x0 ^= u<<18 | u>>>(32-18); u = x5 + x4 | 0; x6 ^= u<<7 | u>>>(32-7); u = x6 + x5 | 0; x7 ^= u<<9 | u>>>(32-9); u = x7 + x6 | 0; x4 ^= u<<13 | u>>>(32-13); u = x4 + x7 | 0; x5 ^= u<<18 | u>>>(32-18); u = x10 + x9 | 0; x11 ^= u<<7 | u>>>(32-7); u = x11 + x10 | 0; x8 ^= u<<9 | u>>>(32-9); u = x8 + x11 | 0; x9 ^= u<<13 | u>>>(32-13); u = x9 + x8 | 0; x10 ^= u<<18 | u>>>(32-18); u = x15 + x14 | 0; x12 ^= u<<7 | u>>>(32-7); u = x12 + x15 | 0; x13 ^= u<<9 | u>>>(32-9); u = x13 + x12 | 0; x14 ^= u<<13 | u>>>(32-13); u = x14 + x13 | 0; x15 ^= u<<18 | u>>>(32-18); } o[ 0] = x0 >>> 0 & 0xff; o[ 1] = x0 >>> 8 & 0xff; o[ 2] = x0 >>> 16 & 0xff; o[ 3] = x0 >>> 24 & 0xff; o[ 4] = x5 >>> 0 & 0xff; o[ 5] = x5 >>> 8 & 0xff; o[ 6] = x5 >>> 16 & 0xff; o[ 7] = x5 >>> 24 & 0xff; o[ 8] = x10 >>> 0 & 0xff; o[ 9] = x10 >>> 8 & 0xff; o[10] = x10 >>> 16 & 0xff; o[11] = x10 >>> 24 & 0xff; o[12] = x15 >>> 0 & 0xff; o[13] = x15 >>> 8 & 0xff; o[14] = x15 >>> 16 & 0xff; o[15] = x15 >>> 24 & 0xff; o[16] = x6 >>> 0 & 0xff; o[17] = x6 >>> 8 & 0xff; o[18] = x6 >>> 16 & 0xff; o[19] = x6 >>> 24 & 0xff; o[20] = x7 >>> 0 & 0xff; o[21] = x7 >>> 8 & 0xff; o[22] = x7 >>> 16 & 0xff; o[23] = x7 >>> 24 & 0xff; o[24] = x8 >>> 0 & 0xff; o[25] = x8 >>> 8 & 0xff; o[26] = x8 >>> 16 & 0xff; o[27] = x8 >>> 24 & 0xff; o[28] = x9 >>> 0 & 0xff; o[29] = x9 >>> 8 & 0xff; o[30] = x9 >>> 16 & 0xff; o[31] = x9 >>> 24 & 0xff; } function crypto_core_salsa20(out,inp,k,c) { core_salsa20(out,inp,k,c); } function crypto_core_hsalsa20(out,inp,k,c) { core_hsalsa20(out,inp,k,c); } var sigma = new Uint8Array([101, 120, 112, 97, 110, 100, 32, 51, 50, 45, 98, 121, 116, 101, 32, 107]); // "expand 32-byte k" function crypto_stream_salsa20_xor(c,cpos,m,mpos,b,n,k) { var z = new Uint8Array(16), x = new Uint8Array(64); var u, i; for (i = 0; i < 16; i++) z[i] = 0; for (i = 0; i < 8; i++) z[i] = n[i]; while (b >= 64) { crypto_core_salsa20(x,z,k,sigma); for (i = 0; i < 64; i++) c[cpos+i] = m[mpos+i] ^ x[i]; u = 1; for (i = 8; i < 16; i++) { u = u + (z[i] & 0xff) | 0; z[i] = u & 0xff; u >>>= 8; } b -= 64; cpos += 64; mpos += 64; } if (b > 0) { crypto_core_salsa20(x,z,k,sigma); for (i = 0; i < b; i++) c[cpos+i] = m[mpos+i] ^ x[i]; } return 0; } function crypto_stream_salsa20(c,cpos,b,n,k) { var z = new Uint8Array(16), x = new Uint8Array(64); var u, i; for (i = 0; i < 16; i++) z[i] = 0; for (i = 0; i < 8; i++) z[i] = n[i]; while (b >= 64) { crypto_core_salsa20(x,z,k,sigma); for (i = 0; i < 64; i++) c[cpos+i] = x[i]; u = 1; for (i = 8; i < 16; i++) { u = u + (z[i] & 0xff) | 0; z[i] = u & 0xff; u >>>= 8; } b -= 64; cpos += 64; } if (b > 0) { crypto_core_salsa20(x,z,k,sigma); for (i = 0; i < b; i++) c[cpos+i] = x[i]; } return 0; } function crypto_stream(c,cpos,d,n,k) { var s = new Uint8Array(32); crypto_core_hsalsa20(s,n,k,sigma); var sn = new Uint8Array(8); for (var i = 0; i < 8; i++) sn[i] = n[i+16]; return crypto_stream_salsa20(c,cpos,d,sn,s); } function crypto_stream_xor(c,cpos,m,mpos,d,n,k) { var s = new Uint8Array(32); crypto_core_hsalsa20(s,n,k,sigma); var sn = new Uint8Array(8); for (var i = 0; i < 8; i++) sn[i] = n[i+16]; return crypto_stream_salsa20_xor(c,cpos,m,mpos,d,sn,s); } /* * Port of Andrew Moon's Poly1305-donna-16. Public domain. * https://github.com/floodyberry/poly1305-donna */ var poly1305 = function(key) { this.buffer = new Uint8Array(16); this.r = new Uint16Array(10); this.h = new Uint16Array(10); this.pad = new Uint16Array(8); this.leftover = 0; this.fin = 0; var t0, t1, t2, t3, t4, t5, t6, t7; t0 = key[ 0] & 0xff | (key[ 1] & 0xff) << 8; this.r[0] = ( t0 ) & 0x1fff; t1 = key[ 2] & 0xff | (key[ 3] & 0xff) << 8; this.r[1] = ((t0 >>> 13) | (t1 << 3)) & 0x1fff; t2 = key[ 4] & 0xff | (key[ 5] & 0xff) << 8; this.r[2] = ((t1 >>> 10) | (t2 << 6)) & 0x1f03; t3 = key[ 6] & 0xff | (key[ 7] & 0xff) << 8; this.r[3] = ((t2 >>> 7) | (t3 << 9)) & 0x1fff; t4 = key[ 8] & 0xff | (key[ 9] & 0xff) << 8; this.r[4] = ((t3 >>> 4) | (t4 << 12)) & 0x00ff; this.r[5] = ((t4 >>> 1)) & 0x1ffe; t5 = key[10] & 0xff | (key[11] & 0xff) << 8; this.r[6] = ((t4 >>> 14) | (t5 << 2)) & 0x1fff; t6 = key[12] & 0xff | (key[13] & 0xff) << 8; this.r[7] = ((t5 >>> 11) | (t6 << 5)) & 0x1f81; t7 = key[14] & 0xff | (key[15] & 0xff) << 8; this.r[8] = ((t6 >>> 8) | (t7 << 8)) & 0x1fff; this.r[9] = ((t7 >>> 5)) & 0x007f; this.pad[0] = key[16] & 0xff | (key[17] & 0xff) << 8; this.pad[1] = key[18] & 0xff | (key[19] & 0xff) << 8; this.pad[2] = key[20] & 0xff | (key[21] & 0xff) << 8; this.pad[3] = key[22] & 0xff | (key[23] & 0xff) << 8; this.pad[4] = key[24] & 0xff | (key[25] & 0xff) << 8; this.pad[5] = key[26] & 0xff | (key[27] & 0xff) << 8; this.pad[6] = key[28] & 0xff | (key[29] & 0xff) << 8; this.pad[7] = key[30] & 0xff | (key[31] & 0xff) << 8; }; poly1305.prototype.blocks = function(m, mpos, bytes) { var hibit = this.fin ? 0 : (1 << 11); var t0, t1, t2, t3, t4, t5, t6, t7, c; var d0, d1, d2, d3, d4, d5, d6, d7, d8, d9; var h0 = this.h[0], h1 = this.h[1], h2 = this.h[2], h3 = this.h[3], h4 = this.h[4], h5 = this.h[5], h6 = this.h[6], h7 = this.h[7], h8 = this.h[8], h9 = this.h[9]; var r0 = this.r[0], r1 = this.r[1], r2 = this.r[2], r3 = this.r[3], r4 = this.r[4], r5 = this.r[5], r6 = this.r[6], r7 = this.r[7], r8 = this.r[8], r9 = this.r[9]; while (bytes >= 16) { t0 = m[mpos+ 0] & 0xff | (m[mpos+ 1] & 0xff) << 8; h0 += ( t0 ) & 0x1fff; t1 = m[mpos+ 2] & 0xff | (m[mpos+ 3] & 0xff) << 8; h1 += ((t0 >>> 13) | (t1 << 3)) & 0x1fff; t2 = m[mpos+ 4] & 0xff | (m[mpos+ 5] & 0xff) << 8; h2 += ((t1 >>> 10) | (t2 << 6)) & 0x1fff; t3 = m[mpos+ 6] & 0xff | (m[mpos+ 7] & 0xff) << 8; h3 += ((t2 >>> 7) | (t3 << 9)) & 0x1fff; t4 = m[mpos+ 8] & 0xff | (m[mpos+ 9] & 0xff) << 8; h4 += ((t3 >>> 4) | (t4 << 12)) & 0x1fff; h5 += ((t4 >>> 1)) & 0x1fff; t5 = m[mpos+10] & 0xff | (m[mpos+11] & 0xff) << 8; h6 += ((t4 >>> 14) | (t5 << 2)) & 0x1fff; t6 = m[mpos+12] & 0xff | (m[mpos+13] & 0xff) << 8; h7 += ((t5 >>> 11) | (t6 << 5)) & 0x1fff; t7 = m[mpos+14] & 0xff | (m[mpos+15] & 0xff) << 8; h8 += ((t6 >>> 8) | (t7 << 8)) & 0x1fff; h9 += ((t7 >>> 5)) | hibit; c = 0; d0 = c; d0 += h0 * r0; d0 += h1 * (5 * r9); d0 += h2 * (5 * r8); d0 += h3 * (5 * r7); d0 += h4 * (5 * r6); c = (d0 >>> 13); d0 &= 0x1fff; d0 += h5 * (5 * r5); d0 += h6 * (5 * r4); d0 += h7 * (5 * r3); d0 += h8 * (5 * r2); d0 += h9 * (5 * r1); c += (d0 >>> 13); d0 &= 0x1fff; d1 = c; d1 += h0 * r1; d1 += h1 * r0; d1 += h2 * (5 * r9); d1 += h3 * (5 * r8); d1 += h4 * (5 * r7); c = (d1 >>> 13); d1 &= 0x1fff; d1 += h5 * (5 * r6); d1 += h6 * (5 * r5); d1 += h7 * (5 * r4); d1 += h8 * (5 * r3); d1 += h9 * (5 * r2); c += (d1 >>> 13); d1 &= 0x1fff; d2 = c; d2 += h0 * r2; d2 += h1 * r1; d2 += h2 * r0; d2 += h3 * (5 * r9); d2 += h4 * (5 * r8); c = (d2 >>> 13); d2 &= 0x1fff; d2 += h5 * (5 * r7); d2 += h6 * (5 * r6); d2 += h7 * (5 * r5); d2 += h8 * (5 * r4); d2 += h9 * (5 * r3); c += (d2 >>> 13); d2 &= 0x1fff; d3 = c; d3 += h0 * r3; d3 += h1 * r2; d3 += h2 * r1; d3 += h3 * r0; d3 += h4 * (5 * r9); c = (d3 >>> 13); d3 &= 0x1fff; d3 += h5 * (5 * r8); d3 += h6 * (5 * r7); d3 += h7 * (5 * r6); d3 += h8 * (5 * r5); d3 += h9 * (5 * r4); c += (d3 >>> 13); d3 &= 0x1fff; d4 = c; d4 += h0 * r4; d4 += h1 * r3; d4 += h2 * r2; d4 += h3 * r1; d4 += h4 * r0; c = (d4 >>> 13); d4 &= 0x1fff; d4 += h5 * (5 * r9); d4 += h6 * (5 * r8); d4 += h7 * (5 * r7); d4 += h8 * (5 * r6); d4 += h9 * (5 * r5); c += (d4 >>> 13); d4 &= 0x1fff; d5 = c; d5 += h0 * r5; d5 += h1 * r4; d5 += h2 * r3; d5 += h3 * r2; d5 += h4 * r1; c = (d5 >>> 13); d5 &= 0x1fff; d5 += h5 * r0; d5 += h6 * (5 * r9); d5 += h7 * (5 * r8); d5 += h8 * (5 * r7); d5 += h9 * (5 * r6); c += (d5 >>> 13); d5 &= 0x1fff; d6 = c; d6 += h0 * r6; d6 += h1 * r5; d6 += h2 * r4; d6 += h3 * r3; d6 += h4 * r2; c = (d6 >>> 13); d6 &= 0x1fff; d6 += h5 * r1; d6 += h6 * r0; d6 += h7 * (5 * r9); d6 += h8 * (5 * r8); d6 += h9 * (5 * r7); c += (d6 >>> 13); d6 &= 0x1fff; d7 = c; d7 += h0 * r7; d7 += h1 * r6; d7 += h2 * r5; d7 += h3 * r4; d7 += h4 * r3; c = (d7 >>> 13); d7 &= 0x1fff; d7 += h5 * r2; d7 += h6 * r1; d7 += h7 * r0; d7 += h8 * (5 * r9); d7 += h9 * (5 * r8); c += (d7 >>> 13); d7 &= 0x1fff; d8 = c; d8 += h0 * r8; d8 += h1 * r7; d8 += h2 * r6; d8 += h3 * r5; d8 += h4 * r4; c = (d8 >>> 13); d8 &= 0x1fff; d8 += h5 * r3; d8 += h6 * r2; d8 += h7 * r1; d8 += h8 * r0; d8 += h9 * (5 * r9); c += (d8 >>> 13); d8 &= 0x1fff; d9 = c; d9 += h0 * r9; d9 += h1 * r8; d9 += h2 * r7; d9 += h3 * r6; d9 += h4 * r5; c = (d9 >>> 13); d9 &= 0x1fff; d9 += h5 * r4; d9 += h6 * r3; d9 += h7 * r2; d9 += h8 * r1; d9 += h9 * r0; c += (d9 >>> 13); d9 &= 0x1fff; c = (((c << 2) + c)) | 0; c = (c + d0) | 0; d0 = c & 0x1fff; c = (c >>> 13); d1 += c; h0 = d0; h1 = d1; h2 = d2; h3 = d3; h4 = d4; h5 = d5; h6 = d6; h7 = d7; h8 = d8; h9 = d9; mpos += 16; bytes -= 16; } this.h[0] = h0; this.h[1] = h1; this.h[2] = h2; this.h[3] = h3; this.h[4] = h4; this.h[5] = h5; this.h[6] = h6; this.h[7] = h7; this.h[8] = h8; this.h[9] = h9; }; poly1305.prototype.finish = function(mac, macpos) { var g = new Uint16Array(10); var c, mask, f, i; if (this.leftover) { i = this.leftover; this.buffer[i++] = 1; for (; i < 16; i++) this.buffer[i] = 0; this.fin = 1; this.blocks(this.buffer, 0, 16); } c = this.h[1] >>> 13; this.h[1] &= 0x1fff; for (i = 2; i < 10; i++) { this.h[i] += c; c = this.h[i] >>> 13; this.h[i] &= 0x1fff; } this.h[0] += (c * 5); c = this.h[0] >>> 13; this.h[0] &= 0x1fff; this.h[1] += c; c = this.h[1] >>> 13; this.h[1] &= 0x1fff; this.h[2] += c; g[0] = this.h[0] + 5; c = g[0] >>> 13; g[0] &= 0x1fff; for (i = 1; i < 10; i++) { g[i] = this.h[i] + c; c = g[i] >>> 13; g[i] &= 0x1fff; } g[9] -= (1 << 13); mask = (c ^ 1) - 1; for (i = 0; i < 10; i++) g[i] &= mask; mask = ~mask; for (i = 0; i < 10; i++) this.h[i] = (this.h[i] & mask) | g[i]; this.h[0] = ((this.h[0] ) | (this.h[1] << 13) ) & 0xffff; this.h[1] = ((this.h[1] >>> 3) | (this.h[2] << 10) ) & 0xffff; this.h[2] = ((this.h[2] >>> 6) | (this.h[3] << 7) ) & 0xffff; this.h[3] = ((this.h[3] >>> 9) | (this.h[4] << 4) ) & 0xffff; this.h[4] = ((this.h[4] >>> 12) | (this.h[5] << 1) | (this.h[6] << 14)) & 0xffff; this.h[5] = ((this.h[6] >>> 2) | (this.h[7] << 11) ) & 0xffff; this.h[6] = ((this.h[7] >>> 5) | (this.h[8] << 8) ) & 0xffff; this.h[7] = ((this.h[8] >>> 8) | (this.h[9] << 5) ) & 0xffff; f = this.h[0] + this.pad[0]; this.h[0] = f & 0xffff; for (i = 1; i < 8; i++) { f = (((this.h[i] + this.pad[i]) | 0) + (f >>> 16)) | 0; this.h[i] = f & 0xffff; } mac[macpos+ 0] = (this.h[0] >>> 0) & 0xff; mac[macpos+ 1] = (this.h[0] >>> 8) & 0xff; mac[macpos+ 2] = (this.h[1] >>> 0) & 0xff; mac[macpos+ 3] = (this.h[1] >>> 8) & 0xff; mac[macpos+ 4] = (this.h[2] >>> 0) & 0xff; mac[macpos+ 5] = (this.h[2] >>> 8) & 0xff; mac[macpos+ 6] = (this.h[3] >>> 0) & 0xff; mac[macpos+ 7] = (this.h[3] >>> 8) & 0xff; mac[macpos+ 8] = (this.h[4] >>> 0) & 0xff; mac[macpos+ 9] = (this.h[4] >>> 8) & 0xff; mac[macpos+10] = (this.h[5] >>> 0) & 0xff; mac[macpos+11] = (this.h[5] >>> 8) & 0xff; mac[macpos+12] = (this.h[6] >>> 0) & 0xff; mac[macpos+13] = (this.h[6] >>> 8) & 0xff; mac[macpos+14] = (this.h[7] >>> 0) & 0xff; mac[macpos+15] = (this.h[7] >>> 8) & 0xff; }; poly1305.prototype.update = function(m, mpos, bytes) { var i, want; if (this.leftover) { want = (16 - this.leftover); if (want > bytes) want = bytes; for (i = 0; i < want; i++) this.buffer[this.leftover + i] = m[mpos+i]; bytes -= want; mpos += want; this.leftover += want; if (this.leftover < 16) return; this.blocks(this.buffer, 0, 16); this.leftover = 0; } if (bytes >= 16) { want = bytes - (bytes % 16); this.blocks(m, mpos, want); mpos += want; bytes -= want; } if (bytes) { for (i = 0; i < bytes; i++) this.buffer[this.leftover + i] = m[mpos+i]; this.leftover += bytes; } }; function crypto_onetimeauth(out, outpos, m, mpos, n, k) { var s = new poly1305(k); s.update(m, mpos, n); s.finish(out, outpos); return 0; } function crypto_onetimeauth_verify(h, hpos, m, mpos, n, k) { var x = new Uint8Array(16); crypto_onetimeauth(x,0,m,mpos,n,k); return crypto_verify_16(h,hpos,x,0); } function crypto_secretbox(c,m,d,n,k) { var i; if (d < 32) return -1; crypto_stream_xor(c,0,m,0,d,n,k); crypto_onetimeauth(c, 16, c, 32, d - 32, c); for (i = 0; i < 16; i++) c[i] = 0; return 0; } function crypto_secretbox_open(m,c,d,n,k) { var i; var x = new Uint8Array(32); if (d < 32) return -1; crypto_stream(x,0,32,n,k); if (crypto_onetimeauth_verify(c, 16,c, 32,d - 32,x) !== 0) return -1; crypto_stream_xor(m,0,c,0,d,n,k); for (i = 0; i < 32; i++) m[i] = 0; return 0; } function set25519(r, a) { var i; for (i = 0; i < 16; i++) r[i] = a[i]|0; } function car25519(o) { var i, v, c = 1; for (i = 0; i < 16; i++) { v = o[i] + c + 65535; c = Math.floor(v / 65536); o[i] = v - c * 65536; } o[0] += c-1 + 37 * (c-1); } function sel25519(p, q, b) { var t, c = ~(b-1); for (var i = 0; i < 16; i++) { t = c & (p[i] ^ q[i]); p[i] ^= t; q[i] ^= t; } } function pack25519(o, n) { var i, j, b; var m = gf(), t = gf(); for (i = 0; i < 16; i++) t[i] = n[i]; car25519(t); car25519(t); car25519(t); for (j = 0; j < 2; j++) { m[0] = t[0] - 0xffed; for (i = 1; i < 15; i++) { m[i] = t[i] - 0xffff - ((m[i-1]>>16) & 1); m[i-1] &= 0xffff; } m[15] = t[15] - 0x7fff - ((m[14]>>16) & 1); b = (m[15]>>16) & 1; m[14] &= 0xffff; sel25519(t, m, 1-b); } for (i = 0; i < 16; i++) { o[2*i] = t[i] & 0xff; o[2*i+1] = t[i]>>8; } } function neq25519(a, b) { var c = new Uint8Array(32), d = new Uint8Array(32); pack25519(c, a); pack25519(d, b); return crypto_verify_32(c, 0, d, 0); } function par25519(a) { var d = new Uint8Array(32); pack25519(d, a); return d[0] & 1; } function unpack25519(o, n) { var i; for (i = 0; i < 16; i++) o[i] = n[2*i] + (n[2*i+1] << 8); o[15] &= 0x7fff; } function A(o, a, b) { for (var i = 0; i < 16; i++) o[i] = a[i] + b[i]; } function Z(o, a, b) { for (var i = 0; i < 16; i++) o[i] = a[i] - b[i]; } function M(o, a, b) { var v, c, t0 = 0, t1 = 0, t2 = 0, t3 = 0, t4 = 0, t5 = 0, t6 = 0, t7 = 0, t8 = 0, t9 = 0, t10 = 0, t11 = 0, t12 = 0, t13 = 0, t14 = 0, t15 = 0, t16 = 0, t17 = 0, t18 = 0, t19 = 0, t20 = 0, t21 = 0, t22 = 0, t23 = 0, t24 = 0, t25 = 0, t26 = 0, t27 = 0, t28 = 0, t29 = 0, t30 = 0, b0 = b[0], b1 = b[1], b2 = b[2], b3 = b[3], b4 = b[4], b5 = b[5], b6 = b[6], b7 = b[7], b8 = b[8], b9 = b[9], b10 = b[10], b11 = b[11], b12 = b[12], b13 = b[13], b14 = b[14], b15 = b[15]; v = a[0]; t0 += v * b0; t1 += v * b1; t2 += v * b2; t3 += v * b3; t4 += v * b4; t5 += v * b5; t6 += v * b6; t7 += v * b7; t8 += v * b8; t9 += v * b9; t10 += v * b10; t11 += v * b11; t12 += v * b12; t13 += v * b13; t14 += v * b14; t15 += v * b15; v = a[1]; t1 += v * b0; t2 += v * b1; t3 += v * b2; t4 += v * b3; t5 += v * b4; t6 += v * b5; t7 += v * b6; t8 += v * b7; t9 += v * b8; t10 += v * b9; t11 += v * b10; t12 += v * b11; t13 += v * b12; t14 += v * b13; t15 += v * b14; t16 += v * b15; v = a[2]; t2 += v * b0; t3 += v * b1; t4 += v * b2; t5 += v * b3; t6 += v * b4; t7 += v * b5; t8 += v * b6; t9 += v * b7; t10 += v * b8; t11 += v * b9; t12 += v * b10; t13 += v * b11; t14 += v * b12; t15 += v * b13; t16 += v * b14; t17 += v * b15; v = a[3]; t3 += v * b0; t4 += v * b1; t5 += v * b2; t6 += v * b3; t7 += v * b4; t8 += v * b5; t9 += v * b6; t10 += v * b7; t11 += v * b8; t12 += v * b9; t13 += v * b10; t14 += v * b11; t15 += v * b12; t16 += v * b13; t17 += v * b14; t18 += v * b15; v = a[4]; t4 += v * b0; t5 += v * b1; t6 += v * b2; t7 += v * b3; t8 += v * b4; t9 += v * b5; t10 += v * b6; t11 += v * b7; t12 += v * b8; t13 += v * b9; t14 += v * b10; t15 += v * b11; t16 += v * b12; t17 += v * b13; t18 += v * b14; t19 += v * b15; v = a[5]; t5 += v * b0; t6 += v * b1; t7 += v * b2; t8 += v * b3; t9 += v * b4; t10 += v * b5; t11 += v * b6; t12 += v * b7; t13 += v * b8; t14 += v * b9; t15 += v * b10; t16 += v * b11; t17 += v * b12; t18 += v * b13; t19 += v * b14; t20 += v * b15; v = a[6]; t6 += v * b0; t7 += v * b1; t8 += v * b2; t9 += v * b3; t10 += v * b4; t11 += v * b5; t12 += v * b6; t13 += v * b7; t14 += v * b8; t15 += v * b9; t16 += v * b10; t17 += v * b11; t18 += v * b12; t19 += v * b13; t20 += v * b14; t21 += v * b15; v = a[7]; t7 += v * b0; t8 += v * b1; t9 += v * b2; t10 += v * b3; t11 += v * b4; t12 += v * b5; t13 += v * b6; t14 += v * b7; t15 += v * b8; t16 += v * b9; t17 += v * b10; t18 += v * b11; t19 += v * b12; t20 += v * b13; t21 += v * b14; t22 += v * b15; v = a[8]; t8 += v * b0; t9 += v * b1; t10 += v * b2; t11 += v * b3; t12 += v * b4; t13 += v * b5; t14 += v * b6; t15 += v * b7; t16 += v * b8; t17 += v * b9; t18 += v * b10; t19 += v * b11; t20 += v * b12; t21 += v * b13; t22 += v * b14; t23 += v * b15; v = a[9]; t9 += v * b0; t10 += v * b1; t11 += v * b2; t12 += v * b3; t13 += v * b4; t14 += v * b5; t15 += v * b6; t16 += v * b7; t17 += v * b8; t18 += v * b9; t19 += v * b10; t20 += v * b11; t21 += v * b12; t22 += v * b13; t23 += v * b14; t24 += v * b15; v = a[10]; t10 += v * b0; t11 += v * b1; t12 += v * b2; t13 += v * b3; t14 += v * b4; t15 += v * b5; t16 += v * b6; t17 += v * b7; t18 += v * b8; t19 += v * b9; t20 += v * b10; t21 += v * b11; t22 += v * b12; t23 += v * b13; t24 += v * b14; t25 += v * b15; v = a[11]; t11 += v * b0; t12 += v * b1; t13 += v * b2; t14 += v * b3; t15 += v * b4; t16 += v * b5; t17 += v * b6; t18 += v * b7; t19 += v * b8; t20 += v * b9; t21 += v * b10; t22 += v * b11; t23 += v * b12; t24 += v * b13; t25 += v * b14; t26 += v * b15; v = a[12]; t12 += v * b0; t13 += v * b1; t14 += v * b2; t15 += v * b3; t16 += v * b4; t17 += v * b5; t18 += v * b6; t19 += v * b7; t20 += v * b8; t21 += v * b9; t22 += v * b10; t23 += v * b11; t24 += v * b12; t25 += v * b13; t26 += v * b14; t27 += v * b15; v = a[13]; t13 += v * b0; t14 += v * b1; t15 += v * b2; t16 += v * b3; t17 += v * b4; t18 += v * b5; t19 += v * b6; t20 += v * b7; t21 += v * b8; t22 += v * b9; t23 += v * b10; t24 += v * b11; t25 += v * b12; t26 += v * b13; t27 += v * b14; t28 += v * b15; v = a[14]; t14 += v * b0; t15 += v * b1; t16 += v * b2; t17 += v * b3; t18 += v * b4; t19 += v * b5; t20 += v * b6; t21 += v * b7; t22 += v * b8; t23 += v * b9; t24 += v * b10; t25 += v * b11; t26 += v * b12; t27 += v * b13; t28 += v * b14; t29 += v * b15; v = a[15]; t15 += v * b0; t16 += v * b1; t17 += v * b2; t18 += v * b3; t19 += v * b4; t20 += v * b5; t21 += v * b6; t22 += v * b7; t23 += v * b8; t24 += v * b9; t25 += v * b10; t26 += v * b11; t27 += v * b12; t28 += v * b13; t29 += v * b14; t30 += v * b15; t0 += 38 * t16; t1 += 38 * t17; t2 += 38 * t18; t3 += 38 * t19; t4 += 38 * t20; t5 += 38 * t21; t6 += 38 * t22; t7 += 38 * t23; t8 += 38 * t24; t9 += 38 * t25; t10 += 38 * t26; t11 += 38 * t27; t12 += 38 * t28; t13 += 38 * t29; t14 += 38 * t30; // t15 left as is // first car c = 1; v = t0 + c + 65535; c = Math.floor(v / 65536); t0 = v - c * 65536; v = t1 + c + 65535; c = Math.floor(v / 65536); t1 = v - c * 65536; v = t2 + c + 65535; c = Math.floor(v / 65536); t2 = v - c * 65536; v = t3 + c + 65535; c = Math.floor(v / 65536); t3 = v - c * 65536; v = t4 + c + 65535; c = Math.floor(v / 65536); t4 = v - c * 65536; v = t5 + c + 65535; c = Math.floor(v / 65536); t5 = v - c * 65536; v = t6 + c + 65535; c = Math.floor(v / 65536); t6 = v - c * 65536; v = t7 + c + 65535; c = Math.floor(v / 65536); t7 = v - c * 65536; v = t8 + c + 65535; c = Math.floor(v / 65536); t8 = v - c * 65536; v = t9 + c + 65535; c = Math.floor(v / 65536); t9 = v - c * 65536; v = t10 + c + 65535; c = Math.floor(v / 65536); t10 = v - c * 65536; v = t11 + c + 65535; c = Math.floor(v / 65536); t11 = v - c * 65536; v = t12 + c + 65535; c = Math.floor(v / 65536); t12 = v - c * 65536; v = t13 + c + 65535; c = Math.floor(v / 65536); t13 = v - c * 65536; v = t14 + c + 65535; c = Math.floor(v / 65536); t14 = v - c * 65536; v = t15 + c + 65535; c = Math.floor(v / 65536); t15 = v - c * 65536; t0 += c-1 + 37 * (c-1); // second car c = 1; v = t0 + c + 65535; c = Math.floor(v / 65536); t0 = v - c * 65536; v = t1 + c + 65535; c = Math.floor(v / 65536); t1 = v - c * 65536; v = t2 + c + 65535; c = Math.floor(v / 65536); t2 = v - c * 65536; v = t3 + c + 65535; c = Math.floor(v / 65536); t3 = v - c * 65536; v = t4 + c + 65535; c = Math.floor(v / 65536); t4 = v - c * 65536; v = t5 + c + 65535; c = Math.floor(v / 65536); t5 = v - c * 65536; v = t6 + c + 65535; c = Math.floor(v / 65536); t6 = v - c * 65536; v = t7 + c + 65535; c = Math.floor(v / 65536); t7 = v - c * 65536; v = t8 + c + 65535; c = Math.floor(v / 65536); t8 = v - c * 65536; v = t9 + c + 65535; c = Math.floor(v / 65536); t9 = v - c * 65536; v = t10 + c + 65535; c = Math.floor(v / 65536); t10 = v - c * 65536; v = t11 + c + 65535; c = Math.floor(v / 65536); t11 = v - c * 65536; v = t12 + c + 65535; c = Math.floor(v / 65536); t12 = v - c * 65536; v = t13 + c + 65535; c = Math.floor(v / 65536); t13 = v - c * 65536; v = t14 + c + 65535; c = Math.floor(v / 65536); t14 = v - c * 65536; v = t15 + c + 65535; c = Math.floor(v / 65536); t15 = v - c * 65536; t0 += c-1 + 37 * (c-1); o[ 0] = t0; o[ 1] = t1; o[ 2] = t2; o[ 3] = t3; o[ 4] = t4; o[ 5] = t5; o[ 6] = t6; o[ 7] = t7; o[ 8] = t8; o[ 9] = t9; o[10] = t10; o[11] = t11; o[12] = t12; o[13] = t13; o[14] = t14; o[15] = t15; } function S(o, a) { M(o, a, a); } function inv25519(o, i) { var c = gf(); var a; for (a = 0; a < 16; a++) c[a] = i[a]; for (a = 253; a >= 0; a--) { S(c, c); if(a !== 2 && a !== 4) M(c, c, i); } for (a = 0; a < 16; a++) o[a] = c[a]; } function pow2523(o, i) { var c = gf(); var a; for (a = 0; a < 16; a++) c[a] = i[a]; for (a = 250; a >= 0; a--) { S(c, c); if(a !== 1) M(c, c, i); } for (a = 0; a < 16; a++) o[a] = c[a]; } function crypto_scalarmult(q, n, p) { var z = new Uint8Array(32); var x = new Float64Array(80), r, i; var a = gf(), b = gf(), c = gf(), d = gf(), e = gf(), f = gf(); for (i = 0; i < 31; i++) z[i] = n[i]; z[31]=(n[31]&127)|64; z[0]&=248; unpack25519(x,p); for (i = 0; i < 16; i++) { b[i]=x[i]; d[i]=a[i]=c[i]=0; } a[0]=d[0]=1; for (i=254; i>=0; --i) { r=(z[i>>>3]>>>(i&7))&1; sel25519(a,b,r); sel25519(c,d,r); A(e,a,c); Z(a,a,c); A(c,b,d); Z(b,b,d); S(d,e); S(f,a); M(a,c,a); M(c,b,e); A(e,a,c); Z(a,a,c); S(b,a); Z(c,d,f); M(a,c,_121665); A(a,a,d); M(c,c,a); M(a,d,f); M(d,b,x); S(b,e); sel25519(a,b,r); sel25519(c,d,r); } for (i = 0; i < 16; i++) { x[i+16]=a[i]; x[i+32]=c[i]; x[i+48]=b[i]; x[i+64]=d[i]; } var x32 = x.subarray(32); var x16 = x.subarray(16); inv25519(x32,x32); M(x16,x16,x32); pack25519(q,x16); return 0; } function crypto_scalarmult_base(q, n) { return crypto_scalarmult(q, n, _9); } function crypto_box_keypair(y, x) { randombytes(x, 32); return crypto_scalarmult_base(y, x); } function crypto_box_beforenm(k, y, x) { var s = new Uint8Array(32); crypto_scalarmult(s, x, y); return crypto_core_hsalsa20(k, _0, s, sigma); } var crypto_box_afternm = crypto_secretbox; var crypto_box_open_afternm = crypto_secretbox_open; function crypto_box(c, m, d, n, y, x) { var k = new Uint8Array(32); crypto_box_beforenm(k, y, x); return crypto_box_afternm(c, m, d, n, k); } function crypto_box_open(m, c, d, n, y, x) { var k = new Uint8Array(32); crypto_box_beforenm(k, y, x); return crypto_box_open_afternm(m, c, d, n, k); } var K = [ 0x428a2f98, 0xd728ae22, 0x71374491, 0x23ef65cd, 0xb5c0fbcf, 0xec4d3b2f, 0xe9b5dba5, 0x8189dbbc, 0x3956c25b, 0xf348b538, 0x59f111f1, 0xb605d019, 0x923f82a4, 0xaf194f9b, 0xab1c5ed5, 0xda6d8118, 0xd807aa98, 0xa3030242, 0x12835b01, 0x45706fbe, 0x243185be, 0x4ee4b28c, 0x550c7dc3, 0xd5ffb4e2, 0x72be5d74, 0xf27b896f, 0x80deb1fe, 0x3b1696b1, 0x9bdc06a7, 0x25c71235, 0xc19bf174, 0xcf692694, 0xe49b69c1, 0x9ef14ad2, 0xefbe4786, 0x384f25e3, 0x0fc19dc6, 0x8b8cd5b5, 0x240ca1cc, 0x77ac9c65, 0x2de92c6f, 0x592b0275, 0x4a7484aa, 0x6ea6e483, 0x5cb0a9dc, 0xbd41fbd4, 0x76f988da, 0x831153b5, 0x983e5152, 0xee66dfab, 0xa831c66d, 0x2db43210, 0xb00327c8, 0x98fb213f, 0xbf597fc7, 0xbeef0ee4, 0xc6e00bf3, 0x3da88fc2, 0xd5a79147, 0x930aa725, 0x06ca6351, 0xe003826f, 0x14292967, 0x0a0e6e70, 0x27b70a85, 0x46d22ffc, 0x2e1b2138, 0x5c26c926, 0x4d2c6dfc, 0x5ac42aed, 0x53380d13, 0x9d95b3df, 0x650a7354, 0x8baf63de, 0x766a0abb, 0x3c77b2a8, 0x81c2c92e, 0x47edaee6, 0x92722c85, 0x1482353b, 0xa2bfe8a1, 0x4cf10364, 0xa81a664b, 0xbc423001, 0xc24b8b70, 0xd0f89791, 0xc76c51a3, 0x0654be30, 0xd192e819, 0xd6ef5218, 0xd6990624, 0x5565a910, 0xf40e3585, 0x5771202a, 0x106aa070, 0x32bbd1b8, 0x19a4c116, 0xb8d2d0c8, 0x1e376c08, 0x5141ab53, 0x2748774c, 0xdf8eeb99, 0x34b0bcb5, 0xe19b48a8, 0x391c0cb3, 0xc5c95a63, 0x4ed8aa4a, 0xe3418acb, 0x5b9cca4f, 0x7763e373, 0x682e6ff3, 0xd6b2b8a3, 0x748f82ee, 0x5defb2fc, 0x78a5636f, 0x43172f60, 0x84c87814, 0xa1f0ab72, 0x8cc70208, 0x1a6439ec, 0x90befffa, 0x23631e28, 0xa4506ceb, 0xde82bde9, 0xbef9a3f7, 0xb2c67915, 0xc67178f2, 0xe372532b, 0xca273ece, 0xea26619c, 0xd186b8c7, 0x21c0c207, 0xeada7dd6, 0xcde0eb1e, 0xf57d4f7f, 0xee6ed178, 0x06f067aa, 0x72176fba, 0x0a637dc5, 0xa2c898a6, 0x113f9804, 0xbef90dae, 0x1b710b35, 0x131c471b, 0x28db77f5, 0x23047d84, 0x32caab7b, 0x40c72493, 0x3c9ebe0a, 0x15c9bebc, 0x431d67c4, 0x9c100d4c, 0x4cc5d4be, 0xcb3e42b6, 0x597f299c, 0xfc657e2a, 0x5fcb6fab, 0x3ad6faec, 0x6c44198c, 0x4a475817 ]; function crypto_hashblocks_hl(hh, hl, m, n) { var wh = new Int32Array(16), wl = new Int32Array(16), bh0, bh1, bh2, bh3, bh4, bh5, bh6, bh7, bl0, bl1, bl2, bl3, bl4, bl5, bl6, bl7, th, tl, i, j, h, l, a, b, c, d; var ah0 = hh[0], ah1 = hh[1], ah2 = hh[2], ah3 = hh[3], ah4 = hh[4], ah5 = hh[5], ah6 = hh[6], ah7 = hh[7], al0 = hl[0], al1 = hl[1], al2 = hl[2], al3 = hl[3], al4 = hl[4], al5 = hl[5], al6 = hl[6], al7 = hl[7]; var pos = 0; while (n >= 128) { for (i = 0; i < 16; i++) { j = 8 * i + pos; wh[i] = (m[j+0] << 24) | (m[j+1] << 16) | (m[j+2] << 8) | m[j+3]; wl[i] = (m[j+4] << 24) | (m[j+5] << 16) | (m[j+6] << 8) | m[j+7]; } for (i = 0; i < 80; i++) { bh0 = ah0; bh1 = ah1; bh2 = ah2; bh3 = ah3; bh4 = ah4; bh5 = ah5; bh6 = ah6; bh7 = ah7; bl0 = al0; bl1 = al1; bl2 = al2; bl3 = al3; bl4 = al4; bl5 = al5; bl6 = al6; bl7 = al7; // add h = ah7; l = al7; a = l & 0xffff; b = l >>> 16; c = h & 0xffff; d = h >>> 16; // Sigma1 h = ((ah4 >>> 14) | (al4 << (32-14))) ^ ((ah4 >>> 18) | (al4 << (32-18))) ^ ((al4 >>> (41-32)) | (ah4 << (32-(41-32)))); l = ((al4 >>> 14) | (ah4 << (32-14))) ^ ((al4 >>> 18) | (ah4 << (32-18))) ^ ((ah4 >>> (41-32)) | (al4 << (32-(41-32)))); a += l & 0xffff; b += l >>> 16; c += h & 0xffff; d += h >>> 16; // Ch h = (ah4 & ah5) ^ (~ah4 & ah6); l = (al4 & al5) ^ (~al4 & al6); a += l & 0xffff; b += l >>> 16; c += h & 0xffff; d += h >>> 16; // K h = K[i*2]; l = K[i*2+1]; a += l & 0xffff; b += l >>> 16; c += h & 0xffff; d += h >>> 16; // w h = wh[i%16]; l = wl[i%16]; a += l & 0xffff; b += l >>> 16; c += h & 0xffff; d += h >>> 16; b += a >>> 16; c += b >>> 16; d += c >>> 16; th = c & 0xffff | d << 16; tl = a & 0xffff | b << 16; // add h = th; l = tl; a = l & 0xffff; b = l >>> 16; c = h & 0xffff; d = h >>> 16; // Sigma0 h = ((ah0 >>> 28) | (al0 << (32-28))) ^ ((al0 >>> (34-32)) | (ah0 << (32-(34-32)))) ^ ((al0 >>> (39-32)) | (ah0 << (32-(39-32)))); l = ((al0 >>> 28) | (ah0 << (32-28))) ^ ((ah0 >>> (34-32)) | (al0 << (32-(34-32)))) ^ ((ah0 >>> (39-32)) | (al0 << (32-(39-32)))); a += l & 0xffff; b += l >>> 16; c += h & 0xffff; d += h >>> 16; // Maj h = (ah0 & ah1) ^ (ah0 & ah2) ^ (ah1 & ah2); l = (al0 & al1) ^ (al0 & al2) ^ (al1 & al2); a += l & 0xffff; b += l >>> 16; c += h & 0xffff; d += h >>> 16; b += a >>> 16; c += b >>> 16; d += c >>> 16; bh7 = (c & 0xffff) | (d << 16); bl7 = (a & 0xffff) | (b << 16); // add h = bh3; l = bl3; a = l & 0xffff; b = l >>> 16; c = h & 0xffff; d = h >>> 16; h = th; l = tl; a += l & 0xffff; b += l >>> 16; c += h & 0xffff; d += h >>> 16; b += a >>> 16; c += b >>> 16; d += c >>> 16; bh3 = (c & 0xffff) | (d << 16); bl3 = (a & 0xffff) | (b << 16); ah1 = bh0; ah2 = bh1; ah3 = bh2; ah4 = bh3; ah5 = bh4; ah6 = bh5; ah7 = bh6; ah0 = bh7; al1 = bl0; al2 = bl1; al3 = bl2; al4 = bl3; al5 = bl4; al6 = bl5; al7 = bl6; al0 = bl7; if (i%16 === 15) { for (j = 0; j < 16; j++) { // add h = wh[j]; l = wl[j]; a = l & 0xffff; b = l >>> 16; c = h & 0xffff; d = h >>> 16; h = wh[(j+9)%16]; l = wl[(j+9)%16]; a += l & 0xffff; b += l >>> 16; c += h & 0xffff; d += h >>> 16; // sigma0 th = wh[(j+1)%16]; tl = wl[(j+1)%16]; h = ((th >>> 1) | (tl << (32-1))) ^ ((th >>> 8) | (tl << (32-8))) ^ (th >>> 7); l = ((tl >>> 1) | (th << (32-1))) ^ ((tl >>> 8) | (th << (32-8))) ^ ((tl >>> 7) | (th << (32-7))); a += l & 0xffff; b += l >>> 16; c += h & 0xffff; d += h >>> 16; // sigma1 th = wh[(j+14)%16]; tl = wl[(j+14)%16]; h = ((th >>> 19) | (tl << (32-19))) ^ ((tl >>> (61-32)) | (th << (32-(61-32)))) ^ (th >>> 6); l = ((tl >>> 19) | (th << (32-19))) ^ ((th >>> (61-32)) | (tl << (32-(61-32)))) ^ ((tl >>> 6) | (th << (32-6))); a += l & 0xffff; b += l >>> 16; c += h & 0xffff; d += h >>> 16; b += a >>> 16; c += b >>> 16; d += c >>> 16; wh[j] = (c & 0xffff) | (d << 16); wl[j] = (a & 0xffff) | (b << 16); } } } // add h = ah0; l = al0; a = l & 0xffff; b = l >>> 16; c = h & 0xffff; d = h >>> 16; h = hh[0]; l = hl[0]; a += l & 0xffff; b += l >>> 16; c += h & 0xffff; d += h >>> 16; b += a >>> 16; c += b >>> 16; d += c >>> 16; hh[0] = ah0 = (c & 0xffff) | (d << 16); hl[0] = al0 = (a & 0xffff) | (b << 16); h = ah1; l = al1; a = l & 0xffff; b = l >>> 16; c = h & 0xffff; d = h >>> 16; h = hh[1]; l = hl[1]; a += l & 0xffff; b += l >>> 16; c += h & 0xffff; d += h >>> 16; b += a >>> 16; c += b >>> 16; d += c >>> 16; hh[1] = ah1 = (c & 0xffff) | (d << 16); hl[1] = al1 = (a & 0xffff) | (b << 16); h = ah2; l = al2; a = l & 0xffff; b = l >>> 16; c = h & 0xffff; d = h >>> 16; h = hh[2]; l = hl[2]; a += l & 0xffff; b += l >>> 16; c += h & 0xffff; d += h >>> 16; b += a >>> 16; c += b >>> 16; d += c >>> 16; hh[2] = ah2 = (c & 0xffff) | (d << 16); hl[2] = al2 = (a & 0xffff) | (b << 16); h = ah3; l = al3; a = l & 0xffff; b = l >>> 16; c = h & 0xffff; d = h >>> 16; h = hh[3]; l = hl[3]; a += l & 0xffff; b += l >>> 16; c += h & 0xffff; d += h >>> 16; b += a >>> 16; c += b >>> 16; d += c >>> 16; hh[3] = ah3 = (c & 0xffff) | (d << 16); hl[3] = al3 = (a & 0xffff) | (b << 16); h = ah4; l = al4; a = l & 0xffff; b = l >>> 16; c = h & 0xffff; d = h >>> 16; h = hh[4]; l = hl[4]; a += l & 0xffff; b += l >>> 16; c += h & 0xffff; d += h >>> 16; b += a >>> 16; c += b >>> 16; d += c >>> 16; hh[4] = ah4 = (c & 0xffff) | (d << 16); hl[4] = al4 = (a & 0xffff) | (b << 16); h = ah5; l = al5; a = l & 0xffff; b = l >>> 16; c = h & 0xffff; d = h >>> 16; h = hh[5]; l = hl[5]; a += l & 0xffff; b += l >>> 16; c += h & 0xffff; d += h >>> 16; b += a >>> 16; c += b >>> 16; d += c >>> 16; hh[5] = ah5 = (c & 0xffff) | (d << 16); hl[5] = al5 = (a & 0xffff) | (b << 16); h = ah6; l = al6; a = l & 0xffff; b = l >>> 16; c = h & 0xffff; d = h >>> 16; h = hh[6]; l = hl[6]; a += l & 0xffff; b += l >>> 16; c += h & 0xffff; d += h >>> 16; b += a >>> 16; c += b >>> 16; d += c >>> 16; hh[6] = ah6 = (c & 0xffff) | (d << 16); hl[6] = al6 = (a & 0xffff) | (b << 16); h = ah7; l = al7; a = l & 0xffff; b = l >>> 16; c = h & 0xffff; d = h >>> 16; h = hh[7]; l = hl[7]; a += l & 0xffff; b += l >>> 16; c += h & 0xffff; d += h >>> 16; b += a >>> 16; c += b >>> 16; d += c >>> 16; hh[7] = ah7 = (c & 0xffff) | (d << 16); hl[7] = al7 = (a & 0xffff) | (b << 16); pos += 128; n -= 128; } return n; } function crypto_hash(out, m, n) { var hh = new Int32Array(8), hl = new Int32Array(8), x = new Uint8Array(256), i, b = n; hh[0] = 0x6a09e667; hh[1] = 0xbb67ae85; hh[2] = 0x3c6ef372; hh[3] = 0xa54ff53a; hh[4] = 0x510e527f; hh[5] = 0x9b05688c; hh[6] = 0x1f83d9ab; hh[7] = 0x5be0cd19; hl[0] = 0xf3bcc908; hl[1] = 0x84caa73b; hl[2] = 0xfe94f82b; hl[3] = 0x5f1d36f1; hl[4] = 0xade682d1; hl[5] = 0x2b3e6c1f; hl[6] = 0xfb41bd6b; hl[7] = 0x137e2179; crypto_hashblocks_hl(hh, hl, m, n); n %= 128; for (i = 0; i < n; i++) x[i] = m[b-n+i]; x[n] = 128; n = 256-128*(n<112?1:0); x[n-9] = 0; ts64(x, n-8, (b / 0x20000000) | 0, b << 3); crypto_hashblocks_hl(hh, hl, x, n); for (i = 0; i < 8; i++) ts64(out, 8*i, hh[i], hl[i]); return 0; } function add(p, q) { var a = gf(), b = gf(), c = gf(), d = gf(), e = gf(), f = gf(), g = gf(), h = gf(), t = gf(); Z(a, p[1], p[0]); Z(t, q[1], q[0]); M(a, a, t); A(b, p[0], p[1]); A(t, q[0], q[1]); M(b, b, t); M(c, p[3], q[3]); M(c, c, D2); M(d, p[2], q[2]); A(d, d, d); Z(e, b, a); Z(f, d, c); A(g, d, c); A(h, b, a); M(p[0], e, f); M(p[1], h, g); M(p[2], g, f); M(p[3], e, h); } function cswap(p, q, b) { var i; for (i = 0; i < 4; i++) { sel25519(p[i], q[i], b); } } function pack(r, p) { var tx = gf(), ty = gf(), zi = gf(); inv25519(zi, p[2]); M(tx, p[0], zi); M(ty, p[1], zi); pack25519(r, ty); r[31] ^= par25519(tx) << 7; } function scalarmult(p, q, s) { var b, i; set25519(p[0], gf0); set25519(p[1], gf1); set25519(p[2], gf1); set25519(p[3], gf0); for (i = 255; i >= 0; --i) { b = (s[(i/8)|0] >> (i&7)) & 1; cswap(p, q, b); add(q, p); add(p, p); cswap(p, q, b); } } function scalarbase(p, s) { var q = [gf(), gf(), gf(), gf()]; set25519(q[0], X); set25519(q[1], Y); set25519(q[2], gf1); M(q[3], X, Y); scalarmult(p, q, s); } function crypto_sign_keypair(pk, sk, seeded) { var d = new Uint8Array(64); var p = [gf(), gf(), gf(), gf()]; var i; if (!seeded) randombytes(sk, 32); crypto_hash(d, sk, 32); d[0] &= 248; d[31] &= 127; d[31] |= 64; scalarbase(p, d); pack(pk, p); for (i = 0; i < 32; i++) sk[i+32] = pk[i]; return 0; } var 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]); function modL(r, x) { var carry, i, j, k; for (i = 63; i >= 32; --i) { carry = 0; for (j = i - 32, k = i - 12; j < k; ++j) { x[j] += carry - 16 * x[i] * L[j - (i - 32)]; carry = (x[j] + 128) >> 8; x[j] -= carry * 256; } x[j] += carry; x[i] = 0; } carry = 0; for (j = 0; j < 32; j++) { x[j] += carry - (x[31] >> 4) * L[j]; carry = x[j] >> 8; x[j] &= 255; } for (j = 0; j < 32; j++) x[j] -= carry * L[j]; for (i = 0; i < 32; i++) { x[i+1] += x[i] >> 8; r[i] = x[i] & 255; } } function reduce(r) { var x = new Float64Array(64), i; for (i = 0; i < 64; i++) x[i] = r[i]; for (i = 0; i < 64; i++) r[i] = 0; modL(r, x); } // Note: difference from C - smlen returned, not passed as argument. function crypto_sign(sm, m, n, sk) { var d = new Uint8Array(64), h = new Uint8Array(64), r = new Uint8Array(64); var i, j, x = new Float64Array(64); var p = [gf(), gf(), gf(), gf()]; crypto_hash(d, sk, 32); d[0] &= 248; d[31] &= 127; d[31] |= 64; var smlen = n + 64; for (i = 0; i < n; i++) sm[64 + i] = m[i]; for (i = 0; i < 32; i++) sm[32 + i] = d[32 + i]; crypto_hash(r, sm.subarray(32), n+32); reduce(r); scalarbase(p, r); pack(sm, p); for (i = 32; i < 64; i++) sm[i] = sk[i]; crypto_hash(h, sm, n + 64); reduce(h); for (i = 0; i < 64; i++) x[i] = 0; for (i = 0; i < 32; i++) x[i] = r[i]; for (i = 0; i < 32; i++) { for (j = 0; j < 32; j++) { x[i+j] += h[i] * d[j]; } } modL(sm.subarray(32), x); return smlen; } function unpackneg(r, p) { var t = gf(), chk = gf(), num = gf(), den = gf(), den2 = gf(), den4 = gf(), den6 = gf(); set25519(r[2], gf1); unpack25519(r[1], p); S(num, r[1]); M(den, num, D); Z(num, num, r[2]); A(den, r[2], den); S(den2, den); S(den4, den2); M(den6, den4, den2); M(t, den6, num); M(t, t, den); pow2523(t, t); M(t, t, num); M(t, t, den); M(t, t, den); M(r[0], t, den); S(chk, r[0]); M(chk, chk, den); if (neq25519(chk, num)) M(r[0], r[0], I); S(chk, r[0]); M(chk, chk, den); if (neq25519(chk, num)) return -1; if (par25519(r[0]) === (p[31]>>7)) Z(r[0], gf0, r[0]); M(r[3], r[0], r[1]); return 0; } function crypto_sign_open(m, sm, n, pk) { var i, mlen; var t = new Uint8Array(32), h = new Uint8Array(64); var p = [gf(), gf(), gf(), gf()], q = [gf(), gf(), gf(), gf()]; mlen = -1; if (n < 64) return -1; if (unpackneg(q, pk)) return -1; for (i = 0; i < n; i++) m[i] = sm[i]; for (i = 0; i < 32; i++) m[i+32] = pk[i]; crypto_hash(h, m, n); reduce(h); scalarmult(p, q, h); scalarbase(q, sm.subarray(32)); add(p, q); pack(t, p); n -= 64; if (crypto_verify_32(sm, 0, t, 0)) { for (i = 0; i < n; i++) m[i] = 0; return -1; } for (i = 0; i < n; i++) m[i] = sm[i + 64]; mlen = n; return mlen; } var crypto_secretbox_KEYBYTES = 32, crypto_secretbox_NONCEBYTES = 24, crypto_secretbox_ZEROBYTES = 32, crypto_secretbox_BOXZEROBYTES = 16, crypto_scalarmult_BYTES = 32, crypto_scalarmult_SCALARBYTES = 32, crypto_box_PUBLICKEYBYTES = 32, crypto_box_SECRETKEYBYTES = 32, crypto_box_BEFORENMBYTES = 32, crypto_box_NONCEBYTES = crypto_secretbox_NONCEBYTES, crypto_box_ZEROBYTES = crypto_secretbox_ZEROBYTES, crypto_box_BOXZEROBYTES = crypto_secretbox_BOXZEROBYTES, crypto_sign_BYTES = 64, crypto_sign_PUBLICKEYBYTES = 32, crypto_sign_SECRETKEYBYTES = 64, crypto_sign_SEEDBYTES = 32, crypto_hash_BYTES = 64; nacl.lowlevel = { crypto_core_hsalsa20: crypto_core_hsalsa20, crypto_stream_xor: crypto_stream_xor, crypto_stream: crypto_stream, crypto_stream_salsa20_xor: crypto_stream_salsa20_xor, crypto_stream_salsa20: crypto_stream_salsa20, crypto_onetimeauth: crypto_onetimeauth, crypto_onetimeauth_verify: crypto_onetimeauth_verify, crypto_verify_16: crypto_verify_16, crypto_verify_32: crypto_verify_32, crypto_secretbox: crypto_secretbox, crypto_secretbox_open: crypto_secretbox_open, crypto_scalarmult: crypto_scalarmult, crypto_scalarmult_base: crypto_scalarmult_base, crypto_box_beforenm: crypto_box_beforenm, crypto_box_afternm: crypto_box_afternm, crypto_box: crypto_box, crypto_box_open: crypto_box_open, crypto_box_keypair: crypto_box_keypair, crypto_hash: crypto_hash, crypto_sign: crypto_sign, crypto_sign_keypair: crypto_sign_keypair, crypto_sign_open: crypto_sign_open, crypto_secretbox_KEYBYTES: crypto_secretbox_KEYBYTES, crypto_secretbox_NONCEBYTES: crypto_secretbox_NONCEBYTES, crypto_secretbox_ZEROBYTES: crypto_secretbox_ZEROBYTES, crypto_secretbox_BOXZEROBYTES: crypto_secretbox_BOXZEROBYTES, crypto_scalarmult_BYTES: crypto_scalarmult_BYTES, crypto_scalarmult_SCALARBYTES: crypto_scalarmult_SCALARBYTES, crypto_box_PUBLICKEYBYTES: crypto_box_PUBLICKEYBYTES, crypto_box_SECRETKEYBYTES: crypto_box_SECRETKEYBYTES, crypto_box_BEFORENMBYTES: crypto_box_BEFORENMBYTES, crypto_box_NONCEBYTES: crypto_box_NONCEBYTES, crypto_box_ZEROBYTES: crypto_box_ZEROBYTES, crypto_box_BOXZEROBYTES: crypto_box_BOXZEROBYTES, crypto_sign_BYTES: crypto_sign_BYTES, crypto_sign_PUBLICKEYBYTES: crypto_sign_PUBLICKEYBYTES, crypto_sign_SECRETKEYBYTES: crypto_sign_SECRETKEYBYTES, crypto_sign_SEEDBYTES: crypto_sign_SEEDBYTES, crypto_hash_BYTES: crypto_hash_BYTES }; /* High-level API */ function checkLengths(k, n) { if (k.length !== crypto_secretbox_KEYBYTES) throw new Error('bad key size'); if (n.length !== crypto_secretbox_NONCEBYTES) throw new Error('bad nonce size'); } function checkBoxLengths(pk, sk) { if (pk.length !== crypto_box_PUBLICKEYBYTES) throw new Error('bad public key size'); if (sk.length !== crypto_box_SECRETKEYBYTES) throw new Error('bad secret key size'); } function checkArrayTypes() { var t, i; for (i = 0; i < arguments.length; i++) { if ((t = Object.prototype.toString.call(arguments[i])) !== '[object Uint8Array]') throw new TypeError('unexpected type ' + t + ', use Uint8Array'); } } function cleanup(arr) { for (var i = 0; i < arr.length; i++) arr[i] = 0; } // TODO: Completely remove this in v0.15. if (!nacl.util) { nacl.util = {}; nacl.util.decodeUTF8 = nacl.util.encodeUTF8 = nacl.util.encodeBase64 = nacl.util.decodeBase64 = function() { throw new Error('nacl.util moved into separate package: https://github.com/dchest/tweetnacl-util-js'); }; } nacl.randomBytes = function(n) { var b = new Uint8Array(n); randombytes(b, n); return b; }; nacl.secretbox = function(msg, nonce, key) { checkArrayTypes(msg, nonce, key); checkLengths(key, nonce); var m = new Uint8Array(crypto_secretbox_ZEROBYTES + msg.length); var c = new Uint8Array(m.length); for (var i = 0; i < msg.length; i++) m[i+crypto_secretbox_ZEROBYTES] = msg[i]; crypto_secretbox(c, m, m.length, nonce, key); return c.subarray(crypto_secretbox_BOXZEROBYTES); }; nacl.secretbox.open = function(box, nonce, key) { checkArrayTypes(box, nonce, key); checkLengths(key, nonce); var c = new Uint8Array(crypto_secretbox_BOXZEROBYTES + box.length); var m = new Uint8Array(c.length); for (var i = 0; i < box.length; i++) c[i+crypto_secretbox_BOXZEROBYTES] = box[i]; if (c.length < 32) return false; if (crypto_secretbox_open(m, c, c.length, nonce, key) !== 0) return false; return m.subarray(crypto_secretbox_ZEROBYTES); }; nacl.secretbox.keyLength = crypto_secretbox_KEYBYTES; nacl.secretbox.nonceLength = crypto_secretbox_NONCEBYTES; nacl.secretbox.overheadLength = crypto_secretbox_BOXZEROBYTES; nacl.scalarMult = function(n, p) { checkArrayTypes(n, p); if (n.length !== crypto_scalarmult_SCALARBYTES) throw new Error('bad n size'); if (p.length !== crypto_scalarmult_BYTES) throw new Error('bad p size'); var q = new Uint8Array(crypto_scalarmult_BYTES); crypto_scalarmult(q, n, p); return q; }; nacl.scalarMult.base = function(n) { checkArrayTypes(n); if (n.length !== crypto_scalarmult_SCALARBYTES) throw new Error('bad n size'); var q = new Uint8Array(crypto_scalarmult_BYTES); crypto_scalarmult_base(q, n); return q; }; nacl.scalarMult.scalarLength = crypto_scalarmult_SCALARBYTES; nacl.scalarMult.groupElementLength = crypto_scalarmult_BYTES; nacl.box = function(msg, nonce, publicKey, secretKey) { var k = nacl.box.before(publicKey, secretKey); return nacl.secretbox(msg, nonce, k); }; nacl.box.before = function(publicKey, secretKey) { checkArrayTypes(publicKey, secretKey); checkBoxLengths(publicKey, secretKey); var k = new Uint8Array(crypto_box_BEFORENMBYTES); crypto_box_beforenm(k, publicKey, secretKey); return k; }; nacl.box.after = nacl.secretbox; nacl.box.open = function(msg, nonce, publicKey, secretKey) { var k = nacl.box.before(publicKey, secretKey); return nacl.secretbox.open(msg, nonce, k); }; nacl.box.open.after = nacl.secretbox.open; nacl.box.keyPair = function() { var pk = new Uint8Array(crypto_box_PUBLICKEYBYTES); var sk = new Uint8Array(crypto_box_SECRETKEYBYTES); crypto_box_keypair(pk, sk); return {publicKey: pk, secretKey: sk}; }; nacl.box.keyPair.fromSecretKey = function(secretKey) { checkArrayTypes(secretKey); if (secretKey.length !== crypto_box_SECRETKEYBYTES) throw new Error('bad secret key size'); var pk = new Uint8Array(crypto_box_PUBLICKEYBYTES); crypto_scalarmult_base(pk, secretKey); return {publicKey: pk, secretKey: new Uint8Array(secretKey)}; }; nacl.box.publicKeyLength = crypto_box_PUBLICKEYBYTES; nacl.box.secretKeyLength = crypto_box_SECRETKEYBYTES; nacl.box.sharedKeyLength = crypto_box_BEFORENMBYTES; nacl.box.nonceLength = crypto_box_NONCEBYTES; nacl.box.overheadLength = nacl.secretbox.overheadLength; nacl.sign = function(msg, secretKey) { checkArrayTypes(msg, secretKey); if (secretKey.length !== crypto_sign_SECRETKEYBYTES) throw new Error('bad secret key size'); var signedMsg = new Uint8Array(crypto_sign_BYTES+msg.length); crypto_sign(signedMsg, msg, msg.length, secretKey); return signedMsg; }; nacl.sign.open = function(signedMsg, publicKey) { if (arguments.length !== 2) throw new Error('nacl.sign.open accepts 2 arguments; did you mean to use nacl.sign.detached.verify?'); checkArrayTypes(signedMsg, publicKey); if (publicKey.length !== crypto_sign_PUBLICKEYBYTES) throw new Error('bad public key size'); var tmp = new Uint8Array(signedMsg.length); var mlen = crypto_sign_open(tmp, signedMsg, signedMsg.length, publicKey); if (mlen < 0) return null; var m = new Uint8Array(mlen); for (var i = 0; i < m.length; i++) m[i] = tmp[i]; return m; }; nacl.sign.detached = function(msg, secretKey) { var signedMsg = nacl.sign(msg, secretKey); var sig = new Uint8Array(crypto_sign_BYTES); for (var i = 0; i < sig.length; i++) sig[i] = signedMsg[i]; return sig; }; nacl.sign.detached.verify = function(msg, sig, publicKey) { checkArrayTypes(msg, sig, publicKey); if (sig.length !== crypto_sign_BYTES) throw new Error('bad signature size'); if (publicKey.length !== crypto_sign_PUBLICKEYBYTES) throw new Error('bad public key size'); var sm = new Uint8Array(crypto_sign_BYTES + msg.length); var m = new Uint8Array(crypto_sign_BYTES + msg.length); var i; for (i = 0; i < crypto_sign_BYTES; i++) sm[i] = sig[i]; for (i = 0; i < msg.length; i++) sm[i+crypto_sign_BYTES] = msg[i]; return (crypto_sign_open(m, sm, sm.length, publicKey) >= 0); }; nacl.sign.keyPair = function() { var pk = new Uint8Array(crypto_sign_PUBLICKEYBYTES); var sk = new Uint8Array(crypto_sign_SECRETKEYBYTES); crypto_sign_keypair(pk, sk); return {publicKey: pk, secretKey: sk}; }; nacl.sign.keyPair.fromSecretKey = function(secretKey) { checkArrayTypes(secretKey); if (secretKey.length !== crypto_sign_SECRETKEYBYTES) throw new Error('bad secret key size'); var pk = new Uint8Array(crypto_sign_PUBLICKEYBYTES); for (var i = 0; i < pk.length; i++) pk[i] = secretKey[32+i]; return {publicKey: pk, secretKey: new Uint8Array(secretKey)}; }; nacl.sign.keyPair.fromSeed = function(seed) { checkArrayTypes(seed); if (seed.length !== crypto_sign_SEEDBYTES) throw new Error('bad seed size'); var pk = new Uint8Array(crypto_sign_PUBLICKEYBYTES); var sk = new Uint8Array(crypto_sign_SECRETKEYBYTES); for (var i = 0; i < 32; i++) sk[i] = seed[i]; crypto_sign_keypair(pk, sk, true); return {publicKey: pk, secretKey: sk}; }; nacl.sign.publicKeyLength = crypto_sign_PUBLICKEYBYTES; nacl.sign.secretKeyLength = crypto_sign_SECRETKEYBYTES; nacl.sign.seedLength = crypto_sign_SEEDBYTES; nacl.sign.signatureLength = crypto_sign_BYTES; nacl.hash = function(msg) { checkArrayTypes(msg); var h = new Uint8Array(crypto_hash_BYTES); crypto_hash(h, msg, msg.length); return h; }; nacl.hash.hashLength = crypto_hash_BYTES; nacl.verify = function(x, y) { checkArrayTypes(x, y); // Zero length arguments are considered not equal. if (x.length === 0 || y.length === 0) return false; if (x.length !== y.length) return false; return (vn(x, 0, y, 0, x.length) === 0) ? true : false; }; nacl.setPRNG = function(fn) { randombytes = fn; }; (function() { // Initialize PRNG if environment provides CSPRNG. // If not, methods calling randombytes will throw. var crypto = typeof self !== 'undefined' ? (self.crypto || self.msCrypto) : null; if (crypto && crypto.getRandomValues) { // Browsers. var QUOTA = 65536; nacl.setPRNG(function(x, n) { var i, v = new Uint8Array(n); for (i = 0; i < n; i += QUOTA) { crypto.getRandomValues(v.subarray(i, i + Math.min(n - i, QUOTA))); } for (i = 0; i < n; i++) x[i] = v[i]; cleanup(v); }); } else if (true) { // Node.js. crypto = __webpack_require__(33373); if (crypto && crypto.randomBytes) { nacl.setPRNG(function(x, n) { var i, v = crypto.randomBytes(n); for (i = 0; i < n; i++) x[i] = v[i]; cleanup(v); }); } } })(); })( true && module.exports ? module.exports : (self.nacl = self.nacl || {})); /***/ }), /***/ 70020: /***/ (function(__unused_webpack_module, exports) { /** @license URI.js v4.4.1 (c) 2011 Gary Court. License: http://github.com/garycourt/uri-js */ (function (global, factory) { true ? factory(exports) : 0; }(this, (function (exports) { 'use strict'; function merge() { for (var _len = arguments.length, sets = Array(_len), _key = 0; _key < _len; _key++) { sets[_key] = arguments[_key]; } if (sets.length > 1) { sets[0] = sets[0].slice(0, -1); var xl = sets.length - 1; for (var x = 1; x < xl; ++x) { sets[x] = sets[x].slice(1, -1); } sets[xl] = sets[xl].slice(1); return sets.join(''); } else { return sets[0]; } } function subexp(str) { return "(?:" + str + ")"; } function typeOf(o) { return o === undefined ? "undefined" : o === null ? "null" : Object.prototype.toString.call(o).split(" ").pop().split("]").shift().toLowerCase(); } function toUpperCase(str) { return str.toUpperCase(); } function toArray(obj) { 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) : []; } function assign(target, source) { var obj = target; if (source) { for (var key in source) { obj[key] = source[key]; } } return obj; } function buildExps(isIRI) { var ALPHA$$ = "[A-Za-z]", CR$ = "[\\x0D]", DIGIT$$ = "[0-9]", DQUOTE$$ = "[\\x22]", HEXDIG$$ = merge(DIGIT$$, "[A-Fa-f]"), //case-insensitive LF$$ = "[\\x0A]", SP$$ = "[\\x20]", PCT_ENCODED$ = subexp(subexp("%[EFef]" + HEXDIG$$ + "%" + HEXDIG$$ + HEXDIG$$ + "%" + HEXDIG$$ + HEXDIG$$) + "|" + subexp("%[89A-Fa-f]" + HEXDIG$$ + "%" + HEXDIG$$ + HEXDIG$$) + "|" + subexp("%" + HEXDIG$$ + HEXDIG$$)), //expanded GEN_DELIMS$$ = "[\\:\\/\\?\\#\\[\\]\\@]", SUB_DELIMS$$ = "[\\!\\$\\&\\'\\(\\)\\*\\+\\,\\;\\=]", RESERVED$$ = merge(GEN_DELIMS$$, SUB_DELIMS$$), UCSCHAR$$ = isIRI ? "[\\xA0-\\u200D\\u2010-\\u2029\\u202F-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF]" : "[]", //subset, excludes bidi control characters IPRIVATE$$ = isIRI ? "[\\uE000-\\uF8FF]" : "[]", //subset UNRESERVED$$ = merge(ALPHA$$, DIGIT$$, "[\\-\\.\\_\\~]", UCSCHAR$$), SCHEME$ = subexp(ALPHA$$ + merge(ALPHA$$, DIGIT$$, "[\\+\\-\\.]") + "*"), USERINFO$ = subexp(subexp(PCT_ENCODED$ + "|" + merge(UNRESERVED$$, SUB_DELIMS$$, "[\\:]")) + "*"), DEC_OCTET$ = subexp(subexp("25[0-5]") + "|" + subexp("2[0-4]" + DIGIT$$) + "|" + subexp("1" + DIGIT$$ + DIGIT$$) + "|" + subexp("[1-9]" + DIGIT$$) + "|" + DIGIT$$), 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$$), //relaxed parsing rules IPV4ADDRESS$ = subexp(DEC_OCTET_RELAXED$ + "\\." + DEC_OCTET_RELAXED$ + "\\." + DEC_OCTET_RELAXED$ + "\\." + DEC_OCTET_RELAXED$), H16$ = subexp(HEXDIG$$ + "{1,4}"), LS32$ = subexp(subexp(H16$ + "\\:" + H16$) + "|" + IPV4ADDRESS$), IPV6ADDRESS1$ = subexp(subexp(H16$ + "\\:") + "{6}" + LS32$), // 6( h16 ":" ) ls32 IPV6ADDRESS2$ = subexp("\\:\\:" + subexp(H16$ + "\\:") + "{5}" + LS32$), // "::" 5( h16 ":" ) ls32 IPV6ADDRESS3$ = subexp(subexp(H16$) + "?\\:\\:" + subexp(H16$ + "\\:") + "{4}" + LS32$), //[ h16 ] "::" 4( h16 ":" ) ls32 IPV6ADDRESS4$ = subexp(subexp(subexp(H16$ + "\\:") + "{0,1}" + H16$) + "?\\:\\:" + subexp(H16$ + "\\:") + "{3}" + LS32$), //[ *1( h16 ":" ) h16 ] "::" 3( h16 ":" ) ls32 IPV6ADDRESS5$ = subexp(subexp(subexp(H16$ + "\\:") + "{0,2}" + H16$) + "?\\:\\:" + subexp(H16$ + "\\:") + "{2}" + LS32$), //[ *2( h16 ":" ) h16 ] "::" 2( h16 ":" ) ls32 IPV6ADDRESS6$ = subexp(subexp(subexp(H16$ + "\\:") + "{0,3}" + H16$) + "?\\:\\:" + H16$ + "\\:" + LS32$), //[ *3( h16 ":" ) h16 ] "::" h16 ":" ls32 IPV6ADDRESS7$ = subexp(subexp(subexp(H16$ + "\\:") + "{0,4}" + H16$) + "?\\:\\:" + LS32$), //[ *4( h16 ":" ) h16 ] "::" ls32 IPV6ADDRESS8$ = subexp(subexp(subexp(H16$ + "\\:") + "{0,5}" + H16$) + "?\\:\\:" + H16$), //[ *5( h16 ":" ) h16 ] "::" h16 IPV6ADDRESS9$ = subexp(subexp(subexp(H16$ + "\\:") + "{0,6}" + H16$) + "?\\:\\:"), //[ *6( h16 ":" ) h16 ] "::" IPV6ADDRESS$ = subexp([IPV6ADDRESS1$, IPV6ADDRESS2$, IPV6ADDRESS3$, IPV6ADDRESS4$, IPV6ADDRESS5$, IPV6ADDRESS6$, IPV6ADDRESS7$, IPV6ADDRESS8$, IPV6ADDRESS9$].join("|")), ZONEID$ = subexp(subexp(UNRESERVED$$ + "|" + PCT_ENCODED$) + "+"), //RFC 6874 IPV6ADDRZ$ = subexp(IPV6ADDRESS$ + "\\%25" + ZONEID$), //RFC 6874 IPV6ADDRZ_RELAXED$ = subexp(IPV6ADDRESS$ + subexp("\\%25|\\%(?!" + HEXDIG$$ + "{2})") + ZONEID$), //RFC 6874, with relaxed parsing rules IPVFUTURE$ = subexp("[vV]" + HEXDIG$$ + "+\\." + merge(UNRESERVED$$, SUB_DELIMS$$, "[\\:]") + "+"), IP_LITERAL$ = subexp("\\[" + subexp(IPV6ADDRZ_RELAXED$ + "|" + IPV6ADDRESS$ + "|" + IPVFUTURE$) + "\\]"), //RFC 6874 REG_NAME$ = subexp(subexp(PCT_ENCODED$ + "|" + merge(UNRESERVED$$, SUB_DELIMS$$)) + "*"), HOST$ = subexp(IP_LITERAL$ + "|" + IPV4ADDRESS$ + "(?!" + REG_NAME$ + ")" + "|" + REG_NAME$), PORT$ = subexp(DIGIT$$ + "*"), AUTHORITY$ = subexp(subexp(USERINFO$ + "@") + "?" + HOST$ + subexp("\\:" + PORT$) + "?"), PCHAR$ = subexp(PCT_ENCODED$ + "|" + merge(UNRESERVED$$, SUB_DELIMS$$, "[\\:\\@]")), SEGMENT$ = subexp(PCHAR$ + "*"), SEGMENT_NZ$ = subexp(PCHAR$ + "+"), SEGMENT_NZ_NC$ = subexp(subexp(PCT_ENCODED$ + "|" + merge(UNRESERVED$$, SUB_DELIMS$$, "[\\@]")) + "+"), PATH_ABEMPTY$ = subexp(subexp("\\/" + SEGMENT$) + "*"), PATH_ABSOLUTE$ = subexp("\\/" + subexp(SEGMENT_NZ$ + PATH_ABEMPTY$) + "?"), //simplified PATH_NOSCHEME$ = subexp(SEGMENT_NZ_NC$ + PATH_ABEMPTY$), //simplified PATH_ROOTLESS$ = subexp(SEGMENT_NZ$ + PATH_ABEMPTY$), //simplified PATH_EMPTY$ = "(?!" + PCHAR$ + ")", PATH$ = subexp(PATH_ABEMPTY$ + "|" + PATH_ABSOLUTE$ + "|" + PATH_NOSCHEME$ + "|" + PATH_ROOTLESS$ + "|" + PATH_EMPTY$), QUERY$ = subexp(subexp(PCHAR$ + "|" + merge("[\\/\\?]", IPRIVATE$$)) + "*"), FRAGMENT$ = subexp(subexp(PCHAR$ + "|[\\/\\?]") + "*"), HIER_PART$ = subexp(subexp("\\/\\/" + AUTHORITY$ + PATH_ABEMPTY$) + "|" + PATH_ABSOLUTE$ + "|" + PATH_ROOTLESS$ + "|" + PATH_EMPTY$), URI$ = subexp(SCHEME$ + "\\:" + HIER_PART$ + subexp("\\?" + QUERY$) + "?" + subexp("\\#" + FRAGMENT$) + "?"), RELATIVE_PART$ = subexp(subexp("\\/\\/" + AUTHORITY$ + PATH_ABEMPTY$) + "|" + PATH_ABSOLUTE$ + "|" + PATH_NOSCHEME$ + "|" + PATH_EMPTY$), RELATIVE$ = subexp(RELATIVE_PART$ + subexp("\\?" + QUERY$) + "?" + subexp("\\#" + FRAGMENT$) + "?"), URI_REFERENCE$ = subexp(URI$ + "|" + RELATIVE$), ABSOLUTE_URI$ = subexp(SCHEME$ + "\\:" + HIER_PART$ + subexp("\\?" + QUERY$) + "?"), GENERIC_REF$ = "^(" + SCHEME$ + ")\\:" + subexp(subexp("\\/\\/(" + subexp("(" + USERINFO$ + ")@") + "?(" + HOST$ + ")" + subexp("\\:(" + PORT$ + ")") + "?)") + "?(" + PATH_ABEMPTY$ + "|" + PATH_ABSOLUTE$ + "|" + PATH_ROOTLESS$ + "|" + PATH_EMPTY$ + ")") + subexp("\\?(" + QUERY$ + ")") + "?" + subexp("\\#(" + FRAGMENT$ + ")") + "?$", RELATIVE_REF$ = "^(){0}" + subexp(subexp("\\/\\/(" + subexp("(" + USERINFO$ + ")@") + "?(" + HOST$ + ")" + subexp("\\:(" + PORT$ + ")") + "?)") + "?(" + PATH_ABEMPTY$ + "|" + PATH_ABSOLUTE$ + "|" + PATH_NOSCHEME$ + "|" + PATH_EMPTY$ + ")") + subexp("\\?(" + QUERY$ + ")") + "?" + subexp("\\#(" + FRAGMENT$ + ")") + "?$", ABSOLUTE_REF$ = "^(" + SCHEME$ + ")\\:" + subexp(subexp("\\/\\/(" + subexp("(" + USERINFO$ + ")@") + "?(" + HOST$ + ")" + subexp("\\:(" + PORT$ + ")") + "?)") + "?(" + PATH_ABEMPTY$ + "|" + PATH_ABSOLUTE$ + "|" + PATH_ROOTLESS$ + "|" + PATH_EMPTY$ + ")") + subexp("\\?(" + QUERY$ + ")") + "?$", SAMEDOC_REF$ = "^" + subexp("\\#(" + FRAGMENT$ + ")") + "?$", AUTHORITY_REF$ = "^" + subexp("(" + USERINFO$ + ")@") + "?(" + HOST$ + ")" + subexp("\\:(" + PORT$ + ")") + "?$"; return { NOT_SCHEME: new RegExp(merge("[^]", ALPHA$$, DIGIT$$, "[\\+\\-\\.]"), "g"), NOT_USERINFO: new RegExp(merge("[^\\%\\:]", UNRESERVED$$, SUB_DELIMS$$), "g"), NOT_HOST: new RegExp(merge("[^\\%\\[\\]\\:]", UNRESERVED$$, SUB_DELIMS$$), "g"), NOT_PATH: new RegExp(merge("[^\\%\\/\\:\\@]", UNRESERVED$$, SUB_DELIMS$$), "g"), NOT_PATH_NOSCHEME: new RegExp(merge("[^\\%\\/\\@]", UNRESERVED$$, SUB_DELIMS$$), "g"), NOT_QUERY: new RegExp(merge("[^\\%]", UNRESERVED$$, SUB_DELIMS$$, "[\\:\\@\\/\\?]", IPRIVATE$$), "g"), NOT_FRAGMENT: new RegExp(merge("[^\\%]", UNRESERVED$$, SUB_DELIMS$$, "[\\:\\@\\/\\?]"), "g"), ESCAPE: new RegExp(merge("[^]", UNRESERVED$$, SUB_DELIMS$$), "g"), UNRESERVED: new RegExp(UNRESERVED$$, "g"), OTHER_CHARS: new RegExp(merge("[^\\%]", UNRESERVED$$, RESERVED$$), "g"), PCT_ENCODED: new RegExp(PCT_ENCODED$, "g"), IPV4ADDRESS: new RegExp("^(" + IPV4ADDRESS$ + ")$"), IPV6ADDRESS: new RegExp("^\\[?(" + IPV6ADDRESS$ + ")" + subexp(subexp("\\%25|\\%(?!" + HEXDIG$$ + "{2})") + "(" + ZONEID$ + ")") + "?\\]?$") //RFC 6874, with relaxed parsing rules }; } var URI_PROTOCOL = buildExps(false); var IRI_PROTOCOL = buildExps(true); var slicedToArray = function () { function sliceIterator(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"]) _i["return"](); } finally { if (_d) throw _e; } } return _arr; } return function (arr, i) { if (Array.isArray(arr)) { return arr; } else if (Symbol.iterator in Object(arr)) { return sliceIterator(arr, i); } else { throw new TypeError("Invalid attempt to destructure non-iterable instance"); } }; }(); var toConsumableArray = function (arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++) arr2[i] = arr[i]; return arr2; } else { return Array.from(arr); } }; /** Highest positive signed 32-bit float value */ var maxInt = 2147483647; // aka. 0x7FFFFFFF or 2^31-1 /** Bootstring parameters */ var base = 36; var tMin = 1; var tMax = 26; var skew = 38; var damp = 700; var initialBias = 72; var initialN = 128; // 0x80 var delimiter = '-'; // '\x2D' /** Regular expressions */ var regexPunycode = /^xn--/; var regexNonASCII = /[^\0-\x7E]/; // non-ASCII chars var regexSeparators = /[\x2E\u3002\uFF0E\uFF61]/g; // RFC 3490 separators /** Error messages */ var errors = { 'overflow': 'Overflow: input needs wider integers to process', 'not-basic': 'Illegal input >= 0x80 (not a basic code point)', 'invalid-input': 'Invalid input' }; /** Convenience shortcuts */ var baseMinusTMin = base - tMin; var floor = Math.floor; var stringFromCharCode = String.fromCharCode; /*--------------------------------------------------------------------------*/ /** * A generic error utility function. * @private * @param {String} type The error type. * @returns {Error} Throws a `RangeError` with the applicable error message. */ function error$1(type) { throw new RangeError(errors[type]); } /** * A generic `Array#map` utility function. * @private * @param {Array} array The array to iterate over. * @param {Function} callback The function that gets called for every array * item. * @returns {Array} A new array of values returned by the callback function. */ function map(array, fn) { var result = []; var length = array.length; while (length--) { result[length] = fn(array[length]); } return result; } /** * A simple `Array#map`-like wrapper to work with domain name strings or email * addresses. * @private * @param {String} domain The domain name or email address. * @param {Function} callback The function that gets called for every * character. * @returns {Array} A new string of characters returned by the callback * function. */ function mapDomain(string, fn) { var parts = string.split('@'); var result = ''; if (parts.length > 1) { // In email addresses, only the domain name should be punycoded. Leave // the local part (i.e. everything up to `@`) intact. result = parts[0] + '@'; string = parts[1]; } // Avoid `split(regex)` for IE8 compatibility. See #17. string = string.replace(regexSeparators, '\x2E'); var labels = string.split('.'); var encoded = map(labels, fn).join('.'); return result + encoded; } /** * Creates an array containing the numeric code points of each Unicode * character in the string. While JavaScript uses UCS-2 internally, * this function will convert a pair of surrogate halves (each of which * UCS-2 exposes as separate characters) into a single code point, * matching UTF-16. * @see `punycode.ucs2.encode` * @see * @memberOf punycode.ucs2 * @name decode * @param {String} string The Unicode input string (UCS-2). * @returns {Array} The new array of code points. */ function ucs2decode(string) { var output = []; var counter = 0; var length = string.length; while (counter < length) { var value = string.charCodeAt(counter++); if (value >= 0xD800 && value <= 0xDBFF && counter < length) { // It's a high surrogate, and there is a next character. var extra = string.charCodeAt(counter++); if ((extra & 0xFC00) == 0xDC00) { // Low surrogate. output.push(((value & 0x3FF) << 10) + (extra & 0x3FF) + 0x10000); } else { // It's an unmatched surrogate; only append this code unit, in case the // next code unit is the high surrogate of a surrogate pair. output.push(value); counter--; } } else { output.push(value); } } return output; } /** * Creates a string based on an array of numeric code points. * @see `punycode.ucs2.decode` * @memberOf punycode.ucs2 * @name encode * @param {Array} codePoints The array of numeric code points. * @returns {String} The new Unicode string (UCS-2). */ var ucs2encode = function ucs2encode(array) { return String.fromCodePoint.apply(String, toConsumableArray(array)); }; /** * Converts a basic code point into a digit/integer. * @see `digitToBasic()` * @private * @param {Number} codePoint The basic numeric code point value. * @returns {Number} The numeric value of a basic code point (for use in * representing integers) in the range `0` to `base - 1`, or `base` if * the code point does not represent a value. */ var basicToDigit = function basicToDigit(codePoint) { if (codePoint - 0x30 < 0x0A) { return codePoint - 0x16; } if (codePoint - 0x41 < 0x1A) { return codePoint - 0x41; } if (codePoint - 0x61 < 0x1A) { return codePoint - 0x61; } return base; }; /** * Converts a digit/integer into a basic code point. * @see `basicToDigit()` * @private * @param {Number} digit The numeric value of a basic code point. * @returns {Number} The basic code point whose value (when used for * representing integers) is `digit`, which needs to be in the range * `0` to `base - 1`. If `flag` is non-zero, the uppercase form is * used; else, the lowercase form is used. The behavior is undefined * if `flag` is non-zero and `digit` has no uppercase form. */ var digitToBasic = function digitToBasic(digit, flag) { // 0..25 map to ASCII a..z or A..Z // 26..35 map to ASCII 0..9 return digit + 22 + 75 * (digit < 26) - ((flag != 0) << 5); }; /** * Bias adaptation function as per section 3.4 of RFC 3492. * https://tools.ietf.org/html/rfc3492#section-3.4 * @private */ var adapt = function adapt(delta, numPoints, firstTime) { var k = 0; delta = firstTime ? floor(delta / damp) : delta >> 1; delta += floor(delta / numPoints); for (; /* no initialization */delta > baseMinusTMin * tMax >> 1; k += base) { delta = floor(delta / baseMinusTMin); } return floor(k + (baseMinusTMin + 1) * delta / (delta + skew)); }; /** * Converts a Punycode string of ASCII-only symbols to a string of Unicode * symbols. * @memberOf punycode * @param {String} input The Punycode string of ASCII-only symbols. * @returns {String} The resulting string of Unicode symbols. */ var decode = function decode(input) { // Don't use UCS-2. var output = []; var inputLength = input.length; var i = 0; var n = initialN; var bias = initialBias; // Handle the basic code points: let `basic` be the number of input code // points before the last delimiter, or `0` if there is none, then copy // the first basic code points to the output. var basic = input.lastIndexOf(delimiter); if (basic < 0) { basic = 0; } for (var j = 0; j < basic; ++j) { // if it's not a basic code point if (input.charCodeAt(j) >= 0x80) { error$1('not-basic'); } output.push(input.charCodeAt(j)); } // Main decoding loop: start just after the last delimiter if any basic code // points were copied; start at the beginning otherwise. for (var index = basic > 0 ? basic + 1 : 0; index < inputLength;) /* no final expression */{ // `index` is the index of the next character to be consumed. // Decode a generalized variable-length integer into `delta`, // which gets added to `i`. The overflow checking is easier // if we increase `i` as we go, then subtract off its starting // value at the end to obtain `delta`. var oldi = i; for (var w = 1, k = base;; /* no condition */k += base) { if (index >= inputLength) { error$1('invalid-input'); } var digit = basicToDigit(input.charCodeAt(index++)); if (digit >= base || digit > floor((maxInt - i) / w)) { error$1('overflow'); } i += digit * w; var t = k <= bias ? tMin : k >= bias + tMax ? tMax : k - bias; if (digit < t) { break; } var baseMinusT = base - t; if (w > floor(maxInt / baseMinusT)) { error$1('overflow'); } w *= baseMinusT; } var out = output.length + 1; bias = adapt(i - oldi, out, oldi == 0); // `i` was supposed to wrap around from `out` to `0`, // incrementing `n` each time, so we'll fix that now: if (floor(i / out) > maxInt - n) { error$1('overflow'); } n += floor(i / out); i %= out; // Insert `n` at position `i` of the output. output.splice(i++, 0, n); } return String.fromCodePoint.apply(String, output); }; /** * Converts a string of Unicode symbols (e.g. a domain name label) to a * Punycode string of ASCII-only symbols. * @memberOf punycode * @param {String} input The string of Unicode symbols. * @returns {String} The resulting Punycode string of ASCII-only symbols. */ var encode = function encode(input) { var output = []; // Convert the input in UCS-2 to an array of Unicode code points. input = ucs2decode(input); // Cache the length. var inputLength = input.length; // Initialize the state. var n = initialN; var delta = 0; var bias = initialBias; // Handle the basic code points. var _iteratorNormalCompletion = true; var _didIteratorError = false; var _iteratorError = undefined; try { for (var _iterator = input[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) { var _currentValue2 = _step.value; if (_currentValue2 < 0x80) { output.push(stringFromCharCode(_currentValue2)); } } } catch (err) { _didIteratorError = true; _iteratorError = err; } finally { try { if (!_iteratorNormalCompletion && _iterator.return) { _iterator.return(); } } finally { if (_didIteratorError) { throw _iteratorError; } } } var basicLength = output.length; var handledCPCount = basicLength; // `handledCPCount` is the number of code points that have been handled; // `basicLength` is the number of basic code points. // Finish the basic string with a delimiter unless it's empty. if (basicLength) { output.push(delimiter); } // Main encoding loop: while (handledCPCount < inputLength) { // All non-basic code points < n have been handled already. Find the next // larger one: var m = maxInt; var _iteratorNormalCompletion2 = true; var _didIteratorError2 = false; var _iteratorError2 = undefined; try { for (var _iterator2 = input[Symbol.iterator](), _step2; !(_iteratorNormalCompletion2 = (_step2 = _iterator2.next()).done); _iteratorNormalCompletion2 = true) { var currentValue = _step2.value; if (currentValue >= n && currentValue < m) { m = currentValue; } } // Increase `delta` enough to advance the decoder's state to , // but guard against overflow. } catch (err) { _didIteratorError2 = true; _iteratorError2 = err; } finally { try { if (!_iteratorNormalCompletion2 && _iterator2.return) { _iterator2.return(); } } finally { if (_didIteratorError2) { throw _iteratorError2; } } } var handledCPCountPlusOne = handledCPCount + 1; if (m - n > floor((maxInt - delta) / handledCPCountPlusOne)) { error$1('overflow'); } delta += (m - n) * handledCPCountPlusOne; n = m; var _iteratorNormalCompletion3 = true; var _didIteratorError3 = false; var _iteratorError3 = undefined; try { for (var _iterator3 = input[Symbol.iterator](), _step3; !(_iteratorNormalCompletion3 = (_step3 = _iterator3.next()).done); _iteratorNormalCompletion3 = true) { var _currentValue = _step3.value; if (_currentValue < n && ++delta > maxInt) { error$1('overflow'); } if (_currentValue == n) { // Represent delta as a generalized variable-length integer. var q = delta; for (var k = base;; /* no condition */k += base) { var t = k <= bias ? tMin : k >= bias + tMax ? tMax : k - bias; if (q < t) { break; } var qMinusT = q - t; var baseMinusT = base - t; output.push(stringFromCharCode(digitToBasic(t + qMinusT % baseMinusT, 0))); q = floor(qMinusT / baseMinusT); } output.push(stringFromCharCode(digitToBasic(q, 0))); bias = adapt(delta, handledCPCountPlusOne, handledCPCount == basicLength); delta = 0; ++handledCPCount; } } } catch (err) { _didIteratorError3 = true; _iteratorError3 = err; } finally { try { if (!_iteratorNormalCompletion3 && _iterator3.return) { _iterator3.return(); } } finally { if (_didIteratorError3) { throw _iteratorError3; } } } ++delta; ++n; } return output.join(''); }; /** * Converts a Punycode string representing a domain name or an email address * to Unicode. Only the Punycoded parts of the input will be converted, i.e. * it doesn't matter if you call it on a string that has already been * converted to Unicode. * @memberOf punycode * @param {String} input The Punycoded domain name or email address to * convert to Unicode. * @returns {String} The Unicode representation of the given Punycode * string. */ var toUnicode = function toUnicode(input) { return mapDomain(input, function (string) { return regexPunycode.test(string) ? decode(string.slice(4).toLowerCase()) : string; }); }; /** * Converts a Unicode string representing a domain name or an email address to * Punycode. Only the non-ASCII parts of the domain name will be converted, * i.e. it doesn't matter if you call it with a domain that's already in * ASCII. * @memberOf punycode * @param {String} input The domain name or email address to convert, as a * Unicode string. * @returns {String} The Punycode representation of the given domain name or * email address. */ var toASCII = function toASCII(input) { return mapDomain(input, function (string) { return regexNonASCII.test(string) ? 'xn--' + encode(string) : string; }); }; /*--------------------------------------------------------------------------*/ /** Define the public API */ var punycode = { /** * A string representing the current Punycode.js version number. * @memberOf punycode * @type String */ 'version': '2.1.0', /** * An object of methods to convert from JavaScript's internal character * representation (UCS-2) to Unicode code points, and back. * @see * @memberOf punycode * @type Object */ 'ucs2': { 'decode': ucs2decode, 'encode': ucs2encode }, 'decode': decode, 'encode': encode, 'toASCII': toASCII, 'toUnicode': toUnicode }; /** * URI.js * * @fileoverview An RFC 3986 compliant, scheme extendable URI parsing/validating/resolving library for JavaScript. * @author Gary Court * @see http://github.com/garycourt/uri-js */ /** * Copyright 2011 Gary Court. All rights reserved. * * Redistribution and use in source and binary forms, with or without modification, are * permitted provided that the following conditions are met: * * 1. Redistributions of source code must retain the above copyright notice, this list of * conditions and the following disclaimer. * * 2. Redistributions in binary form must reproduce the above copyright notice, this list * of conditions and the following disclaimer in the documentation and/or other materials * provided with the distribution. * * THIS SOFTWARE IS PROVIDED BY GARY COURT ``AS IS'' AND ANY EXPRESS OR IMPLIED * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL GARY COURT OR * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * The views and conclusions contained in the software and documentation are those of the * authors and should not be interpreted as representing official policies, either expressed * or implied, of Gary Court. */ var SCHEMES = {}; function pctEncChar(chr) { var c = chr.charCodeAt(0); var e = void 0; 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(); return e; } function pctDecChars(str) { var newStr = ""; var i = 0; var il = str.length; while (i < il) { var c = parseInt(str.substr(i + 1, 2), 16); if (c < 128) { newStr += String.fromCharCode(c); i += 3; } else if (c >= 194 && c < 224) { if (il - i >= 6) { var c2 = parseInt(str.substr(i + 4, 2), 16); newStr += String.fromCharCode((c & 31) << 6 | c2 & 63); } else { newStr += str.substr(i, 6); } i += 6; } else if (c >= 224) { if (il - i >= 9) { var _c = parseInt(str.substr(i + 4, 2), 16); var c3 = parseInt(str.substr(i + 7, 2), 16); newStr += String.fromCharCode((c & 15) << 12 | (_c & 63) << 6 | c3 & 63); } else { newStr += str.substr(i, 9); } i += 9; } else { newStr += str.substr(i, 3); i += 3; } } return newStr; } function _normalizeComponentEncoding(components, protocol) { function decodeUnreserved(str) { var decStr = pctDecChars(str); return !decStr.match(protocol.UNRESERVED) ? str : decStr; } if (components.scheme) components.scheme = String(components.scheme).replace(protocol.PCT_ENCODED, decodeUnreserved).toLowerCase().replace(protocol.NOT_SCHEME, ""); if (components.userinfo !== undefined) components.userinfo = String(components.userinfo).replace(protocol.PCT_ENCODED, decodeUnreserved).replace(protocol.NOT_USERINFO, pctEncChar).replace(protocol.PCT_ENCODED, toUpperCase); 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); 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); if (components.query !== undefined) components.query = String(components.query).replace(protocol.PCT_ENCODED, decodeUnreserved).replace(protocol.NOT_QUERY, pctEncChar).replace(protocol.PCT_ENCODED, toUpperCase); if (components.fragment !== undefined) components.fragment = String(components.fragment).replace(protocol.PCT_ENCODED, decodeUnreserved).replace(protocol.NOT_FRAGMENT, pctEncChar).replace(protocol.PCT_ENCODED, toUpperCase); return components; } function _stripLeadingZeros(str) { return str.replace(/^0*(.*)/, "$1") || "0"; } function _normalizeIPv4(host, protocol) { var matches = host.match(protocol.IPV4ADDRESS) || []; var _matches = slicedToArray(matches, 2), address = _matches[1]; if (address) { return address.split(".").map(_stripLeadingZeros).join("."); } else { return host; } } function _normalizeIPv6(host, protocol) { var matches = host.match(protocol.IPV6ADDRESS) || []; var _matches2 = slicedToArray(matches, 3), address = _matches2[1], zone = _matches2[2]; if (address) { var _address$toLowerCase$ = address.toLowerCase().split('::').reverse(), _address$toLowerCase$2 = slicedToArray(_address$toLowerCase$, 2), last = _address$toLowerCase$2[0], first = _address$toLowerCase$2[1]; var firstFields = first ? first.split(":").map(_stripLeadingZeros) : []; var lastFields = last.split(":").map(_stripLeadingZeros); var isLastFieldIPv4Address = protocol.IPV4ADDRESS.test(lastFields[lastFields.length - 1]); var fieldCount = isLastFieldIPv4Address ? 7 : 8; var lastFieldsStart = lastFields.length - fieldCount; var fields = Array(fieldCount); for (var x = 0; x < fieldCount; ++x) { fields[x] = firstFields[x] || lastFields[lastFieldsStart + x] || ''; } if (isLastFieldIPv4Address) { fields[fieldCount - 1] = _normalizeIPv4(fields[fieldCount - 1], protocol); } var allZeroFields = fields.reduce(function (acc, field, index) { if (!field || field === "0") { var lastLongest = acc[acc.length - 1]; if (lastLongest && lastLongest.index + lastLongest.length === index) { lastLongest.length++; } else { acc.push({ index: index, length: 1 }); } } return acc; }, []); var longestZeroFields = allZeroFields.sort(function (a, b) { return b.length - a.length; })[0]; var newHost = void 0; if (longestZeroFields && longestZeroFields.length > 1) { var newFirst = fields.slice(0, longestZeroFields.index); var newLast = fields.slice(longestZeroFields.index + longestZeroFields.length); newHost = newFirst.join(":") + "::" + newLast.join(":"); } else { newHost = fields.join(":"); } if (zone) { newHost += "%" + zone; } return newHost; } else { return host; } } var URI_PARSE = /^(?:([^:\/?#]+):)?(?:\/\/((?:([^\/?#@]*)@)?(\[[^\/?#\]]+\]|[^\/?#:]*)(?:\:(\d*))?))?([^?#]*)(?:\?([^#]*))?(?:#((?:.|\n|\r)*))?/i; var NO_MATCH_IS_UNDEFINED = "".match(/(){0}/)[1] === undefined; function parse(uriString) { var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; var components = {}; var protocol = options.iri !== false ? IRI_PROTOCOL : URI_PROTOCOL; if (options.reference === "suffix") uriString = (options.scheme ? options.scheme + ":" : "") + "//" + uriString; var matches = uriString.match(URI_PARSE); if (matches) { if (NO_MATCH_IS_UNDEFINED) { //store each component components.scheme = matches[1]; components.userinfo = matches[3]; components.host = matches[4]; components.port = parseInt(matches[5], 10); components.path = matches[6] || ""; components.query = matches[7]; components.fragment = matches[8]; //fix port number if (isNaN(components.port)) { components.port = matches[5]; } } else { //IE FIX for improper RegExp matching //store each component components.scheme = matches[1] || undefined; components.userinfo = uriString.indexOf("@") !== -1 ? matches[3] : undefined; components.host = uriString.indexOf("//") !== -1 ? matches[4] : undefined; components.port = parseInt(matches[5], 10); components.path = matches[6] || ""; components.query = uriString.indexOf("?") !== -1 ? matches[7] : undefined; components.fragment = uriString.indexOf("#") !== -1 ? matches[8] : undefined; //fix port number if (isNaN(components.port)) { components.port = uriString.match(/\/\/(?:.|\n)*\:(?:\/|\?|\#|$)/) ? matches[4] : undefined; } } if (components.host) { //normalize IP hosts components.host = _normalizeIPv6(_normalizeIPv4(components.host, protocol), protocol); } //determine reference type if (components.scheme === undefined && components.userinfo === undefined && components.host === undefined && components.port === undefined && !components.path && components.query === undefined) { components.reference = "same-document"; } else if (components.scheme === undefined) { components.reference = "relative"; } else if (components.fragment === undefined) { components.reference = "absolute"; } else { components.reference = "uri"; } //check for reference errors if (options.reference && options.reference !== "suffix" && options.reference !== components.reference) { components.error = components.error || "URI is not a " + options.reference + " reference."; } //find scheme handler var schemeHandler = SCHEMES[(options.scheme || components.scheme || "").toLowerCase()]; //check if scheme can't handle IRIs if (!options.unicodeSupport && (!schemeHandler || !schemeHandler.unicodeSupport)) { //if host component is a domain name if (components.host && (options.domainHost || schemeHandler && schemeHandler.domainHost)) { //convert Unicode IDN -> ASCII IDN try { components.host = punycode.toASCII(components.host.replace(protocol.PCT_ENCODED, pctDecChars).toLowerCase()); } catch (e) { components.error = components.error || "Host's domain name can not be converted to ASCII via punycode: " + e; } } //convert IRI -> URI _normalizeComponentEncoding(components, URI_PROTOCOL); } else { //normalize encodings _normalizeComponentEncoding(components, protocol); } //perform scheme specific parsing if (schemeHandler && schemeHandler.parse) { schemeHandler.parse(components, options); } } else { components.error = components.error || "URI can not be parsed."; } return components; } function _recomposeAuthority(components, options) { var protocol = options.iri !== false ? IRI_PROTOCOL : URI_PROTOCOL; var uriTokens = []; if (components.userinfo !== undefined) { uriTokens.push(components.userinfo); uriTokens.push("@"); } if (components.host !== undefined) { //normalize IP hosts, add brackets and escape zone separator for IPv6 uriTokens.push(_normalizeIPv6(_normalizeIPv4(String(components.host), protocol), protocol).replace(protocol.IPV6ADDRESS, function (_, $1, $2) { return "[" + $1 + ($2 ? "%25" + $2 : "") + "]"; })); } if (typeof components.port === "number" || typeof components.port === "string") { uriTokens.push(":"); uriTokens.push(String(components.port)); } return uriTokens.length ? uriTokens.join("") : undefined; } var RDS1 = /^\.\.?\//; var RDS2 = /^\/\.(\/|$)/; var RDS3 = /^\/\.\.(\/|$)/; var RDS5 = /^\/?(?:.|\n)*?(?=\/|$)/; function removeDotSegments(input) { var output = []; while (input.length) { if (input.match(RDS1)) { input = input.replace(RDS1, ""); } else if (input.match(RDS2)) { input = input.replace(RDS2, "/"); } else if (input.match(RDS3)) { input = input.replace(RDS3, "/"); output.pop(); } else if (input === "." || input === "..") { input = ""; } else { var im = input.match(RDS5); if (im) { var s = im[0]; input = input.slice(s.length); output.push(s); } else { throw new Error("Unexpected dot segment condition"); } } } return output.join(""); } function serialize(components) { var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; var protocol = options.iri ? IRI_PROTOCOL : URI_PROTOCOL; var uriTokens = []; //find scheme handler var schemeHandler = SCHEMES[(options.scheme || components.scheme || "").toLowerCase()]; //perform scheme specific serialization if (schemeHandler && schemeHandler.serialize) schemeHandler.serialize(components, options); if (components.host) { //if host component is an IPv6 address if (protocol.IPV6ADDRESS.test(components.host)) {} //TODO: normalize IPv6 address as per RFC 5952 //if host component is a domain name else if (options.domainHost || schemeHandler && schemeHandler.domainHost) { //convert IDN via punycode try { components.host = !options.iri ? punycode.toASCII(components.host.replace(protocol.PCT_ENCODED, pctDecChars).toLowerCase()) : punycode.toUnicode(components.host); } catch (e) { components.error = components.error || "Host's domain name can not be converted to " + (!options.iri ? "ASCII" : "Unicode") + " via punycode: " + e; } } } //normalize encoding _normalizeComponentEncoding(components, protocol); if (options.reference !== "suffix" && components.scheme) { uriTokens.push(components.scheme); uriTokens.push(":"); } var authority = _recomposeAuthority(components, options); if (authority !== undefined) { if (options.reference !== "suffix") { uriTokens.push("//"); } uriTokens.push(authority); if (components.path && components.path.charAt(0) !== "/") { uriTokens.push("/"); } } if (components.path !== undefined) { var s = components.path; if (!options.absolutePath && (!schemeHandler || !schemeHandler.absolutePath)) { s = removeDotSegments(s); } if (authority === undefined) { s = s.replace(/^\/\//, "/%2F"); //don't allow the path to start with "//" } uriTokens.push(s); } if (components.query !== undefined) { uriTokens.push("?"); uriTokens.push(components.query); } if (components.fragment !== undefined) { uriTokens.push("#"); uriTokens.push(components.fragment); } return uriTokens.join(""); //merge tokens into a string } function resolveComponents(base, relative) { var options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {}; var skipNormalization = arguments[3]; var target = {}; if (!skipNormalization) { base = parse(serialize(base, options), options); //normalize base components relative = parse(serialize(relative, options), options); //normalize relative components } options = options || {}; if (!options.tolerant && relative.scheme) { target.scheme = relative.scheme; //target.authority = relative.authority; target.userinfo = relative.userinfo; target.host = relative.host; target.port = relative.port; target.path = removeDotSegments(relative.path || ""); target.query = relative.query; } else { if (relative.userinfo !== undefined || relative.host !== undefined || relative.port !== undefined) { //target.authority = relative.authority; target.userinfo = relative.userinfo; target.host = relative.host; target.port = relative.port; target.path = removeDotSegments(relative.path || ""); target.query = relative.query; } else { if (!relative.path) { target.path = base.path; if (relative.query !== undefined) { target.query = relative.query; } else { target.query = base.query; } } else { if (relative.path.charAt(0) === "/") { target.path = removeDotSegments(relative.path); } else { if ((base.userinfo !== undefined || base.host !== undefined || base.port !== undefined) && !base.path) { target.path = "/" + relative.path; } else if (!base.path) { target.path = relative.path; } else { target.path = base.path.slice(0, base.path.lastIndexOf("/") + 1) + relative.path; } target.path = removeDotSegments(target.path); } target.query = relative.query; } //target.authority = base.authority; target.userinfo = base.userinfo; target.host = base.host; target.port = base.port; } target.scheme = base.scheme; } target.fragment = relative.fragment; return target; } function resolve(baseURI, relativeURI, options) { var schemelessOptions = assign({ scheme: 'null' }, options); return serialize(resolveComponents(parse(baseURI, schemelessOptions), parse(relativeURI, schemelessOptions), schemelessOptions, true), schemelessOptions); } function normalize(uri, options) { if (typeof uri === "string") { uri = serialize(parse(uri, options), options); } else if (typeOf(uri) === "object") { uri = parse(serialize(uri, options), options); } return uri; } function equal(uriA, uriB, options) { if (typeof uriA === "string") { uriA = serialize(parse(uriA, options), options); } else if (typeOf(uriA) === "object") { uriA = serialize(uriA, options); } if (typeof uriB === "string") { uriB = serialize(parse(uriB, options), options); } else if (typeOf(uriB) === "object") { uriB = serialize(uriB, options); } return uriA === uriB; } function escapeComponent(str, options) { return str && str.toString().replace(!options || !options.iri ? URI_PROTOCOL.ESCAPE : IRI_PROTOCOL.ESCAPE, pctEncChar); } function unescapeComponent(str, options) { return str && str.toString().replace(!options || !options.iri ? URI_PROTOCOL.PCT_ENCODED : IRI_PROTOCOL.PCT_ENCODED, pctDecChars); } var handler = { scheme: "http", domainHost: true, parse: function parse(components, options) { //report missing host if (!components.host) { components.error = components.error || "HTTP URIs must have a host."; } return components; }, serialize: function serialize(components, options) { var secure = String(components.scheme).toLowerCase() === "https"; //normalize the default port if (components.port === (secure ? 443 : 80) || components.port === "") { components.port = undefined; } //normalize the empty path if (!components.path) { components.path = "/"; } //NOTE: We do not parse query strings for HTTP URIs //as WWW Form Url Encoded query strings are part of the HTML4+ spec, //and not the HTTP spec. return components; } }; var handler$1 = { scheme: "https", domainHost: handler.domainHost, parse: handler.parse, serialize: handler.serialize }; function isSecure(wsComponents) { return typeof wsComponents.secure === 'boolean' ? wsComponents.secure : String(wsComponents.scheme).toLowerCase() === "wss"; } //RFC 6455 var handler$2 = { scheme: "ws", domainHost: true, parse: function parse(components, options) { var wsComponents = components; //indicate if the secure flag is set wsComponents.secure = isSecure(wsComponents); //construct resouce name wsComponents.resourceName = (wsComponents.path || '/') + (wsComponents.query ? '?' + wsComponents.query : ''); wsComponents.path = undefined; wsComponents.query = undefined; return wsComponents; }, serialize: function serialize(wsComponents, options) { //normalize the default port if (wsComponents.port === (isSecure(wsComponents) ? 443 : 80) || wsComponents.port === "") { wsComponents.port = undefined; } //ensure scheme matches secure flag if (typeof wsComponents.secure === 'boolean') { wsComponents.scheme = wsComponents.secure ? 'wss' : 'ws'; wsComponents.secure = undefined; } //reconstruct path from resource name if (wsComponents.resourceName) { var _wsComponents$resourc = wsComponents.resourceName.split('?'), _wsComponents$resourc2 = slicedToArray(_wsComponents$resourc, 2), path = _wsComponents$resourc2[0], query = _wsComponents$resourc2[1]; wsComponents.path = path && path !== '/' ? path : undefined; wsComponents.query = query; wsComponents.resourceName = undefined; } //forbid fragment component wsComponents.fragment = undefined; return wsComponents; } }; var handler$3 = { scheme: "wss", domainHost: handler$2.domainHost, parse: handler$2.parse, serialize: handler$2.serialize }; var O = {}; var isIRI = true; //RFC 3986 var UNRESERVED$$ = "[A-Za-z0-9\\-\\.\\_\\~" + (isIRI ? "\\xA0-\\u200D\\u2010-\\u2029\\u202F-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF" : "") + "]"; var HEXDIG$$ = "[0-9A-Fa-f]"; //case-insensitive var PCT_ENCODED$ = subexp(subexp("%[EFef]" + HEXDIG$$ + "%" + HEXDIG$$ + HEXDIG$$ + "%" + HEXDIG$$ + HEXDIG$$) + "|" + subexp("%[89A-Fa-f]" + HEXDIG$$ + "%" + HEXDIG$$ + HEXDIG$$) + "|" + subexp("%" + HEXDIG$$ + HEXDIG$$)); //expanded //RFC 5322, except these symbols as per RFC 6068: @ : / ? # [ ] & ; = //const ATEXT$$ = "[A-Za-z0-9\\!\\#\\$\\%\\&\\'\\*\\+\\-\\/\\=\\?\\^\\_\\`\\{\\|\\}\\~]"; //const WSP$$ = "[\\x20\\x09]"; //const OBS_QTEXT$$ = "[\\x01-\\x08\\x0B\\x0C\\x0E-\\x1F\\x7F]"; //(%d1-8 / %d11-12 / %d14-31 / %d127) //const QTEXT$$ = merge("[\\x21\\x23-\\x5B\\x5D-\\x7E]", OBS_QTEXT$$); //%d33 / %d35-91 / %d93-126 / obs-qtext //const VCHAR$$ = "[\\x21-\\x7E]"; //const WSP$$ = "[\\x20\\x09]"; //const OBS_QP$ = subexp("\\\\" + merge("[\\x00\\x0D\\x0A]", OBS_QTEXT$$)); //%d0 / CR / LF / obs-qtext //const FWS$ = subexp(subexp(WSP$$ + "*" + "\\x0D\\x0A") + "?" + WSP$$ + "+"); //const QUOTED_PAIR$ = subexp(subexp("\\\\" + subexp(VCHAR$$ + "|" + WSP$$)) + "|" + OBS_QP$); //const QUOTED_STRING$ = subexp('\\"' + subexp(FWS$ + "?" + QCONTENT$) + "*" + FWS$ + "?" + '\\"'); var ATEXT$$ = "[A-Za-z0-9\\!\\$\\%\\'\\*\\+\\-\\^\\_\\`\\{\\|\\}\\~]"; var QTEXT$$ = "[\\!\\$\\%\\'\\(\\)\\*\\+\\,\\-\\.0-9\\<\\>A-Z\\x5E-\\x7E]"; var VCHAR$$ = merge(QTEXT$$, "[\\\"\\\\]"); var SOME_DELIMS$$ = "[\\!\\$\\'\\(\\)\\*\\+\\,\\;\\:\\@]"; var UNRESERVED = new RegExp(UNRESERVED$$, "g"); var PCT_ENCODED = new RegExp(PCT_ENCODED$, "g"); var NOT_LOCAL_PART = new RegExp(merge("[^]", ATEXT$$, "[\\.]", '[\\"]', VCHAR$$), "g"); var NOT_HFNAME = new RegExp(merge("[^]", UNRESERVED$$, SOME_DELIMS$$), "g"); var NOT_HFVALUE = NOT_HFNAME; function decodeUnreserved(str) { var decStr = pctDecChars(str); return !decStr.match(UNRESERVED) ? str : decStr; } var handler$4 = { scheme: "mailto", parse: function parse$$1(components, options) { var mailtoComponents = components; var to = mailtoComponents.to = mailtoComponents.path ? mailtoComponents.path.split(",") : []; mailtoComponents.path = undefined; if (mailtoComponents.query) { var unknownHeaders = false; var headers = {}; var hfields = mailtoComponents.query.split("&"); for (var x = 0, xl = hfields.length; x < xl; ++x) { var hfield = hfields[x].split("="); switch (hfield[0]) { case "to": var toAddrs = hfield[1].split(","); for (var _x = 0, _xl = toAddrs.length; _x < _xl; ++_x) { to.push(toAddrs[_x]); } break; case "subject": mailtoComponents.subject = unescapeComponent(hfield[1], options); break; case "body": mailtoComponents.body = unescapeComponent(hfield[1], options); break; default: unknownHeaders = true; headers[unescapeComponent(hfield[0], options)] = unescapeComponent(hfield[1], options); break; } } if (unknownHeaders) mailtoComponents.headers = headers; } mailtoComponents.query = undefined; for (var _x2 = 0, _xl2 = to.length; _x2 < _xl2; ++_x2) { var addr = to[_x2].split("@"); addr[0] = unescapeComponent(addr[0]); if (!options.unicodeSupport) { //convert Unicode IDN -> ASCII IDN try { addr[1] = punycode.toASCII(unescapeComponent(addr[1], options).toLowerCase()); } catch (e) { mailtoComponents.error = mailtoComponents.error || "Email address's domain name can not be converted to ASCII via punycode: " + e; } } else { addr[1] = unescapeComponent(addr[1], options).toLowerCase(); } to[_x2] = addr.join("@"); } return mailtoComponents; }, serialize: function serialize$$1(mailtoComponents, options) { var components = mailtoComponents; var to = toArray(mailtoComponents.to); if (to) { for (var x = 0, xl = to.length; x < xl; ++x) { var toAddr = String(to[x]); var atIdx = toAddr.lastIndexOf("@"); var localPart = toAddr.slice(0, atIdx).replace(PCT_ENCODED, decodeUnreserved).replace(PCT_ENCODED, toUpperCase).replace(NOT_LOCAL_PART, pctEncChar); var domain = toAddr.slice(atIdx + 1); //convert IDN via punycode try { domain = !options.iri ? punycode.toASCII(unescapeComponent(domain, options).toLowerCase()) : punycode.toUnicode(domain); } catch (e) { components.error = components.error || "Email address's domain name can not be converted to " + (!options.iri ? "ASCII" : "Unicode") + " via punycode: " + e; } to[x] = localPart + "@" + domain; } components.path = to.join(","); } var headers = mailtoComponents.headers = mailtoComponents.headers || {}; if (mailtoComponents.subject) headers["subject"] = mailtoComponents.subject; if (mailtoComponents.body) headers["body"] = mailtoComponents.body; var fields = []; for (var name in headers) { if (headers[name] !== O[name]) { 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)); } } if (fields.length) { components.query = fields.join("&"); } return components; } }; var URN_PARSE = /^([^\:]+)\:(.*)/; //RFC 2141 var handler$5 = { scheme: "urn", parse: function parse$$1(components, options) { var matches = components.path && components.path.match(URN_PARSE); var urnComponents = components; if (matches) { var scheme = options.scheme || urnComponents.scheme || "urn"; var nid = matches[1].toLowerCase(); var nss = matches[2]; var urnScheme = scheme + ":" + (options.nid || nid); var schemeHandler = SCHEMES[urnScheme]; urnComponents.nid = nid; urnComponents.nss = nss; urnComponents.path = undefined; if (schemeHandler) { urnComponents = schemeHandler.parse(urnComponents, options); } } else { urnComponents.error = urnComponents.error || "URN can not be parsed."; } return urnComponents; }, serialize: function serialize$$1(urnComponents, options) { var scheme = options.scheme || urnComponents.scheme || "urn"; var nid = urnComponents.nid; var urnScheme = scheme + ":" + (options.nid || nid); var schemeHandler = SCHEMES[urnScheme]; if (schemeHandler) { urnComponents = schemeHandler.serialize(urnComponents, options); } var uriComponents = urnComponents; var nss = urnComponents.nss; uriComponents.path = (nid || options.nid) + ":" + nss; return uriComponents; } }; var UUID = /^[0-9A-Fa-f]{8}(?:\-[0-9A-Fa-f]{4}){3}\-[0-9A-Fa-f]{12}$/; //RFC 4122 var handler$6 = { scheme: "urn:uuid", parse: function parse(urnComponents, options) { var uuidComponents = urnComponents; uuidComponents.uuid = uuidComponents.nss; uuidComponents.nss = undefined; if (!options.tolerant && (!uuidComponents.uuid || !uuidComponents.uuid.match(UUID))) { uuidComponents.error = uuidComponents.error || "UUID is not valid."; } return uuidComponents; }, serialize: function serialize(uuidComponents, options) { var urnComponents = uuidComponents; //normalize UUID urnComponents.nss = (uuidComponents.uuid || "").toLowerCase(); return urnComponents; } }; SCHEMES[handler.scheme] = handler; SCHEMES[handler$1.scheme] = handler$1; SCHEMES[handler$2.scheme] = handler$2; SCHEMES[handler$3.scheme] = handler$3; SCHEMES[handler$4.scheme] = handler$4; SCHEMES[handler$5.scheme] = handler$5; SCHEMES[handler$6.scheme] = handler$6; exports.SCHEMES = SCHEMES; exports.pctEncChar = pctEncChar; exports.pctDecChars = pctDecChars; exports.parse = parse; exports.removeDotSegments = removeDotSegments; exports.serialize = serialize; exports.resolveComponents = resolveComponents; exports.resolve = resolve; exports.normalize = normalize; exports.equal = equal; exports.escapeComponent = escapeComponent; exports.unescapeComponent = unescapeComponent; Object.defineProperty(exports, '__esModule', { value: true }); }))); //# sourceMappingURL=uri.all.js.map /***/ }), /***/ 12821: /***/ (function(module) { (function (name, context, definition) { if ( true && module.exports) module.exports = definition(); else if (typeof define === 'function' && define.amd) define(definition); else context[name] = definition(); })('urljoin', this, function () { function normalize (strArray) { var resultArray = []; if (strArray.length === 0) { return ''; } if (typeof strArray[0] !== 'string') { throw new TypeError('Url must be a string. Received ' + strArray[0]); } // If the first part is a plain protocol, we combine it with the next part. if (strArray[0].match(/^[^/:]+:\/*$/) && strArray.length > 1) { var first = strArray.shift(); strArray[0] = first + strArray[0]; } // There must be two or three slashes in the file protocol, two slashes in anything else. if (strArray[0].match(/^file:\/\/\//)) { strArray[0] = strArray[0].replace(/^([^/:]+):\/*/, '$1:///'); } else { strArray[0] = strArray[0].replace(/^([^/:]+):\/*/, '$1://'); } for (var i = 0; i < strArray.length; i++) { var component = strArray[i]; if (typeof component !== 'string') { throw new TypeError('Url must be a string. Received ' + component); } if (component === '') { continue; } if (i > 0) { // Removing the starting slashes for each component but the first. component = component.replace(/^[\/]+/, ''); } if (i < strArray.length - 1) { // Removing the ending slashes for each component but the last. component = component.replace(/[\/]+$/, ''); } else { // For the last component we will combine multiple slashes to a single one. component = component.replace(/[\/]+$/, '/'); } resultArray.push(component); } var str = resultArray.join('/'); // Each input component is now separated by a single slash except the possible first plain protocol part. // remove trailing slash before parameters or hash str = str.replace(/\/(\?|&|#[^!])/g, '$1'); // replace ? in parameters with & var parts = str.split('?'); str = parts.shift() + (parts.length > 0 ? '?': '') + parts.join('&'); return str; } return function () { var input; if (typeof arguments[0] === 'object') { input = arguments[0]; } else { input = [].slice.call(arguments); } return normalize(input); }; }); /***/ }), /***/ 13194: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; const url = __webpack_require__(78835); const prependHttp = __webpack_require__(56143); module.exports = (input, options) => { if (typeof input !== 'string') { throw new TypeError(`Expected \`url\` to be of type \`string\`, got \`${typeof input}\` instead.`); } const finalUrl = prependHttp(input, Object.assign({https: true}, options)); return url.parse(finalUrl); }; /***/ }), /***/ 2155: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { var v1 = __webpack_require__(18749); var v4 = __webpack_require__(80824); var uuid = v4; uuid.v1 = v1; uuid.v4 = v4; module.exports = uuid; /***/ }), /***/ 92707: /***/ ((module) => { /** * Convert array of 16 byte values to UUID string format of the form: * XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX */ var byteToHex = []; for (var i = 0; i < 256; ++i) { byteToHex[i] = (i + 0x100).toString(16).substr(1); } function bytesToUuid(buf, offset) { var i = offset || 0; var bth = byteToHex; // join used to fix memory issue caused by concatenation: https://bugs.chromium.org/p/v8/issues/detail?id=3175#c4 return ([bth[buf[i++]], bth[buf[i++]], bth[buf[i++]], bth[buf[i++]], '-', bth[buf[i++]], bth[buf[i++]], '-', bth[buf[i++]], bth[buf[i++]], '-', bth[buf[i++]], bth[buf[i++]], '-', bth[buf[i++]], bth[buf[i++]], bth[buf[i++]], bth[buf[i++]], bth[buf[i++]], bth[buf[i++]]]).join(''); } module.exports = bytesToUuid; /***/ }), /***/ 15859: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { // Unique ID creation requires a high quality random # generator. In node.js // this is pretty straight-forward - we use the crypto API. var crypto = __webpack_require__(33373); module.exports = function nodeRNG() { return crypto.randomBytes(16); }; /***/ }), /***/ 18749: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { var rng = __webpack_require__(15859); var bytesToUuid = __webpack_require__(92707); // **`v1()` - Generate time-based UUID** // // Inspired by https://github.com/LiosK/UUID.js // and http://docs.python.org/library/uuid.html var _nodeId; var _clockseq; // Previous uuid creation time var _lastMSecs = 0; var _lastNSecs = 0; // See https://github.com/broofa/node-uuid for API details function v1(options, buf, offset) { var i = buf && offset || 0; var b = buf || []; options = options || {}; var node = options.node || _nodeId; var clockseq = options.clockseq !== undefined ? options.clockseq : _clockseq; // node and clockseq need to be initialized to random values if they're not // specified. We do this lazily to minimize issues related to insufficient // system entropy. See #189 if (node == null || clockseq == null) { var seedBytes = rng(); if (node == null) { // Per 4.5, create and 48-bit node id, (47 random bits + multicast bit = 1) node = _nodeId = [ seedBytes[0] | 0x01, seedBytes[1], seedBytes[2], seedBytes[3], seedBytes[4], seedBytes[5] ]; } if (clockseq == null) { // Per 4.2.2, randomize (14 bit) clockseq clockseq = _clockseq = (seedBytes[6] << 8 | seedBytes[7]) & 0x3fff; } } // UUID timestamps are 100 nano-second units since the Gregorian epoch, // (1582-10-15 00:00). JSNumbers aren't precise enough for this, so // time is handled internally as 'msecs' (integer milliseconds) and 'nsecs' // (100-nanoseconds offset from msecs) since unix epoch, 1970-01-01 00:00. var msecs = options.msecs !== undefined ? options.msecs : new Date().getTime(); // Per 4.2.1.2, use count of uuid's generated during the current clock // cycle to simulate higher resolution clock var nsecs = options.nsecs !== undefined ? options.nsecs : _lastNSecs + 1; // Time since last uuid creation (in msecs) var dt = (msecs - _lastMSecs) + (nsecs - _lastNSecs)/10000; // Per 4.2.1.2, Bump clockseq on clock regression if (dt < 0 && options.clockseq === undefined) { clockseq = clockseq + 1 & 0x3fff; } // Reset nsecs if clock regresses (new clockseq) or we've moved onto a new // time interval if ((dt < 0 || msecs > _lastMSecs) && options.nsecs === undefined) { nsecs = 0; } // Per 4.2.1.2 Throw error if too many uuids are requested if (nsecs >= 10000) { throw new Error('uuid.v1(): Can\'t create more than 10M uuids/sec'); } _lastMSecs = msecs; _lastNSecs = nsecs; _clockseq = clockseq; // Per 4.1.4 - Convert from unix epoch to Gregorian epoch msecs += 12219292800000; // `time_low` var tl = ((msecs & 0xfffffff) * 10000 + nsecs) % 0x100000000; b[i++] = tl >>> 24 & 0xff; b[i++] = tl >>> 16 & 0xff; b[i++] = tl >>> 8 & 0xff; b[i++] = tl & 0xff; // `time_mid` var tmh = (msecs / 0x100000000 * 10000) & 0xfffffff; b[i++] = tmh >>> 8 & 0xff; b[i++] = tmh & 0xff; // `time_high_and_version` b[i++] = tmh >>> 24 & 0xf | 0x10; // include version b[i++] = tmh >>> 16 & 0xff; // `clock_seq_hi_and_reserved` (Per 4.2.2 - include variant) b[i++] = clockseq >>> 8 | 0x80; // `clock_seq_low` b[i++] = clockseq & 0xff; // `node` for (var n = 0; n < 6; ++n) { b[i + n] = node[n]; } return buf ? buf : bytesToUuid(b); } module.exports = v1; /***/ }), /***/ 80824: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { var rng = __webpack_require__(15859); var bytesToUuid = __webpack_require__(92707); function v4(options, buf, offset) { var i = buf && offset || 0; if (typeof(options) == 'string') { buf = options === 'binary' ? new Array(16) : null; options = null; } options = options || {}; var rnds = options.random || (options.rng || rng)(); // Per 4.4, set bits for version and `clock_seq_hi_and_reserved` rnds[6] = (rnds[6] & 0x0f) | 0x40; rnds[8] = (rnds[8] & 0x3f) | 0x80; // Copy bytes to buffer, if provided if (buf) { for (var ii = 0; ii < 16; ++ii) { buf[i + ii] = rnds[ii]; } } return buf || bytesToUuid(rnds); } module.exports = v4; /***/ }), /***/ 81692: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { /* * verror.js: richer JavaScript errors */ var mod_assertplus = __webpack_require__(66631); var mod_util = __webpack_require__(31669); var mod_extsprintf = __webpack_require__(41508); var mod_isError = __webpack_require__(95898)/* .isError */ .VZ; var sprintf = mod_extsprintf.sprintf; /* * Public interface */ /* So you can 'var VError = require('verror')' */ module.exports = VError; /* For compatibility */ VError.VError = VError; /* Other exported classes */ VError.SError = SError; VError.WError = WError; VError.MultiError = MultiError; /* * Common function used to parse constructor arguments for VError, WError, and * SError. Named arguments to this function: * * strict force strict interpretation of sprintf arguments, even * if the options in "argv" don't say so * * argv error's constructor arguments, which are to be * interpreted as described in README.md. For quick * reference, "argv" has one of the following forms: * * [ sprintf_args... ] (argv[0] is a string) * [ cause, sprintf_args... ] (argv[0] is an Error) * [ options, sprintf_args... ] (argv[0] is an object) * * This function normalizes these forms, producing an object with the following * properties: * * options equivalent to "options" in third form. This will never * be a direct reference to what the caller passed in * (i.e., it may be a shallow copy), so it can be freely * modified. * * shortmessage result of sprintf(sprintf_args), taking options.strict * into account as described in README.md. */ function parseConstructorArguments(args) { var argv, options, sprintf_args, shortmessage, k; mod_assertplus.object(args, 'args'); mod_assertplus.bool(args.strict, 'args.strict'); mod_assertplus.array(args.argv, 'args.argv'); argv = args.argv; /* * First, figure out which form of invocation we've been given. */ if (argv.length === 0) { options = {}; sprintf_args = []; } else if (mod_isError(argv[0])) { options = { 'cause': argv[0] }; sprintf_args = argv.slice(1); } else if (typeof (argv[0]) === 'object') { options = {}; for (k in argv[0]) { options[k] = argv[0][k]; } sprintf_args = argv.slice(1); } else { mod_assertplus.string(argv[0], 'first argument to VError, SError, or WError ' + 'constructor must be a string, object, or Error'); options = {}; sprintf_args = argv; } /* * Now construct the error's message. * * extsprintf (which we invoke here with our caller's arguments in order * to construct this Error's message) is strict in its interpretation of * values to be processed by the "%s" specifier. The value passed to * extsprintf must actually be a string or something convertible to a * String using .toString(). Passing other values (notably "null" and * "undefined") is considered a programmer error. The assumption is * that if you actually want to print the string "null" or "undefined", * then that's easy to do that when you're calling extsprintf; on the * other hand, if you did NOT want that (i.e., there's actually a bug * where the program assumes some variable is non-null and tries to * print it, which might happen when constructing a packet or file in * some specific format), then it's better to stop immediately than * produce bogus output. * * However, sometimes the bug is only in the code calling VError, and a * programmer might prefer to have the error message contain "null" or * "undefined" rather than have the bug in the error path crash the * program (making the first bug harder to identify). For that reason, * by default VError converts "null" or "undefined" arguments to their * string representations and passes those to extsprintf. Programmers * desiring the strict behavior can use the SError class or pass the * "strict" option to the VError constructor. */ mod_assertplus.object(options); if (!options.strict && !args.strict) { sprintf_args = sprintf_args.map(function (a) { return (a === null ? 'null' : a === undefined ? 'undefined' : a); }); } if (sprintf_args.length === 0) { shortmessage = ''; } else { shortmessage = sprintf.apply(null, sprintf_args); } return ({ 'options': options, 'shortmessage': shortmessage }); } /* * See README.md for reference documentation. */ function VError() { var args, obj, parsed, cause, ctor, message, k; args = Array.prototype.slice.call(arguments, 0); /* * This is a regrettable pattern, but JavaScript's built-in Error class * is defined to work this way, so we allow the constructor to be called * without "new". */ if (!(this instanceof VError)) { obj = Object.create(VError.prototype); VError.apply(obj, arguments); return (obj); } /* * For convenience and backwards compatibility, we support several * different calling forms. Normalize them here. */ parsed = parseConstructorArguments({ 'argv': args, 'strict': false }); /* * If we've been given a name, apply it now. */ if (parsed.options.name) { mod_assertplus.string(parsed.options.name, 'error\'s "name" must be a string'); this.name = parsed.options.name; } /* * For debugging, we keep track of the original short message (attached * this Error particularly) separately from the complete message (which * includes the messages of our cause chain). */ this.jse_shortmsg = parsed.shortmessage; message = parsed.shortmessage; /* * If we've been given a cause, record a reference to it and update our * message appropriately. */ cause = parsed.options.cause; if (cause) { mod_assertplus.ok(mod_isError(cause), 'cause is not an Error'); this.jse_cause = cause; if (!parsed.options.skipCauseMessage) { message += ': ' + cause.message; } } /* * If we've been given an object with properties, shallow-copy that * here. We don't want to use a deep copy in case there are non-plain * objects here, but we don't want to use the original object in case * the caller modifies it later. */ this.jse_info = {}; if (parsed.options.info) { for (k in parsed.options.info) { this.jse_info[k] = parsed.options.info[k]; } } this.message = message; Error.call(this, message); if (Error.captureStackTrace) { ctor = parsed.options.constructorOpt || this.constructor; Error.captureStackTrace(this, ctor); } return (this); } mod_util.inherits(VError, Error); VError.prototype.name = 'VError'; VError.prototype.toString = function ve_toString() { var str = (this.hasOwnProperty('name') && this.name || this.constructor.name || this.constructor.prototype.name); if (this.message) str += ': ' + this.message; return (str); }; /* * This method is provided for compatibility. New callers should use * VError.cause() instead. That method also uses the saner `null` return value * when there is no cause. */ VError.prototype.cause = function ve_cause() { var cause = VError.cause(this); return (cause === null ? undefined : cause); }; /* * Static methods * * These class-level methods are provided so that callers can use them on * instances of Errors that are not VErrors. New interfaces should be provided * only using static methods to eliminate the class of programming mistake where * people fail to check whether the Error object has the corresponding methods. */ VError.cause = function (err) { mod_assertplus.ok(mod_isError(err), 'err must be an Error'); return (mod_isError(err.jse_cause) ? err.jse_cause : null); }; VError.info = function (err) { var rv, cause, k; mod_assertplus.ok(mod_isError(err), 'err must be an Error'); cause = VError.cause(err); if (cause !== null) { rv = VError.info(cause); } else { rv = {}; } if (typeof (err.jse_info) == 'object' && err.jse_info !== null) { for (k in err.jse_info) { rv[k] = err.jse_info[k]; } } return (rv); }; VError.findCauseByName = function (err, name) { var cause; mod_assertplus.ok(mod_isError(err), 'err must be an Error'); mod_assertplus.string(name, 'name'); mod_assertplus.ok(name.length > 0, 'name cannot be empty'); for (cause = err; cause !== null; cause = VError.cause(cause)) { mod_assertplus.ok(mod_isError(cause)); if (cause.name == name) { return (cause); } } return (null); }; VError.hasCauseWithName = function (err, name) { return (VError.findCauseByName(err, name) !== null); }; VError.fullStack = function (err) { mod_assertplus.ok(mod_isError(err), 'err must be an Error'); var cause = VError.cause(err); if (cause) { return (err.stack + '\ncaused by: ' + VError.fullStack(cause)); } return (err.stack); }; VError.errorFromList = function (errors) { mod_assertplus.arrayOfObject(errors, 'errors'); if (errors.length === 0) { return (null); } errors.forEach(function (e) { mod_assertplus.ok(mod_isError(e)); }); if (errors.length == 1) { return (errors[0]); } return (new MultiError(errors)); }; VError.errorForEach = function (err, func) { mod_assertplus.ok(mod_isError(err), 'err must be an Error'); mod_assertplus.func(func, 'func'); if (err instanceof MultiError) { err.errors().forEach(function iterError(e) { func(e); }); } else { func(err); } }; /* * SError is like VError, but stricter about types. You cannot pass "null" or * "undefined" as string arguments to the formatter. */ function SError() { var args, obj, parsed, options; args = Array.prototype.slice.call(arguments, 0); if (!(this instanceof SError)) { obj = Object.create(SError.prototype); SError.apply(obj, arguments); return (obj); } parsed = parseConstructorArguments({ 'argv': args, 'strict': true }); options = parsed.options; VError.call(this, options, '%s', parsed.shortmessage); return (this); } /* * We don't bother setting SError.prototype.name because once constructed, * SErrors are just like VErrors. */ mod_util.inherits(SError, VError); /* * Represents a collection of errors for the purpose of consumers that generally * only deal with one error. Callers can extract the individual errors * contained in this object, but may also just treat it as a normal single * error, in which case a summary message will be printed. */ function MultiError(errors) { mod_assertplus.array(errors, 'list of errors'); mod_assertplus.ok(errors.length > 0, 'must be at least one error'); this.ase_errors = errors; VError.call(this, { 'cause': errors[0] }, 'first of %d error%s', errors.length, errors.length == 1 ? '' : 's'); } mod_util.inherits(MultiError, VError); MultiError.prototype.name = 'MultiError'; MultiError.prototype.errors = function me_errors() { return (this.ase_errors.slice(0)); }; /* * See README.md for reference details. */ function WError() { var args, obj, parsed, options; args = Array.prototype.slice.call(arguments, 0); if (!(this instanceof WError)) { obj = Object.create(WError.prototype); WError.apply(obj, args); return (obj); } parsed = parseConstructorArguments({ 'argv': args, 'strict': false }); options = parsed.options; options['skipCauseMessage'] = true; VError.call(this, options, '%s', parsed.shortmessage); return (this); } mod_util.inherits(WError, VError); WError.prototype.name = 'WError'; WError.prototype.toString = function we_toString() { var str = (this.hasOwnProperty('name') && this.name || this.constructor.name || this.constructor.prototype.name); if (this.message) str += ': ' + this.message; if (this.jse_cause && this.jse_cause.message) str += '; caused by ' + this.jse_cause.toString(); return (str); }; /* * For purely historical reasons, WError's cause() function allows you to set * the cause. */ WError.prototype.cause = function we_cause(c) { if (mod_isError(c)) this.jse_cause = c; return (this.jse_cause); }; /***/ }), /***/ 41508: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { /* * extsprintf.js: extended POSIX-style sprintf */ var mod_assert = __webpack_require__(42357); var mod_util = __webpack_require__(31669); /* * Public interface */ exports.sprintf = jsSprintf; exports.printf = jsPrintf; exports.fprintf = jsFprintf; /* * Stripped down version of s[n]printf(3c). We make a best effort to throw an * exception when given a format string we don't understand, rather than * ignoring it, so that we won't break existing programs if/when we go implement * the rest of this. * * This implementation currently supports specifying * - field alignment ('-' flag), * - zero-pad ('0' flag) * - always show numeric sign ('+' flag), * - field width * - conversions for strings, decimal integers, and floats (numbers). * - argument size specifiers. These are all accepted but ignored, since * Javascript has no notion of the physical size of an argument. * * Everything else is currently unsupported, most notably precision, unsigned * numbers, non-decimal numbers, and characters. */ function jsSprintf(ofmt) { var regex = [ '([^%]*)', /* normal text */ '%', /* start of format */ '([\'\\-+ #0]*?)', /* flags (optional) */ '([1-9]\\d*)?', /* width (optional) */ '(\\.([1-9]\\d*))?', /* precision (optional) */ '[lhjztL]*?', /* length mods (ignored) */ '([diouxXfFeEgGaAcCsSp%jr])' /* conversion */ ].join(''); var re = new RegExp(regex); /* variadic arguments used to fill in conversion specifiers */ var args = Array.prototype.slice.call(arguments, 1); /* remaining format string */ var fmt = ofmt; /* components of the current conversion specifier */ var flags, width, precision, conversion; var left, pad, sign, arg, match; /* return value */ var ret = ''; /* current variadic argument (1-based) */ var argn = 1; /* 0-based position in the format string that we've read */ var posn = 0; /* 1-based position in the format string of the current conversion */ var convposn; /* current conversion specifier */ var curconv; mod_assert.equal('string', typeof (fmt), 'first argument must be a format string'); while ((match = re.exec(fmt)) !== null) { ret += match[1]; fmt = fmt.substring(match[0].length); /* * Update flags related to the current conversion specifier's * position so that we can report clear error messages. */ curconv = match[0].substring(match[1].length); convposn = posn + match[1].length + 1; posn += match[0].length; flags = match[2] || ''; width = match[3] || 0; precision = match[4] || ''; conversion = match[6]; left = false; sign = false; pad = ' '; if (conversion == '%') { ret += '%'; continue; } if (args.length === 0) { throw (jsError(ofmt, convposn, curconv, 'has no matching argument ' + '(too few arguments passed)')); } arg = args.shift(); argn++; if (flags.match(/[\' #]/)) { throw (jsError(ofmt, convposn, curconv, 'uses unsupported flags')); } if (precision.length > 0) { throw (jsError(ofmt, convposn, curconv, 'uses non-zero precision (not supported)')); } if (flags.match(/-/)) left = true; if (flags.match(/0/)) pad = '0'; if (flags.match(/\+/)) sign = true; switch (conversion) { case 's': if (arg === undefined || arg === null) { throw (jsError(ofmt, convposn, curconv, 'attempted to print undefined or null ' + 'as a string (argument ' + argn + ' to ' + 'sprintf)')); } ret += doPad(pad, width, left, arg.toString()); break; case 'd': arg = Math.floor(arg); /*jsl:fallthru*/ case 'f': sign = sign && arg > 0 ? '+' : ''; ret += sign + doPad(pad, width, left, arg.toString()); break; case 'x': ret += doPad(pad, width, left, arg.toString(16)); break; case 'j': /* non-standard */ if (width === 0) width = 10; ret += mod_util.inspect(arg, false, width); break; case 'r': /* non-standard */ ret += dumpException(arg); break; default: throw (jsError(ofmt, convposn, curconv, 'is not supported')); } } ret += fmt; return (ret); } function jsError(fmtstr, convposn, curconv, reason) { mod_assert.equal(typeof (fmtstr), 'string'); mod_assert.equal(typeof (curconv), 'string'); mod_assert.equal(typeof (convposn), 'number'); mod_assert.equal(typeof (reason), 'string'); return (new Error('format string "' + fmtstr + '": conversion specifier "' + curconv + '" at character ' + convposn + ' ' + reason)); } function jsPrintf() { var args = Array.prototype.slice.call(arguments); args.unshift(process.stdout); jsFprintf.apply(null, args); } function jsFprintf(stream) { var args = Array.prototype.slice.call(arguments, 1); return (stream.write(jsSprintf.apply(this, args))); } function doPad(chr, width, left, str) { var ret = str; while (ret.length < width) { if (left) ret += chr; else ret = chr + ret; } return (ret); } /* * This function dumps long stack traces for exceptions having a cause() method. * See node-verror for an example. */ function dumpException(ex) { var ret; if (!(ex instanceof Error)) throw (new Error(jsSprintf('invalid type for %%r: %j', ex))); /* Note that V8 prepends "ex.stack" with ex.toString(). */ ret = 'EXCEPTION: ' + ex.constructor.name + ': ' + ex.stack; if (ex.cause && typeof (ex.cause) === 'function') { var cex = ex.cause(); if (cex) { ret += '\nCaused by: ' + dumpException(cex); } } return (ret); } /***/ }), /***/ 62940: /***/ ((module) => { // Returns a wrapper function that returns a wrapped callback // The wrapper function should do some stuff, and return a // presumably different callback function. // This makes sure that own properties are retained, so that // decorations and such are not lost along the way. module.exports = wrappy function wrappy (fn, cb) { if (fn && cb) return wrappy(fn)(cb) if (typeof fn !== 'function') throw new TypeError('need wrapper function') Object.keys(fn).forEach(function (k) { wrapper[k] = fn[k] }) return wrapper function wrapper() { var args = new Array(arguments.length) for (var i = 0; i < args.length; i++) { args[i] = arguments[i] } var ret = fn.apply(this, args) var cb = args[args.length-1] if (typeof ret === 'function' && ret !== cb) { Object.keys(cb).forEach(function (k) { ret[k] = cb[k] }) } return ret } } /***/ }), /***/ 88867: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; const WebSocket = __webpack_require__(91518); WebSocket.Server = __webpack_require__(58887); WebSocket.Receiver = __webpack_require__(25066); WebSocket.Sender = __webpack_require__(36947); module.exports = WebSocket; /***/ }), /***/ 9436: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; const { EMPTY_BUFFER } = __webpack_require__(15949); /** * Merges an array of buffers into a new buffer. * * @param {Buffer[]} list The array of buffers to concat * @param {Number} totalLength The total length of buffers in the list * @return {Buffer} The resulting buffer * @public */ function concat(list, totalLength) { if (list.length === 0) return EMPTY_BUFFER; if (list.length === 1) return list[0]; const target = Buffer.allocUnsafe(totalLength); var offset = 0; for (var i = 0; i < list.length; i++) { const buf = list[i]; buf.copy(target, offset); offset += buf.length; } return target; } /** * Masks a buffer using the given mask. * * @param {Buffer} source The buffer to mask * @param {Buffer} mask The mask to use * @param {Buffer} output The buffer where to store the result * @param {Number} offset The offset at which to start writing * @param {Number} length The number of bytes to mask. * @public */ function _mask(source, mask, output, offset, length) { for (var i = 0; i < length; i++) { output[offset + i] = source[i] ^ mask[i & 3]; } } /** * Unmasks a buffer using the given mask. * * @param {Buffer} buffer The buffer to unmask * @param {Buffer} mask The mask to use * @public */ function _unmask(buffer, mask) { // Required until https://github.com/nodejs/node/issues/9006 is resolved. const length = buffer.length; for (var i = 0; i < length; i++) { buffer[i] ^= mask[i & 3]; } } /** * Converts a buffer to an `ArrayBuffer`. * * @param {Buffer} buf The buffer to convert * @return {ArrayBuffer} Converted buffer * @public */ function toArrayBuffer(buf) { if (buf.byteLength === buf.buffer.byteLength) { return buf.buffer; } return buf.buffer.slice(buf.byteOffset, buf.byteOffset + buf.byteLength); } /** * Converts `data` to a `Buffer`. * * @param {*} data The data to convert * @return {Buffer} The buffer * @throws {TypeError} * @public */ function toBuffer(data) { toBuffer.readOnly = true; if (Buffer.isBuffer(data)) return data; var buf; if (data instanceof ArrayBuffer) { buf = Buffer.from(data); } else if (ArrayBuffer.isView(data)) { buf = viewToBuffer(data); } else { buf = Buffer.from(data); toBuffer.readOnly = false; } return buf; } /** * Converts an `ArrayBuffer` view into a buffer. * * @param {(DataView|TypedArray)} view The view to convert * @return {Buffer} Converted view * @private */ function viewToBuffer(view) { const buf = Buffer.from(view.buffer); if (view.byteLength !== view.buffer.byteLength) { return buf.slice(view.byteOffset, view.byteOffset + view.byteLength); } return buf; } try { const bufferUtil = __webpack_require__(71269); const bu = bufferUtil.BufferUtil || bufferUtil; module.exports = { concat, mask(source, mask, output, offset, length) { if (length < 48) _mask(source, mask, output, offset, length); else bu.mask(source, mask, output, offset, length); }, toArrayBuffer, toBuffer, unmask(buffer, mask) { if (buffer.length < 32) _unmask(buffer, mask); else bu.unmask(buffer, mask); } }; } catch (e) /* istanbul ignore next */ { module.exports = { concat, mask: _mask, toArrayBuffer, toBuffer, unmask: _unmask }; } /***/ }), /***/ 15949: /***/ ((module) => { "use strict"; module.exports = { BINARY_TYPES: ['nodebuffer', 'arraybuffer', 'fragments'], GUID: '258EAFA5-E914-47DA-95CA-C5AB0DC85B11', kStatusCode: Symbol('status-code'), kWebSocket: Symbol('websocket'), EMPTY_BUFFER: Buffer.alloc(0), NOOP: () => {} }; /***/ }), /***/ 64561: /***/ ((module) => { "use strict"; /** * Class representing an event. * * @private */ class Event { /** * Create a new `Event`. * * @param {String} type The name of the event * @param {Object} target A reference to the target to which the event was dispatched */ constructor(type, target) { this.target = target; this.type = type; } } /** * Class representing a message event. * * @extends Event * @private */ class MessageEvent extends Event { /** * Create a new `MessageEvent`. * * @param {(String|Buffer|ArrayBuffer|Buffer[])} data The received data * @param {WebSocket} target A reference to the target to which the event was dispatched */ constructor(data, target) { super('message', target); this.data = data; } } /** * Class representing a close event. * * @extends Event * @private */ class CloseEvent extends Event { /** * Create a new `CloseEvent`. * * @param {Number} code The status code explaining why the connection is being closed * @param {String} reason A human-readable string explaining why the connection is closing * @param {WebSocket} target A reference to the target to which the event was dispatched */ constructor(code, reason, target) { super('close', target); this.wasClean = target._closeFrameReceived && target._closeFrameSent; this.reason = reason; this.code = code; } } /** * Class representing an open event. * * @extends Event * @private */ class OpenEvent extends Event { /** * Create a new `OpenEvent`. * * @param {WebSocket} target A reference to the target to which the event was dispatched */ constructor(target) { super('open', target); } } /** * Class representing an error event. * * @extends Event * @private */ class ErrorEvent extends Event { /** * Create a new `ErrorEvent`. * * @param {Object} error The error that generated this event * @param {WebSocket} target A reference to the target to which the event was dispatched */ constructor(error, target) { super('error', target); this.message = error.message; this.error = error; } } /** * This provides methods for emulating the `EventTarget` interface. It's not * meant to be used directly. * * @mixin */ const EventTarget = { /** * Register an event listener. * * @param {String} method A string representing the event type to listen for * @param {Function} listener The listener to add * @public */ addEventListener(method, listener) { if (typeof listener !== 'function') return; function onMessage(data) { listener.call(this, new MessageEvent(data, this)); } function onClose(code, message) { listener.call(this, new CloseEvent(code, message, this)); } function onError(error) { listener.call(this, new ErrorEvent(error, this)); } function onOpen() { listener.call(this, new OpenEvent(this)); } if (method === 'message') { onMessage._listener = listener; this.on(method, onMessage); } else if (method === 'close') { onClose._listener = listener; this.on(method, onClose); } else if (method === 'error') { onError._listener = listener; this.on(method, onError); } else if (method === 'open') { onOpen._listener = listener; this.on(method, onOpen); } else { this.on(method, listener); } }, /** * Remove an event listener. * * @param {String} method A string representing the event type to remove * @param {Function} listener The listener to remove * @public */ removeEventListener(method, listener) { const listeners = this.listeners(method); for (var i = 0; i < listeners.length; i++) { if (listeners[i] === listener || listeners[i]._listener === listener) { this.removeListener(method, listeners[i]); } } } }; module.exports = EventTarget; /***/ }), /***/ 92035: /***/ ((module) => { "use strict"; // // Allowed token characters: // // '!', '#', '$', '%', '&', ''', '*', '+', '-', // '.', 0-9, A-Z, '^', '_', '`', a-z, '|', '~' // // tokenChars[32] === 0 // ' ' // tokenChars[33] === 1 // '!' // tokenChars[34] === 0 // '"' // ... // // prettier-ignore const tokenChars = [ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // 0 - 15 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // 16 - 31 0, 1, 0, 1, 1, 1, 1, 1, 0, 0, 1, 1, 0, 1, 1, 0, // 32 - 47 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, // 48 - 63 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 64 - 79 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 1, 1, // 80 - 95 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 96 - 111 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 0, 1, 0 // 112 - 127 ]; /** * Adds an offer to the map of extension offers or a parameter to the map of * parameters. * * @param {Object} dest The map of extension offers or parameters * @param {String} name The extension or parameter name * @param {(Object|Boolean|String)} elem The extension parameters or the * parameter value * @private */ function push(dest, name, elem) { if (Object.prototype.hasOwnProperty.call(dest, name)) dest[name].push(elem); else dest[name] = [elem]; } /** * Parses the `Sec-WebSocket-Extensions` header into an object. * * @param {String} header The field value of the header * @return {Object} The parsed object * @public */ function parse(header) { const offers = {}; if (header === undefined || header === '') return offers; var params = {}; var mustUnescape = false; var isEscaping = false; var inQuotes = false; var extensionName; var paramName; var start = -1; var end = -1; for (var i = 0; i < header.length; i++) { const code = header.charCodeAt(i); if (extensionName === undefined) { if (end === -1 && tokenChars[code] === 1) { if (start === -1) start = i; } else if (code === 0x20 /* ' ' */ || code === 0x09 /* '\t' */) { if (end === -1 && start !== -1) end = i; } else if (code === 0x3b /* ';' */ || code === 0x2c /* ',' */) { if (start === -1) { throw new SyntaxError(`Unexpected character at index ${i}`); } if (end === -1) end = i; const name = header.slice(start, end); if (code === 0x2c) { push(offers, name, params); params = {}; } else { extensionName = name; } start = end = -1; } else { throw new SyntaxError(`Unexpected character at index ${i}`); } } else if (paramName === undefined) { if (end === -1 && tokenChars[code] === 1) { if (start === -1) start = i; } else if (code === 0x20 || code === 0x09) { if (end === -1 && start !== -1) end = i; } else if (code === 0x3b || code === 0x2c) { if (start === -1) { throw new SyntaxError(`Unexpected character at index ${i}`); } if (end === -1) end = i; push(params, header.slice(start, end), true); if (code === 0x2c) { push(offers, extensionName, params); params = {}; extensionName = undefined; } start = end = -1; } else if (code === 0x3d /* '=' */ && start !== -1 && end === -1) { paramName = header.slice(start, i); start = end = -1; } else { throw new SyntaxError(`Unexpected character at index ${i}`); } } else { // // The value of a quoted-string after unescaping must conform to the // token ABNF, so only token characters are valid. // Ref: https://tools.ietf.org/html/rfc6455#section-9.1 // if (isEscaping) { if (tokenChars[code] !== 1) { throw new SyntaxError(`Unexpected character at index ${i}`); } if (start === -1) start = i; else if (!mustUnescape) mustUnescape = true; isEscaping = false; } else if (inQuotes) { if (tokenChars[code] === 1) { if (start === -1) start = i; } else if (code === 0x22 /* '"' */ && start !== -1) { inQuotes = false; end = i; } else if (code === 0x5c /* '\' */) { isEscaping = true; } else { throw new SyntaxError(`Unexpected character at index ${i}`); } } else if (code === 0x22 && header.charCodeAt(i - 1) === 0x3d) { inQuotes = true; } else if (end === -1 && tokenChars[code] === 1) { if (start === -1) start = i; } else if (start !== -1 && (code === 0x20 || code === 0x09)) { if (end === -1) end = i; } else if (code === 0x3b || code === 0x2c) { if (start === -1) { throw new SyntaxError(`Unexpected character at index ${i}`); } if (end === -1) end = i; var value = header.slice(start, end); if (mustUnescape) { value = value.replace(/\\/g, ''); mustUnescape = false; } push(params, paramName, value); if (code === 0x2c) { push(offers, extensionName, params); params = {}; extensionName = undefined; } paramName = undefined; start = end = -1; } else { throw new SyntaxError(`Unexpected character at index ${i}`); } } } if (start === -1 || inQuotes) { throw new SyntaxError('Unexpected end of input'); } if (end === -1) end = i; const token = header.slice(start, end); if (extensionName === undefined) { push(offers, token, {}); } else { if (paramName === undefined) { push(params, token, true); } else if (mustUnescape) { push(params, paramName, token.replace(/\\/g, '')); } else { push(params, paramName, token); } push(offers, extensionName, params); } return offers; } /** * Builds the `Sec-WebSocket-Extensions` header field value. * * @param {Object} extensions The map of extensions and parameters to format * @return {String} A string representing the given object * @public */ function format(extensions) { return Object.keys(extensions) .map((extension) => { var configurations = extensions[extension]; if (!Array.isArray(configurations)) configurations = [configurations]; return configurations .map((params) => { return [extension] .concat( Object.keys(params).map((k) => { var values = params[k]; if (!Array.isArray(values)) values = [values]; return values .map((v) => (v === true ? k : `${k}=${v}`)) .join('; '); }) ) .join('; '); }) .join(', '); }) .join(', '); } module.exports = { format, parse }; /***/ }), /***/ 56684: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; const Limiter = __webpack_require__(56964); const zlib = __webpack_require__(78761); const bufferUtil = __webpack_require__(9436); const { kStatusCode, NOOP } = __webpack_require__(15949); const TRAILER = Buffer.from([0x00, 0x00, 0xff, 0xff]); const EMPTY_BLOCK = Buffer.from([0x00]); const kPerMessageDeflate = Symbol('permessage-deflate'); const kTotalLength = Symbol('total-length'); const kCallback = Symbol('callback'); const kBuffers = Symbol('buffers'); const kError = Symbol('error'); // // We limit zlib concurrency, which prevents severe memory fragmentation // as documented in https://github.com/nodejs/node/issues/8871#issuecomment-250915913 // and https://github.com/websockets/ws/issues/1202 // // Intentionally global; it's the global thread pool that's an issue. // let zlibLimiter; /** * permessage-deflate implementation. */ class PerMessageDeflate { /** * Creates a PerMessageDeflate instance. * * @param {Object} options Configuration options * @param {Boolean} options.serverNoContextTakeover Request/accept disabling * of server context takeover * @param {Boolean} options.clientNoContextTakeover Advertise/acknowledge * disabling of client context takeover * @param {(Boolean|Number)} options.serverMaxWindowBits Request/confirm the * use of a custom server window size * @param {(Boolean|Number)} options.clientMaxWindowBits Advertise support * for, or request, a custom client window size * @param {Object} options.zlibDeflateOptions Options to pass to zlib on deflate * @param {Object} options.zlibInflateOptions Options to pass to zlib on inflate * @param {Number} options.threshold Size (in bytes) below which messages * should not be compressed * @param {Number} options.concurrencyLimit The number of concurrent calls to * zlib * @param {Boolean} isServer Create the instance in either server or client * mode * @param {Number} maxPayload The maximum allowed message length */ constructor(options, isServer, maxPayload) { this._maxPayload = maxPayload | 0; this._options = options || {}; this._threshold = this._options.threshold !== undefined ? this._options.threshold : 1024; this._isServer = !!isServer; this._deflate = null; this._inflate = null; this.params = null; if (!zlibLimiter) { const concurrency = this._options.concurrencyLimit !== undefined ? this._options.concurrencyLimit : 10; zlibLimiter = new Limiter({ concurrency }); } } /** * @type {String} */ static get extensionName() { return 'permessage-deflate'; } /** * Create an extension negotiation offer. * * @return {Object} Extension parameters * @public */ offer() { const params = {}; if (this._options.serverNoContextTakeover) { params.server_no_context_takeover = true; } if (this._options.clientNoContextTakeover) { params.client_no_context_takeover = true; } if (this._options.serverMaxWindowBits) { params.server_max_window_bits = this._options.serverMaxWindowBits; } if (this._options.clientMaxWindowBits) { params.client_max_window_bits = this._options.clientMaxWindowBits; } else if (this._options.clientMaxWindowBits == null) { params.client_max_window_bits = true; } return params; } /** * Accept an extension negotiation offer/response. * * @param {Array} configurations The extension negotiation offers/reponse * @return {Object} Accepted configuration * @public */ accept(configurations) { configurations = this.normalizeParams(configurations); this.params = this._isServer ? this.acceptAsServer(configurations) : this.acceptAsClient(configurations); return this.params; } /** * Releases all resources used by the extension. * * @public */ cleanup() { if (this._inflate) { this._inflate.close(); this._inflate = null; } if (this._deflate) { this._deflate.close(); this._deflate = null; } } /** * Accept an extension negotiation offer. * * @param {Array} offers The extension negotiation offers * @return {Object} Accepted configuration * @private */ acceptAsServer(offers) { const opts = this._options; const accepted = offers.find((params) => { if ( (opts.serverNoContextTakeover === false && params.server_no_context_takeover) || (params.server_max_window_bits && (opts.serverMaxWindowBits === false || (typeof opts.serverMaxWindowBits === 'number' && opts.serverMaxWindowBits > params.server_max_window_bits))) || (typeof opts.clientMaxWindowBits === 'number' && !params.client_max_window_bits) ) { return false; } return true; }); if (!accepted) { throw new Error('None of the extension offers can be accepted'); } if (opts.serverNoContextTakeover) { accepted.server_no_context_takeover = true; } if (opts.clientNoContextTakeover) { accepted.client_no_context_takeover = true; } if (typeof opts.serverMaxWindowBits === 'number') { accepted.server_max_window_bits = opts.serverMaxWindowBits; } if (typeof opts.clientMaxWindowBits === 'number') { accepted.client_max_window_bits = opts.clientMaxWindowBits; } else if ( accepted.client_max_window_bits === true || opts.clientMaxWindowBits === false ) { delete accepted.client_max_window_bits; } return accepted; } /** * Accept the extension negotiation response. * * @param {Array} response The extension negotiation response * @return {Object} Accepted configuration * @private */ acceptAsClient(response) { const params = response[0]; if ( this._options.clientNoContextTakeover === false && params.client_no_context_takeover ) { throw new Error('Unexpected parameter "client_no_context_takeover"'); } if (!params.client_max_window_bits) { if (typeof this._options.clientMaxWindowBits === 'number') { params.client_max_window_bits = this._options.clientMaxWindowBits; } } else if ( this._options.clientMaxWindowBits === false || (typeof this._options.clientMaxWindowBits === 'number' && params.client_max_window_bits > this._options.clientMaxWindowBits) ) { throw new Error( 'Unexpected or invalid parameter "client_max_window_bits"' ); } return params; } /** * Normalize parameters. * * @param {Array} configurations The extension negotiation offers/reponse * @return {Array} The offers/response with normalized parameters * @private */ normalizeParams(configurations) { configurations.forEach((params) => { Object.keys(params).forEach((key) => { var value = params[key]; if (value.length > 1) { throw new Error(`Parameter "${key}" must have only a single value`); } value = value[0]; if (key === 'client_max_window_bits') { if (value !== true) { const num = +value; if (!Number.isInteger(num) || num < 8 || num > 15) { throw new TypeError( `Invalid value for parameter "${key}": ${value}` ); } value = num; } else if (!this._isServer) { throw new TypeError( `Invalid value for parameter "${key}": ${value}` ); } } else if (key === 'server_max_window_bits') { const num = +value; if (!Number.isInteger(num) || num < 8 || num > 15) { throw new TypeError( `Invalid value for parameter "${key}": ${value}` ); } value = num; } else if ( key === 'client_no_context_takeover' || key === 'server_no_context_takeover' ) { if (value !== true) { throw new TypeError( `Invalid value for parameter "${key}": ${value}` ); } } else { throw new Error(`Unknown parameter "${key}"`); } params[key] = value; }); }); return configurations; } /** * Decompress data. Concurrency limited by async-limiter. * * @param {Buffer} data Compressed data * @param {Boolean} fin Specifies whether or not this is the last fragment * @param {Function} callback Callback * @public */ decompress(data, fin, callback) { zlibLimiter.push((done) => { this._decompress(data, fin, (err, result) => { done(); callback(err, result); }); }); } /** * Compress data. Concurrency limited by async-limiter. * * @param {Buffer} data Data to compress * @param {Boolean} fin Specifies whether or not this is the last fragment * @param {Function} callback Callback * @public */ compress(data, fin, callback) { zlibLimiter.push((done) => { this._compress(data, fin, (err, result) => { done(); callback(err, result); }); }); } /** * Decompress data. * * @param {Buffer} data Compressed data * @param {Boolean} fin Specifies whether or not this is the last fragment * @param {Function} callback Callback * @private */ _decompress(data, fin, callback) { const endpoint = this._isServer ? 'client' : 'server'; if (!this._inflate) { const key = `${endpoint}_max_window_bits`; const windowBits = typeof this.params[key] !== 'number' ? zlib.Z_DEFAULT_WINDOWBITS : this.params[key]; this._inflate = zlib.createInflateRaw( Object.assign({}, this._options.zlibInflateOptions, { windowBits }) ); this._inflate[kPerMessageDeflate] = this; this._inflate[kTotalLength] = 0; this._inflate[kBuffers] = []; this._inflate.on('error', inflateOnError); this._inflate.on('data', inflateOnData); } this._inflate[kCallback] = callback; this._inflate.write(data); if (fin) this._inflate.write(TRAILER); this._inflate.flush(() => { const err = this._inflate[kError]; if (err) { this._inflate.close(); this._inflate = null; callback(err); return; } const data = bufferUtil.concat( this._inflate[kBuffers], this._inflate[kTotalLength] ); if (fin && this.params[`${endpoint}_no_context_takeover`]) { this._inflate.close(); this._inflate = null; } else { this._inflate[kTotalLength] = 0; this._inflate[kBuffers] = []; } callback(null, data); }); } /** * Compress data. * * @param {Buffer} data Data to compress * @param {Boolean} fin Specifies whether or not this is the last fragment * @param {Function} callback Callback * @private */ _compress(data, fin, callback) { if (!data || data.length === 0) { process.nextTick(callback, null, EMPTY_BLOCK); return; } const endpoint = this._isServer ? 'server' : 'client'; if (!this._deflate) { const key = `${endpoint}_max_window_bits`; const windowBits = typeof this.params[key] !== 'number' ? zlib.Z_DEFAULT_WINDOWBITS : this.params[key]; this._deflate = zlib.createDeflateRaw( Object.assign({}, this._options.zlibDeflateOptions, { windowBits }) ); this._deflate[kTotalLength] = 0; this._deflate[kBuffers] = []; // // An `'error'` event is emitted, only on Node.js < 10.0.0, if the // `zlib.DeflateRaw` instance is closed while data is being processed. // This can happen if `PerMessageDeflate#cleanup()` is called at the wrong // time due to an abnormal WebSocket closure. // this._deflate.on('error', NOOP); this._deflate.on('data', deflateOnData); } this._deflate.write(data); this._deflate.flush(zlib.Z_SYNC_FLUSH, () => { if (!this._deflate) { // // This `if` statement is only needed for Node.js < 10.0.0 because as of // commit https://github.com/nodejs/node/commit/5e3f5164, the flush // callback is no longer called if the deflate stream is closed while // data is being processed. // return; } var data = bufferUtil.concat( this._deflate[kBuffers], this._deflate[kTotalLength] ); if (fin) data = data.slice(0, data.length - 4); if (fin && this.params[`${endpoint}_no_context_takeover`]) { this._deflate.close(); this._deflate = null; } else { this._deflate[kTotalLength] = 0; this._deflate[kBuffers] = []; } callback(null, data); }); } } module.exports = PerMessageDeflate; /** * The listener of the `zlib.DeflateRaw` stream `'data'` event. * * @param {Buffer} chunk A chunk of data * @private */ function deflateOnData(chunk) { this[kBuffers].push(chunk); this[kTotalLength] += chunk.length; } /** * The listener of the `zlib.InflateRaw` stream `'data'` event. * * @param {Buffer} chunk A chunk of data * @private */ function inflateOnData(chunk) { this[kTotalLength] += chunk.length; if ( this[kPerMessageDeflate]._maxPayload < 1 || this[kTotalLength] <= this[kPerMessageDeflate]._maxPayload ) { this[kBuffers].push(chunk); return; } this[kError] = new RangeError('Max payload size exceeded'); this[kError][kStatusCode] = 1009; this.removeListener('data', inflateOnData); this.reset(); } /** * The listener of the `zlib.InflateRaw` stream `'error'` event. * * @param {Error} err The emitted error * @private */ function inflateOnError(err) { // // There is no need to call `Zlib#close()` as the handle is automatically // closed when an error is emitted. // this[kPerMessageDeflate]._inflate = null; err[kStatusCode] = 1007; this[kCallback](err); } /***/ }), /***/ 25066: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; const { Writable } = __webpack_require__(92413); const PerMessageDeflate = __webpack_require__(56684); const { BINARY_TYPES, EMPTY_BUFFER, kStatusCode, kWebSocket } = __webpack_require__(15949); const { concat, toArrayBuffer, unmask } = __webpack_require__(9436); const { isValidStatusCode, isValidUTF8 } = __webpack_require__(86279); const GET_INFO = 0; const GET_PAYLOAD_LENGTH_16 = 1; const GET_PAYLOAD_LENGTH_64 = 2; const GET_MASK = 3; const GET_DATA = 4; const INFLATING = 5; /** * HyBi Receiver implementation. * * @extends stream.Writable */ class Receiver extends Writable { /** * Creates a Receiver instance. * * @param {String} binaryType The type for binary data * @param {Object} extensions An object containing the negotiated extensions * @param {Number} maxPayload The maximum allowed message length */ constructor(binaryType, extensions, maxPayload) { super(); this._binaryType = binaryType || BINARY_TYPES[0]; this[kWebSocket] = undefined; this._extensions = extensions || {}; this._maxPayload = maxPayload | 0; this._bufferedBytes = 0; this._buffers = []; this._compressed = false; this._payloadLength = 0; this._mask = undefined; this._fragmented = 0; this._masked = false; this._fin = false; this._opcode = 0; this._totalPayloadLength = 0; this._messageLength = 0; this._fragments = []; this._state = GET_INFO; this._loop = false; } /** * Implements `Writable.prototype._write()`. * * @param {Buffer} chunk The chunk of data to write * @param {String} encoding The character encoding of `chunk` * @param {Function} cb Callback */ _write(chunk, encoding, cb) { if (this._opcode === 0x08 && this._state == GET_INFO) return cb(); this._bufferedBytes += chunk.length; this._buffers.push(chunk); this.startLoop(cb); } /** * Consumes `n` bytes from the buffered data. * * @param {Number} n The number of bytes to consume * @return {Buffer} The consumed bytes * @private */ consume(n) { this._bufferedBytes -= n; if (n === this._buffers[0].length) return this._buffers.shift(); if (n < this._buffers[0].length) { const buf = this._buffers[0]; this._buffers[0] = buf.slice(n); return buf.slice(0, n); } const dst = Buffer.allocUnsafe(n); do { const buf = this._buffers[0]; if (n >= buf.length) { this._buffers.shift().copy(dst, dst.length - n); } else { buf.copy(dst, dst.length - n, 0, n); this._buffers[0] = buf.slice(n); } n -= buf.length; } while (n > 0); return dst; } /** * Starts the parsing loop. * * @param {Function} cb Callback * @private */ startLoop(cb) { var err; this._loop = true; do { switch (this._state) { case GET_INFO: err = this.getInfo(); break; case GET_PAYLOAD_LENGTH_16: err = this.getPayloadLength16(); break; case GET_PAYLOAD_LENGTH_64: err = this.getPayloadLength64(); break; case GET_MASK: this.getMask(); break; case GET_DATA: err = this.getData(cb); break; default: // `INFLATING` this._loop = false; return; } } while (this._loop); cb(err); } /** * Reads the first two bytes of a frame. * * @return {(RangeError|undefined)} A possible error * @private */ getInfo() { if (this._bufferedBytes < 2) { this._loop = false; return; } const buf = this.consume(2); if ((buf[0] & 0x30) !== 0x00) { this._loop = false; return error(RangeError, 'RSV2 and RSV3 must be clear', true, 1002); } const compressed = (buf[0] & 0x40) === 0x40; if (compressed && !this._extensions[PerMessageDeflate.extensionName]) { this._loop = false; return error(RangeError, 'RSV1 must be clear', true, 1002); } this._fin = (buf[0] & 0x80) === 0x80; this._opcode = buf[0] & 0x0f; this._payloadLength = buf[1] & 0x7f; if (this._opcode === 0x00) { if (compressed) { this._loop = false; return error(RangeError, 'RSV1 must be clear', true, 1002); } if (!this._fragmented) { this._loop = false; return error(RangeError, 'invalid opcode 0', true, 1002); } this._opcode = this._fragmented; } else if (this._opcode === 0x01 || this._opcode === 0x02) { if (this._fragmented) { this._loop = false; return error(RangeError, `invalid opcode ${this._opcode}`, true, 1002); } this._compressed = compressed; } else if (this._opcode > 0x07 && this._opcode < 0x0b) { if (!this._fin) { this._loop = false; return error(RangeError, 'FIN must be set', true, 1002); } if (compressed) { this._loop = false; return error(RangeError, 'RSV1 must be clear', true, 1002); } if (this._payloadLength > 0x7d) { this._loop = false; return error( RangeError, `invalid payload length ${this._payloadLength}`, true, 1002 ); } } else { this._loop = false; return error(RangeError, `invalid opcode ${this._opcode}`, true, 1002); } if (!this._fin && !this._fragmented) this._fragmented = this._opcode; this._masked = (buf[1] & 0x80) === 0x80; if (this._payloadLength === 126) this._state = GET_PAYLOAD_LENGTH_16; else if (this._payloadLength === 127) this._state = GET_PAYLOAD_LENGTH_64; else return this.haveLength(); } /** * Gets extended payload length (7+16). * * @return {(RangeError|undefined)} A possible error * @private */ getPayloadLength16() { if (this._bufferedBytes < 2) { this._loop = false; return; } this._payloadLength = this.consume(2).readUInt16BE(0); return this.haveLength(); } /** * Gets extended payload length (7+64). * * @return {(RangeError|undefined)} A possible error * @private */ getPayloadLength64() { if (this._bufferedBytes < 8) { this._loop = false; return; } const buf = this.consume(8); const num = buf.readUInt32BE(0); // // The maximum safe integer in JavaScript is 2^53 - 1. An error is returned // if payload length is greater than this number. // if (num > Math.pow(2, 53 - 32) - 1) { this._loop = false; return error( RangeError, 'Unsupported WebSocket frame: payload length > 2^53 - 1', false, 1009 ); } this._payloadLength = num * Math.pow(2, 32) + buf.readUInt32BE(4); return this.haveLength(); } /** * Payload length has been read. * * @return {(RangeError|undefined)} A possible error * @private */ haveLength() { if (this._payloadLength && this._opcode < 0x08) { this._totalPayloadLength += this._payloadLength; if (this._totalPayloadLength > this._maxPayload && this._maxPayload > 0) { this._loop = false; return error(RangeError, 'Max payload size exceeded', false, 1009); } } if (this._masked) this._state = GET_MASK; else this._state = GET_DATA; } /** * Reads mask bytes. * * @private */ getMask() { if (this._bufferedBytes < 4) { this._loop = false; return; } this._mask = this.consume(4); this._state = GET_DATA; } /** * Reads data bytes. * * @param {Function} cb Callback * @return {(Error|RangeError|undefined)} A possible error * @private */ getData(cb) { var data = EMPTY_BUFFER; if (this._payloadLength) { if (this._bufferedBytes < this._payloadLength) { this._loop = false; return; } data = this.consume(this._payloadLength); if (this._masked) unmask(data, this._mask); } if (this._opcode > 0x07) return this.controlMessage(data); if (this._compressed) { this._state = INFLATING; this.decompress(data, cb); return; } if (data.length) { // // This message is not compressed so its lenght is the sum of the payload // length of all fragments. // this._messageLength = this._totalPayloadLength; this._fragments.push(data); } return this.dataMessage(); } /** * Decompresses data. * * @param {Buffer} data Compressed data * @param {Function} cb Callback * @private */ decompress(data, cb) { const perMessageDeflate = this._extensions[PerMessageDeflate.extensionName]; perMessageDeflate.decompress(data, this._fin, (err, buf) => { if (err) return cb(err); if (buf.length) { this._messageLength += buf.length; if (this._messageLength > this._maxPayload && this._maxPayload > 0) { return cb( error(RangeError, 'Max payload size exceeded', false, 1009) ); } this._fragments.push(buf); } const er = this.dataMessage(); if (er) return cb(er); this.startLoop(cb); }); } /** * Handles a data message. * * @return {(Error|undefined)} A possible error * @private */ dataMessage() { if (this._fin) { const messageLength = this._messageLength; const fragments = this._fragments; this._totalPayloadLength = 0; this._messageLength = 0; this._fragmented = 0; this._fragments = []; if (this._opcode === 2) { var data; if (this._binaryType === 'nodebuffer') { data = concat(fragments, messageLength); } else if (this._binaryType === 'arraybuffer') { data = toArrayBuffer(concat(fragments, messageLength)); } else { data = fragments; } this.emit('message', data); } else { const buf = concat(fragments, messageLength); if (!isValidUTF8(buf)) { this._loop = false; return error(Error, 'invalid UTF-8 sequence', true, 1007); } this.emit('message', buf.toString()); } } this._state = GET_INFO; } /** * Handles a control message. * * @param {Buffer} data Data to handle * @return {(Error|RangeError|undefined)} A possible error * @private */ controlMessage(data) { if (this._opcode === 0x08) { this._loop = false; if (data.length === 0) { this.emit('conclude', 1005, ''); this.end(); } else if (data.length === 1) { return error(RangeError, 'invalid payload length 1', true, 1002); } else { const code = data.readUInt16BE(0); if (!isValidStatusCode(code)) { return error(RangeError, `invalid status code ${code}`, true, 1002); } const buf = data.slice(2); if (!isValidUTF8(buf)) { return error(Error, 'invalid UTF-8 sequence', true, 1007); } this.emit('conclude', code, buf.toString()); this.end(); } } else if (this._opcode === 0x09) { this.emit('ping', data); } else { this.emit('pong', data); } this._state = GET_INFO; } } module.exports = Receiver; /** * Builds an error object. * * @param {(Error|RangeError)} ErrorCtor The error constructor * @param {String} message The error message * @param {Boolean} prefix Specifies whether or not to add a default prefix to * `message` * @param {Number} statusCode The status code * @return {(Error|RangeError)} The error * @private */ function error(ErrorCtor, message, prefix, statusCode) { const err = new ErrorCtor( prefix ? `Invalid WebSocket frame: ${message}` : message ); Error.captureStackTrace(err, error); err[kStatusCode] = statusCode; return err; } /***/ }), /***/ 36947: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; const { randomBytes } = __webpack_require__(33373); const PerMessageDeflate = __webpack_require__(56684); const { EMPTY_BUFFER } = __webpack_require__(15949); const { isValidStatusCode } = __webpack_require__(86279); const { mask: applyMask, toBuffer } = __webpack_require__(9436); /** * HyBi Sender implementation. */ class Sender { /** * Creates a Sender instance. * * @param {net.Socket} socket The connection socket * @param {Object} extensions An object containing the negotiated extensions */ constructor(socket, extensions) { this._extensions = extensions || {}; this._socket = socket; this._firstFragment = true; this._compress = false; this._bufferedBytes = 0; this._deflating = false; this._queue = []; } /** * Frames a piece of data according to the HyBi WebSocket protocol. * * @param {Buffer} data The data to frame * @param {Object} options Options object * @param {Number} options.opcode The opcode * @param {Boolean} options.readOnly Specifies whether `data` can be modified * @param {Boolean} options.fin Specifies whether or not to set the FIN bit * @param {Boolean} options.mask Specifies whether or not to mask `data` * @param {Boolean} options.rsv1 Specifies whether or not to set the RSV1 bit * @return {Buffer[]} The framed data as a list of `Buffer` instances * @public */ static frame(data, options) { const merge = options.mask && options.readOnly; var offset = options.mask ? 6 : 2; var payloadLength = data.length; if (data.length >= 65536) { offset += 8; payloadLength = 127; } else if (data.length > 125) { offset += 2; payloadLength = 126; } const target = Buffer.allocUnsafe(merge ? data.length + offset : offset); target[0] = options.fin ? options.opcode | 0x80 : options.opcode; if (options.rsv1) target[0] |= 0x40; target[1] = payloadLength; if (payloadLength === 126) { target.writeUInt16BE(data.length, 2); } else if (payloadLength === 127) { target.writeUInt32BE(0, 2); target.writeUInt32BE(data.length, 6); } if (!options.mask) return [target, data]; const mask = randomBytes(4); target[1] |= 0x80; target[offset - 4] = mask[0]; target[offset - 3] = mask[1]; target[offset - 2] = mask[2]; target[offset - 1] = mask[3]; if (merge) { applyMask(data, mask, target, offset, data.length); return [target]; } applyMask(data, mask, data, 0, data.length); return [target, data]; } /** * Sends a close message to the other peer. * * @param {(Number|undefined)} code The status code component of the body * @param {String} data The message component of the body * @param {Boolean} mask Specifies whether or not to mask the message * @param {Function} cb Callback * @public */ close(code, data, mask, cb) { var buf; if (code === undefined) { buf = EMPTY_BUFFER; } else if (typeof code !== 'number' || !isValidStatusCode(code)) { throw new TypeError('First argument must be a valid error code number'); } else if (data === undefined || data === '') { buf = Buffer.allocUnsafe(2); buf.writeUInt16BE(code, 0); } else { buf = Buffer.allocUnsafe(2 + Buffer.byteLength(data)); buf.writeUInt16BE(code, 0); buf.write(data, 2); } if (this._deflating) { this.enqueue([this.doClose, buf, mask, cb]); } else { this.doClose(buf, mask, cb); } } /** * Frames and sends a close message. * * @param {Buffer} data The message to send * @param {Boolean} mask Specifies whether or not to mask `data` * @param {Function} cb Callback * @private */ doClose(data, mask, cb) { this.sendFrame( Sender.frame(data, { fin: true, rsv1: false, opcode: 0x08, mask, readOnly: false }), cb ); } /** * Sends a ping message to the other peer. * * @param {*} data The message to send * @param {Boolean} mask Specifies whether or not to mask `data` * @param {Function} cb Callback * @public */ ping(data, mask, cb) { const buf = toBuffer(data); if (this._deflating) { this.enqueue([this.doPing, buf, mask, toBuffer.readOnly, cb]); } else { this.doPing(buf, mask, toBuffer.readOnly, cb); } } /** * Frames and sends a ping message. * * @param {*} data The message to send * @param {Boolean} mask Specifies whether or not to mask `data` * @param {Boolean} readOnly Specifies whether `data` can be modified * @param {Function} cb Callback * @private */ doPing(data, mask, readOnly, cb) { this.sendFrame( Sender.frame(data, { fin: true, rsv1: false, opcode: 0x09, mask, readOnly }), cb ); } /** * Sends a pong message to the other peer. * * @param {*} data The message to send * @param {Boolean} mask Specifies whether or not to mask `data` * @param {Function} cb Callback * @public */ pong(data, mask, cb) { const buf = toBuffer(data); if (this._deflating) { this.enqueue([this.doPong, buf, mask, toBuffer.readOnly, cb]); } else { this.doPong(buf, mask, toBuffer.readOnly, cb); } } /** * Frames and sends a pong message. * * @param {*} data The message to send * @param {Boolean} mask Specifies whether or not to mask `data` * @param {Boolean} readOnly Specifies whether `data` can be modified * @param {Function} cb Callback * @private */ doPong(data, mask, readOnly, cb) { this.sendFrame( Sender.frame(data, { fin: true, rsv1: false, opcode: 0x0a, mask, readOnly }), cb ); } /** * Sends a data message to the other peer. * * @param {*} data The message to send * @param {Object} options Options object * @param {Boolean} options.compress Specifies whether or not to compress `data` * @param {Boolean} options.binary Specifies whether `data` is binary or text * @param {Boolean} options.fin Specifies whether the fragment is the last one * @param {Boolean} options.mask Specifies whether or not to mask `data` * @param {Function} cb Callback * @public */ send(data, options, cb) { const buf = toBuffer(data); const perMessageDeflate = this._extensions[PerMessageDeflate.extensionName]; var opcode = options.binary ? 2 : 1; var rsv1 = options.compress; if (this._firstFragment) { this._firstFragment = false; if (rsv1 && perMessageDeflate) { rsv1 = buf.length >= perMessageDeflate._threshold; } this._compress = rsv1; } else { rsv1 = false; opcode = 0; } if (options.fin) this._firstFragment = true; if (perMessageDeflate) { const opts = { fin: options.fin, rsv1, opcode, mask: options.mask, readOnly: toBuffer.readOnly }; if (this._deflating) { this.enqueue([this.dispatch, buf, this._compress, opts, cb]); } else { this.dispatch(buf, this._compress, opts, cb); } } else { this.sendFrame( Sender.frame(buf, { fin: options.fin, rsv1: false, opcode, mask: options.mask, readOnly: toBuffer.readOnly }), cb ); } } /** * Dispatches a data message. * * @param {Buffer} data The message to send * @param {Boolean} compress Specifies whether or not to compress `data` * @param {Object} options Options object * @param {Number} options.opcode The opcode * @param {Boolean} options.readOnly Specifies whether `data` can be modified * @param {Boolean} options.fin Specifies whether or not to set the FIN bit * @param {Boolean} options.mask Specifies whether or not to mask `data` * @param {Boolean} options.rsv1 Specifies whether or not to set the RSV1 bit * @param {Function} cb Callback * @private */ dispatch(data, compress, options, cb) { if (!compress) { this.sendFrame(Sender.frame(data, options), cb); return; } const perMessageDeflate = this._extensions[PerMessageDeflate.extensionName]; this._deflating = true; perMessageDeflate.compress(data, options.fin, (_, buf) => { this._deflating = false; options.readOnly = false; this.sendFrame(Sender.frame(buf, options), cb); this.dequeue(); }); } /** * Executes queued send operations. * * @private */ dequeue() { while (!this._deflating && this._queue.length) { const params = this._queue.shift(); this._bufferedBytes -= params[1].length; params[0].apply(this, params.slice(1)); } } /** * Enqueues a send operation. * * @param {Array} params Send operation parameters. * @private */ enqueue(params) { this._bufferedBytes += params[1].length; this._queue.push(params); } /** * Sends a frame. * * @param {Buffer[]} list The frame to send * @param {Function} cb Callback * @private */ sendFrame(list, cb) { if (list.length === 2) { this._socket.cork(); this._socket.write(list[0]); this._socket.write(list[1], cb); this._socket.uncork(); } else { this._socket.write(list[0], cb); } } } module.exports = Sender; /***/ }), /***/ 86279: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; try { const isValidUTF8 = __webpack_require__(24592); exports.isValidUTF8 = typeof isValidUTF8 === 'object' ? isValidUTF8.Validation.isValidUTF8 // utf-8-validate@<3.0.0 : isValidUTF8; } catch (e) /* istanbul ignore next */ { exports.isValidUTF8 = () => true; } /** * Checks if a status code is allowed in a close frame. * * @param {Number} code The status code * @return {Boolean} `true` if the status code is valid, else `false` * @public */ exports.isValidStatusCode = (code) => { return ( (code >= 1000 && code <= 1013 && code !== 1004 && code !== 1005 && code !== 1006) || (code >= 3000 && code <= 4999) ); }; /***/ }), /***/ 58887: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; const EventEmitter = __webpack_require__(28614); const crypto = __webpack_require__(33373); const http = __webpack_require__(98605); const PerMessageDeflate = __webpack_require__(56684); const extension = __webpack_require__(92035); const WebSocket = __webpack_require__(91518); const { GUID } = __webpack_require__(15949); const keyRegex = /^[+/0-9A-Za-z]{22}==$/; /** * Class representing a WebSocket server. * * @extends EventEmitter */ class WebSocketServer extends EventEmitter { /** * Create a `WebSocketServer` instance. * * @param {Object} options Configuration options * @param {Number} options.backlog The maximum length of the queue of pending * connections * @param {Boolean} options.clientTracking Specifies whether or not to track * clients * @param {Function} options.handleProtocols An hook to handle protocols * @param {String} options.host The hostname where to bind the server * @param {Number} options.maxPayload The maximum allowed message size * @param {Boolean} options.noServer Enable no server mode * @param {String} options.path Accept only connections matching this path * @param {(Boolean|Object)} options.perMessageDeflate Enable/disable * permessage-deflate * @param {Number} options.port The port where to bind the server * @param {http.Server} options.server A pre-created HTTP/S server to use * @param {Function} options.verifyClient An hook to reject connections * @param {Function} callback A listener for the `listening` event */ constructor(options, callback) { super(); options = Object.assign( { maxPayload: 100 * 1024 * 1024, perMessageDeflate: false, handleProtocols: null, clientTracking: true, verifyClient: null, noServer: false, backlog: null, // use default (511 as implemented in net.js) server: null, host: null, path: null, port: null }, options ); if (options.port == null && !options.server && !options.noServer) { throw new TypeError( 'One of the "port", "server", or "noServer" options must be specified' ); } if (options.port != null) { this._server = http.createServer((req, res) => { const body = http.STATUS_CODES[426]; res.writeHead(426, { 'Content-Length': body.length, 'Content-Type': 'text/plain' }); res.end(body); }); this._server.listen( options.port, options.host, options.backlog, callback ); } else if (options.server) { this._server = options.server; } if (this._server) { this._removeListeners = addListeners(this._server, { listening: this.emit.bind(this, 'listening'), error: this.emit.bind(this, 'error'), upgrade: (req, socket, head) => { this.handleUpgrade(req, socket, head, (ws) => { this.emit('connection', ws, req); }); } }); } if (options.perMessageDeflate === true) options.perMessageDeflate = {}; if (options.clientTracking) this.clients = new Set(); this.options = options; } /** * Returns the bound address, the address family name, and port of the server * as reported by the operating system if listening on an IP socket. * If the server is listening on a pipe or UNIX domain socket, the name is * returned as a string. * * @return {(Object|String|null)} The address of the server * @public */ address() { if (this.options.noServer) { throw new Error('The server is operating in "noServer" mode'); } if (!this._server) return null; return this._server.address(); } /** * Close the server. * * @param {Function} cb Callback * @public */ close(cb) { if (cb) this.once('close', cb); // // Terminate all associated clients. // if (this.clients) { for (const client of this.clients) client.terminate(); } const server = this._server; if (server) { this._removeListeners(); this._removeListeners = this._server = null; // // Close the http server if it was internally created. // if (this.options.port != null) { server.close(() => this.emit('close')); return; } } process.nextTick(emitClose, this); } /** * See if a given request should be handled by this server instance. * * @param {http.IncomingMessage} req Request object to inspect * @return {Boolean} `true` if the request is valid, else `false` * @public */ shouldHandle(req) { if (this.options.path) { const index = req.url.indexOf('?'); const pathname = index !== -1 ? req.url.slice(0, index) : req.url; if (pathname !== this.options.path) return false; } return true; } /** * Handle a HTTP Upgrade request. * * @param {http.IncomingMessage} req The request object * @param {net.Socket} socket The network socket between the server and client * @param {Buffer} head The first packet of the upgraded stream * @param {Function} cb Callback * @public */ handleUpgrade(req, socket, head, cb) { socket.on('error', socketOnError); const key = req.headers['sec-websocket-key'] !== undefined ? req.headers['sec-websocket-key'].trim() : false; const version = +req.headers['sec-websocket-version']; const extensions = {}; if ( req.method !== 'GET' || req.headers.upgrade.toLowerCase() !== 'websocket' || !key || !keyRegex.test(key) || (version !== 8 && version !== 13) || !this.shouldHandle(req) ) { return abortHandshake(socket, 400); } if (this.options.perMessageDeflate) { const perMessageDeflate = new PerMessageDeflate( this.options.perMessageDeflate, true, this.options.maxPayload ); try { const offers = extension.parse(req.headers['sec-websocket-extensions']); if (offers[PerMessageDeflate.extensionName]) { perMessageDeflate.accept(offers[PerMessageDeflate.extensionName]); extensions[PerMessageDeflate.extensionName] = perMessageDeflate; } } catch (err) { return abortHandshake(socket, 400); } } // // Optionally call external client verification handler. // if (this.options.verifyClient) { const info = { origin: req.headers[`${version === 8 ? 'sec-websocket-origin' : 'origin'}`], secure: !!(req.connection.authorized || req.connection.encrypted), req }; if (this.options.verifyClient.length === 2) { this.options.verifyClient(info, (verified, code, message, headers) => { if (!verified) { return abortHandshake(socket, code || 401, message, headers); } this.completeUpgrade(key, extensions, req, socket, head, cb); }); return; } if (!this.options.verifyClient(info)) return abortHandshake(socket, 401); } this.completeUpgrade(key, extensions, req, socket, head, cb); } /** * Upgrade the connection to WebSocket. * * @param {String} key The value of the `Sec-WebSocket-Key` header * @param {Object} extensions The accepted extensions * @param {http.IncomingMessage} req The request object * @param {net.Socket} socket The network socket between the server and client * @param {Buffer} head The first packet of the upgraded stream * @param {Function} cb Callback * @private */ completeUpgrade(key, extensions, req, socket, head, cb) { // // Destroy the socket if the client has already sent a FIN packet. // if (!socket.readable || !socket.writable) return socket.destroy(); const digest = crypto .createHash('sha1') .update(key + GUID) .digest('base64'); const headers = [ 'HTTP/1.1 101 Switching Protocols', 'Upgrade: websocket', 'Connection: Upgrade', `Sec-WebSocket-Accept: ${digest}` ]; const ws = new WebSocket(null); var protocol = req.headers['sec-websocket-protocol']; if (protocol) { protocol = protocol.split(',').map(trim); // // Optionally call external protocol selection handler. // if (this.options.handleProtocols) { protocol = this.options.handleProtocols(protocol, req); } else { protocol = protocol[0]; } if (protocol) { headers.push(`Sec-WebSocket-Protocol: ${protocol}`); ws.protocol = protocol; } } if (extensions[PerMessageDeflate.extensionName]) { const params = extensions[PerMessageDeflate.extensionName].params; const value = extension.format({ [PerMessageDeflate.extensionName]: [params] }); headers.push(`Sec-WebSocket-Extensions: ${value}`); ws._extensions = extensions; } // // Allow external modification/inspection of handshake headers. // this.emit('headers', headers, req); socket.write(headers.concat('\r\n').join('\r\n')); socket.removeListener('error', socketOnError); ws.setSocket(socket, head, this.options.maxPayload); if (this.clients) { this.clients.add(ws); ws.on('close', () => this.clients.delete(ws)); } cb(ws); } } module.exports = WebSocketServer; /** * Add event listeners on an `EventEmitter` using a map of * pairs. * * @param {EventEmitter} server The event emitter * @param {Object.} map The listeners to add * @return {Function} A function that will remove the added listeners when called * @private */ function addListeners(server, map) { for (const event of Object.keys(map)) server.on(event, map[event]); return function removeListeners() { for (const event of Object.keys(map)) { server.removeListener(event, map[event]); } }; } /** * Emit a `'close'` event on an `EventEmitter`. * * @param {EventEmitter} server The event emitter * @private */ function emitClose(server) { server.emit('close'); } /** * Handle premature socket errors. * * @private */ function socketOnError() { this.destroy(); } /** * Close the connection when preconditions are not fulfilled. * * @param {net.Socket} socket The socket of the upgrade request * @param {Number} code The HTTP response status code * @param {String} [message] The HTTP response body * @param {Object} [headers] Additional HTTP response headers * @private */ function abortHandshake(socket, code, message, headers) { if (socket.writable) { message = message || http.STATUS_CODES[code]; headers = Object.assign( { Connection: 'close', 'Content-type': 'text/html', 'Content-Length': Buffer.byteLength(message) }, headers ); socket.write( `HTTP/1.1 ${code} ${http.STATUS_CODES[code]}\r\n` + Object.keys(headers) .map((h) => `${h}: ${headers[h]}`) .join('\r\n') + '\r\n\r\n' + message ); } socket.removeListener('error', socketOnError); socket.destroy(); } /** * Remove whitespace characters from both ends of a string. * * @param {String} str The string * @return {String} A new string representing `str` stripped of whitespace * characters from both its beginning and end * @private */ function trim(str) { return str.trim(); } /***/ }), /***/ 91518: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; const EventEmitter = __webpack_require__(28614); const crypto = __webpack_require__(33373); const https = __webpack_require__(57211); const http = __webpack_require__(98605); const net = __webpack_require__(11631); const tls = __webpack_require__(4016); const url = __webpack_require__(78835); const PerMessageDeflate = __webpack_require__(56684); const EventTarget = __webpack_require__(64561); const extension = __webpack_require__(92035); const Receiver = __webpack_require__(25066); const Sender = __webpack_require__(36947); const { BINARY_TYPES, EMPTY_BUFFER, GUID, kStatusCode, kWebSocket, NOOP } = __webpack_require__(15949); const readyStates = ['CONNECTING', 'OPEN', 'CLOSING', 'CLOSED']; const protocolVersions = [8, 13]; const closeTimeout = 30 * 1000; /** * Class representing a WebSocket. * * @extends EventEmitter */ class WebSocket extends EventEmitter { /** * Create a new `WebSocket`. * * @param {(String|url.Url|url.URL)} address The URL to which to connect * @param {(String|String[])} protocols The subprotocols * @param {Object} options Connection options */ constructor(address, protocols, options) { super(); this.readyState = WebSocket.CONNECTING; this.protocol = ''; this._binaryType = BINARY_TYPES[0]; this._closeFrameReceived = false; this._closeFrameSent = false; this._closeMessage = ''; this._closeTimer = null; this._closeCode = 1006; this._extensions = {}; this._receiver = null; this._sender = null; this._socket = null; if (address !== null) { this._isServer = false; this._redirects = 0; if (Array.isArray(protocols)) { protocols = protocols.join(', '); } else if (typeof protocols === 'object' && protocols !== null) { options = protocols; protocols = undefined; } initAsClient(this, address, protocols, options); } else { this._isServer = true; } } get CONNECTING() { return WebSocket.CONNECTING; } get CLOSING() { return WebSocket.CLOSING; } get CLOSED() { return WebSocket.CLOSED; } get OPEN() { return WebSocket.OPEN; } /** * This deviates from the WHATWG interface since ws doesn't support the * required default "blob" type (instead we define a custom "nodebuffer" * type). * * @type {String} */ get binaryType() { return this._binaryType; } set binaryType(type) { if (!BINARY_TYPES.includes(type)) return; this._binaryType = type; // // Allow to change `binaryType` on the fly. // if (this._receiver) this._receiver._binaryType = type; } /** * @type {Number} */ get bufferedAmount() { if (!this._socket) return 0; // // `socket.bufferSize` is `undefined` if the socket is closed. // return (this._socket.bufferSize || 0) + this._sender._bufferedBytes; } /** * @type {String} */ get extensions() { return Object.keys(this._extensions).join(); } /** * Set up the socket and the internal resources. * * @param {net.Socket} socket The network socket between the server and client * @param {Buffer} head The first packet of the upgraded stream * @param {Number} maxPayload The maximum allowed message size * @private */ setSocket(socket, head, maxPayload) { const receiver = new Receiver( this._binaryType, this._extensions, maxPayload ); this._sender = new Sender(socket, this._extensions); this._receiver = receiver; this._socket = socket; receiver[kWebSocket] = this; socket[kWebSocket] = this; receiver.on('conclude', receiverOnConclude); receiver.on('drain', receiverOnDrain); receiver.on('error', receiverOnError); receiver.on('message', receiverOnMessage); receiver.on('ping', receiverOnPing); receiver.on('pong', receiverOnPong); socket.setTimeout(0); socket.setNoDelay(); if (head.length > 0) socket.unshift(head); socket.on('close', socketOnClose); socket.on('data', socketOnData); socket.on('end', socketOnEnd); socket.on('error', socketOnError); this.readyState = WebSocket.OPEN; this.emit('open'); } /** * Emit the `'close'` event. * * @private */ emitClose() { this.readyState = WebSocket.CLOSED; if (!this._socket) { this.emit('close', this._closeCode, this._closeMessage); return; } if (this._extensions[PerMessageDeflate.extensionName]) { this._extensions[PerMessageDeflate.extensionName].cleanup(); } this._receiver.removeAllListeners(); this.emit('close', this._closeCode, this._closeMessage); } /** * Start a closing handshake. * * +----------+ +-----------+ +----------+ * - - -|ws.close()|-->|close frame|-->|ws.close()|- - - * | +----------+ +-----------+ +----------+ | * +----------+ +-----------+ | * CLOSING |ws.close()|<--|close frame|<--+-----+ CLOSING * +----------+ +-----------+ | * | | | +---+ | * +------------------------+-->|fin| - - - - * | +---+ | +---+ * - - - - -|fin|<---------------------+ * +---+ * * @param {Number} code Status code explaining why the connection is closing * @param {String} data A string explaining why the connection is closing * @public */ close(code, data) { if (this.readyState === WebSocket.CLOSED) return; if (this.readyState === WebSocket.CONNECTING) { const msg = 'WebSocket was closed before the connection was established'; return abortHandshake(this, this._req, msg); } if (this.readyState === WebSocket.CLOSING) { if (this._closeFrameSent && this._closeFrameReceived) this._socket.end(); return; } this.readyState = WebSocket.CLOSING; this._sender.close(code, data, !this._isServer, (err) => { // // This error is handled by the `'error'` listener on the socket. We only // want to know if the close frame has been sent here. // if (err) return; this._closeFrameSent = true; if (this._closeFrameReceived) this._socket.end(); }); // // Specify a timeout for the closing handshake to complete. // this._closeTimer = setTimeout( this._socket.destroy.bind(this._socket), closeTimeout ); } /** * Send a ping. * * @param {*} data The data to send * @param {Boolean} mask Indicates whether or not to mask `data` * @param {Function} cb Callback which is executed when the ping is sent * @public */ ping(data, mask, cb) { if (typeof data === 'function') { cb = data; data = mask = undefined; } else if (typeof mask === 'function') { cb = mask; mask = undefined; } if (this.readyState !== WebSocket.OPEN) { const err = new Error( `WebSocket is not open: readyState ${this.readyState} ` + `(${readyStates[this.readyState]})` ); if (cb) return cb(err); throw err; } if (typeof data === 'number') data = data.toString(); if (mask === undefined) mask = !this._isServer; this._sender.ping(data || EMPTY_BUFFER, mask, cb); } /** * Send a pong. * * @param {*} data The data to send * @param {Boolean} mask Indicates whether or not to mask `data` * @param {Function} cb Callback which is executed when the pong is sent * @public */ pong(data, mask, cb) { if (typeof data === 'function') { cb = data; data = mask = undefined; } else if (typeof mask === 'function') { cb = mask; mask = undefined; } if (this.readyState !== WebSocket.OPEN) { const err = new Error( `WebSocket is not open: readyState ${this.readyState} ` + `(${readyStates[this.readyState]})` ); if (cb) return cb(err); throw err; } if (typeof data === 'number') data = data.toString(); if (mask === undefined) mask = !this._isServer; this._sender.pong(data || EMPTY_BUFFER, mask, cb); } /** * Send a data message. * * @param {*} data The message to send * @param {Object} options Options object * @param {Boolean} options.compress Specifies whether or not to compress `data` * @param {Boolean} options.binary Specifies whether `data` is binary or text * @param {Boolean} options.fin Specifies whether the fragment is the last one * @param {Boolean} options.mask Specifies whether or not to mask `data` * @param {Function} cb Callback which is executed when data is written out * @public */ send(data, options, cb) { if (typeof options === 'function') { cb = options; options = {}; } if (this.readyState !== WebSocket.OPEN) { const err = new Error( `WebSocket is not open: readyState ${this.readyState} ` + `(${readyStates[this.readyState]})` ); if (cb) return cb(err); throw err; } if (typeof data === 'number') data = data.toString(); const opts = Object.assign( { binary: typeof data !== 'string', mask: !this._isServer, compress: true, fin: true }, options ); if (!this._extensions[PerMessageDeflate.extensionName]) { opts.compress = false; } this._sender.send(data || EMPTY_BUFFER, opts, cb); } /** * Forcibly close the connection. * * @public */ terminate() { if (this.readyState === WebSocket.CLOSED) return; if (this.readyState === WebSocket.CONNECTING) { const msg = 'WebSocket was closed before the connection was established'; return abortHandshake(this, this._req, msg); } if (this._socket) { this.readyState = WebSocket.CLOSING; this._socket.destroy(); } } } readyStates.forEach((readyState, i) => { WebSocket[readyState] = i; }); // // Add the `onopen`, `onerror`, `onclose`, and `onmessage` attributes. // See https://html.spec.whatwg.org/multipage/comms.html#the-websocket-interface // ['open', 'error', 'close', 'message'].forEach((method) => { Object.defineProperty(WebSocket.prototype, `on${method}`, { /** * Return the listener of the event. * * @return {(Function|undefined)} The event listener or `undefined` * @public */ get() { const listeners = this.listeners(method); for (var i = 0; i < listeners.length; i++) { if (listeners[i]._listener) return listeners[i]._listener; } return undefined; }, /** * Add a listener for the event. * * @param {Function} listener The listener to add * @public */ set(listener) { const listeners = this.listeners(method); for (var i = 0; i < listeners.length; i++) { // // Remove only the listeners added via `addEventListener`. // if (listeners[i]._listener) this.removeListener(method, listeners[i]); } this.addEventListener(method, listener); } }); }); WebSocket.prototype.addEventListener = EventTarget.addEventListener; WebSocket.prototype.removeEventListener = EventTarget.removeEventListener; module.exports = WebSocket; /** * Initialize a WebSocket client. * * @param {WebSocket} websocket The client to initialize * @param {(String|url.Url|url.URL)} address The URL to which to connect * @param {String} protocols The subprotocols * @param {Object} options Connection options * @param {(Boolean|Object)} options.perMessageDeflate Enable/disable * permessage-deflate * @param {Number} options.handshakeTimeout Timeout in milliseconds for the * handshake request * @param {Number} options.protocolVersion Value of the `Sec-WebSocket-Version` * header * @param {String} options.origin Value of the `Origin` or * `Sec-WebSocket-Origin` header * @param {Number} options.maxPayload The maximum allowed message size * @param {Boolean} options.followRedirects Whether or not to follow redirects * @param {Number} options.maxRedirects The maximum number of redirects allowed * @private */ function initAsClient(websocket, address, protocols, options) { const opts = Object.assign( { protocolVersion: protocolVersions[1], maxPayload: 100 * 1024 * 1024, perMessageDeflate: true, followRedirects: false, maxRedirects: 10 }, options, { createConnection: undefined, socketPath: undefined, hostname: undefined, protocol: undefined, timeout: undefined, method: undefined, auth: undefined, host: undefined, path: undefined, port: undefined } ); if (!protocolVersions.includes(opts.protocolVersion)) { throw new RangeError( `Unsupported protocol version: ${opts.protocolVersion} ` + `(supported versions: ${protocolVersions.join(', ')})` ); } var parsedUrl; if (typeof address === 'object' && address.href !== undefined) { parsedUrl = address; websocket.url = address.href; } else { // // The WHATWG URL constructor is not available on Node.js < 6.13.0 // parsedUrl = url.URL ? new url.URL(address) : url.parse(address); websocket.url = address; } const isUnixSocket = parsedUrl.protocol === 'ws+unix:'; if (!parsedUrl.host && (!isUnixSocket || !parsedUrl.pathname)) { throw new Error(`Invalid URL: ${websocket.url}`); } const isSecure = parsedUrl.protocol === 'wss:' || parsedUrl.protocol === 'https:'; const defaultPort = isSecure ? 443 : 80; const key = crypto.randomBytes(16).toString('base64'); const get = isSecure ? https.get : http.get; const path = parsedUrl.search ? `${parsedUrl.pathname || '/'}${parsedUrl.search}` : parsedUrl.pathname || '/'; var perMessageDeflate; opts.createConnection = isSecure ? tlsConnect : netConnect; opts.defaultPort = opts.defaultPort || defaultPort; opts.port = parsedUrl.port || defaultPort; opts.host = parsedUrl.hostname.startsWith('[') ? parsedUrl.hostname.slice(1, -1) : parsedUrl.hostname; opts.headers = Object.assign( { 'Sec-WebSocket-Version': opts.protocolVersion, 'Sec-WebSocket-Key': key, Connection: 'Upgrade', Upgrade: 'websocket' }, opts.headers ); opts.path = path; opts.timeout = opts.handshakeTimeout; if (opts.perMessageDeflate) { perMessageDeflate = new PerMessageDeflate( opts.perMessageDeflate !== true ? opts.perMessageDeflate : {}, false, opts.maxPayload ); opts.headers['Sec-WebSocket-Extensions'] = extension.format({ [PerMessageDeflate.extensionName]: perMessageDeflate.offer() }); } if (protocols) { opts.headers['Sec-WebSocket-Protocol'] = protocols; } if (opts.origin) { if (opts.protocolVersion < 13) { opts.headers['Sec-WebSocket-Origin'] = opts.origin; } else { opts.headers.Origin = opts.origin; } } if (parsedUrl.auth) { opts.auth = parsedUrl.auth; } else if (parsedUrl.username || parsedUrl.password) { opts.auth = `${parsedUrl.username}:${parsedUrl.password}`; } if (isUnixSocket) { const parts = path.split(':'); opts.socketPath = parts[0]; opts.path = parts[1]; } var req = (websocket._req = get(opts)); if (opts.timeout) { req.on('timeout', () => { abortHandshake(websocket, req, 'Opening handshake has timed out'); }); } req.on('error', (err) => { if (websocket._req.aborted) return; req = websocket._req = null; websocket.readyState = WebSocket.CLOSING; websocket.emit('error', err); websocket.emitClose(); }); req.on('response', (res) => { const location = res.headers.location; const statusCode = res.statusCode; if ( location && opts.followRedirects && statusCode >= 300 && statusCode < 400 ) { if (++websocket._redirects > opts.maxRedirects) { abortHandshake(websocket, req, 'Maximum redirects exceeded'); return; } req.abort(); const addr = url.URL ? new url.URL(location, address) : url.resolve(address, location); initAsClient(websocket, addr, protocols, options); } else if (!websocket.emit('unexpected-response', req, res)) { abortHandshake( websocket, req, `Unexpected server response: ${res.statusCode}` ); } }); req.on('upgrade', (res, socket, head) => { websocket.emit('upgrade', res); // // The user may have closed the connection from a listener of the `upgrade` // event. // if (websocket.readyState !== WebSocket.CONNECTING) return; req = websocket._req = null; const digest = crypto .createHash('sha1') .update(key + GUID) .digest('base64'); if (res.headers['sec-websocket-accept'] !== digest) { abortHandshake(websocket, socket, 'Invalid Sec-WebSocket-Accept header'); return; } const serverProt = res.headers['sec-websocket-protocol']; const protList = (protocols || '').split(/, */); var protError; if (!protocols && serverProt) { protError = 'Server sent a subprotocol but none was requested'; } else if (protocols && !serverProt) { protError = 'Server sent no subprotocol'; } else if (serverProt && !protList.includes(serverProt)) { protError = 'Server sent an invalid subprotocol'; } if (protError) { abortHandshake(websocket, socket, protError); return; } if (serverProt) websocket.protocol = serverProt; if (perMessageDeflate) { try { const extensions = extension.parse( res.headers['sec-websocket-extensions'] ); if (extensions[PerMessageDeflate.extensionName]) { perMessageDeflate.accept(extensions[PerMessageDeflate.extensionName]); websocket._extensions[ PerMessageDeflate.extensionName ] = perMessageDeflate; } } catch (err) { abortHandshake( websocket, socket, 'Invalid Sec-WebSocket-Extensions header' ); return; } } websocket.setSocket(socket, head, opts.maxPayload); }); } /** * Create a `net.Socket` and initiate a connection. * * @param {Object} options Connection options * @return {net.Socket} The newly created socket used to start the connection * @private */ function netConnect(options) { // // Override `options.path` only if `options` is a copy of the original options // object. This is always true on Node.js >= 8 but not on Node.js 6 where // `options.socketPath` might be `undefined` even if the `socketPath` option // was originally set. // if (options.protocolVersion) options.path = options.socketPath; return net.connect(options); } /** * Create a `tls.TLSSocket` and initiate a connection. * * @param {Object} options Connection options * @return {tls.TLSSocket} The newly created socket used to start the connection * @private */ function tlsConnect(options) { options.path = undefined; options.servername = options.servername || options.host; return tls.connect(options); } /** * Abort the handshake and emit an error. * * @param {WebSocket} websocket The WebSocket instance * @param {(http.ClientRequest|net.Socket)} stream The request to abort or the * socket to destroy * @param {String} message The error message * @private */ function abortHandshake(websocket, stream, message) { websocket.readyState = WebSocket.CLOSING; const err = new Error(message); Error.captureStackTrace(err, abortHandshake); if (stream.setHeader) { stream.abort(); stream.once('abort', websocket.emitClose.bind(websocket)); websocket.emit('error', err); } else { stream.destroy(err); stream.once('error', websocket.emit.bind(websocket, 'error')); stream.once('close', websocket.emitClose.bind(websocket)); } } /** * The listener of the `Receiver` `'conclude'` event. * * @param {Number} code The status code * @param {String} reason The reason for closing * @private */ function receiverOnConclude(code, reason) { const websocket = this[kWebSocket]; websocket._socket.removeListener('data', socketOnData); websocket._socket.resume(); websocket._closeFrameReceived = true; websocket._closeMessage = reason; websocket._closeCode = code; if (code === 1005) websocket.close(); else websocket.close(code, reason); } /** * The listener of the `Receiver` `'drain'` event. * * @private */ function receiverOnDrain() { this[kWebSocket]._socket.resume(); } /** * The listener of the `Receiver` `'error'` event. * * @param {(RangeError|Error)} err The emitted error * @private */ function receiverOnError(err) { const websocket = this[kWebSocket]; websocket._socket.removeListener('data', socketOnData); websocket.readyState = WebSocket.CLOSING; websocket._closeCode = err[kStatusCode]; websocket.emit('error', err); websocket._socket.destroy(); } /** * The listener of the `Receiver` `'finish'` event. * * @private */ function receiverOnFinish() { this[kWebSocket].emitClose(); } /** * The listener of the `Receiver` `'message'` event. * * @param {(String|Buffer|ArrayBuffer|Buffer[])} data The message * @private */ function receiverOnMessage(data) { this[kWebSocket].emit('message', data); } /** * The listener of the `Receiver` `'ping'` event. * * @param {Buffer} data The data included in the ping frame * @private */ function receiverOnPing(data) { const websocket = this[kWebSocket]; websocket.pong(data, !websocket._isServer, NOOP); websocket.emit('ping', data); } /** * The listener of the `Receiver` `'pong'` event. * * @param {Buffer} data The data included in the pong frame * @private */ function receiverOnPong(data) { this[kWebSocket].emit('pong', data); } /** * The listener of the `net.Socket` `'close'` event. * * @private */ function socketOnClose() { const websocket = this[kWebSocket]; this.removeListener('close', socketOnClose); this.removeListener('end', socketOnEnd); websocket.readyState = WebSocket.CLOSING; // // The close frame might not have been received or the `'end'` event emitted, // for example, if the socket was destroyed due to an error. Ensure that the // `receiver` stream is closed after writing any remaining buffered data to // it. If the readable side of the socket is in flowing mode then there is no // buffered data as everything has been already written and `readable.read()` // will return `null`. If instead, the socket is paused, any possible buffered // data will be read as a single chunk and emitted synchronously in a single // `'data'` event. // websocket._socket.read(); websocket._receiver.end(); this.removeListener('data', socketOnData); this[kWebSocket] = undefined; clearTimeout(websocket._closeTimer); if ( websocket._receiver._writableState.finished || websocket._receiver._writableState.errorEmitted ) { websocket.emitClose(); } else { websocket._receiver.on('error', receiverOnFinish); websocket._receiver.on('finish', receiverOnFinish); } } /** * The listener of the `net.Socket` `'data'` event. * * @param {Buffer} chunk A chunk of data * @private */ function socketOnData(chunk) { if (!this[kWebSocket]._receiver.write(chunk)) { this.pause(); } } /** * The listener of the `net.Socket` `'end'` event. * * @private */ function socketOnEnd() { const websocket = this[kWebSocket]; websocket.readyState = WebSocket.CLOSING; websocket._receiver.end(); this.end(); } /** * The listener of the `net.Socket` `'error'` event. * * @private */ function socketOnError() { const websocket = this[kWebSocket]; this.removeListener('error', socketOnError); this.on('error', NOOP); websocket.readyState = WebSocket.CLOSING; this.destroy(); } /***/ }), /***/ 22624: /***/ (function(__unused_webpack_module, exports) { // Generated by CoffeeScript 1.12.7 (function() { "use strict"; exports.stripBOM = function(str) { if (str[0] === '\uFEFF') { return str.substring(1); } else { return str; } }; }).call(this); /***/ }), /***/ 43337: /***/ (function(__unused_webpack_module, exports, __webpack_require__) { // Generated by CoffeeScript 1.12.7 (function() { "use strict"; var builder, defaults, escapeCDATA, requiresCDATA, wrapCDATA, hasProp = {}.hasOwnProperty; builder = __webpack_require__(52958); defaults = __webpack_require__(97251).defaults; requiresCDATA = function(entry) { return typeof entry === "string" && (entry.indexOf('&') >= 0 || entry.indexOf('>') >= 0 || entry.indexOf('<') >= 0); }; wrapCDATA = function(entry) { return ""; }; escapeCDATA = function(entry) { return entry.replace(']]>', ']]]]>'); }; exports.Builder = (function() { function Builder(opts) { var key, ref, value; this.options = {}; ref = defaults["0.2"]; for (key in ref) { if (!hasProp.call(ref, key)) continue; value = ref[key]; this.options[key] = value; } for (key in opts) { if (!hasProp.call(opts, key)) continue; value = opts[key]; this.options[key] = value; } } Builder.prototype.buildObject = function(rootObj) { var attrkey, charkey, render, rootElement, rootName; attrkey = this.options.attrkey; charkey = this.options.charkey; if ((Object.keys(rootObj).length === 1) && (this.options.rootName === defaults['0.2'].rootName)) { rootName = Object.keys(rootObj)[0]; rootObj = rootObj[rootName]; } else { rootName = this.options.rootName; } render = (function(_this) { return function(element, obj) { var attr, child, entry, index, key, value; if (typeof obj !== 'object') { if (_this.options.cdata && requiresCDATA(obj)) { element.raw(wrapCDATA(obj)); } else { element.txt(obj); } } else if (Array.isArray(obj)) { for (index in obj) { if (!hasProp.call(obj, index)) continue; child = obj[index]; for (key in child) { entry = child[key]; element = render(element.ele(key), entry).up(); } } } else { for (key in obj) { if (!hasProp.call(obj, key)) continue; child = obj[key]; if (key === attrkey) { if (typeof child === "object") { for (attr in child) { value = child[attr]; element = element.att(attr, value); } } } else if (key === charkey) { if (_this.options.cdata && requiresCDATA(child)) { element = element.raw(wrapCDATA(child)); } else { element = element.txt(child); } } else if (Array.isArray(child)) { for (index in child) { if (!hasProp.call(child, index)) continue; entry = child[index]; if (typeof entry === 'string') { if (_this.options.cdata && requiresCDATA(entry)) { element = element.ele(key).raw(wrapCDATA(entry)).up(); } else { element = element.ele(key, entry).up(); } } else { element = render(element.ele(key), entry).up(); } } } else if (typeof child === "object") { element = render(element.ele(key), child).up(); } else { if (typeof child === 'string' && _this.options.cdata && requiresCDATA(child)) { element = element.ele(key).raw(wrapCDATA(child)).up(); } else { if (child == null) { child = ''; } element = element.ele(key, child.toString()).up(); } } } } return element; }; })(this); rootElement = builder.create(rootName, this.options.xmldec, this.options.doctype, { headless: this.options.headless, allowSurrogateChars: this.options.allowSurrogateChars }); return render(rootElement, rootObj).end(this.options.renderOpts); }; return Builder; })(); }).call(this); /***/ }), /***/ 97251: /***/ (function(__unused_webpack_module, exports) { // Generated by CoffeeScript 1.12.7 (function() { exports.defaults = { "0.1": { explicitCharkey: false, trim: true, normalize: true, normalizeTags: false, attrkey: "@", charkey: "#", explicitArray: false, ignoreAttrs: false, mergeAttrs: false, explicitRoot: false, validator: null, xmlns: false, explicitChildren: false, childkey: '@@', charsAsChildren: false, includeWhiteChars: false, async: false, strict: true, attrNameProcessors: null, attrValueProcessors: null, tagNameProcessors: null, valueProcessors: null, emptyTag: '' }, "0.2": { explicitCharkey: false, trim: false, normalize: false, normalizeTags: false, attrkey: "$", charkey: "_", explicitArray: true, ignoreAttrs: false, mergeAttrs: false, explicitRoot: true, validator: null, xmlns: false, explicitChildren: false, preserveChildrenOrder: false, childkey: '$$', charsAsChildren: false, includeWhiteChars: false, async: false, strict: true, attrNameProcessors: null, attrValueProcessors: null, tagNameProcessors: null, valueProcessors: null, rootName: 'root', xmldec: { 'version': '1.0', 'encoding': 'UTF-8', 'standalone': true }, doctype: null, renderOpts: { 'pretty': true, 'indent': ' ', 'newline': '\n' }, headless: false, chunkSize: 10000, emptyTag: '', cdata: false } }; }).call(this); /***/ }), /***/ 83314: /***/ (function(__unused_webpack_module, exports, __webpack_require__) { // Generated by CoffeeScript 1.12.7 (function() { "use strict"; var bom, defaults, events, isEmpty, processItem, processors, sax, setImmediate, bind = function(fn, me){ return function(){ return fn.apply(me, arguments); }; }, extend = function(child, parent) { for (var key in parent) { if (hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; }, hasProp = {}.hasOwnProperty; sax = __webpack_require__(41695); events = __webpack_require__(28614); bom = __webpack_require__(22624); processors = __webpack_require__(99236); setImmediate = __webpack_require__(78213).setImmediate; defaults = __webpack_require__(97251).defaults; isEmpty = function(thing) { return typeof thing === "object" && (thing != null) && Object.keys(thing).length === 0; }; processItem = function(processors, item, key) { var i, len, process; for (i = 0, len = processors.length; i < len; i++) { process = processors[i]; item = process(item, key); } return item; }; exports.Parser = (function(superClass) { extend(Parser, superClass); function Parser(opts) { this.parseString = bind(this.parseString, this); this.reset = bind(this.reset, this); this.assignOrPush = bind(this.assignOrPush, this); this.processAsync = bind(this.processAsync, this); var key, ref, value; if (!(this instanceof exports.Parser)) { return new exports.Parser(opts); } this.options = {}; ref = defaults["0.2"]; for (key in ref) { if (!hasProp.call(ref, key)) continue; value = ref[key]; this.options[key] = value; } for (key in opts) { if (!hasProp.call(opts, key)) continue; value = opts[key]; this.options[key] = value; } if (this.options.xmlns) { this.options.xmlnskey = this.options.attrkey + "ns"; } if (this.options.normalizeTags) { if (!this.options.tagNameProcessors) { this.options.tagNameProcessors = []; } this.options.tagNameProcessors.unshift(processors.normalize); } this.reset(); } Parser.prototype.processAsync = function() { var chunk, err; try { if (this.remaining.length <= this.options.chunkSize) { chunk = this.remaining; this.remaining = ''; this.saxParser = this.saxParser.write(chunk); return this.saxParser.close(); } else { chunk = this.remaining.substr(0, this.options.chunkSize); this.remaining = this.remaining.substr(this.options.chunkSize, this.remaining.length); this.saxParser = this.saxParser.write(chunk); return setImmediate(this.processAsync); } } catch (error1) { err = error1; if (!this.saxParser.errThrown) { this.saxParser.errThrown = true; return this.emit(err); } } }; Parser.prototype.assignOrPush = function(obj, key, newValue) { if (!(key in obj)) { if (!this.options.explicitArray) { return obj[key] = newValue; } else { return obj[key] = [newValue]; } } else { if (!(obj[key] instanceof Array)) { obj[key] = [obj[key]]; } return obj[key].push(newValue); } }; Parser.prototype.reset = function() { var attrkey, charkey, ontext, stack; this.removeAllListeners(); this.saxParser = sax.parser(this.options.strict, { trim: false, normalize: false, xmlns: this.options.xmlns }); this.saxParser.errThrown = false; this.saxParser.onerror = (function(_this) { return function(error) { _this.saxParser.resume(); if (!_this.saxParser.errThrown) { _this.saxParser.errThrown = true; return _this.emit("error", error); } }; })(this); this.saxParser.onend = (function(_this) { return function() { if (!_this.saxParser.ended) { _this.saxParser.ended = true; return _this.emit("end", _this.resultObject); } }; })(this); this.saxParser.ended = false; this.EXPLICIT_CHARKEY = this.options.explicitCharkey; this.resultObject = null; stack = []; attrkey = this.options.attrkey; charkey = this.options.charkey; this.saxParser.onopentag = (function(_this) { return function(node) { var key, newValue, obj, processedKey, ref; obj = {}; obj[charkey] = ""; if (!_this.options.ignoreAttrs) { ref = node.attributes; for (key in ref) { if (!hasProp.call(ref, key)) continue; if (!(attrkey in obj) && !_this.options.mergeAttrs) { obj[attrkey] = {}; } newValue = _this.options.attrValueProcessors ? processItem(_this.options.attrValueProcessors, node.attributes[key], key) : node.attributes[key]; processedKey = _this.options.attrNameProcessors ? processItem(_this.options.attrNameProcessors, key) : key; if (_this.options.mergeAttrs) { _this.assignOrPush(obj, processedKey, newValue); } else { obj[attrkey][processedKey] = newValue; } } } obj["#name"] = _this.options.tagNameProcessors ? processItem(_this.options.tagNameProcessors, node.name) : node.name; if (_this.options.xmlns) { obj[_this.options.xmlnskey] = { uri: node.uri, local: node.local }; } return stack.push(obj); }; })(this); this.saxParser.onclosetag = (function(_this) { return function() { var cdata, emptyStr, key, node, nodeName, obj, objClone, old, s, xpath; obj = stack.pop(); nodeName = obj["#name"]; if (!_this.options.explicitChildren || !_this.options.preserveChildrenOrder) { delete obj["#name"]; } if (obj.cdata === true) { cdata = obj.cdata; delete obj.cdata; } s = stack[stack.length - 1]; if (obj[charkey].match(/^\s*$/) && !cdata) { emptyStr = obj[charkey]; delete obj[charkey]; } else { if (_this.options.trim) { obj[charkey] = obj[charkey].trim(); } if (_this.options.normalize) { obj[charkey] = obj[charkey].replace(/\s{2,}/g, " ").trim(); } obj[charkey] = _this.options.valueProcessors ? processItem(_this.options.valueProcessors, obj[charkey], nodeName) : obj[charkey]; if (Object.keys(obj).length === 1 && charkey in obj && !_this.EXPLICIT_CHARKEY) { obj = obj[charkey]; } } if (isEmpty(obj)) { obj = _this.options.emptyTag !== '' ? _this.options.emptyTag : emptyStr; } if (_this.options.validator != null) { xpath = "/" + ((function() { var i, len, results; results = []; for (i = 0, len = stack.length; i < len; i++) { node = stack[i]; results.push(node["#name"]); } return results; })()).concat(nodeName).join("/"); (function() { var err; try { return obj = _this.options.validator(xpath, s && s[nodeName], obj); } catch (error1) { err = error1; return _this.emit("error", err); } })(); } if (_this.options.explicitChildren && !_this.options.mergeAttrs && typeof obj === 'object') { if (!_this.options.preserveChildrenOrder) { node = {}; if (_this.options.attrkey in obj) { node[_this.options.attrkey] = obj[_this.options.attrkey]; delete obj[_this.options.attrkey]; } if (!_this.options.charsAsChildren && _this.options.charkey in obj) { node[_this.options.charkey] = obj[_this.options.charkey]; delete obj[_this.options.charkey]; } if (Object.getOwnPropertyNames(obj).length > 0) { node[_this.options.childkey] = obj; } obj = node; } else if (s) { s[_this.options.childkey] = s[_this.options.childkey] || []; objClone = {}; for (key in obj) { if (!hasProp.call(obj, key)) continue; objClone[key] = obj[key]; } s[_this.options.childkey].push(objClone); delete obj["#name"]; if (Object.keys(obj).length === 1 && charkey in obj && !_this.EXPLICIT_CHARKEY) { obj = obj[charkey]; } } } if (stack.length > 0) { return _this.assignOrPush(s, nodeName, obj); } else { if (_this.options.explicitRoot) { old = obj; obj = {}; obj[nodeName] = old; } _this.resultObject = obj; _this.saxParser.ended = true; return _this.emit("end", _this.resultObject); } }; })(this); ontext = (function(_this) { return function(text) { var charChild, s; s = stack[stack.length - 1]; if (s) { s[charkey] += text; if (_this.options.explicitChildren && _this.options.preserveChildrenOrder && _this.options.charsAsChildren && (_this.options.includeWhiteChars || text.replace(/\\n/g, '').trim() !== '')) { s[_this.options.childkey] = s[_this.options.childkey] || []; charChild = { '#name': '__text__' }; charChild[charkey] = text; if (_this.options.normalize) { charChild[charkey] = charChild[charkey].replace(/\s{2,}/g, " ").trim(); } s[_this.options.childkey].push(charChild); } return s; } }; })(this); this.saxParser.ontext = ontext; return this.saxParser.oncdata = (function(_this) { return function(text) { var s; s = ontext(text); if (s) { return s.cdata = true; } }; })(this); }; Parser.prototype.parseString = function(str, cb) { var err; if ((cb != null) && typeof cb === "function") { this.on("end", function(result) { this.reset(); return cb(null, result); }); this.on("error", function(err) { this.reset(); return cb(err); }); } try { str = str.toString(); if (str.trim() === '') { this.emit("end", null); return true; } str = bom.stripBOM(str); if (this.options.async) { this.remaining = str; setImmediate(this.processAsync); return this.saxParser; } return this.saxParser.write(str).close(); } catch (error1) { err = error1; if (!(this.saxParser.errThrown || this.saxParser.ended)) { this.emit('error', err); return this.saxParser.errThrown = true; } else if (this.saxParser.ended) { throw err; } } }; return Parser; })(events.EventEmitter); exports.parseString = function(str, a, b) { var cb, options, parser; if (b != null) { if (typeof b === 'function') { cb = b; } if (typeof a === 'object') { options = a; } } else { if (typeof a === 'function') { cb = a; } options = {}; } parser = new exports.Parser(options); return parser.parseString(str, cb); }; }).call(this); /***/ }), /***/ 99236: /***/ (function(__unused_webpack_module, exports) { // Generated by CoffeeScript 1.12.7 (function() { "use strict"; var prefixMatch; prefixMatch = new RegExp(/(?!xmlns)^.*:/); exports.normalize = function(str) { return str.toLowerCase(); }; exports.firstCharLowerCase = function(str) { return str.charAt(0).toLowerCase() + str.slice(1); }; exports.stripPrefix = function(str) { return str.replace(prefixMatch, ''); }; exports.parseNumbers = function(str) { if (!isNaN(str)) { str = str % 1 === 0 ? parseInt(str, 10) : parseFloat(str); } return str; }; exports.parseBooleans = function(str) { if (/^(?:true|false)$/i.test(str)) { str = str.toLowerCase() === 'true'; } return str; }; }).call(this); /***/ }), /***/ 66189: /***/ (function(__unused_webpack_module, exports, __webpack_require__) { // Generated by CoffeeScript 1.12.7 (function() { "use strict"; var builder, defaults, parser, processors, extend = function(child, parent) { for (var key in parent) { if (hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; }, hasProp = {}.hasOwnProperty; defaults = __webpack_require__(97251); builder = __webpack_require__(43337); parser = __webpack_require__(83314); processors = __webpack_require__(99236); exports.defaults = defaults.defaults; exports.processors = processors; exports.ValidationError = (function(superClass) { extend(ValidationError, superClass); function ValidationError(message) { this.message = message; } return ValidationError; })(Error); exports.Builder = builder.Builder; exports.Parser = parser.Parser; exports.parseString = parser.parseString; }).call(this); /***/ }), /***/ 41695: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { ;(function (sax) { // wrapper for non-node envs sax.parser = function (strict, opt) { return new SAXParser(strict, opt) } sax.SAXParser = SAXParser sax.SAXStream = SAXStream sax.createStream = createStream // When we pass the MAX_BUFFER_LENGTH position, start checking for buffer overruns. // When we check, schedule the next check for MAX_BUFFER_LENGTH - (max(buffer lengths)), // since that's the earliest that a buffer overrun could occur. This way, checks are // as rare as required, but as often as necessary to ensure never crossing this bound. // Furthermore, buffers are only tested at most once per write(), so passing a very // large string into write() might have undesirable effects, but this is manageable by // the caller, so it is assumed to be safe. Thus, a call to write() may, in the extreme // edge case, result in creating at most one complete copy of the string passed in. // Set to Infinity to have unlimited buffers. sax.MAX_BUFFER_LENGTH = 64 * 1024 var buffers = [ 'comment', 'sgmlDecl', 'textNode', 'tagName', 'doctype', 'procInstName', 'procInstBody', 'entity', 'attribName', 'attribValue', 'cdata', 'script' ] sax.EVENTS = [ 'text', 'processinginstruction', 'sgmldeclaration', 'doctype', 'comment', 'opentagstart', 'attribute', 'opentag', 'closetag', 'opencdata', 'cdata', 'closecdata', 'error', 'end', 'ready', 'script', 'opennamespace', 'closenamespace' ] function SAXParser (strict, opt) { if (!(this instanceof SAXParser)) { return new SAXParser(strict, opt) } var parser = this clearBuffers(parser) parser.q = parser.c = '' parser.bufferCheckPosition = sax.MAX_BUFFER_LENGTH parser.opt = opt || {} parser.opt.lowercase = parser.opt.lowercase || parser.opt.lowercasetags parser.looseCase = parser.opt.lowercase ? 'toLowerCase' : 'toUpperCase' parser.tags = [] parser.closed = parser.closedRoot = parser.sawRoot = false parser.tag = parser.error = null parser.strict = !!strict parser.noscript = !!(strict || parser.opt.noscript) parser.state = S.BEGIN parser.strictEntities = parser.opt.strictEntities parser.ENTITIES = parser.strictEntities ? Object.create(sax.XML_ENTITIES) : Object.create(sax.ENTITIES) parser.attribList = [] // namespaces form a prototype chain. // it always points at the current tag, // which protos to its parent tag. if (parser.opt.xmlns) { parser.ns = Object.create(rootNS) } // mostly just for error reporting parser.trackPosition = parser.opt.position !== false if (parser.trackPosition) { parser.position = parser.line = parser.column = 0 } emit(parser, 'onready') } if (!Object.create) { Object.create = function (o) { function F () {} F.prototype = o var newf = new F() return newf } } if (!Object.keys) { Object.keys = function (o) { var a = [] for (var i in o) if (o.hasOwnProperty(i)) a.push(i) return a } } function checkBufferLength (parser) { var maxAllowed = Math.max(sax.MAX_BUFFER_LENGTH, 10) var maxActual = 0 for (var i = 0, l = buffers.length; i < l; i++) { var len = parser[buffers[i]].length if (len > maxAllowed) { // Text/cdata nodes can get big, and since they're buffered, // we can get here under normal conditions. // Avoid issues by emitting the text node now, // so at least it won't get any bigger. switch (buffers[i]) { case 'textNode': closeText(parser) break case 'cdata': emitNode(parser, 'oncdata', parser.cdata) parser.cdata = '' break case 'script': emitNode(parser, 'onscript', parser.script) parser.script = '' break default: error(parser, 'Max buffer length exceeded: ' + buffers[i]) } } maxActual = Math.max(maxActual, len) } // schedule the next check for the earliest possible buffer overrun. var m = sax.MAX_BUFFER_LENGTH - maxActual parser.bufferCheckPosition = m + parser.position } function clearBuffers (parser) { for (var i = 0, l = buffers.length; i < l; i++) { parser[buffers[i]] = '' } } function flushBuffers (parser) { closeText(parser) if (parser.cdata !== '') { emitNode(parser, 'oncdata', parser.cdata) parser.cdata = '' } if (parser.script !== '') { emitNode(parser, 'onscript', parser.script) parser.script = '' } } SAXParser.prototype = { end: function () { end(this) }, write: write, resume: function () { this.error = null; return this }, close: function () { return this.write(null) }, flush: function () { flushBuffers(this) } } var Stream try { Stream = __webpack_require__(92413).Stream } catch (ex) { Stream = function () {} } var streamWraps = sax.EVENTS.filter(function (ev) { return ev !== 'error' && ev !== 'end' }) function createStream (strict, opt) { return new SAXStream(strict, opt) } function SAXStream (strict, opt) { if (!(this instanceof SAXStream)) { return new SAXStream(strict, opt) } Stream.apply(this) this._parser = new SAXParser(strict, opt) this.writable = true this.readable = true var me = this this._parser.onend = function () { me.emit('end') } this._parser.onerror = function (er) { me.emit('error', er) // if didn't throw, then means error was handled. // go ahead and clear error, so we can write again. me._parser.error = null } this._decoder = null streamWraps.forEach(function (ev) { Object.defineProperty(me, 'on' + ev, { get: function () { return me._parser['on' + ev] }, set: function (h) { if (!h) { me.removeAllListeners(ev) me._parser['on' + ev] = h return h } me.on(ev, h) }, enumerable: true, configurable: false }) }) } SAXStream.prototype = Object.create(Stream.prototype, { constructor: { value: SAXStream } }) SAXStream.prototype.write = function (data) { if (typeof Buffer === 'function' && typeof Buffer.isBuffer === 'function' && Buffer.isBuffer(data)) { if (!this._decoder) { var SD = __webpack_require__(24304).StringDecoder this._decoder = new SD('utf8') } data = this._decoder.write(data) } this._parser.write(data.toString()) this.emit('data', data) return true } SAXStream.prototype.end = function (chunk) { if (chunk && chunk.length) { this.write(chunk) } this._parser.end() return true } SAXStream.prototype.on = function (ev, handler) { var me = this if (!me._parser['on' + ev] && streamWraps.indexOf(ev) !== -1) { me._parser['on' + ev] = function () { var args = arguments.length === 1 ? [arguments[0]] : Array.apply(null, arguments) args.splice(0, 0, ev) me.emit.apply(me, args) } } return Stream.prototype.on.call(me, ev, handler) } // this really needs to be replaced with character classes. // XML allows all manner of ridiculous numbers and digits. var CDATA = '[CDATA[' var DOCTYPE = 'DOCTYPE' var XML_NAMESPACE = 'http://www.w3.org/XML/1998/namespace' var XMLNS_NAMESPACE = 'http://www.w3.org/2000/xmlns/' var rootNS = { xml: XML_NAMESPACE, xmlns: XMLNS_NAMESPACE } // http://www.w3.org/TR/REC-xml/#NT-NameStartChar // This implementation works on strings, a single character at a time // as such, it cannot ever support astral-plane characters (10000-EFFFF) // without a significant breaking change to either this parser, or the // JavaScript language. Implementation of an emoji-capable xml parser // is left as an exercise for the reader. var nameStart = /[:_A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]/ var nameBody = /[:_A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\u00B7\u0300-\u036F\u203F-\u2040.\d-]/ var entityStart = /[#:_A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]/ var entityBody = /[#:_A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\u00B7\u0300-\u036F\u203F-\u2040.\d-]/ function isWhitespace (c) { return c === ' ' || c === '\n' || c === '\r' || c === '\t' } function isQuote (c) { return c === '"' || c === '\'' } function isAttribEnd (c) { return c === '>' || isWhitespace(c) } function isMatch (regex, c) { return regex.test(c) } function notMatch (regex, c) { return !isMatch(regex, c) } var S = 0 sax.STATE = { BEGIN: S++, // leading byte order mark or whitespace BEGIN_WHITESPACE: S++, // leading whitespace TEXT: S++, // general stuff TEXT_ENTITY: S++, // & and such. OPEN_WAKA: S++, // < SGML_DECL: S++, // SCRIPT: S++, //